|
Krita Source Code Documentation
|
#include <kis_generator_layer.h>
Inheritance diagram for KisGeneratorLayer:Private Slots | |
| void | slotDelayedStaticUpdate () |
Private Member Functions | |
| void | requestUpdateJobsWithStroke (const KisStrokeId stroke, const KisFilterConfigurationSP configuration) |
| void | resetCacheWithoutUpdate (const KoColorSpace *colorSpace) |
Private Attributes | |
| const QScopedPointer< Private > | m_d |
A generator layer is a special kind of layer that can be prefilled with some pixel pattern generated by a KisGenerator plugin. A KisGenerator is similar to a filter, but doesn't take input pixel data and creates new pixel data.
It is not possible to destructively paint on a generator layer.
XXX: what about threadedness?
Definition at line 32 of file kis_generator_layer.cpp.
| KisGeneratorLayer::KisGeneratorLayer | ( | KisImageWSP | image, |
| const QString & | name, | ||
| KisFilterConfigurationSP | kfc, | ||
| KisSelectionSP | selection ) |
Create a new Generator layer with the given configuration and selection. Note that the selection will be copied (using COW, though).
Definition at line 48 of file kis_generator_layer.cpp.
References connect(), m_d, and slotDelayedStaticUpdate().
| KisGeneratorLayer::KisGeneratorLayer | ( | const KisGeneratorLayer & | rhs | ) |
Definition at line 58 of file kis_generator_layer.cpp.
References connect(), m_d, and slotDelayedStaticUpdate().
|
override |
Definition at line 65 of file kis_generator_layer.cpp.
|
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 182 of file kis_generator_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 187 of file kis_generator_layer.cpp.
References KisProcessingVisitor::visit().
|
inlineoverridevirtual |
Implements KisNode.
Definition at line 45 of file kis_generator_layer.h.
|
overridevirtual |
forceUpdateTimedNode forces the node to regenerate its project. The update might be asynchronous, so you should call image->waitForDone() after that.
Implements KisDelayedUpdateNodeInterface.
Definition at line 234 of file kis_generator_layer.cpp.
References hasPendingTimedUpdates(), m_d, and slotDelayedStaticUpdate().
|
overridevirtual |
Implements KisDelayedUpdateNodeInterface.
Definition at line 244 of file kis_generator_layer.cpp.
References m_d.
|
overridevirtual |
Reimplemented from KisBaseNode.
Definition at line 192 of file kis_generator_layer.cpp.
References KisIconUtils::loadIcon().
|
inline |
Definition at line 101 of file kis_generator_layer.h.
| QWeakPointer< boost::none_t > KisGeneratorLayer::previewWithStroke | ( | const KisStrokeId | stroke | ) |
re-runs the generator with the specified configuration. Used for previewing the layer inside the stroke.
Definition at line 157 of file kis_generator_layer.cpp.
References KisNodeFilterInterface::filter(), KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, m_d, and requestUpdateJobsWithStroke().
|
inline |
Definition at line 34 of file kis_generator_layer.cpp.
|
private |
Injects render jobs into the given stroke.
Definition at line 117 of file kis_generator_layer.cpp.
References KisImage::addJob(), KisImage::bounds(), KisImage::colorSpace(), KisGeneratorStrokeStrategy::createJobsData(), KisSelectionBasedLayer::extent(), KisBaseNode::image, KisGeneratorRegistry::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, KisSelectionBasedLayer::original(), resetCacheWithoutUpdate(), KisWeakSharedPtr< T >::toStrongRef(), and KoGenericRegistry< T >::value().
|
overridevirtual |
resets cached projection of lower layer to a new device
Reimplemented from KisSelectionBasedLayer.
Definition at line 228 of file kis_generator_layer.cpp.
References KisLayer::colorSpace(), m_d, and resetCacheWithoutUpdate().
|
private |
Resets the projection cache without triggering the update job.
Definition at line 249 of file kis_generator_layer.cpp.
References KisLayer::colorSpace(), m_d, and KisSelectionBasedLayer::resetCache().
|
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 197 of file kis_generator_layer.cpp.
References KisNodeFilterInterface::filter(), KisGeneratorRegistry::instance(), KisLayer::sectionModelProperties(), and value().
|
overridevirtual |
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 258 of file kis_generator_layer.cpp.
References m_d, and setDirtyWithoutUpdate().
Updates the selected tiles without triggering the update job.
Definition at line 264 of file kis_generator_layer.cpp.
References KisSelectionBasedLayer::setDirty().
|
overridevirtual |
Sets the filter configuration for this node. The filter might differ from the filter that is currently set up on this node.
WARNING: the filterConfig becomes owned by the node right after you've set it. Don't try to access the configuration after you've associated it with the node.
| filterConfig | the new configuration object |
| checkCompareConfig | if true, the update code will check whether the config is the same as the old config, and if so, do nothing. If false, the filter node will be updated always. |
Reimplemented from KisNodeFilterInterface.
Definition at line 69 of file kis_generator_layer.cpp.
References m_d, and setFilterWithoutUpdate().
| void KisGeneratorLayer::setFilterWithoutUpdate | ( | KisFilterConfigurationSP | filterConfig, |
| bool | checkCompareConfig = true ) |
Changes the filter configuration without triggering an update.
Definition at line 75 of file kis_generator_layer.cpp.
References KisSharedPtr< T >::constData(), KisNodeFilterInterface::filter(), m_d, and KisNodeFilterInterface::setFilter().
|
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 208 of file kis_generator_layer.cpp.
References m_d, KisSelectionBasedLayer::setX(), and KisSelectionBasedLayer::x().
|
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 218 of file kis_generator_layer.cpp.
References m_d, KisSelectionBasedLayer::setY(), and KisSelectionBasedLayer::y().
|
privateslot |
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.
The mask might have been deleted from the layers stack in the meanwhile. Just ignore the updates in the case.
Definition at line 86 of file kis_generator_layer.cpp.
References KisBaseNode::image, KisImage::locked(), m_d, KisNode::parent, KisLayer::parentLayer(), and update().
| void KisGeneratorLayer::update | ( | ) |
re-run the generator. This happens over the bounds of the associated selection.
Definition at line 166 of file kis_generator_layer.cpp.
References KisImage::endStroke(), KisNodeFilterInterface::filter(), KisBaseNode::image, KIS_SAFE_ASSERT_RECOVER_RETURN, requestUpdateJobsWithStroke(), KisImage::startStroke(), and KisWeakSharedPtr< T >::toStrongRef().
|
private |
Definition at line 107 of file kis_generator_layer.h.
| QMutex KisGeneratorLayer::mutex |
Definition at line 44 of file kis_generator_layer.cpp.
| KisFilterConfigurationSP KisGeneratorLayer::preparedForFilter |
Definition at line 42 of file kis_generator_layer.cpp.
| QRect KisGeneratorLayer::preparedImageBounds |
Definition at line 41 of file kis_generator_layer.cpp.
| QRect KisGeneratorLayer::preparedRect |
Definition at line 40 of file kis_generator_layer.cpp.
| QWeakPointer<boost::none_t> KisGeneratorLayer::updateCookie |
Definition at line 43 of file kis_generator_layer.cpp.
| KisThreadSafeSignalCompressor KisGeneratorLayer::updateSignalCompressor |
Definition at line 39 of file kis_generator_layer.cpp.