|
Krita Source Code Documentation
|
#include <SvgUtil.h>
Classes | |
| struct | PreserveAspectRatioParser |
Static Public Member Functions | |
| static double | fromPercentage (QString s, bool *ok=nullptr) |
| static double | fromUserSpace (double value) |
| static QString | mapExtendedShapeTag (const QString &tagName, const QDomElement &element) |
| static QPointF | objectToUserSpace (const QPointF &position, const QRectF &objectBound) |
| static QSizeF | objectToUserSpace (const QSizeF &size, const QRectF &objectBound) |
| static void | parseAspectRatio (const PreserveAspectRatioParser &p, const QRectF &elementBounds, const QRectF &viewRect, QTransform *_viewTransform) |
| static const char * | parseNumber (const char *ptr, qreal &number) |
| parses the number into parameter number | |
| static qreal | parseNumber (const QString &string) |
| static KoSvgText::CssLengthPercentage | parseTextUnitStruct (SvgGraphicsContext *gc, QStringView unit) |
| Unit structs for text do not need the percentage to be resolved to viewport in most cases. | |
| static qreal | parseUnit (SvgGraphicsContext *gc, const KoSvgTextProperties &resolved, QStringView, bool horiz=false, bool vert=false, const QRectF &bbox=QRectF()) |
| Parses a length attribute. | |
| static qreal | parseUnitAngular (SvgGraphicsContext *gc, const QString &unit) |
| parses angle, result in radians! | |
| static KoSvgText::CssLengthPercentage | parseUnitStruct (SvgGraphicsContext *gc, QStringView unit, bool horiz=false, bool vert=false, const QRectF &bbox=QRectF()) |
| Parse length attribute into a struct, always resolving the percentage to viewport. | |
| static KoSvgText::CssLengthPercentage | parseUnitStructImpl (SvgGraphicsContext *gc, QStringView, bool horiz=false, bool vert=false, const QRectF &bbox=QRectF(), bool percentageViewBox=false) |
| Parse length attribute into struct. | |
| static qreal | parseUnitX (SvgGraphicsContext *gc, const KoSvgTextProperties &resolved, const QString &unit) |
| parses a length attribute in x-direction | |
| static qreal | parseUnitXY (SvgGraphicsContext *gc, const KoSvgTextProperties &resolved, const QString &unit) |
| parses a length attribute in xy-direction | |
| static qreal | parseUnitY (SvgGraphicsContext *gc, const KoSvgTextProperties &resolved, const QString &unit) |
| parses a length attribute in y-direction | |
| static bool | parseViewBox (const QDomElement &e, const QRectF &elementBounds, QRectF *_viewRect, QTransform *_viewTransform) |
| Parses a viewbox attribute into an rectangle. | |
| static double | ptToPx (SvgGraphicsContext *gc, double value) |
| static QStringList | simplifyList (const QString &str) |
| static QString | toPercentage (qreal value) |
| static QPointF | toUserSpace (const QPointF &point) |
| Converts given point from points to userspace units. | |
| static QRectF | toUserSpace (const QRectF &rect) |
| Converts given rectangle from points to userspace units. | |
| static QSizeF | toUserSpace (const QSizeF &size) |
| Converts given rectangle from points to userspace units. | |
| static double | toUserSpace (double value) |
| static QString | transformToString (const QTransform &transform) |
| Converts specified transformation to a string. | |
| static QPointF | userSpaceToObject (const QPointF &position, const QRectF &objectBound) |
| static QSizeF | userSpaceToObject (const QSizeF &size, const QRectF &objectBound) |
| static void | writeTransformAttributeLazy (const QString &name, const QTransform &transform, KoXmlWriter &shapeWriter) |
Writes a transform as an attribute name iff the transform is not empty. | |
|
static |
Parses the given string containing a percentage.
| s | the input string containing the percentage, float (0..1) or integer (0%..100%) |
| ok | optional failure indicator |
Definition at line 64 of file SvgUtil.cpp.
References KisDomUtils::toDouble().
|
static |
Definition at line 29 of file SvgUtil.cpp.
References value().
|
static |
Definition at line 432 of file SvgUtil.cpp.
|
static |
Converts position from objectBoundingBox units to userSpace units.
Definition at line 72 of file SvgUtil.cpp.
|
static |
Converts size from objectBoundingBox units to userSpace units.
Definition at line 79 of file SvgUtil.cpp.
|
static |
Definition at line 190 of file SvgUtil.cpp.
References p.
|
static |
parses the number into parameter number
Definition at line 378 of file SvgUtil.cpp.
References sign().
|
static |
Definition at line 363 of file SvgUtil.cpp.
References KIS_SAFE_ASSERT_RECOVER_NOOP, length(), parseNumber(), and value().
|
static |
Unit structs for text do not need the percentage to be resolved to viewport in most cases.
Definition at line 239 of file SvgUtil.cpp.
References parseUnitStructImpl().
|
static |
Parses a length attribute.
Definition at line 218 of file SvgUtil.cpp.
References KoSvgTextProperties::fontSize(), length(), KoSvgTextProperties::metrics(), parseUnitStruct(), and KoSvgText::CssLengthPercentage::value.
|
static |
parses angle, result in radians!
Definition at line 332 of file SvgUtil.cpp.
References kisDegreesToRadians(), M_PI, parseNumber(), and value().
|
static |
Parse length attribute into a struct, always resolving the percentage to viewport.
Definition at line 234 of file SvgUtil.cpp.
References parseUnitStructImpl().
|
static |
Parse length attribute into struct.
Definition at line 244 of file SvgUtil.cpp.
References KoSvgText::CssLengthPercentage::Cap, KoSvgText::CssLengthPercentage::Ch, CM_TO_POINT(), KoSvgText::CssLengthPercentage::Em, KoSvgText::CssLengthPercentage::Ex, fromUserSpace(), KoSvgText::CssLengthPercentage::Ic, INCH_TO_POINT(), length(), KoSvgText::CssLengthPercentage::Lh, MM_TO_POINT(), parseNumber(), KoSvgText::CssLengthPercentage::Percentage, PI_TO_POINT(), and ptToPx().
|
static |
parses a length attribute in x-direction
Definition at line 304 of file SvgUtil.cpp.
References SvgGraphicsContext::currentBoundingBox, SvgGraphicsContext::forcePercentage, fromPercentage(), and parseUnit().
|
static |
parses a length attribute in xy-direction
Definition at line 322 of file SvgUtil.cpp.
References SvgGraphicsContext::currentBoundingBox, SvgGraphicsContext::forcePercentage, fromPercentage(), parseUnit(), and value().
|
static |
parses a length attribute in y-direction
Definition at line 313 of file SvgUtil.cpp.
References SvgGraphicsContext::currentBoundingBox, SvgGraphicsContext::forcePercentage, fromPercentage(), and parseUnit().
|
static |
Parses a viewbox attribute into an rectangle.
Definition at line 133 of file SvgUtil.cpp.
References fromUserSpace(), KIS_ASSERT, p, parseAspectRatio(), qFuzzyCompare(), and toDouble().
|
static |
Definition at line 39 of file SvgUtil.cpp.
References DPI, SvgGraphicsContext::pixelsPerInch, and value().
|
static |
Definition at line 450 of file SvgUtil.cpp.
|
static |
Parses the given float percentage.
| value | the input number containing float percentage (0..1) |
Definition at line 59 of file SvgUtil.cpp.
References KisDomUtils::toString(), and value().
|
static |
Converts given point from points to userspace units.
Definition at line 44 of file SvgUtil.cpp.
References toUserSpace().
|
static |
Converts given rectangle from points to userspace units.
Definition at line 49 of file SvgUtil.cpp.
References toUserSpace().
|
static |
Converts given rectangle from points to userspace units.
Definition at line 54 of file SvgUtil.cpp.
References toUserSpace().
|
static |
|
static |
Converts specified transformation to a string.
Definition at line 104 of file SvgUtil.cpp.
References KisDomUtils::toString(), and toUserSpace().
|
static |
Converts position from userSpace units to objectBoundingBox units.
Definition at line 86 of file SvgUtil.cpp.
|
static |
Converts size from userSpace units to objectBoundingBox units.
Definition at line 97 of file SvgUtil.cpp.
|
static |
Writes a transform as an attribute name iff the transform is not empty.
Definition at line 124 of file SvgUtil.cpp.
References KoXmlWriter::addAttribute(), transformToString(), and value().