|
Krita Source Code Documentation
|
#include <kis_clone_layer.h>
Inheritance diagram for KisCloneLayer:Public Member Functions | |
| bool | accept (KisNodeVisitor &) override |
| void | accept (KisProcessingVisitor &visitor, KisUndoAdapter *undoAdapter) override |
| bool | allowAsChild (KisNodeSP) const override |
| KisNodeSP | clone () const override |
| const KoColorSpace * | colorSpace () const override |
| KisLayerSP | copyFrom () const |
| KisNodeUuidInfo | copyFromInfo () const |
| CopyLayerType | copyType () const |
| QRect | exactBounds () const override |
| Returns the exact bounds of where the actual data resides in this layer. | |
| QRect | extent () const override |
| Returns an approximation of where the bounds on actual data are in this layer. | |
| QIcon | icon () const override |
| KisCloneLayer (const KisCloneLayer &rhs) | |
| KisCloneLayer (KisLayerSP from, KisImageWSP image, const QString &name, quint8 opacity) | |
| bool | needProjection () const override |
| QRect | needRectOnSourceForMasks (const QRect &rc) const |
| KisPaintDeviceSP | original () const override |
| KisPaintDeviceSP | paintDevice () const override |
| Private (KisDefaultBoundsBaseSP defaultBounds) | |
| KisLayerSP | reincarnateAsPaintLayer () const |
| KisBaseNode::PropertyList | sectionModelProperties () const override |
| void | setCopyFrom (KisLayerSP layer) |
| void | setCopyFromInfo (KisNodeUuidInfo info) |
| void | setCopyType (CopyLayerType type) |
| void | setDirtyOriginal (const QRect &rect, bool dontInvalidateFrames) |
| void | setImage (KisImageWSP image) override |
| void | setX (qint32) override |
| void | setY (qint32) override |
| void | syncLodCache () override |
| qint32 | x () const override |
| qint32 | y () const override |
| ~KisCloneLayer () 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 KoColorSpace * | colorSpace () const override |
| returns the image's colorSpace or null, if there is no image | |
| const KoCompositeOp * | compositeOp () const override |
| returns the layer's composite op for the colorspace of the layer's parent. | |
| virtual KisLayerSP | createMergedLayerTemplate (KisLayerSP prevLayer) |
| QImage | createThumbnail (qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) override |
| QImage | createThumbnailForFrame (qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode=Qt::IgnoreAspectRatio) override |
| void | disableAlphaChannel (bool disable) |
| QList< KisEffectMaskSP > | effectMasks () const |
| QList< KisEffectMaskSP > | effectMasks (KisNodeSP lastNode) const |
| QRect | exactBounds () const override |
| QRect | extent () const override |
| 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::Store * | metaData () |
| 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< KisCloneLayerWSP > | registeredClones () const |
| KisBaseNode::PropertyList | sectionModelProperties () const override |
| virtual KisSelectionSP | selection () const |
| virtual KisSelectionMaskSP | selectionMask () const |
| virtual void | setChannelFlags (const QBitArray &channelFlags) |
| void | setImage (KisImageWSP image) override |
| void | setLayerStyle (KisPSDLayerStyleSP layerStyle) |
| void | setSectionModelProperties (const KisBaseNode::PropertyList &properties) override |
| void | setTemporary (bool t) |
| void | setX (qint32 x) override |
| void | setY (qint32 y) override |
| bool | temporary () const |
| int | thumbnailSeqNo () const override |
| QRect | tightUserVisibleBounds () const |
| void | unregisterClone (KisCloneLayerWSP clone) |
| void | updateClones (const QRect &rect, bool dontInvalidateFrames) |
| qint32 | x () const override |
| qint32 | y () const override |
| ~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 |
| 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 |
| ~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 () |
| 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) | |
| 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) |
| virtual bool | supportsKeyframeChannel (const QString &id) |
| bool | supportsLodMoves () const |
| virtual bool | supportsLodPainting () 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 () |
Protected Member Functions | |
| QRect | accessRect (const QRect &rect, PositionToFilthy pos) const override |
| void | copyOriginalToProjection (const KisPaintDeviceSP original, KisPaintDeviceSP projection, const QRect &rect) const override |
| void | notifyParentVisibilityChanged (bool value) override |
| QRect | outgoingChangeRect (const QRect &rect) const 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 |
| virtual QRect | incomingChangeRect (const QRect &rect) const |
| 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 |
| QList< KisEffectMaskSP > | searchEffectMasks (KisNodeSP lastNode) const |
| QRect | updateProjection (const QRect &rect, KisNodeSP filthyNode, KisRenderPassFlags flags) |
Protected Member Functions inherited from KisNode | |
| void | addKeyframeChannel (KisKeyframeChannel *channel) override |
| void | baseNodeChangedCallback () override |
| void | baseNodeCollapsedChangedCallback () override |
| void | baseNodeInvalidateAllFramesCallback () override |
| virtual KisFrameChangeUpdateRecipe | handleKeyframeChannelFrameAboutToBeRemovedImpl (const KisKeyframeChannel *channel, int time) |
| virtual QRect | needRect (const QRect &rect, PositionToFilthy pos=N_FILTHY) const |
| void | notifyParentVisibilityChanged (bool value) override |
| KisBaseNodeSP | parentCallback () const override |
Protected Member Functions inherited from KisBaseNode | |
| virtual KisKeyframeChannel * | requestKeyframeChannel (const QString &id) |
| void | setSupportsLodMoves (bool value) |
Protected Member Functions inherited from KisShared | |
| KisShared () | |
| ~KisShared () | |
Private Attributes | |
| Private *const | m_d {nullptr} |
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< Property > | PropertyList |
Signals inherited from KisNode | |
| void | sigNodeChangedInternal () |
Signals inherited from KisBaseNode | |
| void | keyframeChannelAdded (KisKeyframeChannel *channel) |
| void | opacityChanged (quint8 value) |
A copy layer adds the contents of another layer in another place in the layer stack. It is possible to add more effect masks to the copy. You can either copy the original data or the projection data produced by the original layer + original effect masks. There is no physical copy of the data; if the original changes, the copy changes too. The copy layer can be positioned differently from the original layer.
Definition at line 31 of file kis_clone_layer.cpp.
| KisCloneLayer::KisCloneLayer | ( | KisLayerSP | from, |
| KisImageWSP | image, | ||
| const QString & | name, | ||
| quint8 | opacity ) |
Definition at line 46 of file kis_clone_layer.cpp.
References KisImage::colorSpace(), COPY_PROJECTION, KisBaseNode::image, m_d, and KisWeakSharedPtr< T >::toStrongRef().
| KisCloneLayer::KisCloneLayer | ( | const KisCloneLayer & | rhs | ) |
Definition at line 66 of file kis_clone_layer.cpp.
References copyFrom, copyType(), KisBaseNode::image, and m_d.
|
override |
|
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 273 of file kis_clone_layer.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 278 of file kis_clone_layer.cpp.
References KisProcessingVisitor::visit().
|
overrideprotectedvirtual |
Shows the area of image, that may be accessed during accessing the node.
Example. You have a layer that needs to prepare some rect on a projection, say expectedRect. To perform this, the projection of all the layers below of the size needRect(expectedRect) should be calculated by the merger beforehand and the layer will access some other area of image inside the rect accessRect(expectedRect) during updateProjection call.
This knowledge about real access rect of a node is used by the scheduler to avoid collisions between two multithreaded updaters and so avoid flickering of the image.
Currently, this method has nondefault value for shifted clone layers only.
KisUpdateOriginalVisitor will try to recalculate some area on the clone's source, so this extra rectangle should also be taken into account
Reimplemented from KisNode.
Definition at line 248 of file kis_clone_layer.cpp.
References m_d, KisNode::N_FILTHY, KisNode::N_FILTHY_PROJECTION, and needRectOnSourceForMasks().
|
overridevirtual |
Re-implement this method to add constraints for the subclasses that can be added as children to this node
Implements KisNode.
Definition at line 109 of file kis_clone_layer.cpp.
|
inlineoverridevirtual |
Implements KisNode.
Definition at line 44 of file kis_clone_layer.h.
|
overridevirtual |
| KisLayerSP KisCloneLayer::copyFrom | ( | ) | const |
| KisNodeUuidInfo KisCloneLayer::copyFromInfo | ( | ) | const |
|
overrideprotectedvirtual |
Layers can override this method to get some special behavior when copying data from original to projection, e.g. blend in indirect painting device. If you need to modify data outside rect, please also override outgoingChangeRect() method.
Reimplemented from KisLayer.
Definition at line 146 of file kis_clone_layer.cpp.
References KisPainter::copyAreaOptimized(), m_d, original(), and KisLayer::projection().
| CopyLayerType KisCloneLayer::copyType | ( | ) | const |
|
overridevirtual |
Returns the exact bounds of where the actual data resides in this layer.
Reimplemented from KisBaseNode.
Definition at line 240 of file kis_clone_layer.cpp.
References KisPaintDevice::exactBounds(), original(), and KisLayer::projection().
|
overridevirtual |
Returns an approximation of where the bounds on actual data are in this layer.
Reimplemented from KisBaseNode.
Definition at line 232 of file kis_clone_layer.cpp.
References KisPaintDevice::extent(), original(), and KisLayer::projection().
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 322 of file kis_clone_layer.cpp.
References KisIconUtils::loadIcon().
|
overridevirtual |
| QRect KisCloneLayer::needRectOnSourceForMasks | ( | const QRect & | rc | ) | const |
Definition at line 193 of file kis_clone_layer.cpp.
References KisLayer::effectMasks(), KisLayer::masksNeedRect(), and KisNode::needRect().
|
overrideprotectedvirtual |
Trigger a full update when the layer is finally getting transitively-visible
Reimplemented from KisBaseNode.
Definition at line 177 of file kis_clone_layer.cpp.
References KisImage::bounds(), KisBaseNode::image, KisBaseNode::notifyParentVisibilityChanged(), KisNode::setDirty(), KisWeakSharedPtr< T >::toStrongRef(), value(), and KisBaseNode::visible().
|
overridevirtual |
Return the layer data before the effect masks have had their go at it.
Implements KisLayer.
Definition at line 119 of file kis_clone_layer.cpp.
References COPY_ORIGINAL, COPY_PROJECTION, and m_d.
|
overrideprotectedvirtual |
Reimplemented from KisLayer.
Definition at line 268 of file kis_clone_layer.cpp.
References m_d.
|
overridevirtual |
Return the paintdevice you can use to change pixels on. For a paint layer these will be paint pixels, for an adjustment layer or a mask the selection paint device.
Implements KisBaseNode.
Definition at line 114 of file kis_clone_layer.cpp.
|
inline |
Definition at line 33 of file kis_clone_layer.cpp.
| KisLayerSP KisCloneLayer::reincarnateAsPaintLayer | ( | ) | const |
When the source layer of the clone is removed from the stack we should substitute the clone with a usual paint layer, because the source might become unreachable quite soon. This method builds a paint layer representation of this clone.
Definition at line 90 of file kis_clone_layer.cpp.
References KisBaseNode::compositeOpId(), KisBaseNode::image, KisBaseNode::mergeNodeProperties(), KisBaseNode::name(), KisBaseNode::nodeProperties(), KisBaseNode::opacity(), original(), KisBaseNode::setCompositeOpId(), KisLayer::setX(), KisLayer::setY(), x(), KisLayer::x(), y(), and KisLayer::y().
|
overridevirtual |
Return a the properties of this base node (locked, visible etc, with the right icons for their representation and their state.
Subclasses can extend this list with new properties, like opacity for layers or visualized for masks.
The order of properties is, unfortunately, for now, important, so take care which properties superclasses of your class define.
KisBaseNode defines visible = 0, locked = 1 KisLayer defines opacity = 2, compositeOp = 3 KisMask defines active = 2 (KisMask does not inherit kislayer)
Reimplemented from KisBaseNode.
Definition at line 327 of file kis_clone_layer.cpp.
References m_d, and KisLayer::sectionModelProperties().
| void KisCloneLayer::setCopyFrom | ( | KisLayerSP | layer | ) |
| void KisCloneLayer::setCopyFromInfo | ( | KisNodeUuidInfo | info | ) |
Used when loading: loading is done in two passes, and the copy from layer is set when all layers have been created, not during loading.
Definition at line 316 of file kis_clone_layer.cpp.
References m_d.
| void KisCloneLayer::setCopyType | ( | CopyLayerType | type | ) |
Definition at line 301 of file kis_clone_layer.cpp.
| void KisCloneLayer::setDirtyOriginal | ( | const QRect & | rect, |
| bool | dontInvalidateFrames ) |
This function is called by the original to notify us that it is dirty
The original will be updated when the clone becomes visible again.
HINT: this method is present for historical reasons only. Long time ago the updates were calculated in "copyOriginalToProjection" coordinate system. Now everything is done in "original()" space.
Definition at line 156 of file kis_clone_layer.cpp.
References KisNode::setDirty(), KisNode::setDirtyDontResetAnimationCache(), and KisBaseNode::visible().
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 102 of file kis_clone_layer.cpp.
References KisBaseNode::image, m_d, and KisLayer::setImage().
|
overridevirtual |
Set the x offset of this layer in the image place. Re-implement this where it makes sense, by default it does nothing. It should not move child nodes.
Reimplemented from KisBaseNode.
Definition at line 223 of file kis_clone_layer.cpp.
|
overridevirtual |
Set the y offset of this layer in the image place. Re-implement this where it makes sense, by default it does nothing. It should not move child nodes.
Reimplemented from KisBaseNode.
Definition at line 227 of file kis_clone_layer.cpp.
|
overridevirtual |
Synchronizes LoD caches of the node with the current state of it. The current level of detail is fetched from the image pointed by default bounds object
Reimplemented from KisNode.
Definition at line 336 of file kis_clone_layer.cpp.
References m_d, and KisNode::syncLodCache().
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 215 of file kis_clone_layer.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 219 of file kis_clone_layer.cpp.
References m_d.
| KisLayerSP KisCloneLayer::copyFrom |
Definition at line 41 of file kis_clone_layer.cpp.
| KisNodeUuidInfo KisCloneLayer::copyFromInfo |
Definition at line 42 of file kis_clone_layer.cpp.
| KisPaintDeviceSP KisCloneLayer::fallback |
Definition at line 38 of file kis_clone_layer.cpp.
|
private |
Definition at line 121 of file kis_clone_layer.h.
| KisLodCapableLayerOffset KisCloneLayer::offset |
Definition at line 39 of file kis_clone_layer.cpp.
| CopyLayerType KisCloneLayer::type {COPY_PROJECTION} |
Definition at line 43 of file kis_clone_layer.cpp.