|
Krita Source Code Documentation
|
Classes | |
| class | CurveObjectCatcher |
| struct | matrix |
| struct | rotate |
| struct | scale |
| struct | skewX |
| struct | skewY |
| struct | transform_unit |
| struct | translate |
Functions | |
| void | appendDoubleXMLNode (const QString &key, const QString &value, QDomElement *parent, QDomDocument *doc) |
| void | appendIntegerXMLNode (const QString &key, const QString &value, QDomElement *parent, QDomDocument *doc) |
| void | appendPointXMLNode (const QString &key, const QPointF &pt, QDomElement *parent, QDomDocument *doc) |
| void | appendTextXMLNode (const QString &key, const QString &value, QDomElement *parent, QDomDocument *doc) |
| QDomElement | appendXMLNodeCommon (const QString &key, const QString &value, const QString &type, QDomElement *parent, QDomDocument *doc) |
| QDomElement | appendXMLNodeCommonNoValue (const QString &key, const QString &type, QDomElement *parent, QDomDocument *doc) |
| QString | buildPath (const QString &parent, const QString &key) |
| qreal | calculateMaxWeight (const QPainterPath &selectionPath, qreal exponent, bool searchForMax) |
| int | calculateNumStyles (const QDomElement &root) |
| QPointF | centerFromPath (const QPainterPath &selectionPath) |
| bool | findBestStartingPoint (int numSamples, const QPainterPath &path, qreal exponent, bool searchForMax, qreal initialExtremumValue, QPointF *result) |
| qreal | getDisnormedGradientValue (const QPointF &pt, const QPainterPath &selectionPath, qreal exponent) |
| qreal | initialExtremumValue (bool searchForMax) |
| KoColor | parseColorObject (QDomElement parent, QString classID) |
| void | parseColorStopsList (QDomElement parent, QVector< qreal > &startLocations, QVector< qreal > &middleOffsets, QVector< KoColor > &colors, QVector< KoGradientSegmentEndpointType > &types) |
| void | parseElement (const QDomElement &el, const QString &parentPath, KisAslObjectCatcher &catcher) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| void | parseElement (const QDomElement &el, QIODevice &device, bool forceTypeInfo=false) |
| void | parseTransparencyStopsList (QDomElement parent, QVector< qreal > &startLocations, QVector< qreal > &middleOffsets, QVector< qreal > &transparencies) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| QString | readBoolAsString (QIODevice &device) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| void | readChildObject (QIODevice &device, QDomElement *parent, QDomDocument *doc, bool skipKey=false) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| void | readDescriptor (QIODevice &device, const QString &key, QDomElement *parent, QDomDocument *doc) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| QString | readDoubleAsString (QIODevice &device) |
| QDomDocument | readFileImpl (QIODevice &device) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| QString | readIntAsString (QIODevice &device) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| qint64 | readPattern (QIODevice &device, QDomElement *parent, QDomDocument *doc) |
| template<psd_byte_order byteOrder> | |
| QImage | readVirtualArrayList (QIODevice &device, int numPlanes, const QVector< QRgb > &palette) |
| bool | tryParseDescriptor (const QDomElement &el, const QString &path, const QString &classId, KisAslObjectCatcher &catcher) |
| void | writeFileImpl (QIODevice &device, const QDomDocument &doc) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| void | writeFillLayerSectionImpl (QIODevice &device, const QDomDocument &doc) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| void | writePsdLfx2SectionImpl (QIODevice &device, const QDomDocument &doc) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| void | writeTypeToolSectionImpl (QIODevice &device, const QDomDocument &doc, const QDomDocument &warpDoc, const QTransform tf, const QRectF bounds) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| void | writeVectorOriginationDataImpl (QIODevice &device, const QDomDocument &doc) |
| template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian> | |
| void | writeVectorStrokeDataImpl (QIODevice &device, const QDomDocument &doc) |
| void Private::appendDoubleXMLNode | ( | const QString & | key, |
| const QString & | value, | ||
| QDomElement * | parent, | ||
| QDomDocument * | doc ) |
Definition at line 98 of file kis_asl_reader.cpp.
References appendXMLNodeCommon(), and value().
| void Private::appendIntegerXMLNode | ( | const QString & | key, |
| const QString & | value, | ||
| QDomElement * | parent, | ||
| QDomDocument * | doc ) |
Definition at line 93 of file kis_asl_reader.cpp.
References appendXMLNodeCommon(), and value().
| void Private::appendPointXMLNode | ( | const QString & | key, |
| const QPointF & | pt, | ||
| QDomElement * | parent, | ||
| QDomDocument * | doc ) |
Definition at line 108 of file kis_asl_reader.cpp.
References appendDoubleXMLNode(), appendXMLNodeCommonNoValue(), and KisDomUtils::toString().
| void Private::appendTextXMLNode | ( | const QString & | key, |
| const QString & | value, | ||
| QDomElement * | parent, | ||
| QDomDocument * | doc ) |
Definition at line 103 of file kis_asl_reader.cpp.
References appendXMLNodeCommon(), and value().
| QDomElement Private::appendXMLNodeCommon | ( | const QString & | key, |
| const QString & | value, | ||
| const QString & | type, | ||
| QDomElement * | parent, | ||
| QDomDocument * | doc ) |
XML generation functions
Add a node and fill the corresponding attributes
Definition at line 68 of file kis_asl_reader.cpp.
References value().
| QDomElement Private::appendXMLNodeCommonNoValue | ( | const QString & | key, |
| const QString & | type, | ||
| QDomElement * | parent, | ||
| QDomDocument * | doc ) |
Definition at line 81 of file kis_asl_reader.cpp.
|
inline |
Definition at line 312 of file kis_asl_xml_parser.cpp.
| qreal Private::calculateMaxWeight | ( | const QPainterPath & | selectionPath, |
| qreal | exponent, | ||
| bool | searchForMax ) |
Definition at line 305 of file kis_polygonal_gradient_shape_strategy.cpp.
References centerFromPath(), and getDisnormedGradientValue().
| int Private::calculateNumStyles | ( | const QDomElement & | root | ) |
Definition at line 139 of file kis_asl_writer.cpp.
| QPointF Private::centerFromPath | ( | const QPainterPath & | selectionPath | ) |
Definition at line 31 of file kis_polygonal_gradient_shape_strategy.cpp.
| bool Private::findBestStartingPoint | ( | int | numSamples, |
| const QPainterPath & | path, | ||
| qreal | exponent, | ||
| bool | searchForMax, | ||
| qreal | initialExtremumValue, | ||
| QPointF * | result ) |
Definition at line 108 of file kis_polygonal_gradient_shape_strategy.cpp.
References centerFromPath(), eps, findBestStartingPoint(), getDisnormedGradientValue(), initialExtremumValue(), KIS_ASSERT_RECOVER, KIS_ASSERT_RECOVER_NOOP, and value().
| qreal Private::getDisnormedGradientValue | ( | const QPointF & | pt, |
| const QPainterPath & | selectionPath, | ||
| qreal | exponent ) |
Definition at line 50 of file kis_polygonal_gradient_shape_strategy.cpp.
References KisAlgebra2D::dotProduct(), KIS_ASSERT_RECOVER_NOOP, kisDistanceToLine(), KisAlgebra2D::norm(), pow2(), q1, q2, and qFuzzyCompare().
| qreal Private::initialExtremumValue | ( | bool | searchForMax | ) |
Definition at line 102 of file kis_polygonal_gradient_shape_strategy.cpp.
| KoColor Private::parseColorObject | ( | QDomElement | parent, |
| QString | classID ) |
Definition at line 62 of file kis_asl_xml_parser.cpp.
References KoColor::addMetadata(), KoColor::data(), KoColor::fromXML(), HSVToRGB(), KoColorSpaceRegistry::instance(), OPACITY_OPAQUE_U8, ppVar, KoColor::setOpacity(), KisDomUtils::toDouble(), KisDomUtils::toInt(), v, value(), and warnKrita.
| void Private::parseColorStopsList | ( | QDomElement | parent, |
| QVector< qreal > & | startLocations, | ||
| QVector< qreal > & | middleOffsets, | ||
| QVector< KoColor > & | colors, | ||
| QVector< KoGradientSegmentEndpointType > & | types ) |
Definition at line 204 of file kis_asl_xml_parser.cpp.
References BACKGROUND_ENDPOINT, COLOR_ENDPOINT, FOREGROUND_ENDPOINT, parseColorObject(), ppVar, KisDomUtils::toInt(), value(), and warnKrita.
| void Private::parseElement | ( | const QDomElement & | el, |
| const QString & | parentPath, | ||
| KisAslObjectCatcher & | catcher ) |
Definition at line 713 of file kis_asl_xml_parser.cpp.
References KisAslObjectCatcher::addBoolean(), KisAslObjectCatcher::addDouble(), KisAslObjectCatcher::addEnum(), KisAslObjectCatcher::addInteger(), KisAslObjectCatcher::addRawData(), KisAslObjectCatcher::addText(), KisAslObjectCatcher::addUnitFloat(), buildPath(), KIS_ASSERT_RECOVER_RETURN, parseElement(), ppVar, KisAslObjectCatcher::setArrayMode(), KisDomUtils::toDouble(), KisDomUtils::toInt(), tryParseDescriptor(), v, and warnKrita.
| void Private::parseElement | ( | const QDomElement & | el, |
| QIODevice & | device, | ||
| bool | forceTypeInfo = false ) |
Definition at line 27 of file kis_asl_writer.cpp.
References KIS_ASSERT_RECOVER_RETURN, length(), ResourceType::Patterns, ppVar, SAFE_WRITE_EX, KisDomUtils::toDouble(), KisDomUtils::toInt(), v, and warnKrita.
| void Private::parseTransparencyStopsList | ( | QDomElement | parent, |
| QVector< qreal > & | startLocations, | ||
| QVector< qreal > & | middleOffsets, | ||
| QVector< qreal > & | transparencies ) |
Definition at line 266 of file kis_asl_xml_parser.cpp.
References ppVar, KisDomUtils::toDouble(), KisDomUtils::toInt(), value(), and warnKrita.
| QString Private::readBoolAsString | ( | QIODevice & | device | ) |
Definition at line 54 of file kis_asl_reader.cpp.
References SAFE_READ_EX, KisDomUtils::toString(), and value().
| void Private::readChildObject | ( | QIODevice & | device, |
| QDomElement * | parent, | ||
| QDomDocument * | doc, | ||
| bool | skipKey = false ) |
Definition at line 126 of file kis_asl_reader.cpp.
References appendDoubleXMLNode(), appendIntegerXMLNode(), appendTextXMLNode(), appendXMLNodeCommon(), appendXMLNodeCommonNoValue(), GARBAGE_VALUE_MARK, SAFE_READ_EX, and value().
| void Private::readDescriptor | ( | QIODevice & | device, |
| const QString & | key, | ||
| QDomElement * | parent, | ||
| QDomDocument * | doc ) |
ASL -> XML parsing functions
Definition at line 214 of file kis_asl_reader.cpp.
References appendXMLNodeCommonNoValue(), GARBAGE_VALUE_MARK, and SAFE_READ_EX.
| QString Private::readDoubleAsString | ( | QIODevice & | device | ) |
Numerical fetch functions
We read numbers and convert them to strings to be able to store them in XML.
Definition at line 36 of file kis_asl_reader.cpp.
References SAFE_READ_EX, KisDomUtils::toString(), and value().
| QDomDocument Private::readFileImpl | ( | QIODevice & | device | ) |
Definition at line 608 of file kis_asl_reader.cpp.
References GARBAGE_VALUE_MARK, ResourceType::Patterns, psdBigEndian, readDescriptor(), readPattern(), SAFE_READ_EX, SAFE_READ_SIGNATURE_EX, SETUP_OFFSET_VERIFIER, and warnKrita.
| QString Private::readIntAsString | ( | QIODevice & | device | ) |
Definition at line 45 of file kis_asl_reader.cpp.
References SAFE_READ_EX, KisDomUtils::toString(), and value().
| qint64 Private::readPattern | ( | QIODevice & | device, |
| QDomElement * | parent, | ||
| QDomDocument * | doc ) |
Create XML data
We are loading the pattern and convert it into ARGB right away, so we need not store real image mode and size of the pattern externally.
Definition at line 463 of file kis_asl_reader.cpp.
References KisAslWriterUtils::alignOffsetCeil(), appendTextXMLNode(), dbgFile, GARBAGE_VALUE_MARK, Grayscale, Indexed, MultiChannel, palette, RGB, SAFE_READ_EX, KoPattern::savePatToDevice(), and SETUP_OFFSET_VERIFIER.
| QImage Private::readVirtualArrayList | ( | QIODevice & | device, |
| int | numPlanes, | ||
| const QVector< QRgb > & | palette ) |
Definition at line 236 of file kis_asl_reader.cpp.
References dbgFile, dbgKrita, GARBAGE_VALUE_MARK, palette, ppVar, RLE, SAFE_READ_EX, SETUP_OFFSET_VERIFIER, Compression::uncompress(), Uncompressed, warnFile, and ZIP.
| bool Private::tryParseDescriptor | ( | const QDomElement & | el, |
| const QString & | path, | ||
| const QString & | classId, | ||
| KisAslObjectCatcher & | catcher ) |
Filenames in Krita cannot have slashes inside, but some of the styles saved in 4.x days could have that. Here we just forcefully crop the directory part of the gradient to make sure that it fits the new policy.
Since ASL doesn't use this name as any linkage (actually, gradients are always embedded into the style) so we don't really care about the contents of the filename field. It should just be somewhat unique.
Definition at line 317 of file kis_asl_xml_parser.cpp.
References KisAslObjectCatcher::addColor(), KisAslObjectCatcher::addCurve(), KisAslObjectCatcher::addGradient(), KisAslObjectCatcher::addPattern(), KisAslObjectCatcher::addPatternRef(), KisAslObjectCatcher::addPoint(), KisAslObjectCatcher::addRect(), KisAslObjectCatcher::addTransform(), KisAslObjectCatcher::addUnitRect(), COLOR_ENDPOINT, COLOR_INTERP_RGB, INTERP_LINEAR, Private::CurveObjectCatcher::m_name, Private::CurveObjectCatcher::m_points, KisAslObjectCatcher::newStyleStarted(), parseColorObject(), parseColorStopsList(), parseElement(), parseTransparencyStopsList(), ppVar, KoColor::setOpacity(), KisDomUtils::toDouble(), value(), and warnKrita.
| void Private::writeFileImpl | ( | QIODevice & | device, |
| const QDomDocument & | doc ) |
Definition at line 159 of file kis_asl_writer.cpp.
References calculateNumStyles(), KIS_ASSERT_RECOVER_RETURN, parseElement(), ResourceType::Patterns, psdBigEndian, SAFE_WRITE_EX, and KisAslPatternsWriter::writePatterns().
| void Private::writeFillLayerSectionImpl | ( | QIODevice & | device, |
| const QDomDocument & | doc ) |
Definition at line 281 of file kis_asl_writer.cpp.
References KIS_ASSERT_RECOVER_RETURN, ResourceType::Patterns, and SAFE_WRITE_EX.
| void Private::writePsdLfx2SectionImpl | ( | QIODevice & | device, |
| const QDomDocument & | doc ) |
Definition at line 239 of file kis_asl_writer.cpp.
References calculateNumStyles(), KIS_ASSERT_RECOVER_RETURN, ResourceType::Patterns, and SAFE_WRITE_EX.
| void Private::writeTypeToolSectionImpl | ( | QIODevice & | device, |
| const QDomDocument & | doc, | ||
| const QDomDocument & | warpDoc, | ||
| const QTransform | tf, | ||
| const QRectF | bounds ) |
Definition at line 315 of file kis_asl_writer.cpp.
References bounds, KIS_ASSERT_RECOVER_RETURN, and SAFE_WRITE_EX.
| void Private::writeVectorOriginationDataImpl | ( | QIODevice & | device, |
| const QDomDocument & | doc ) |
Definition at line 396 of file kis_asl_writer.cpp.
References KIS_ASSERT_RECOVER_RETURN, and SAFE_WRITE_EX.
| void Private::writeVectorStrokeDataImpl | ( | QIODevice & | device, |
| const QDomDocument & | doc ) |
Definition at line 374 of file kis_asl_writer.cpp.
References KIS_ASSERT_RECOVER_RETURN, and SAFE_WRITE_EX.