Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAdjustmentLayer Class Reference

#include <kis_adjustment_layer.h>

+ Inheritance diagram for KisAdjustmentLayer:

Public Slots

KisLayerlayer ()
 
- Public Slots inherited from KisSelectionBasedLayer
KisLayerlayer ()
 
void slotImageSizeChanged ()
 

Public Member Functions

bool accept (KisNodeVisitor &) override
 
void accept (KisProcessingVisitor &visitor, KisUndoAdapter *undoAdapter) override
 
KisNodeSP clone () const override
 
QIcon icon () const override
 
 KisAdjustmentLayer (const KisAdjustmentLayer &rhs)
 
 KisAdjustmentLayer (KisImageWSP image, const QString &name, KisFilterConfigurationSP kfc, KisSelectionSP selection)
 
KisBaseNode::PropertyList sectionModelProperties () const override
 
void setChannelFlags (const QBitArray &channelFlags) override
 
void setFilter (KisFilterConfigurationSP filterConfig, bool checkCompareConfig=true) override
 
 ~KisAdjustmentLayer () override
 
- Public Member Functions inherited from KisSelectionBasedLayer
bool allowAsChild (KisNodeSP node) const override
 
QImage createThumbnail (qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) override
 
QRect exactBounds () const override
 
QRect extent () const override
 
KisSelectionSP fetchComposedInternalSelection (const QRect &rect) const
 
KisSelectionSP internalSelection () const
 
 KisSelectionBasedLayer (const KisSelectionBasedLayer &rhs)
 
 KisSelectionBasedLayer (KisImageWSP image, const QString &name, KisSelectionSP selection, KisFilterConfigurationSP filterConfig)
 
bool needProjection () const override
 
KisPaintDeviceSP original () const override
 
KisPaintDeviceSP paintDevice () const override
 
 Private ()
 
 Private (const Private &rhs)
 
virtual void resetCache (const KoColorSpace *colorSpace)
 
void setDirty () override
 
void setImage (KisImageWSP image) override
 
void setInternalSelection (KisSelectionSP selection)
 
void setX (qint32 x) override
 
void setY (qint32 y) override
 
bool supportsLodPainting () const override
 
int thumbnailSeqNo () const override
 
qint32 x () const override
 
qint32 y () const override
 
 ~KisSelectionBasedLayer () override
 
- Public Member Functions inherited from Private
 Private (KisCanvas2 *c)
 
- Public Member Functions inherited from KisLayer
bool alphaChannelDisabled () const
 
void buildProjectionUpToNode (KisPaintDeviceSP projection, KisNodeSP lastNode, const QRect &rect)
 
QBitArray & channelFlags () const
 
KisFilterMaskSP colorOverlayMask () const
 
const KoColorSpacecolorSpace () const override
 returns the image's colorSpace or null, if there is no image
 
const KoCompositeOpcompositeOp () const override
 returns the layer's composite op for the colorspace of the layer's parent.
 
virtual KisLayerSP createMergedLayerTemplate (KisLayerSP prevLayer)
 
QImage createThumbnailForFrame (qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) override
 
void disableAlphaChannel (bool disable)
 
QList< KisEffectMaskSPeffectMasks () const
 
QList< KisEffectMaskSPeffectMasks (KisNodeSP lastNode) const
 
virtual void fillMergedLayerTemplate (KisLayerSP dstLayer, KisLayerSP prevLayer, bool skipPaintingThisLayer=false)
 
bool hasClones () const
 
bool hasEffectMasks () const
 
virtual KisLayerProjectionPlaneSP internalProjectionPlane () const
 
 KisLayer (const KisLayer &rhs)
 
 KisLayer (KisImageWSP image, const QString &name, quint8 opacity)
 
KisPSDLayerStyleSP layerStyle () const
 
QRect looseUserVisibleBounds () const
 
KisMetaData::StoremetaData ()
 
