This class provides a loading context for filter effects.
More...
#include <KoFilterEffectLoadingContext.h>
This class provides a loading context for filter effects.
Definition at line 14 of file KoFilterEffectLoadingContext.cpp.
◆ KoFilterEffectLoadingContext()
| KoFilterEffectLoadingContext::KoFilterEffectLoadingContext |
( |
const QString & | basePath = QString() | ) |
|
|
explicit |
◆ ~KoFilterEffectLoadingContext()
| KoFilterEffectLoadingContext::~KoFilterEffectLoadingContext |
( |
| ) |
|
|
virtual |
◆ convertFilterPrimitiveUnits()
| QPointF KoFilterEffectLoadingContext::convertFilterPrimitiveUnits |
( |
const QPointF & | value | ) |
const |
◆ convertFilterPrimitiveUnitsX()
| qreal KoFilterEffectLoadingContext::convertFilterPrimitiveUnitsX |
( |
qreal | value | ) |
const |
Converts an x value from user space to bounding box coordinates.
Definition at line 84 of file KoFilterEffectLoadingContext.cpp.
85{
86 if (!
d->convertFilterPrimitiveUnits)
88
89 return value /
d->shapeBound.width();
90}
float value(const T *src, size_t ch)
References d, and value().
◆ convertFilterPrimitiveUnitsY()
| qreal KoFilterEffectLoadingContext::convertFilterPrimitiveUnitsY |
( |
qreal | value | ) |
const |
Converts an y value from user space to bounding box coordinates.
Definition at line 92 of file KoFilterEffectLoadingContext.cpp.
93{
94 if (!
d->convertFilterPrimitiveUnits)
96
97 return value /
d->shapeBound.height();
98}
References d, and value().
◆ convertFilterUnits()
| QPointF KoFilterEffectLoadingContext::convertFilterUnits |
( |
const QPointF & | value | ) |
const |
Converts a point value from user space to bounding box coordinates.
◆ convertFilterUnitsX()
| qreal KoFilterEffectLoadingContext::convertFilterUnitsX |
( |
qreal | value | ) |
const |
◆ convertFilterUnitsY()
| qreal KoFilterEffectLoadingContext::convertFilterUnitsY |
( |
qreal | value | ) |
const |
◆ enableFilterPrimitiveUnitsConversion()
| void KoFilterEffectLoadingContext::enableFilterPrimitiveUnitsConversion |
( |
bool | enable | ) |
|
◆ enableFilterUnitsConversion()
| void KoFilterEffectLoadingContext::enableFilterUnitsConversion |
( |
bool | enable | ) |
|
◆ pathFromHref()
| QString KoFilterEffectLoadingContext::pathFromHref |
( |
const QString & | href | ) |
const |
Converts a href to an absolute path name.
Definition at line 100 of file KoFilterEffectLoadingContext.cpp.
101{
102 QFileInfo info(href);
103 if (! info.isRelative())
104 return href;
105
106 QFileInfo pathInfo(QFileInfo(
d->basePath).filePath());
107
108 QString relFile = href;
109 while (relFile.startsWith(QLatin1String("../"))) {
110 relFile.remove(0, 3);
111 pathInfo.setFile(pathInfo.dir(), QString());
112 }
113
114 QString absFile = pathInfo.absolutePath() + '/' + relFile;
115
116 return absFile;
117}
References d.
◆ Private()
| KoFilterEffectLoadingContext::Private |
( |
| ) |
|
|
inline |
◆ setShapeBoundingBox()
| void KoFilterEffectLoadingContext::setShapeBoundingBox |
( |
const QRectF & | shapeBound | ) |
|
Sets the bounding box of the shape a filter is loaded for. The shapes bounding box is used to convert from user space coordinates to bounding box coordinates for filter attributes.
- Parameters
-
| shapeBound | the shapes bounding box |
Definition at line 37 of file KoFilterEffectLoadingContext.cpp.
References d, and shapeBound.
◆ basePath
| QString KoFilterEffectLoadingContext::basePath |
◆ convertFilterPrimitiveUnits
| QPointF KoFilterEffectLoadingContext::convertFilterPrimitiveUnits |
◆ convertFilterUnits
| QPointF KoFilterEffectLoadingContext::convertFilterUnits |
| Private* const KoFilterEffectLoadingContext::d |
|
private |
◆ shapeBound
| QRectF KoFilterEffectLoadingContext::shapeBound |
The documentation for this class was generated from the following files: