|
Krita Source Code Documentation
|
#include <kis_selection_mask.h>
Inheritance diagram for KisSelectionMask:Protected Member Functions | |
| void | flattenSelectionProjection (KisSelectionSP selection, const QRect &dirtyRect) const override |
| void | mergeInMaskInternal (KisPaintDeviceSP projection, KisSelectionSP effectiveSelection, const QRect &applyRect, const QRect &preparedNeedRect, KisNode::PositionToFilthy maskPos, KisRenderPassFlags flags) const override |
| bool | paintsOutsideSelection () const override |
Protected Member Functions inherited from KisMask | |
| void | apply (KisPaintDeviceSP projection, const QRect &applyRect, const QRect &needRect, PositionToFilthy maskPos, KisRenderPassFlags flags) const |
| void | baseNodeChangedCallback () override |
| virtual QRect | decorateRect (KisPaintDeviceSP &src, KisPaintDeviceSP &dst, const QRect &rc, PositionToFilthy maskPos, KisRenderPassFlags flags) const |
| KisKeyframeChannel * | requestKeyframeChannel (const QString &id) override |
| bool | supportsKeyframeChannel (const QString &id) override |
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 void | childNodeChanged (KisNodeSP changedChildNode) |
| 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) |
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> |
An selection mask is a single channel mask that applies a particular selection to the layer the mask belongs to. A selection can contain both vector and pixel selection components.
Definition at line 32 of file kis_selection_mask.cpp.
| KisSelectionMask::KisSelectionMask | ( | KisImageWSP | image, |
| const QString & | name = QString() ) |
Create an empty selection mask. There is filter and no layer associated with this mask.
Definition at line 51 of file kis_selection_mask.cpp.
References KisSignalCompressor::FIRST_ACTIVE, KisImageConfigNotifier::instance(), m_d, setActive(), KisBaseNode::setSupportsLodMoves(), slotConfigChanged(), and slotSelectionChangedCompressed().
|
override |
Definition at line 80 of file kis_selection_mask.cpp.
References m_d.
| KisSelectionMask::KisSelectionMask | ( | const KisSelectionMask & | rhs | ) |
Definition at line 67 of file kis_selection_mask.cpp.
References KisImageConfigNotifier::instance(), m_d, KisSignalCompressor::POSTPONE, slotConfigChanged(), and slotSelectionChangedCompressed().
|
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 156 of file kis_selection_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 KisNode.
Definition at line 161 of file kis_selection_mask.cpp.
References KisProcessingVisitor::visit().
| bool KisSelectionMask::active | ( | ) | const |
Definition at line 190 of file kis_selection_mask.cpp.
References KoProperties::boolProperty(), and KisBaseNode::nodeProperties().
|
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.
Reimplemented from KisMask.
Definition at line 233 of file kis_selection_mask.cpp.
|
inlineoverridevirtual |
Implements KisNode.
Definition at line 38 of file kis_selection_mask.h.
|
overridevirtual |
Implements KisDecoratedNodeInterface.
Definition at line 275 of file kis_selection_mask.cpp.
References KisSelection::isVisible, and KisMask::selection.
|
overridevirtual |
Returns the exact bounds of where the actual data resides in this node.
Reimplemented from KisMask.
Definition at line 265 of file kis_selection_mask.cpp.
References extent().
|
overridevirtual |
The extent and bounds of the mask are those of the selection inside
Reimplemented from KisMask.
Definition at line 241 of file kis_selection_mask.cpp.
References KisDefaultBoundsBase::bounds(), KisPaintDevice::defaultBounds(), KisBaseNode::extent(), KisNode::parent, KisSelection::pixelSelection, KisBaseNode::projection(), and KisMask::selection.
|
overrideprotectedvirtual |
A special callback for calling selection->updateProjection() during the projection calculation process. Some masks (e.g. selection masks) don't need it, because they do it separately.
Reimplemented from KisMask.
Definition at line 302 of file kis_selection_mask.cpp.
References KisMask::selection.
|
overridevirtual |
Reimplemented from KisEffectMask.
Definition at line 86 of file kis_selection_mask.cpp.
References KisIconUtils::loadIcon().
|
overrideprotectedvirtual |
Reimplemented from KisMask.
Definition at line 90 of file kis_selection_mask.cpp.
References KisPainter::bitBlt(), KisPaintDevice::defaultBounds(), KisCachedPaintDevice::Guard::device(), KisDefaultBoundsBase::externalFrameActive(), KisPixelSelection::invert(), KisSelection::isVisible, m_d, KisPaintDevice::makeCloneFromRough(), KisSelection::pixelSelection, KisMask::projection(), s1, KisSelection::selectedRect(), KisMask::selection, KisPaintDevice::setDefaultPixel(), and KisPainter::setSelection().
|
overridevirtual |
Some filters need pixels outside the current processing rect to compute the new value (for instance, convolution filters) See changeRect See accessRect
Reimplemented from KisMask.
Definition at line 225 of file kis_selection_mask.cpp.
| void KisSelectionMask::notifySelectionChangedCompressed | ( | ) |
This method works like the one in KisSelection, but it compressed the incoming events instead of processing each of them separately.
Definition at line 270 of file kis_selection_mask.cpp.
References m_d.
|
overrideprotectedvirtual |
Reimplemented from KisMask.
Definition at line 136 of file kis_selection_mask.cpp.
|
inline |
Definition at line 35 of file kis_selection_mask.cpp.
|
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 166 of file kis_selection_mask.cpp.
References active(), KisLayerPropertiesIcons::getProperty(), KisBaseNode::sectionModelProperties(), and KisLayerPropertiesIcons::selectionActive.
| void KisSelectionMask::setActive | ( | bool | active | ) |
WARNING: we have a direct link to the image here, but we must not use it for notification until we are a part of the node graph! Notifications should be emitted iff we have graph listener link set up.
Definition at line 195 of file kis_selection_mask.cpp.
References active(), KisMask::baseNodeChangedCallback(), KisUndoAdapter::emitSelectionChanged(), KisNode::graphListener, KisBaseNode::image, KisNode::parent, KisLayer::selectionMask(), setActive(), KisBaseNode::setNodeProperty(), and KisImage::undoAdapter().
| 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 280 of file kis_selection_mask.cpp.
References decorationsVisible(), extent(), KisMask::selection, KisNode::setDirty(), KisSelection::setVisible(), and value().
|
virtual |
Enable or disable writing decorative information into layer stack.
Implements KisDecoratedNodeInterface.
Add the given rects to the set of dirty rects for this node; this percolates up to parent nodes all the way to the root node.
Reimplemented from KisNode.
Definition at line 293 of file kis_selection_mask.cpp.
References KisBaseNode::image, KisImage::overlaySelectionMask(), and KisNode::setDirty().
|
overridevirtual |
Change the section model properties.
Reimplemented from KisBaseNode.
Definition at line 173 of file kis_selection_mask.cpp.
References KisBaseNode::properties, setActive(), and KisBaseNode::setSectionModelProperties().
| void KisSelectionMask::setSelection | ( | KisSelectionSP | selection | ) |
Set the selection of this adjustment layer to a copy of selection.
Definition at line 141 of file kis_selection_mask.cpp.
References KoColorSpaceRegistry::alpha8(), bounds, KisPainter::end(), KisFillPainter::fillRect(), KisBaseNode::image, KoColorSpaceRegistry::instance(), MAX_SELECTED, KisMask::selection, KisNode::setDirty(), and KisMask::setSelection().
|
overridevirtual |
Set the visible status of this node. Visible nodes are active in the graph (except for selections masks which can be active while hidden), that is to say, they are taken into account when merging. Invisible nodes play no role in the final image , but will be modified when modifying all layers, for instance when cropping.
Toggling the visibility of a node will not automatically lead to recomposition.
| visible | the new visibility state |
| isLoading | if true, the property is set during loading. |
Reimplemented from KisBaseNode.
Definition at line 179 of file kis_selection_mask.cpp.
References KisMask::selection, KisBaseNode::setNodeProperty(), KisSelection::setVisible(), and KisBaseNode::visible().
| void KisSelectionMask::slotConfigChanged | ( | ) |
| void KisSelectionMask::slotConfigChangedImpl | ( | bool | blockUpdates | ) |
| void KisSelectionMask::slotSelectionChangedCompressed | ( | ) |
| KisCachedSelection KisSelectionMask::cachedSelection |
Definition at line 42 of file kis_selection_mask.cpp.
|
private |
Definition at line 91 of file kis_selection_mask.h.
| KoColor KisSelectionMask::maskColor |
Definition at line 44 of file kis_selection_mask.cpp.
| KisCachedPaintDevice KisSelectionMask::paintDeviceCache |
Definition at line 41 of file kis_selection_mask.cpp.
| KisSelectionMask* KisSelectionMask::q |
Definition at line 40 of file kis_selection_mask.cpp.
| KisThreadSafeSignalCompressor* KisSelectionMask::updatesCompressor |
Definition at line 43 of file kis_selection_mask.cpp.