void notifyChildMaskChanged ()
 
KisLayerSP parentLayer () const
 
QRect partialChangeRect (KisNodeSP lastNode, const QRect &rect)
 
 Private (KisLayer *q)
 
KisPaintDeviceSP projection () const override
 
KisAbstractProjectionPlaneSP projectionPlane () const override
 
void registerClone (KisCloneLayerWSP clone)
 
const QList< KisCloneLayerWSPregisteredClones () const
 
KisBaseNode::PropertyList sectionModelProperties () const override
 
virtual KisSelectionSP selection () const
 
virtual KisSelectionMaskSP selectionMask () const
 
void setLayerStyle (KisPSDLayerStyleSP layerStyle)
 
void setSectionModelProperties (const KisBaseNode::PropertyList &properties) override
 
void setTemporary (bool t)
 
bool temporary () const
 
QRect tightUserVisibleBounds () const
 
void unregisterClone (KisCloneLayerWSP clone)
 
void updateClones (const QRect &rect, bool dontInvalidateFrames)
 
 ~KisLayer () override
 
- Public Member Functions inherited from KisNode
bool accept (KisNodeVisitor &v) override
 
void accept (KisProcessingVisitor &visitor, KisUndoAdapter *undoAdapter) override
 
KisNodeSP at (quint32 index) const
 
KisBusyProgressIndicatorbusyProgressIndicator () const
 
quint32 childCount () const
 
QList< KisNodeSPchildNodes (const QStringList &nodeTypes, const KoProperties &properties) const
 
const KisNodefindSymmetricClone (const KisNode *srcRoot, const KisNode *dstRoot, const KisNode *srcTarget)
 
KisNodeSP firstChild () const
 
virtual KisPaintDeviceList getLodCapableDevices () const
 
KisNodeGraphListenergraphListener () 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
 
KisNodeProgressProxynodeProgressProxy () 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)
 
void setDirty (const KisRegion &region)
 
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)
 
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
 
void enableAnimation ()
 
KisKeyframeChannelgetKeyframeChannel (const QString &id) const
 
