|
Krita Source Code Documentation
|
#include <KoFilterEffect.h>
Inheritance diagram for KoFilterEffect:Public Member Functions | |
| void | addInput (const QString &input) |
| Adds a new input at the end of the input list. | |
| QRectF | filterRect () const |
| Returns the region this filter is applied to in bounding box units. | |
| QRectF | filterRectForBoundingRect (const QRectF &boundingRect) const |
| Returns the region this filter is applied to for the given bounding rect. | |
| QString | id () const |
| Returns the unique id of the filter. | |
| QList< QString > | inputs () const |
| void | insertInput (int index, const QString &input) |
| Inserts an input at the given position in the input list. | |
| KoFilterEffect (const QString &id, const QString &name) | |
| virtual bool | load (const QDomElement &element, const KoFilterEffectLoadingContext &context)=0 |
| int | maximalInputCount () const |
| QString | name () const |
| Returns the user visible name of the filter. | |
| QString | output () const |
| Returns the name of the output image. | |
| Private () | |
| virtual QImage | processImage (const QImage &image, const KoFilterEffectRenderContext &context) const =0 |
| virtual QImage | processImages (const QList< QImage > &images, const KoFilterEffectRenderContext &context) const |
| void | removeInput (int index) |
| Removes an input from the given position in the input list. | |
| int | requiredInputCount () const |
| virtual void | save (KoXmlWriter &writer)=0 |
| void | setFilterRect (const QRectF &filterRect) |
| Sets the region the filter is applied to in bounding box units. | |
| void | setInput (int index, const QString &input) |
| Sets an existing input to a new value. | |
| void | setOutput (const QString &output) |
| virtual | ~KoFilterEffect () |
Public Attributes | |
| QRectF | filterRect |
| QString | id |
| QList< QString > | inputs |
| int | maximalInputCount |
| QString | name |
| QString | output |
| int | requiredInputCount |
Protected Member Functions | |
| void | saveCommonAttributes (KoXmlWriter &writer) |
| void | setMaximalInputCount (int count) |
| Sets the maximal number of input images. | |
| void | setRequiredInputCount (int count) |
| Sets the required number of input images. | |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Additional Inherited Members | |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
This is the base for filter effect (blur, invert...) that can be applied on a shape. All sizes and coordinates of the filter effect are stored in object bounding box coordinates, where (0,0) refers to the top-left corner of a shapes bounding rect and (1,1) refers to the bottom-right corner. When loading, a transformation matrix is given to convert from user space coordinates. Another transformation matrix is given via the render context to convert back to user space coordinates when applying the effect. Using object bounding box coordinates internally makes it easy to share effects between shapes or even between users via the filter effect resources.
Definition at line 15 of file KoFilterEffect.cpp.
| KoFilterEffect::KoFilterEffect | ( | const QString & | id, |
| const QString & | name ) |
Definition at line 35 of file KoFilterEffect.cpp.
|
virtual |
| void KoFilterEffect::addInput | ( | const QString & | input | ) |
| QRectF KoFilterEffect::filterRect | ( | ) | const |
Returns the region this filter is applied to in bounding box units.
| QRectF KoFilterEffect::filterRectForBoundingRect | ( | const QRectF & | boundingRect | ) | const |
Returns the region this filter is applied to for the given bounding rect.
Definition at line 67 of file KoFilterEffect.cpp.
References d.
| QString KoFilterEffect::id | ( | ) | const |
Returns the unique id of the filter.
| QList< QString > KoFilterEffect::inputs | ( | ) | const |
Returns list of named input images of this filter effect.
These names identify the input images for this filter effect. These can be one of the keywords SourceGraphic, SourceAlpha, BackgroundImage, BackgroundAlpha, FillPaint or StrokePaint, as well as a named output of another filter effect in the stack. An empty input list of the first effect in the stack default to SourceGraphic, whereas on subsequent effects it defaults to the result of the previous filter effect.
| void KoFilterEffect::insertInput | ( | int | index, |
| const QString & | input ) |
|
pure virtual |
Loads data from given xml element.
| element | the xml element to load data from |
| context | the loading context providing additional data |
| int KoFilterEffect::maximalInputCount | ( | ) | const |
Returns the maximal number of input images. The default maximal number of input images is 1. Derived classes should call setMaximalInputCount to set a different number.
| QString KoFilterEffect::name | ( | ) | const |
Returns the user visible name of the filter.
| QString KoFilterEffect::output | ( | ) | const |
Returns the name of the output image.
|
inline |
Definition at line 18 of file KoFilterEffect.cpp.
|
pure virtual |
Apply the effect on an image.
| image | the image the filter should be applied to |
| context | the render context providing additional data |
|
virtual |
Apply the effect on a list of images.
| images | the images the filter should be applied to |
| context | the render context providing additional data |
Definition at line 125 of file KoFilterEffect.cpp.
| void KoFilterEffect::removeInput | ( | int | index | ) |
| int KoFilterEffect::requiredInputCount | ( | ) | const |
Return the required number of input images. The default required number of input images is 1. Derived classes should call setRequiredInputCount to set a different number.
|
pure virtual |
Writes custom data to given xml element.
| writer | the xml writer to write data to |
|
protected |
Saves common filter attributes
Saves result, subregion and input attributes. The input attribute is only saved if required, maximal and actual input count equals 1. All other filters have to write inputs on their own.
Definition at line 148 of file KoFilterEffect.cpp.
References KoXmlWriter::addAttribute(), d, maximalInputCount, output, and requiredInputCount.
| void KoFilterEffect::setFilterRect | ( | const QRectF & | filterRect | ) |
Sets the region the filter is applied to in bounding box units.
Definition at line 57 of file KoFilterEffect.cpp.
References d, and filterRect.
| void KoFilterEffect::setInput | ( | int | index, |
| const QString & | input ) |
|
protected |
Sets the maximal number of input images.
Definition at line 138 of file KoFilterEffect.cpp.
References d, and maximalInputCount.
| void KoFilterEffect::setOutput | ( | const QString & | output | ) |
|
protected |
|
private |
Definition at line 155 of file KoFilterEffect.h.
| QRectF KoFilterEffect::filterRect |
Definition at line 28 of file KoFilterEffect.cpp.
| QString KoFilterEffect::id |
Definition at line 26 of file KoFilterEffect.cpp.
| QList< QString > KoFilterEffect::inputs |
Definition at line 29 of file KoFilterEffect.cpp.
| int KoFilterEffect::maximalInputCount |
Definition at line 32 of file KoFilterEffect.cpp.
| QString KoFilterEffect::name |
Definition at line 27 of file KoFilterEffect.cpp.
| QString KoFilterEffect::output |
Definition at line 30 of file KoFilterEffect.cpp.
| int KoFilterEffect::requiredInputCount |
Definition at line 31 of file KoFilterEffect.cpp.