|
Krita Source Code Documentation
|
#include <kis_paint_layer.h>
Inheritance diagram for KisPaintLayer:Public Slots | |
| void | slotExternalUpdateOnionSkins () |
Protected Member Functions | |
| void | copyOriginalToProjection (const KisPaintDeviceSP original, KisPaintDeviceSP projection, const QRect &rect) const override |
| KisFrameChangeUpdateRecipe | handleKeyframeChannelFrameAboutToBeRemovedImpl (const KisKeyframeChannel *channel, int time) override |
| KisKeyframeChannel * | requestKeyframeChannel (const QString &id) override |
| 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 |
| 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 |
| virtual QRect | outgoingChangeRect (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 | |
| 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 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 | |
| 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) |
Private Attributes | |
| Private *const | m_d |
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 |
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) |
Protected Types inherited from KisIndirectPaintingSupport | |
| using | WriteLockerSP = QSharedPointer<WriteLocker> |
This layer is of a type that can be drawn on. A paint layer can have any number of effect masks, a transparency mask, a local selection and a protection mask.
The protection mask can be read/write, read-only or write-only. The transparency mask has two rendering forms: as a selection mask and by changing the transparency of the paint layer's pixels.
Definition at line 40 of file kis_paint_layer.cc.
| KisPaintLayer::KisPaintLayer | ( | KisImageWSP | image, |
| const QString & | name, | ||
| quint8 | opacity, | ||
| KisPaintDeviceSP | dev ) |
Construct a paint layer with the given parameters. The default bounds of the paintdevice are overwritten.
| image | this layer belongs to, or null, if it shouldn't belong to any image |
| name | of the layer |
| opacity | in the range between OPACITY_TRANSPARENT_U8 and OPACITY_OPAQUE_U8 |
| dev | is the paint device, that should be used |
Definition at line 63 of file kis_paint_layer.cc.
References KisBaseNode::image, and m_d.
| KisPaintLayer::KisPaintLayer | ( | KisImageWSP | image, |
| const QString & | name, | ||
| quint8 | opacity ) |
Construct a paint layer with the given parameters
| image | this layer belongs to. it must not be null and it must have a valid color space. |
| name | of the layer |
| opacity | in the range between OPACITY_TRANSPARENT_U8 and OPACITY_OPAQUE_U8 |
Definition at line 76 of file kis_paint_layer.cc.
References KisImage::colorSpace(), KisBaseNode::image, and m_d.
| KisPaintLayer::KisPaintLayer | ( | KisImageWSP | image, |
| const QString & | name, | ||
| quint8 | opacity, | ||
| const KoColorSpace * | colorSpace ) |
Construct a paint layer with the given parameters
| image | this layer belongs to, or null, if it shouldn't belong to any image. image must not be null, if colorSpace is null |
| name | of the layer |
| opacity | in the range between OPACITY_TRANSPARENT_U8 and OPACITY_OPAQUE_U8 |
| colorSpace | is the color space, that should be used to construct the paint device. it can be null, if the image is valid. |
Definition at line 86 of file kis_paint_layer.cc.
References KisImage::colorSpace(), KisLayer::colorSpace(), KisBaseNode::image, and m_d.
| KisPaintLayer::KisPaintLayer | ( | const KisPaintLayer & | rhs | ) |
Copy Constructor
Definition at line 99 of file kis_paint_layer.cc.
References KisNode::addKeyframeChannel(), KritaUtils::CopyAllFrames, KritaUtils::CopySnapshot, KisBaseNode::enableAnimation(), m_d, and onionSkinEnabled().
|
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 KisNode.
Definition at line 226 of file kis_paint_layer.cc.
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 KisNode.
Definition at line 231 of file kis_paint_layer.cc.
References KisProcessingVisitor::visit().
|
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 128 of file kis_paint_layer.cc.
| bool KisPaintLayer::alphaLocked | ( | ) | const |
Definition at line 263 of file kis_paint_layer.cc.
References KoColorSpace::channelFlags(), KisLayer::colorSpace(), and m_d.
| const QBitArray & KisPaintLayer::channelLockFlags | ( | ) | const |
Return a bit array where each bit indicates whether a particular channel is locked or not (used by painting tools). If the channelflags bit array is empty, all channels are active.
Definition at line 242 of file kis_paint_layer.cc.
References m_d.
|
inlineoverridevirtual |
Implements KisNode.
Definition at line 65 of file kis_paint_layer.h.
|
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 148 of file kis_paint_layer.cc.
References KisPainter::bitBlt(), COMPOSITE_BEHIND, KisPainter::copyAreaOptimized(), KisPainter::end(), KisIndirectPaintingSupport::hasTemporaryTarget(), m_d, onionSkinEnabled(), original(), KisLayer::projection(), KisPainter::setCompositeOpId(), KisIndirectPaintingSupport::setupTemporaryPainter(), and KisIndirectPaintingSupport::temporaryTarget.
|
overridevirtual |
Implements KisDecoratedNodeInterface.
Definition at line 415 of file kis_paint_layer.cc.
References m_d.
|
overridevirtual |
Returns the exact bounds of where the actual data of this layer resides
Reimplemented from KisLayer.
Definition at line 255 of file kis_paint_layer.cc.
References KisOnionSkinCompositor::calculateExtent(), KisLayer::exactBounds(), KisPaintDevice::extent(), KisOnionSkinCompositor::instance(), m_d, onionSkinEnabled(), and KisIndirectPaintingSupport::temporaryTarget.
|
overridevirtual |
Returns an approximation of where the bounds of actual data of this layer are
Reimplemented from KisLayer.
Definition at line 247 of file kis_paint_layer.cc.
References KisOnionSkinCompositor::calculateExtent(), KisPaintDevice::extent(), KisLayer::extent(), KisOnionSkinCompositor::instance(), m_d, onionSkinEnabled(), and KisIndirectPaintingSupport::temporaryTarget.
| void KisPaintLayer::flushOnionSkinCache | ( | ) |
Reset the onion skin cache to initial state. Useful for ensuring that old and invalid onion skin projections are no longer used.
Definition at line 318 of file kis_paint_layer.cc.
References m_d.
|
overridevirtual |
Reimplemented from KisNode.
Definition at line 403 of file kis_paint_layer.cc.
References KisNode::getLodCapableDevices(), and m_d.
|
overrideprotectedvirtual |
Reimplemented from KisNode.
Definition at line 385 of file kis_paint_layer.cc.
References KisNode::handleKeyframeChannelFrameAboutToBeRemovedImpl(), KoID::id(), KisKeyframeChannel::id(), m_d, and KisKeyframeChannel::Raster.
|
overridevirtual |
Reimplemented from KisNode.
Definition at line 376 of file kis_paint_layer.cc.
References KisNode::handleKeyframeChannelFrameAdded(), KoID::id(), KisKeyframeChannel::id(), m_d, and KisKeyframeChannel::Raster.
|
overridevirtual |
Reimplemented from KisNode.
Definition at line 367 of file kis_paint_layer.cc.
References KisNode::handleKeyframeChannelFrameChange(), KoID::id(), KisKeyframeChannel::id(), KIS_SAFE_ASSERT_RECOVER_NOOP, and KisKeyframeChannel::Raster.
| KisFrameChangeUpdateRecipe KisPaintLayer::handleRasterKeyframeChannelUpdateImpl | ( | const KisKeyframeChannel * | channel, |
| int | time ) |
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 182 of file kis_paint_layer.cc.
References KisIconUtils::loadIcon().
|
inline |
Definition at line 156 of file kis_paint_layer.h.
|
overridevirtual |
Reimplemented from KisLayer.
Definition at line 143 of file kis_paint_layer.cc.
References KisIndirectPaintingSupport::hasTemporaryTarget(), KisBaseNode::isAnimated(), and onionSkinEnabled().
| bool KisPaintLayer::onionSkinEnabled | ( | ) | const |
Definition at line 285 of file kis_paint_layer.cc.
References KoProperties::boolProperty(), and KisBaseNode::nodeProperties().
|
overridevirtual |
Returns the original pixels before masks have been applied.
Implements KisLayer.
Definition at line 133 of file kis_paint_layer.cc.
References m_d.
|
overridevirtual |
Returns the paintDevice that accompanies this layer
Implements KisBaseNode.
|
inline |
Definition at line 43 of file kis_paint_layer.cc.
|
overrideprotectedvirtual |
Attempt to create the requested channel. Used internally by getKeyframeChannel. Subclasses should implement this method to catch any new channel types they support.
| id | channel to create |
Reimplemented from KisBaseNode.
Definition at line 332 of file kis_paint_layer.cc.
References KisBaseNode::enableAnimation(), m_d, onionSkinEnabled(), KisKeyframeChannel::Raster, and KisBaseNode::requestKeyframeChannel().
|
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 KisLayer.
Definition at line 193 of file kis_paint_layer.cc.
References KisLayerPropertiesIcons::alphaLocked, alphaLocked(), KisImage::colorSpace(), KisLayerPropertiesIcons::getColorSpaceMismatchProperty(), KisLayerPropertiesIcons::getProperty(), KisBaseNode::image, KisBaseNode::isAnimated(), m_d, onionSkinEnabled(), KisLayerPropertiesIcons::onionSkins, and KisLayer::sectionModelProperties().
| void KisPaintLayer::setAlphaLocked | ( | bool | lock | ) |
| l | if true, the alpha channel will be protected from modification |
Definition at line 269 of file kis_paint_layer.cc.
References alphaLocked(), KisNode::baseNodeChangedCallback(), KoColorSpace::channelFlags(), KisLayer::colorSpace(), KisIndirectPaintingSupport::lock, and m_d.
| void KisPaintLayer::setChannelLockFlags | ( | const QBitArray & | channelFlags | ) |
set the channelflags for locking certain channels (used by painting tools) 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.
Definition at line 236 of file kis_paint_layer.cc.
References KisIndirectPaintingSupport::channelFlags, KisLayer::colorSpace(), and m_d.
| void KisDecoratedNodeInterface::setDecorationsVisible | ( | bool | value | ) |
Convenience override for setDecorationsVisible()
Definition at line 38 of file KisDecoratedNodeInterface.cpp.
|
overridevirtual |
Enable or disable writing decorative information into layer stack.
Implements KisDecoratedNodeInterface.
Definition at line 420 of file kis_paint_layer.cc.
References decorationsVisible(), extent(), m_d, onionSkinEnabled(), KisNode::setDirty(), and value().
|
virtual |
Enable or disable writing decorative information into layer stack.
Implements KisDecoratedNodeInterface.
|
overridevirtual |
Set the image this layer belongs to.
Reimplemented from KisLayer.
Definition at line 187 of file kis_paint_layer.cc.
References KisBaseNode::image, m_d, and KisLayer::setImage().
| void KisPaintLayer::setOnionSkinEnabled | ( | bool | state | ) |
| state | whether onion skins should be rendered |
Definition at line 290 of file kis_paint_layer.cc.
References KisOnionSkinCompositor::instance(), m_d, onionSkinEnabled(), KisNode::setDirty(), KisBaseNode::setNodeProperty(), and slotExternalUpdateOnionSkins().
|
overridevirtual |
Change the section model properties.
Reimplemented from KisLayer.
Definition at line 212 of file kis_paint_layer.cc.
References KisBaseNode::Property::name, KisBaseNode::properties, setAlphaLocked(), setOnionSkinEnabled(), KisLayer::setSectionModelProperties(), and KisBaseNode::Property::state.
|
slot |
Definition at line 322 of file kis_paint_layer.cc.
References KisOnionSkinCompositor::calculateFullExtent(), KisOnionSkinCompositor::instance(), m_d, onionSkinEnabled(), and KisNode::setDirty().
|
overrideprotectedvirtual |
Ideally, this function would be used to query for keyframe support before trying to create channels. The ability to query would help in cases such as animation curves where you might want to ask which channels it supports before allowing the user to add.
| id | queried channel |
Reimplemented from KisBaseNode.
Definition at line 394 of file kis_paint_layer.cc.
References KisKeyframeChannel::Raster, and KisBaseNode::supportsKeyframeChannel().
| KisRasterKeyframeChannel* KisPaintLayer::contentChannel |
Definition at line 51 of file kis_paint_layer.cc.
|
private |
Definition at line 172 of file kis_paint_layer.h.
| KisOnionSkinCache KisPaintLayer::onionSkinCache |
Definition at line 54 of file kis_paint_layer.cc.
| KisSignalAutoConnectionsStore KisPaintLayer::onionSkinConnection |
Definition at line 53 of file kis_paint_layer.cc.
| bool KisPaintLayer::onionSkinVisibleOverride = true |
Definition at line 56 of file kis_paint_layer.cc.
| QBitArray KisPaintLayer::paintChannelFlags |
Definition at line 48 of file kis_paint_layer.cc.
| KisPaintDeviceSP KisPaintLayer::paintDevice |
Definition at line 47 of file kis_paint_layer.cc.
| KisPaintLayer* KisPaintLayer::q |
Definition at line 45 of file kis_paint_layer.cc.