KisKeyframeChannelgetKeyframeChannel (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 KoPropertiesnodeProperties () const
 
quint8 opacity () const
 
quint8 percentOpacity () const
 
 Private (const Private &rhs)
 
 Private (KisImageWSP p_image)
 
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 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 ()
 

Protected Member Functions

QRect incomingChangeRect (const QRect &rect) const override
 
QRect needRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const override
 
- Protected Member Functions inherited from KisSelectionBasedLayer
void copyOriginalToProjection (const KisPaintDeviceSP original, KisPaintDeviceSP projection, const QRect &rect) const override
 
QRect cropChangeRectBySelection (const QRect &rect) const
 
void initSelection ()
 
QRect needRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const override
 
KisKeyframeChannelrequestKeyframeChannel (const QString &id) override
 
void setUseSelectionInProjection (bool value) const
 
bool supportsKeyframeChannel (const QString &id) override
 
- Protected Member Functions inherited from KisLayer
virtual QRect amortizedProjectionRectForCleanupInChangePass () const
 
QRect applyMasks (const KisPaintDeviceSP source, KisPaintDeviceSP destination, const QRect &requestedRect, KisNodeSP filthyNode, KisNodeSP lastNode, KisRenderPassFlags flags) const
 
bool canMergeAndKeepBlendOptions (KisLayerSP otherLayer)
 
QRect changeRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const override
 
void childNodeChanged (KisNodeSP changedChildNode) override
 
QRect masksChangeRect (const QList< KisEffectMaskSP > &masks, const QRect &requestedRect, bool &rectVariesFlag) const
 
QRect masksNeedRect (const QList< KisEffectMaskSP > &masks, const QRect &changeRect, QStack< QRect > &applyRects, bool &rectVariesFlag) const
 
QRect needRectForOriginal (const QRect &rect) const
 
virtual QRect outgoingChangeRect (const QRect &rect) const
 
QList< KisEffectMaskSPsearchEffectMasks (KisNodeSP lastNode) const
 
QRect updateProjection (const QRect &rect, KisNodeSP filthyNode, KisRenderPassFlags flags)
 
- Protected Member Functions inherited from KisNode
virtual QRect accessRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const
 
void addKeyframeChannel (KisKeyframeChannel *channel) override
 
void baseNodeChangedCallback () override
 
void baseNodeCollapsedChangedCallback () override
 
void baseNodeInvalidateAllFramesCallback () override
 
virtual KisFrameChangeUpdateRecipe handleKeyframeChannelFrameAboutToBeRemovedImpl (const KisKeyframeChannel *channel, int time)
 
void notifyParentVisibilityChanged (bool value) override
 
KisBaseNodeSP parentCallback () const override
 
- Protected Member Functions inherited from KisBaseNode
void setSupportsLodMoves (bool value)
 
- Protected Member Functions inherited from KisShared
 KisShared ()
 
 ~KisShared ()
 
- Protected Member Functions inherited from KisIndirectPaintingSupport
void lockTemporaryTargetForWrite () const
 
void mergeToLayerImpl (KisPaintDeviceSP dst, KUndo2Command *parentCommand, const KUndo2MagicString &transactionText, int timedID, bool cleanResources, WriteLockerSP sharedWriteLock, QVector< KisRunnableStrokeJobData * > *jobs)
 
void releaseResources ()
 
QString temporaryCompositeOp () const
 
virtual void writeMergeData (KisPainter *painter, KisPaintDeviceSP src, const QRect &rc)
 

Additional Inherited Members

- Public Types inherited from KisNode
enum  PositionToFilthy { N_ABOVE_FILTHY = 0x08 , N_FILTHY_PROJECTION = 0x20 , N_FILTHY = 0x40 , N_BELOW_FILTHY = 0x80 }
 
- Public Types inherited from KisBaseNode
typedef QList< PropertyPropertyList
 
- Public Types inherited from KisIndirectPaintingSupport
using FinalMergeSuspenderSP = QSharedPointer<FinalMergeSuspender>
 
- Signals inherited from KisNode
void sigNodeChangedInternal ()
 
- Signals inherited from KisBaseNode
void keyframeChannelAdded (KisKeyframeChannel *channel)
 
void opacityChanged (quint8 value)
 
- Public Attributes inherited from KisSelectionBasedLayer
KisSignalAutoConnectionsStore imageConnections
 
KisPaintDeviceSP paintDevice
 
KisSelectionSP selection
 
bool useSelectionInProjection
 
- Public Attributes inherited from Private
KisCanvas2canvas
 
int displayedFrame
 
int intendedFrame
 
- Public Attributes inherited from KisLayer
QBitArray channelFlags
 
KisCloneLayersList clonesList
 
KisPSDLayerStyleSP layerStyle
 
KisLayerStyleProjectionPlaneSP layerStyleProjectionPlane
 
KisLayerMasksCache masksCache
 
KisMetaData::StoremetaDataStore {nullptr}
 
KisLayerProjectionPlaneSP projectionPlane
 
KisSafeNodeProjectionStoreSP safeProjection
 
- Public Attributes inherited from KisNode
KisBusyProgressIndicatorbusyProgressIndicator
 
std::optional< KisFrameChangeUpdateRecipeframeRemovalUpdateRecipe
 
KisNodeGraphListenergraphListener
 
KisNodeProgressProxynodeProgressProxy
 
KisSafeReadNodeList nodes
 
QReadWriteLock nodeSubgraphLock
 
KisNodeWSP parent
 
KisProjectionLeafSP projectionLeaf
 
- Public Attributes inherited from KisBaseNode
bool animated {false}
 
bool collapsed {false}
 
QString compositeOp
 
KisBaseNode::Property hack_visible
 
QUuid id
 
KisImageWSP image
 
QMap< QString, KisKeyframeChannel * > keyframeChannels
 
KisAnimatedOpacityProperty opacityProperty
 
bool pinnedToTimeline {false}
 
KoProperties properties
 
bool supportsLodMoves {false}
 
- Public Attributes inherited from KisIndirectPaintingSupport
QBitArray channelFlags
 
QString compositeOp
 
qreal compositeOpacity
 
bool finalMergeInProgress = true
 
QReadWriteLock lock
 
KisSelectionSP selection
 
KisPaintDeviceSP temporaryTarget
 
- Protected Types inherited from KisIndirectPaintingSupport
using WriteLockerSP = QSharedPointer<WriteLocker>
 

Detailed Description

Definition at line 25 of file kis_adjustment_layer.h.

Constructor & Destructor Documentation

◆ KisAdjustmentLayer() [1/2]

KisAdjustmentLayer::KisAdjustmentLayer ( KisImageWSP image,
const QString & name,
KisFilterConfigurationSP kfc,
KisSelectionSP selection )

creates a new adjustment layer with the given configuration and selection. Note that the selection will be copied (with COW, though).

Parameters
imagethe image to set this AdjustmentLayer to
namename of the adjustment layer
kfcthe configuration for the adjustment layer filter
selectionis a mask used by the adjustment layer to know where to apply the filter.

Definition at line 26 of file kis_adjustment_layer.cc.

31{
32 // by default Adjustment Layers have a copy composition,
33 // which is more natural for users
34 // https://bugs.kde.org/show_bug.cgi?id=324505
35 // https://bugs.kde.org/show_bug.cgi?id=294122
36 // demand the opposite from each other...
37 //
38 // also see a comment in KisLayerUtils::mergeMultipleLayersImpl()
39
42}
const QString COMPOSITE_COPY
KisImageWSP image
QString name() const
void setCompositeOpId(const QString &compositeOpId)
void setUseSelectionInProjection(bool value) const
KisSelectionBasedLayer(KisImageWSP image, const QString &name, KisSelectionSP selection, KisFilterConfigurationSP filterConfig)

References COMPOSITE_COPY, KisBaseNode::setCompositeOpId(), and KisSelectionBasedLayer::setUseSelectionInProjection().

◆ KisAdjustmentLayer() [2/2]

KisAdjustmentLayer::KisAdjustmentLayer ( const KisAdjustmentLayer & rhs)

Definition at line 44 of file kis_adjustment_layer.cc.

46{
47}

◆ ~KisAdjustmentLayer()

KisAdjustmentLayer::~KisAdjustmentLayer ( )
override

Definition at line 50 of file kis_adjustment_layer.cc.

51{
52}

Member Function Documentation

◆ accept() [1/2]

bool KisAdjustmentLayer::accept ( KisNodeVisitor & )
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 104 of file kis_adjustment_layer.cc.

105{
106 return v.visit(this);
107}
qreal v

References v.

◆ accept() [2/2]

void KisAdjustmentLayer::accept ( KisProcessingVisitor & visitor,
KisUndoAdapter * undoAdapter )
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 109 of file kis_adjustment_layer.cc.

110{
111 return visitor.visit(this, undoAdapter);
112}
virtual void visit(KisNode *node, KisUndoAdapter *undoAdapter)=0

References KisProcessingVisitor::visit().

◆ clone()

KisNodeSP KisAdjustmentLayer::clone ( ) const
inlineoverridevirtual

clones this AdjustmentLayer into a KisNodeSP type.

Returns
the KisNodeSP returned

Implements KisNode.

Definition at line 51 of file kis_adjustment_layer.h.

51 {
52 return KisNodeSP(new KisAdjustmentLayer(*this));
53 }
KisAdjustmentLayer(KisImageWSP image, const QString &name, KisFilterConfigurationSP kfc, KisSelectionSP selection)
KisSharedPtr< KisNode > KisNodeSP
Definition kis_types.h:86

◆ icon()

QIcon KisAdjustmentLayer::icon ( ) const
overridevirtual

gets the adjustmentLayer's tool filter

Returns
QIcon returns the QIcon tool filter

Reimplemented from KisBaseNode.

Definition at line 114 of file kis_adjustment_layer.cc.

115{
116 return KisIconUtils::loadIcon("filterLayer");
117}
QIcon loadIcon(const QString &name)

References KisIconUtils::loadIcon().

◆ incomingChangeRect()

QRect KisAdjustmentLayer::incomingChangeRect ( const QRect & rect) const
overrideprotectedvirtual

For KisLayer classes change rect transformation consists of two parts: incoming and outgoing.

1) incomingChangeRect(rect) chande rect transformation performed by the transformations done basing on global projection. It is performed in KisAsyncMerger + KisUpdateOriginalVisitor classes. It happens before data coming to KisLayer::original() therefore it is 'incoming'. See KisAdjustmentLayer for example of usage.

