|
Krita Source Code Documentation
|
#include <kis_filter_mask.h>
Inheritance diagram for KisFilterMask:Classes | |
| struct | Private |
Public Member Functions | |
| bool | accept (KisNodeVisitor &v) override |
| void | accept (KisProcessingVisitor &visitor, KisUndoAdapter *undoAdapter) override |
| QRect | changeRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const override |
| KisNodeSP | clone () const override |
| QRect | decorateRect (KisPaintDeviceSP &src, KisPaintDeviceSP &dst, const QRect &rc, PositionToFilthy maskPos, KisRenderPassFlags flags) const override |
| QRect | exactBounds () const override |
| QRect | extent () const override |
| QIcon | icon () const override |
| KisFilterMask (const KisFilterMask &rhs) | |
| KisFilterMask (KisImageWSP image, const QString &name=QString()) | |
| QRect | needRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const override |
| void | setFilter (KisFilterConfigurationSP filterConfig, bool checkCompareConfig=true) override |
| ~KisFilterMask () override | |
Public Member Functions inherited from KisEffectMask | |
| void | apply (KisPaintDeviceSP projection, const QRect &applyRect, const QRect &needRect, PositionToFilthy maskPos, KisRenderPassFlags flags) const |
| KisEffectMask (const KisEffectMask &rhs) | |
| KisEffectMask (KisImageWSP image, const QString &name) | |
| ~KisEffectMask () override | |
Public Member Functions inherited from KisMask | |
| bool | allowAsChild (KisNodeSP node) const override |
| QRect | changeRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const override |
| const KoColorSpace * | colorSpace () const override |
| const KoCompositeOp * | compositeOp () const override |
| QImage | createThumbnail (qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) override |
| QRect | exactBounds () const override |
| QRect | extent () const override |
| void | initSelection (KisLayerSP parentLayer) |
| initSelection initializes an empty selection | |
| void | initSelection (KisPaintDeviceSP copyFromDevice, KisLayerSP parentLayer) |
| initSelection initializes the selection for the mask from the given paint device. | |
| void | initSelection (KisSelectionSP copyFrom, KisLayerSP parentLayer) |
| initSelection initializes the selection for the mask from the given selection's projection. | |
| void | initSelectionImpl (KisSelectionSP copyFrom, KisLayerSP parentLayer, KisPaintDeviceSP copyFromDevice, KisImageWSP image) |
| KisMask (const KisMask &rhs) | |
| KisMask (KisImageWSP image, const QString &name) | |
| QRect | needRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const override |
| virtual QRect | nonDependentExtent () const |
| KisPaintDeviceSP | original () const override |
| KisPaintDeviceSP | paintDevice () const override |
| Private (KisMask *_q) | |
| KisPaintDeviceSP | projection () const override |
| KisAbstractProjectionPlaneSP | projectionPlane () const override |
| void | select (const QRect &rc, quint8 selectedness=MAX_SELECTED) |
| KisSelectionSP | selection () const |
| void | setImage (KisImageWSP image) override |
| void | setSelection (KisSelectionSP selection) |
| void | setX (qint32 x) override |
| void | setY (qint32 y) override |
| bool | supportsLodPainting () const override |
| void | testingInitSelection (const QRect &rect, KisLayerSP parentLayer) |
| int | thumbnailSeqNo () const override |
| qint32 | x () const override |
| qint32 | y () const override |
| ~KisMask () override | |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Public Member Functions inherited from KisNode | |
| bool | accept (KisNodeVisitor &v) override |
| void | accept (KisProcessingVisitor &visitor, KisUndoAdapter *undoAdapter) override |
| KisNodeSP | at (quint32 index) const |
| KisBusyProgressIndicator * | busyProgressIndicator () const |
| quint32 | childCount () const |
| QList< KisNodeSP > | childNodes (const QStringList &nodeTypes, const KoProperties &properties) const |
| const KisNode * | findSymmetricClone (const KisNode *srcRoot, const KisNode *dstRoot, const KisNode *srcTarget) |
| KisNodeSP | firstChild () const |
| virtual KisPaintDeviceList | getLodCapableDevices () const |
| KisNodeGraphListener * | graphListener () const |
| int | graphSequenceNumber () const |
| void | handleKeyframeChannelFrameAboutToBeRemoved (const KisKeyframeChannel *channel, int time) |
| virtual void | handleKeyframeChannelFrameAdded (const KisKeyframeChannel *channel, int time) |
| virtual void | handleKeyframeChannelFrameChange (const KisKeyframeChannel *channel, int time) |
| void | handleKeyframeChannelFrameHasBeenRemoved (const KisKeyframeChannel *channel, int time) |
| KisFrameChangeUpdateRecipe | handleKeyframeChannelUpdateImpl (const KisKeyframeChannel *channel, int time) |
| int | index (const KisNodeSP node) const |
| void | invalidateFrames (const KisTimeSpan &range, const QRect &rect) |
| KisNode (const KisNode &rhs) | |
| KisNode (KisImageWSP image) | |
| KisNodeSP | lastChild () const |
| KisNodeSP | nextSibling () const |
| KisNodeProgressProxy * | nodeProgressProxy () const |
| KisNodeSP | parent () const |
| KisNodeSP | prevSibling () const |
| Private (KisNode *node) | |
| void | processDuplicatedClones (const KisNode *srcDuplicationRoot, const KisNode *dstDuplicationRoot, KisNode *node) |
| virtual KisProjectionLeafSP | projectionLeaf () const |
| void | requestTimeSwitch (int time) |
| virtual void | setDirty () |
| void | setDirty (const KisRegion ®ion) |
| void | setDirty (const QRect &rect) |
| virtual void | setDirty (const QVector< QRect > &rects) |
| void | setDirtyDontResetAnimationCache () |
| void | setDirtyDontResetAnimationCache (const QRect &rect) |
| void | setDirtyDontResetAnimationCache (const QVector< QRect > &rects) |
| setDirtyDontResetAnimationCache does almost the same thing as usual setDirty() call, but doesn't reset the animation cache (since onion skins are not used when rendering animation. | |
| void | setGraphListener (KisNodeGraphListener *graphListener) |
| void | setImage (KisImageWSP newImage) override |
| virtual void | syncLodCache () |
| ~KisNode () override | |
Public Member Functions inherited from KisBaseNode | |
| bool | belongsToIsolatedGroup () const |
| bool | check (const KoProperties &properties) const |
| bool | collapsed () const |
| int | colorLabelIndex () const |
| virtual KisPaintDeviceSP | colorSampleSourceDevice () const |
| const QString & | compositeOpId () const |
| virtual QImage | createThumbnailForFrame (qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) |
| void | enableAnimation () |
| KisKeyframeChannel * | getKeyframeChannel (const QString &id) const |
| KisKeyframeChannel * | getKeyframeChannel (const QString &id, bool create) |
| bool | hasEditablePaintDevice () const |
| KisImageWSP | image () const |
| bool | isAnimated () const |
| bool | isEditable (bool checkVisibility=true) const |
| virtual bool | isFakeNode () const |
| bool | isIsolatedRoot () const |
| bool | isPinnedToTimeline () const |
| QMap< QString, KisKeyframeChannel * > | keyframeChannels () const |
| KisBaseNode (const KisBaseNode &rhs) | |
| KisBaseNode (KisImageWSP image) | |
| void | mergeNodeProperties (const KoProperties &properties) |
| QString | name () const |
| const KoProperties & | nodeProperties () const |
| quint8 | opacity () const |
| quint8 | percentOpacity () const |
| Private (const Private &rhs) | |
| Private (KisImageWSP p_image) | |
| virtual PropertyList | sectionModelProperties () const |
| void | setCollapsed (bool collapsed) |
| void | setColorLabelIndex (int index) |
| void | setCompositeOpId (const QString &compositeOpId) |
| void | setName (const QString &name) |
| void | setNodeProperty (const QString &name, const QVariant &value) |
| void | setOpacity (quint8 val) |
| void | setPercentOpacity (quint8 val) |
| void | setPinnedToTimeline (bool pinned) |
| virtual void | setSectionModelProperties (const PropertyList &properties) |
| virtual void | setUserLocked (bool l) |
| void | setUuid (const QUuid &id) |
| virtual void | setVisible (bool visible, bool loading=false) |
| bool | supportsLodMoves () const |
| virtual void | updateSettings () |
| bool | userLocked () const |
| QUuid | uuid () const |
| virtual bool | visible (bool recursive=false) const |
| ~KisBaseNode () override | |
Public Member Functions inherited from KisShared | |
| bool | deref () |
| bool | ref () |
| int | refCount () |
| QAtomicInt * | sharedWeakReference () |
Public Member Functions inherited from KisIndirectPaintingSupport | |
| bool | hasTemporaryTarget () const |
| KisIndirectPaintingSupport () | |
| void | mergeToLayer (KisNodeSP layer, KUndo2Command *parentCommand, const KUndo2MagicString &transactionText, int timedID) |
| virtual void | mergeToLayerThreaded (KisNodeSP layer, KUndo2Command *parentCommand, const KUndo2MagicString &transactionText, int timedID, QVector< KisRunnableStrokeJobData * > *jobs) |
| virtual void | setCurrentColor (const KoColor &color) |
| void | setTemporaryChannelFlags (const QBitArray &channelFlags) |
| void | setTemporaryCompositeOp (const QString &id) |
| void | setTemporaryOpacity (qreal o) |
| void | setTemporarySelection (KisSelectionSP selection) |
| void | setTemporaryTarget (KisPaintDeviceSP t) |
| void | setupTemporaryPainter (KisPainter *painter) const |
| virtual bool | supportsNonIndirectPainting () const |
| KisPaintDeviceSP | temporaryTarget () const |
| FinalMergeSuspenderSP | trySuspendFinalMerge () |
| virtual | ~KisIndirectPaintingSupport () |
Public Member Functions inherited from KisNodeFilterInterface | |
| virtual KisFilterConfigurationSP | filter () const |
| KisNodeFilterInterface (const KisNodeFilterInterface &rhs) | |
| KisNodeFilterInterface (KisFilterConfigurationSP filterConfig) | |
| virtual void | notifyColorSpaceChanged () |
| virtual | ~KisNodeFilterInterface () |
Private Member Functions | |
| bool | filterNeedsTransparentPixels () const |
Private Attributes | |
| QScopedPointer< Private > | m_d |
An filter mask is a single channel mask that applies a particular filter to the layer the mask belongs to. It differs from an adjustment layer in that it only works on its parent layer, while adjustment layers work on all layers below it in its layer group.
Definition at line 23 of file kis_filter_mask.h.
| KisFilterMask::KisFilterMask | ( | KisImageWSP | image, |
| const QString & | name = QString() ) |
Create an empty filter mask.
Definition at line 34 of file kis_filter_mask.cpp.
References COMPOSITE_COPY, and KisBaseNode::setCompositeOpId().
| KisFilterMask::KisFilterMask | ( | const KisFilterMask & | rhs | ) |
Definition at line 42 of file kis_filter_mask.cpp.
|
overridedefault |
|
overridevirtual |
Accept the KisNodeVisitor (for the Visitor design pattern), should call the correct function on the KisNodeVisitor for this node type, so you need to override it for all leaf classes in the node inheritance hierarchy.
return false if the visitor could not successfully act on this node instance.
Reimplemented from KisBaseNode.
Definition at line 131 of file kis_filter_mask.cpp.
References v.
|
overridevirtual |
Accept the KisNodeVisitor (for the Visitor design pattern), should call the correct function on the KisProcessingVisitor for this node type, so you need to override it for all leaf classes in the node inheritance hierarchy.
The processing visitor differs from node visitor in the way that it accepts undo adapter, that allows the processing to be multithreaded
Reimplemented from KisBaseNode.
Definition at line 136 of file kis_filter_mask.cpp.
References KisProcessingVisitor::visit().
|
overridevirtual |
Some filters will cause a change of pixels those are outside a requested rect. E.g. we change a rect of 2x2, then we want to apply a convolution filter with kernel 4x4 (changeRect is (2+2*3)x(2+2*3)=8x8) to that area. The rect that should be updated on the layer will be exactly 8x8. More than that the needRect for that update will be 14x14. See needRect.
FIXME: This check of the emptiness should be done on the higher/lower level
We can't paint outside a selection, that is why we call KisMask::changeRect to crop actual change area in the end
FIXME: Think over this solution Union of rects means that changeRect returns NOT the rect changed by this very layer, but an accumulated rect changed by all underlying layers. Just take into account and change documentation accordingly
Reimplemented from KisNode.
Definition at line 175 of file kis_filter_mask.cpp.
References KisMask::changeRect(), KisDefaultBoundsBase::currentLevelOfDetail(), KisSharedPtr< T >::data(), KisPaintDevice::defaultBounds(), KisNodeFilterInterface::filter(), KisFilterRegistry::instance(), KisNode::parent, KisBaseNode::projection(), and KoGenericRegistry< T >::value().
|
inlineoverridevirtual |
Implements KisNode.
Definition at line 39 of file kis_filter_mask.h.
|
overridevirtual |
Reimplemented from KisMask.
Definition at line 91 of file kis_filter_mask.cpp.
References KisNode::busyProgressIndicator, KisDefaultBoundsBase::currentLevelOfDetail(), KisSharedPtr< T >::data(), KisPaintDevice::defaultBounds(), KisNodeFilterInterface::filter(), KisFilterRegistry::instance(), KIS_ASSERT_RECOVER_NOOP, KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, KisNode::nodeProgressProxy, KisFilter::process(), KisBusyProgressIndicator::update(), KoGenericRegistry< T >::value(), and warnKrita.
|
overridevirtual |
Returns the exact bounds of where the actual data resides in this node.
Reimplemented from KisBaseNode.
Definition at line 158 of file kis_filter_mask.cpp.
References KisBaseNode::exactBounds(), filterNeedsTransparentPixels(), and KisNode::parent.
|
overridevirtual |
Returns an approximation of where the bounds on actual data are in this node.
Reimplemented from KisBaseNode.
Definition at line 141 of file kis_filter_mask.cpp.
References KisBaseNode::extent(), filterNeedsTransparentPixels(), and KisNode::parent.
|
private |
Definition at line 56 of file kis_filter_mask.cpp.
References KisMask::colorSpace(), KisNodeFilterInterface::filter(), KisFilterRegistry::instance(), m_d, and KoGenericRegistry< T >::value().
|
overridevirtual |
Reimplemented from KisEffectMask.
Definition at line 51 of file kis_filter_mask.cpp.
References KisIconUtils::loadIcon().
|
overridevirtual |
Some filters need pixels outside the current processing rect to compute the new value (for instance, convolution filters) See changeRect See accessRect
FIXME: This check of the emptiness should be done on the higher/lower level
If we need some additional pixels even outside of a selection for accurate layer filtering, we'll get them! And no KisMask::needRect will prevent us from doing this! ;) That's why simply we do not call KisMask::needRect here :)
Reimplemented from KisNode.
Definition at line 211 of file kis_filter_mask.cpp.
References KisDefaultBoundsBase::currentLevelOfDetail(), KisSharedPtr< T >::data(), KisPaintDevice::defaultBounds(), KisNodeFilterInterface::filter(), KisFilterRegistry::instance(), KisNode::parent, KisBaseNode::projection(), and KoGenericRegistry< T >::value().
|
overridevirtual |
Sets the filter configuration for this node. The filter might differ from the filter that is currently set up on this node.
WARNING: the filterConfig becomes owned by the node right after you've set it. Don't try to access the configuration after you've associated it with the node.
| filterConfig | the new configuration object |
| checkCompareConfig | if true, the update code will check whether the config is the same as the old config, and if so, do nothing. If false, the filter node will be updated always. |
Reimplemented from KisNodeFilterInterface.
Definition at line 85 of file kis_filter_mask.cpp.
References m_d, and KisNodeFilterInterface::setFilter().
|
private |
Definition at line 65 of file kis_filter_mask.h.