|
Krita Source Code Documentation
|
#include <kis_transform_mask.h>
Inheritance diagram for KisTransformMask:Signals | |
| void | sigInternalForceStaticImageUpdate () |
Signals inherited from KisNode | |
| void | sigNodeChangedInternal () |
Signals inherited from KisBaseNode | |
| void | keyframeChannelAdded (KisKeyframeChannel *channel) |
| void | opacityChanged (quint8 value) |
Protected Member Functions | |
| KisKeyframeChannel * | requestKeyframeChannel (const QString &id) override |
| bool | supportsKeyframeChannel (const QString &id) 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 void | flattenSelectionProjection (KisSelectionSP selection, const QRect &dirtyRect) const |
| virtual void | mergeInMaskInternal (KisPaintDeviceSP projection, KisSelectionSP effectiveSelection, const QRect &applyRect, const QRect &preparedNeedRect, PositionToFilthy maskPos, KisRenderPassFlags flags) const |
| virtual bool | paintsOutsideSelection () const |
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 Slots | |
| void | slotDelayedStaticUpdate () |
| void | slotInternalForceStaticImageUpdate () |
Private Member Functions | |
| void | forceStartAsyncRegenerationJob () |
| void | startAsyncRegenerationJob () |
Private Attributes | |
| const QScopedPointer< Private > | 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> |
Protected Types inherited from KisIndirectPaintingSupport | |
| using | WriteLockerSP = QSharedPointer<WriteLocker> |
Transform a layer according to a matrix transform
Definition at line 156 of file kis_transform_mask.cpp.
| KisTransformMask::KisTransformMask | ( | KisImageWSP | image, |
| const QString & | name ) |
Create an empty transform mask.
Definition at line 195 of file kis_transform_mask.cpp.
References connect(), m_d, KisBaseNode::setSupportsLodMoves(), sigInternalForceStaticImageUpdate(), slotDelayedStaticUpdate(), slotInternalForceStaticImageUpdate(), and KisImageConfig::transformMaskOffBoundsReadArea().
|
override |
Definition at line 205 of file kis_transform_mask.cpp.
| KisTransformMask::KisTransformMask | ( | const KisTransformMask & | rhs | ) |
The channels has already been cloned inside the params object, just relink them to the node
Definition at line 209 of file kis_transform_mask.cpp.
References KisNode::addKeyframeChannel(), connect(), KoID::id(), m_d, KisKeyframeChannel::PositionX, KisKeyframeChannel::PositionY, KisKeyframeChannel::RotationX, KisKeyframeChannel::RotationY, KisKeyframeChannel::RotationZ, KisKeyframeChannel::ScaleX, KisKeyframeChannel::ScaleY, KisKeyframeChannel::ShearX, KisKeyframeChannel::ShearY, and slotDelayedStaticUpdate().
|
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 540 of file kis_transform_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 545 of file kis_transform_mask.cpp.
References KisProcessingVisitor::visit().
| KisPaintDeviceSP KisTransformMask::buildPreviewDevice | ( | ) |
Note: this function must be called from within the scheduler's context. We are accessing parent's updateProjection(), which is not entirely safe. The calling job must ensure it is the only job running.
Definition at line 317 of file kis_transform_mask.cpp.
References KisLayer::buildProjectionUpToNode(), KisPaintDevice::colorSpace(), KisMask::colorSpace(), KisPaintDevice::defaultBounds(), KisPaintDevice::exactBounds(), KIS_ASSERT_RECOVER, KisLayer::original(), KisNode::parent, and KisPaintDevice::setDefaultBounds().
| KisPaintDeviceSP KisTransformMask::buildSourcePreviewDevice | ( | ) |
Note: this function must be called from within the scheduler's context. We are accessing parent's updateProjection(), which is not entirely safe. The calling job must ensure it is the only job running.
Definition at line 339 of file kis_transform_mask.cpp.
References KisLayer::buildProjectionUpToNode(), KisPaintDevice::colorSpace(), KisMask::colorSpace(), KisLayer::copyOriginalToProjection(), KisPaintDevice::defaultBounds(), KisPaintDevice::exactBounds(), KIS_ASSERT_RECOVER, KisLayer::original(), KisLayer::outgoingChangeRect(), KisNode::parent, KisNode::prevSibling(), and KisPaintDevice::setDefaultBounds().
|
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
Reimplemented from KisMask.
Definition at line 564 of file kis_transform_mask.cpp.
References KisAlgebra2D::blowRect(), KisDefaultBoundsBase::bounds(), bounds, changeRect(), KisPaintDevice::defaultBounds(), m_d, KisSafeTransform::mapRectForward(), KisBaseNode::original(), KisNode::parent, ppVar, and warnKrita.
|
inlineoverridevirtual |
Implements KisNode.
Definition at line 36 of file kis_transform_mask.h.
|
overridevirtual |
We shouldn't reset or use the static image when rendering the animation frames.
TODO: implement proper high-quality rendering for animation frames
clone layers may fetch data outside image bounds, that should never cause async refresh, since it will cause an infinite loop
Reimplemented from KisMask.
Definition at line 433 of file kis_transform_mask.cpp.
References KisNode::busyProgressIndicator, KisPaintDevice::clear(), KisPainter::copyAreaOptimized(), KisPaintDevice::exactBounds(), KisPaintDevice::extent(), KIS_ASSERT_RECOVER_NOOP, KIS_DUMP_DEVICE_2, KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, KisNode::N_ABOVE_FILTHY, KisNode::N_BELOW_FILTHY, KisNode::N_FILTHY, KisBaseNode::name(), NoTransformMaskUpdates, ppVar, and KisBusyProgressIndicator::update().
|
overridevirtual |
Returns the exact bounds of where the actual data resides in this node.
Reimplemented from KisMask.
Definition at line 669 of file kis_transform_mask.cpp.
References KisKeyframeChannel::allKeyframeTimes(), bounds, changeRect(), KisPaintDevice::defaultBounds(), KisPaintDevice::exactBounds(), KisBaseNode::image, KisBaseNode::isAnimated(), KisKeyframeChannel::keyframeAt(), KisPaintDevice::keyframeChannel(), KisLayer::original(), KisNode::parent, KisLayer::projection(), and sourceDataBounds().
|
overridevirtual |
The extent and bounds of the mask are those of the selection inside
Reimplemented from KisMask.
Definition at line 654 of file kis_transform_mask.cpp.
References changeRect(), KisPaintDevice::extent(), KisMask::extent(), KisNode::parent, KisLayer::partialChangeRect(), and KisLayer::projection().
|
private |
Definition at line 279 of file kis_transform_mask.cpp.
References m_d, and startAsyncRegenerationJob().
|
overridevirtual |
forceUpdateTimedNode forces the node to regenerate its project. The update might be asynchronous, so you should call image->waitForDone() after that.
When flattening the layer with animated transform mask we should actually rerender the static image
Implements KisDelayedUpdateNodeInterface.
Definition at line 745 of file kis_transform_mask.cpp.
References forceStartAsyncRegenerationJob(), hasPendingTimedUpdates(), and m_d.
|
overridevirtual |
Reimplemented from KisNode.
Definition at line 795 of file kis_transform_mask.cpp.
References KisNode::getLodCapableDevices(), and m_d.
|
overridevirtual |
Implements KisDelayedUpdateNodeInterface.
Definition at line 762 of file kis_transform_mask.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisEffectMask.
Definition at line 243 of file kis_transform_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
When sampling affine transformations we use KisRandomSubAccessor, which uses bilinear interpolation for calculating pixels. Therefore, we need to extend the sides of the need rect by one pixel.
Reimplemented from KisMask.
Definition at line 605 of file kis_transform_mask.cpp.
References KisAlgebra2D::blowRect(), KisDefaultBoundsBase::bounds(), bounds, KisPaintDevice::defaultBounds(), kisGrowRect(), m_d, KisSafeTransform::mapRectBackward(), needRect(), KisBaseNode::original(), KisNode::parent, ppVar, and warnKrita.
| void KisTransformMask::overrideStaticCacheDevice | ( | KisPaintDeviceSP | device | ) |
Transform Tool may override mask's device for the sake of in-stack preview
Definition at line 368 of file kis_transform_mask.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisMask.
Definition at line 238 of file kis_transform_mask.cpp.
|
inline |
Definition at line 168 of file kis_transform_mask.cpp.
|
inline |
Definition at line 158 of file kis_transform_mask.cpp.
| void KisTransformMask::recalculateStaticImage | ( | ) |
Note: this function must be called from within the scheduler's context. We are accessing parent's updateProjection(), which is not entirely safe.
updateProjection() is assuming that the requestedRect takes into account all the change rects of all the masks. Usually, this work is done by the walkers.
NOTE: we should use layer's exact bounds, not its original paint device's exact bounds; it is necessary because the layer may have onion skins, which are a part of layer's bounds.
Here we use updateProjection() to regenerate the projection of the layer and after that a special update call (no-filthy) will be issued to pass the changed further through the stack.
Definition at line 379 of file kis_transform_mask.cpp.
References KisAlgebra2D::blowRect(), KisDefaultBoundsBase::bounds(), bounds, KisLayer::changeRect(), KisPaintDevice::clear(), KisPaintDevice::colorSpace(), KisPaintDevice::defaultBounds(), KisLayer::exactBounds(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, NoTransformMaskUpdates, KisLayer::original(), KisBaseNode::paintDevice(), KisNode::parent, KisLayer::projection(), and KisLayer::updateProjection().
|
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 KisMask.
Definition at line 815 of file kis_transform_mask.cpp.
References KIS_SAFE_ASSERT_RECOVER_NOOP, m_d, KisKeyframeChannel::PositionX, KisKeyframeChannel::PositionY, KisBaseNode::requestKeyframeChannel(), KisKeyframeChannel::RotationX, KisKeyframeChannel::RotationY, KisKeyframeChannel::RotationZ, KisKeyframeChannel::ScaleX, KisKeyframeChannel::ScaleY, KisKeyframeChannel::ShearX, and KisKeyframeChannel::ShearY.
|
overridevirtual |
Reimplemented from KisMask.
Definition at line 708 of file kis_transform_mask.cpp.
References KisBaseNode::image, m_d, and KisBaseNode::setImage().
| void KisTransformMask::setTestingInterface | ( | KisTransformMaskTestingInterface * | interface | ) |
Definition at line 805 of file kis_transform_mask.cpp.
References m_d.
| void KisTransformMask::setTransformParams | ( | KisTransformMaskParamsInterfaceSP | params | ) |
Definition at line 255 of file kis_transform_mask.cpp.
References m_d, KUndo2Command::redo(), and setTransformParamsWithUndo().
| void KisTransformMask::setTransformParamsWithUndo | ( | KisTransformMaskParamsInterfaceSP | params, |
| KUndo2Command * | parentCommand ) |
Definition at line 248 of file kis_transform_mask.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN, and m_d.
|
overridevirtual |
overridden from KisBaseNode
Reimplemented from KisMask.
Definition at line 725 of file kis_transform_mask.cpp.
References m_d, setTransformParams(), and x().
|
overridevirtual |
overridden from KisBaseNode
Reimplemented from KisMask.
Definition at line 735 of file kis_transform_mask.cpp.
References m_d, setTransformParams(), and y().
|
signal |
|
privateslot |
Definition at line 270 of file kis_transform_mask.cpp.
References m_d, and startAsyncRegenerationJob().
|
privateslot |
Definition at line 783 of file kis_transform_mask.cpp.
References forceStartAsyncRegenerationJob().
| QRect KisTransformMask::sourceDataBounds | ( | ) | const |
NOTE: we should avoid including parent layer's projection's extent into the source of changeRect calculation, because that is exactly what partialChangeRect() calculates.
Definition at line 692 of file kis_transform_mask.cpp.
References KisPaintDevice::exactBounds(), KisLayer::original(), KisNode::parent, and KisLayer::partialChangeRect().
|
private |
The mask might have been deleted from the layers stack in the meanwhile. Just ignore the updates in the case.
Don't try to start a regeneration stroke while image is locked. It may happen on loading, when all necessary conversions are not yet finished.
Definition at line 286 of file kis_transform_mask.cpp.
References KisImage::addSpontaneousJob(), KisBaseNode::image, KisImage::locked(), m_d, and KisNode::parent.
| bool KisTransformMask::staticImageCacheIsValid | ( | ) | const |
Definition at line 374 of file kis_transform_mask.cpp.
References m_d.
|
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 KisMask.
Definition at line 835 of file kis_transform_mask.cpp.
References KisKeyframeChannel::Opacity, KisKeyframeChannel::PositionX, KisKeyframeChannel::PositionY, KisKeyframeChannel::RotationX, KisKeyframeChannel::RotationY, KisKeyframeChannel::RotationZ, KisKeyframeChannel::ScaleX, KisKeyframeChannel::ScaleY, KisKeyframeChannel::ShearX, KisKeyframeChannel::ShearY, and KisBaseNode::supportsKeyframeChannel().
|
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 788 of file kis_transform_mask.cpp.
References m_d, and KisNode::syncLodCache().
| KisTransformMaskTestingInterface * KisTransformMask::testingInterface | ( | ) | const |
| void KisTransformMask::threadSafeForceStaticImageUpdate | ( | ) |
Definition at line 767 of file kis_transform_mask.cpp.
References threadSafeForceStaticImageUpdate().
| void KisTransformMask::threadSafeForceStaticImageUpdate | ( | const QRect & | extraUpdateRect | ) |
Definition at line 772 of file kis_transform_mask.cpp.
References m_d, and sigInternalForceStaticImageUpdate().
| KisTransformMaskParamsInterfaceSP KisTransformMask::transformParams | ( | ) | const |
Definition at line 265 of file kis_transform_mask.cpp.
References m_d.
|
overridevirtual |
overridden from KisBaseNode
Reimplemented from KisMask.
Definition at line 715 of file kis_transform_mask.cpp.
References m_d.
|
overridevirtual |
overridden from KisBaseNode
Reimplemented from KisMask.
Definition at line 720 of file kis_transform_mask.cpp.
References m_d.
| AccumulatedRectStorage KisTransformMask::forcedStaticUpdateExtraUpdateRect |
Definition at line 184 of file kis_transform_mask.cpp.
|
private |
Definition at line 113 of file kis_transform_mask.h.
| qreal KisTransformMask::offBoundsReadArea |
Definition at line 189 of file kis_transform_mask.cpp.
| KisLodCapableLayerOffset KisTransformMask::offset |
Definition at line 186 of file kis_transform_mask.cpp.
| KisAnimatedTransformParamsHolderInterfaceSP KisTransformMask::paramsHolder |
Definition at line 179 of file kis_transform_mask.cpp.
| bool KisTransformMask::recalculatingStaticImage |
Definition at line 182 of file kis_transform_mask.cpp.
| StaticCacheStorage KisTransformMask::staticCache |
Definition at line 181 of file kis_transform_mask.cpp.
| KisTransformMaskTestingInterface * KisTransformMask::testingInterface |
Definition at line 191 of file kis_transform_mask.cpp.
| KisThreadSafeSignalCompressor KisTransformMask::updateSignalCompressor |
Definition at line 188 of file kis_transform_mask.cpp.
| KisPerspectiveTransformWorker KisTransformMask::worker |
Definition at line 178 of file kis_transform_mask.cpp.