2) outgoingChangeRect(rect) change rect transformation that happens in KisLayer::copyOriginalToProjection(). It applies only when the layer is 'filthy', that is was the cause of the merge process. See KisCloneLayer for example of usage.

The flow of changed areas can be illustrated in the following way:

  1. Current projection of size R1 is stored in KisAsyncMerger::m_currentProjection | | <– KisUpdateOriginalVisitor writes data into layer's original() device. | The changed area on KisLayer::original() is | R2 = KisLayer::incomingChangeRect(R1) |
  2. KisLayer::original() / changed rect: R2 | | <– KisLayer::updateProjection() starts composing a layer | It calls KisLayer::copyOriginalToProjection() which copies some area | to a temporary device. The temporary device now stores | R3 = KisLayer::outgoingChangeRect(R2) |
  3. Temporary device / changed rect: R3 | | <– KisLayer::updateProjection() continues composing a layer. It merges a mask. | R4 = KisMask::changeRect(R3) |
  4. KisLayer::original() / changed rect: R4

So in the end rect R4 will be passed up to the next layers in the stack.

After the change in the blending using setUseSelectionInProjection(false) we should not crop the change rect of the layer, because we pass contents through.

//filteredRect = cropChangeRectBySelection(filteredRect);

Reimplemented from KisLayer.

Definition at line 60 of file kis_adjustment_layer.cc.

61{
62 KisFilterConfigurationSP filterConfig = filter();
63
64 QRect filteredRect = rect;
65
66 if (filterConfig) {
67 KisFilterSP filter = KisFilterRegistry::instance()->value(filterConfig->name());
68 filteredRect = filter->changedRect(rect, filterConfig.data(), projection()->defaultBounds()->currentLevelOfDetail());
69 }
70
79 return filteredRect;
80}
static KisFilterRegistry * instance()
virtual KisFilterConfigurationSP filter() const
const T value(const QString &id) const
KisPaintDeviceSP projection() const override
Definition kis_layer.cc:820

References KisSharedPtr< T >::data(), KisNodeFilterInterface::filter(), KisFilterRegistry::instance(), KisLayer::projection(), and KoGenericRegistry< T >::value().

◆ layer

KisLayer * KisAdjustmentLayer::layer ( )
inlineslot

gets this AdjustmentLayer. Overrides function in KisIndirectPaintingSupport

Returns
this AdjustmentLayer

Definition at line 93 of file kis_adjustment_layer.h.

93 {
94 return this;
95 }

◆ needRect()

QRect KisAdjustmentLayer::needRect ( const QRect & rect,
PositionToFilthy pos = N_FILTHY ) const
overrideprotectedvirtual
Returns
internal needRect() of the node. Do not mix with
See also
projectionPlane()

Some filters need pixels outside the current processing rect to compute the new value (for instance, convolution filters) See changeRect See accessRect

If we need some additional pixels even outside of a selection for accurate layer filtering, we'll get them! And no KisSelectionBasedLayer::needRect will prevent us from doing this! ;) That's why simply we do not call KisSelectionBasedLayer::needRect here :)

Reimplemented from KisNode.

Definition at line 82 of file kis_adjustment_layer.cc.

83{
84 Q_UNUSED(pos);
85
86 KisFilterConfigurationSP filterConfig = filter();
87 if (!filterConfig) return rect;
88 KisFilterSP filter = KisFilterRegistry::instance()->value(filterConfig->name());
89
98 QRect needRect = rect;
100 needRect = filter->neededRect(needRect, filterConfig.data(), projection()->defaultBounds()->currentLevelOfDetail());
101 return needRect;
102}
QRect needRect(const QRect &rect, PositionToFilthy pos=N_FILTHY) const override
QRect needRectForOriginal(const QRect &rect) const
Definition kis_layer.cc:913

References KisSharedPtr< T >::data(), KisNodeFilterInterface::filter(), KisFilterRegistry::instance(), needRect(), KisLayer::needRectForOriginal(), KisLayer::projection(), and KoGenericRegistry< T >::value().

◆ sectionModelProperties()

KisBaseNode::PropertyList KisAdjustmentLayer::sectionModelProperties ( ) const
overridevirtual

gets the AdjustmentLayer properties describing whether or not the node is locked, visible, and the filter name is it is a filter. Overrides sectionModelProperties in KisLayer, and KisLayer overrides sectionModelProperties in KisBaseNode.

Returns
KisBaseNode::PropertyList returns a list of the properties

Reimplemented from KisBaseNode.

Definition at line 119 of file kis_adjustment_layer.cc.

120{
121 KisFilterConfigurationSP filterConfig = filter();
123 if (filterConfig)
124 l << KisBaseNode::Property(KoID("filter", i18nc("property of a filter layer, noun", "Filter")), KisFilterRegistry::instance()->value(filterConfig->name())->name());
125
126 return l;
127}
float value(const T *src, size_t ch)
Definition KoID.h:30
KisBaseNode::PropertyList sectionModelProperties() const override
Definition kis_layer.cc:272

References KisNodeFilterInterface::filter(), KisFilterRegistry::instance(), KisLayer::sectionModelProperties(), and value().

◆ setChannelFlags()

void KisAdjustmentLayer::setChannelFlags ( const QBitArray & channelFlags)
overridevirtual

set the channelflags for this layer to the specified bit array. The bit array must have exactly the same number of channels as the colorspace this layer is in, or be empty, in which case all channels are active.

Reimplemented from KisLayer.

Definition at line 129 of file kis_adjustment_layer.cc.

130{
131 KisFilterConfigurationSP filterConfig = filter();
132
133 if (filterConfig) {
134 filterConfig->setChannelFlags(channelFlags);
135 }
137}
virtual void setChannelFlags(const QBitArray &channelFlags)
Definition kis_layer.cc:342

References KisIndirectPaintingSupport::channelFlags, KisNodeFilterInterface::filter(), and KisLayer::setChannelFlags().

◆ setFilter()

void KisAdjustmentLayer::setFilter ( KisFilterConfigurationSP filterConfig,
bool checkCompareConfig = true )
overridevirtual
See also
KisNodeFilterInterface::setFilter()

Reimplemented from KisNodeFilterInterface.

Definition at line 54 of file kis_adjustment_layer.cc.

55{
56 filterConfig->setChannelFlags(channelFlags());
57 KisSelectionBasedLayer::setFilter(filterConfig, checkCompareConfig);
58}
virtual void setFilter(KisFilterConfigurationSP filterConfig, bool checkCompareConfig=true)

References KisIndirectPaintingSupport::channelFlags, and KisNodeFilterInterface::setFilter().


The documentation for this class was generated from the following files: