|
Krita Source Code Documentation
|
#include <Node.h>
Inheritance diagram for Node:Classes | |
| struct | Private |
Public Slots | |
| bool | addChildNode (Node *child, Node *above) |
| addChildNode adds the given node in the list of children. | |
| bool | alphaLocked () const |
| alphaLocked checks whether the node is a paint layer and returns whether it is alpha locked | |
| bool | animated () const |
| Krita layers can be animated, i.e., have frames. | |
| QString | blendingMode () const |
| QRect | bounds () const |
| bounds return the exact bounds of the node's paint device | |
| QList< Channel * > | channels () const |
| channels creates a list of Channel objects that can be used individually to show or hide certain channels, and to retrieve the contents of each channel in a node separately. | |
| QList< Node * > | childNodes () const |
| childNodes | |
| Node * | clone () const |
| clone clone the current node. The node is not associated with any image. | |
| bool | collapsed () const |
| QString | colorDepth () const |
| int | colorLabel () const |
| QString | colorModel () const |
| colorModel retrieve the current color model of this document: | |
| QString | colorProfile () const |
| void | cropNode (int x, int y, int w, int h) |
| cropNode crop this layer. | |
| Node * | duplicate () |
| duplicate returns a full copy of the current node. The node is not inserted in the graphic | |
| void | enableAnimation () const |
| enableAnimation make the current layer animated, so it can have frames. | |
| QList< Node * > | findChildNodes (const QString &name=QString(), bool recursive=false, bool partialMatch=false, const QString &type=QString(), int colorLabelIndex=0) const |
| findChildNodes | |
| bool | hasExtents () |
| does the node have any content in it? | |
| bool | hasKeyframeAtTime (int frameNumber) |
| QIcon | icon () const |
| icon | |
| int | index () const |
| index the index of the node inside the parent | |
| bool | inheritAlpha () const |
| inheritAlpha checks whether this node has the inherits alpha flag set | |
| bool | isPinnedToTimeline () const |
| QString | layerStyleToAsl () |
| layerStyleToAsl retrieve the current layer's style in ASL format. | |
| bool | locked () const |
| locked checks whether the Node is locked. A locked node cannot be changed. | |
| Node * | mergeDown () |
| mergeDown merges the given node with the first visible node underneath this node in the layerstack. This will drop all per-layer metadata. | |
| void | move (int x, int y) |
| QString | name () const |
| int | opacity () const |
| QString | paintAbility () |
| paintAbility can be used to determine whether this node can be painted on with the current brush preset. | |
| void | paintEllipse (const QRectF &rect, const QString strokeStyle=PaintingResources::defaultStrokeStyle, const QString fillStyle=PaintingResources::defaultFillStyle) |
| paint an ellipse on the canvas. Uses current brush preset | |
| void | paintLine (const QPointF pointOne, const QPointF pointTwo, double pressureOne=1.0, double pressureTwo=1.0, const QString strokeStyle=PaintingResources::defaultStrokeStyle) |
| paint a line on the canvas. Uses current brush preset | |
| void | paintPath (const QPainterPath &path, const QString strokeStyle=PaintingResources::defaultStrokeStyle, const QString fillStyle=PaintingResources::defaultFillStyle) |
| paint a custom path on the canvas. Uses current brush preset | |
| void | paintPolygon (const QList< QPointF > points, const QString strokeStyle=PaintingResources::defaultStrokeStyle, const QString fillStyle=PaintingResources::defaultFillStyle) |
| paint a polygon on the canvas. Uses current brush preset | |
| void | paintRectangle (const QRectF &rect, const QString strokeStyle=PaintingResources::defaultStrokeStyle, const QString fillStyle=PaintingResources::defaultFillStyle) |
| paint a rectangle on the canvas. Uses current brush preset | |
| Node * | parentNode () const |
| QByteArray | pixelData (int x, int y, int w, int h) const |
| pixelData reads the given rectangle from the Node's paintable pixels, if those exist, and returns it as a byte array. The pixel data starts top-left, and is ordered row-first. | |
| QByteArray | pixelDataAtTime (int x, int y, int w, int h, int time) const |
| pixelDataAtTime a basic function to get pixeldata from an animated node at a given time. | |
| QPoint | position () const |
| position returns the position of the paint device of this node. The position is always 0,0 unless the layer has been moved. If you want to know the topleft position of the rectangle around the actual non-transparent pixels in the node, use bounds(). | |
| QByteArray | projectionPixelData (int x, int y, int w, int h) const |
| projectionPixelData reads the given rectangle from the Node's projection (that is, what the node looks like after all sub-Nodes (like layers in a group or masks on a layer) have been applied, and returns it as a byte array. The pixel data starts top-left, and is ordered row-first. | |
| bool | remove () |
| remove removes this node from its parent image. | |
| bool | removeChildNode (Node *child) |
| removeChildNode removes the given node from the list of children. | |
| void | rotateNode (double radians) |
| rotateNode rotate this layer by the given radians. | |
| bool | save (const QString &filename, double xRes, double yRes, const InfoObject &exportConfiguration, const QRect &exportRect=QRect()) |
| save exports the given node with this filename. The extension of the filename determines the filetype. | |
| void | scaleNode (QPointF origin, int width, int height, QString strategy) |
| scaleNode | |
| void | setAlphaLocked (bool value) |
| setAlphaLocked set the layer to value if the node is paint layer. | |
| void | setBlendingMode (QString value) |
| setBlendingMode set the blending mode of the node to the given value | |
| void | setChildNodes (QList< Node * > nodes) |
| setChildNodes this replaces the existing set of child nodes with the new set. | |
| void | setCollapsed (bool collapsed) |
| void | setColorLabel (int index) |
| setColorLabel sets a color label index associated to the layer. The actual color of the label and the number of available colors is defined by Krita GUI configuration. | |
| bool | setColorProfile (const QString &colorProfile) |
| setColorProfile set the color profile of the image to the given profile. The profile has to be registered with krita and be compatible with the current color model and depth; the image data is not converted. | |
| bool | setColorSpace (const QString &colorModel, const QString &colorDepth, const QString &colorProfile) |
| setColorSpace convert the node to the given colorspace | |
| void | setInheritAlpha (bool value) |
| bool | setLayerStyleFromAsl (const QString &asl) |
| setLayerStyleFromAsl set a new layer style for this node. | |
| void | setLocked (bool value) |
| void | setName (QString name) |
| void | setOpacity (int value) |
| void | setPinnedToTimeline (bool pinned) const |
| Sets whether or not node should be pinned to the Timeline Docker, regardless of selection activity. | |
| bool | setPixelData (QByteArray value, int x, int y, int w, int h) |
| setPixelData writes the given bytes, of which there must be enough, into the Node, if the Node has writable pixel data: | |
| void | setVisible (bool visible) |
| void | shearNode (double angleX, double angleY) |
| shearNode perform a shear operation on this node. | |
| QImage | thumbnail (int w, int h) |
| thumbnail create a thumbnail of the given dimensions. The thumbnail is sized according to the layer dimensions, not the image dimensions. If the requested size is too big a null QImage is created. If the current node cannot generate a thumbnail, a transparent QImage of the requested size is generated. | |
| virtual QString | type () const |
| type Krita has several types of nodes, split in layers and masks. Group layers can contain other layers, any layer can contain masks. | |
| QUuid | uniqueId () const |
| uniqueId uniqueId of the node | |
| bool | visible () const |
Public Member Functions | |
| bool | operator!= (const Node &other) const |
| bool | operator== (const Node &other) const |
| ~Node () override | |
Static Public Member Functions | |
| static Node * | createNode (KisImageSP image, KisNodeSP node, QObject *parent=0) |
Private Member Functions | |
| KisImageSP | image () const |
| KisNodeSP | node () const |
| Node (KisImageSP image, KisNodeSP node, QObject *parent=0) | |
| KisPaintDeviceSP | paintDevice () const |
| paintDevice gives access to the internal paint device of this Node | |
Private Attributes | |
| Private *const | d |
Friends | |
| class | CloneLayer |
| class | ColorizeMask |
| class | Document |
| class | FileLayer |
| class | FillLayer |
| class | Filter |
| class | FilterLayer |
| class | FilterMask |
| class | GroupLayer |
| class | Selection |
| class | SelectionMask |
| class | TransformMask |
| class | TransparencyMask |
| class | VectorLayer |
Node represents a layer or mask in a Krita image's Node hierarchy. Group layers can contain other layers and masks; layers can contain masks.
|
override |
|
explicitprivate |
Definition at line 83 of file Node.cpp.
References d, Node::Private::image, image(), Node::Private::node, and node().
addChildNode adds the given node in the list of children.
| child | the node to be added |
| above | the node above which this node will be placed |
Definition at line 265 of file Node.cpp.
References KisNode::childCount(), d, Node::Private::image, Node::Private::node, node(), KisProcessingApplicator::runSingleCommandStroke(), and KisImage::waitForDone().
|
slot |
alphaLocked checks whether the node is a paint layer and returns whether it is alpha locked
Definition at line 158 of file Node.cpp.
References KisPaintLayer::alphaLocked(), d, KisSharedPtr< T >::data(), and Node::Private::node.
|
slot |
Krita layers can be animated, i.e., have frames.
Definition at line 361 of file Node.cpp.
References d, KisBaseNode::isAnimated(), and Node::Private::node.
|
slot |
Definition at line 178 of file Node.cpp.
References KisBaseNode::compositeOpId(), d, and Node::Private::node.
|
slot |
bounds return the exact bounds of the node's paint device
Definition at line 615 of file Node.cpp.
References d, KisBaseNode::exactBounds(), and Node::Private::node.
channels creates a list of Channel objects that can be used individually to show or hide certain channels, and to retrieve the contents of each channel in a node separately.
Only layers have channels, masks do not, and calling channels on a Node that is a mask will return an empty list.
Definition at line 197 of file Node.cpp.
References channels(), KoColorSpace::channels, KisBaseNode::colorSpace(), d, and Node::Private::node.
childNodes
Definition at line 212 of file Node.cpp.
References KisNode::at(), KisNode::childCount(), LibKisUtils::createNodeList(), d, Node::Private::image, and Node::Private::node.
|
slot |
clone clone the current node. The node is not associated with any image.
Definition at line 150 of file Node.cpp.
References clone(), KisNode::clone(), createNode(), d, Node::Private::node, and node().
|
slot |
returns the collapsed state of this node
Definition at line 385 of file Node.cpp.
References KisBaseNode::collapsed, d, and Node::Private::node.
|
slot |
colorDepth A string describing the color depth of the image:
Definition at line 314 of file Node.cpp.
References KoColorSpace::colorDepthId(), KisPaintDevice::colorSpace(), KisBaseNode::colorSpace(), d, KoID::id(), Node::Private::node, and KisBaseNode::projection().
|
slot |
Sets a color label index associated to the layer. The actual color of the label and the number of available colors is defined by Krita GUI configuration.
Definition at line 302 of file Node.cpp.
References KisBaseNode::colorLabelIndex(), d, and Node::Private::node.
|
slot |
colorModel retrieve the current color model of this document:
Definition at line 321 of file Node.cpp.
References KoColorSpace::colorModelId(), KisPaintDevice::colorSpace(), KisBaseNode::colorSpace(), d, KoID::id(), Node::Private::node, and KisBaseNode::projection().
|
slot |
Definition at line 329 of file Node.cpp.
References KisPaintDevice::colorSpace(), KisBaseNode::colorSpace(), d, KoColorProfile::name, Node::Private::node, KoColorSpace::profile(), and KisBaseNode::projection().
|
static |
Definition at line 91 of file Node.cpp.
References CloneLayer, ColorizeMask, KisSharedPtr< T >::data(), FileLayer, FillLayer, FilterLayer, FilterMask, GroupLayer, image(), KisSharedPtr< T >::isNull(), node(), Node(), SelectionMask, TransformMask, TransparencyMask, and VectorLayer.
|
slot |
cropNode crop this layer.
| x | the left edge of the cropping rectangle. |
| y | the top edge of the cropping rectangle |
| w | the right edge of the cropping rectangle |
| h | the bottom edge of the cropping rectangle |
Definition at line 726 of file Node.cpp.
References KisImage::cropNode(), d, KisSharedPtr< T >::data(), Node::Private::image, Node::Private::node, KisNode::parent, and KisImage::waitForDone().
|
slot |
duplicate returns a full copy of the current node. The node is not inserted in the graphic
Definition at line 647 of file Node.cpp.
References KisNode::clone(), createNode(), d, Node::Private::image, and Node::Private::node.
|
slot |
enableAnimation make the current layer animated, so it can have frames.
Definition at line 367 of file Node.cpp.
References d, KisBaseNode::enableAnimation(), and Node::Private::node.
|
slot |
findChildNodes
| name | name of the child node to search for. Leaving this blank will return all nodes. |
| recursive | whether or not to search recursively. Defaults to false. |
| partialMatch | return if the name partially contains the string (case insensitive). Defaults to false. |
| type | filter returned nodes based on type |
| colorLabelIndex | filter returned nodes based on color label index |
Definition at line 226 of file Node.cpp.
References LibKisUtils::createNodeList(), d, KisLayerUtils::findNodesByName(), Node::Private::image, name(), Node::Private::node, and type().
|
slot |
does the node have any content in it?
Definition at line 423 of file Node.cpp.
References d, KisBaseNode::extent(), and Node::Private::node.
|
slot |
Check to see if frame number on layer is a keyframe
Definition at line 523 of file Node.cpp.
References d, KisBaseNode::getKeyframeChannel(), KisBaseNode::isAnimated(), KisKeyframeChannel::keyframeAt(), Node::Private::node, and KisKeyframeChannel::Raster.
|
slot |
icon
Definition at line 508 of file Node.cpp.
References d, KisBaseNode::icon(), icon(), and Node::Private::node.
|
private |
|
slot |
index the index of the node inside the parent
Definition at line 803 of file Node.cpp.
References d, KisNode::index(), Node::Private::node, and KisNode::parent.
|
slot |
inheritAlpha checks whether this node has the inherits alpha flag set
Definition at line 397 of file Node.cpp.
References d, and Node::Private::node.
|
slot |
Definition at line 379 of file Node.cpp.
References d, KisBaseNode::isPinnedToTimeline(), and Node::Private::node.
|
slot |
layerStyleToAsl retrieve the current layer's style in ASL format.
Definition at line 753 of file Node.cpp.
References d, KisSharedPtr< T >::data(), KisAslLayerStyleSerializer::formPsdXmlDocument(), KisLayer::layerStyle, Node::Private::node, and KisAslLayerStyleSerializer::setStyles().
|
slot |
locked checks whether the Node is locked. A locked node cannot be changed.
Definition at line 411 of file Node.cpp.
References d, Node::Private::node, and KisBaseNode::userLocked().
|
slot |
mergeDown merges the given node with the first visible node underneath this node in the layerstack. This will drop all per-layer metadata.
Definition at line 685 of file Node.cpp.
References createNode(), d, KisSharedPtr< T >::data(), KoGenericRegistry< T >::get(), Node::Private::image, KisMetaData::MergeStrategyRegistry::instance(), KisImage::mergeDown(), Node::Private::node, KisNode::prevSibling(), and KisImage::waitForDone().
|
slot |
move the pixels to the given x, y location in the image coordinate space.
Definition at line 621 of file Node.cpp.
References d, Node::Private::node, KisBaseNode::setX(), and KisBaseNode::setY().
|
slot |
Definition at line 428 of file Node.cpp.
References d, KisBaseNode::name(), and Node::Private::node.
|
private |
|
slot |
return the opacity of the Node. The opacity is a value between 0 and 255.
Definition at line 441 of file Node.cpp.
References d, Node::Private::node, and KisBaseNode::opacity().
| bool Node::operator!= | ( | const Node & | other | ) | const |
| bool Node::operator== | ( | const Node & | other | ) | const |
|
slot |
paintAbility can be used to determine whether this node can be painted on with the current brush preset.
Definition at line 832 of file Node.cpp.
References KisMainWindow::activeView, KoColorSpace::colorModelId(), KisPaintDevice::colorSpace(), KisPart::currentMainwindow(), KoCanvasResource::CurrentPaintOpPreset, d, KisPart::instance(), Node::Private::node, KisBaseNode::paintDevice(), KoCanvasBase::resourceManager, and RGBAColorModelID.
|
private |
paintDevice gives access to the internal paint device of this Node
Definition at line 817 of file Node.cpp.
References d, Node::Private::node, and KisBaseNode::paintDevice().
|
slot |
paint an ellipse on the canvas. Uses current brush preset
| rect | QRect with x, y, width, and height
|
| fillStyle | appearance of the fill, one of:
|
Definition at line 916 of file Node.cpp.
References PaintingResources::createHelper(), d, dbgScript, Node::Private::image, node(), paintAbility(), and KisFigurePaintingToolHelper::paintEllipse().
|
slot |
paint a line on the canvas. Uses current brush preset
| pointOne | starting point |
| pointTwo | end point |
| pressureOne | starting pressure |
| pressureTwo | end pressure |
| strokeStyle | appearance of the outline, one of:
|
Definition at line 867 of file Node.cpp.
References PaintingResources::createHelper(), d, dbgScript, Node::Private::image, node(), paintAbility(), KisFigurePaintingToolHelper::paintLine(), KisPaintInformation::setPos(), and KisPaintInformation::setPressure().
|
slot |
paint a custom path on the canvas. Uses current brush preset
| path | QPainterPath to determine path
|
| fillStyle | appearance of the fill, one of:
|
Definition at line 928 of file Node.cpp.
References PaintingResources::createHelper(), d, dbgScript, Node::Private::image, node(), paintAbility(), and KisFigurePaintingToolHelper::paintPainterPath().
|
slot |
paint a polygon on the canvas. Uses current brush preset
| list | of Qpoints
|
| fillStyle | appearance of the fill, one of:
|
Definition at line 902 of file Node.cpp.
References PaintingResources::createHelper(), d, dbgScript, Node::Private::image, node(), paintAbility(), and KisFigurePaintingToolHelper::paintPolygon().
|
slot |
paint a rectangle on the canvas. Uses current brush preset
| rect | QRect with x, y, width, and height |
| strokeStyle | appearance of the outline, one of:
|
| fillStyle | appearance of the fill, one of:
|
Definition at line 887 of file Node.cpp.
References PaintingResources::createHelper(), d, dbgScript, Node::Private::image, node(), paintAbility(), and KisFigurePaintingToolHelper::paintRect().
|
slot |
return the Node that is the parent of the current Node, or 0 if this is the root Node.
Definition at line 456 of file Node.cpp.
References createNode(), d, Node::Private::image, Node::Private::node, and KisNode::parent.
|
slot |
pixelData reads the given rectangle from the Node's paintable pixels, if those exist, and returns it as a byte array. The pixel data starts top-left, and is ordered row-first.
The byte array can be interpreted as follows: 8 bits images have one byte per channel, and as many bytes as there are channels. 16 bits integer images have two bytes per channel, representing an unsigned short. 16 bits float images have two bytes per channel, representing a half, or 16 bits float. 32 bits float images have four bytes per channel, representing a float.
You can read outside the node boundaries; those pixels will be transparent black.
The order of channels is:
The byte array is a copy of the original node data. In Python, you can use bytes, bytearray and the struct module to interpret the data and construct, for instance, a Pillow Image object.
If you read the pixeldata of a mask, a filter or generator layer, you get the selection bytes, which is one channel with values in the range from 0..255.
If you want to change the pixels of a node you can write the pixels back after manipulation with setPixelData(). This will only succeed on nodes with writable pixel data, e.g not on groups or file layers.
| x | x position from where to start reading |
| y | y position from where to start reading |
| w | row length to read |
| h | number of rows to read |
Definition at line 546 of file Node.cpp.
References d, Node::Private::node, KisBaseNode::paintDevice(), KisPaintDevice::pixelSize(), and KisPaintDevice::readBytes().
|
slot |
pixelDataAtTime a basic function to get pixeldata from an animated node at a given time.
| x | the position from the left to start reading. |
| y | the position from the top to start reader |
| w | the row length to read |
| h | the number of rows to read |
| time | the frame number |
Definition at line 560 of file Node.cpp.
References KritaUtils::CopySnapshot, d, KisBaseNode::getKeyframeChannel(), KisBaseNode::isAnimated(), KisKeyframeChannel::keyframeAt(), Node::Private::node, KisBaseNode::paintDevice(), KisPaintDevice::pixelSize(), KisKeyframeChannel::Raster, and KisPaintDevice::readBytes().
|
slot |
position returns the position of the paint device of this node. The position is always 0,0 unless the layer has been moved. If you want to know the topleft position of the rectangle around the actual non-transparent pixels in the node, use bounds().
Definition at line 628 of file Node.cpp.
References d, Node::Private::node, KisBaseNode::x(), and KisBaseNode::y().
|
slot |
projectionPixelData reads the given rectangle from the Node's projection (that is, what the node looks like after all sub-Nodes (like layers in a group or masks on a layer) have been applied, and returns it as a byte array. The pixel data starts top-left, and is ordered row-first.
The byte array can be interpreted as follows: 8 bits images have one byte per channel, and as many bytes as there are channels. 16 bits integer images have two bytes per channel, representing an unsigned short. 16 bits float images have two bytes per channel, representing a half, or 16 bits float. 32 bits float images have four bytes per channel, representing a float.
You can read outside the node boundaries; those pixels will be transparent black.
The order of channels is:
The byte array is a copy of the original node data. In Python, you can use bytes, bytearray and the struct module to interpret the data and construct, for instance, a Pillow Image object.
If you read the projection of a mask, you get the selection bytes, which is one channel with values in the range from 0..255.
If you want to change the pixels of a node you can write the pixels back after manipulation with setPixelData(). This will only succeed on nodes with writable pixel data, e.g not on groups or file layers.
| x | x position from where to start reading |
| y | y position from where to start reading |
| w | row length to read |
| h | number of rows to read |
Definition at line 582 of file Node.cpp.
References d, Node::Private::node, KisPaintDevice::pixelSize(), KisBaseNode::projection(), and KisPaintDevice::readBytes().
|
slot |
remove removes this node from its parent image.
Definition at line 634 of file Node.cpp.
References d, Node::Private::image, Node::Private::node, KisNode::parent, KisProcessingApplicator::runSingleCommandStroke(), and KisImage::waitForDone().
|
slot |
removeChildNode removes the given node from the list of children.
| child | the node to be removed |
Definition at line 283 of file Node.cpp.
References d, Node::Private::node, and remove().
|
slot |
rotateNode rotate this layer by the given radians.
| radians | amount the layer should be rotated in, in radians. |
Definition at line 716 of file Node.cpp.
References d, KisSharedPtr< T >::data(), Node::Private::image, Node::Private::node, KisNode::parent, KisImage::rotateNode(), and KisImage::waitForDone().
|
slot |
save exports the given node with this filename. The extension of the filename determines the filetype.
| filename | the filename including extension |
| xRes | the horizontal resolution in pixels per pt (there are 72 pts in an inch) |
| yRes | the horizontal resolution in pixels per pt (there are 72 pts in an inch) |
| exportConfiguration | a configuration object appropriate to the file format. |
| exportRect | the export bounds for saving a node as a QRect If exportRect is empty, then save exactBounds() of the node. If you'd like to save the image- aligned area of the node, just pass image->bounds() there. See Document->exportImage for InfoObject details. |
Definition at line 653 of file Node.cpp.
References KisNodeFacade::addNode(), bounds, KisPaintDevice::compositionSourceColorSpace(), InfoObject::configuration(), createDocument(), KisImage::cropImage(), d, KisBaseNode::exactBounds(), KisImage::initialRefreshGraph(), Krita::instance(), KisPart::instance(), KisPaintDevice::makeCloneFrom(), KisMimeDatabase::mimeTypeForFile(), KisBaseNode::name(), Node::Private::node, KisBaseNode::opacity(), KisPaintLayer::paintDevice, KisBaseNode::projection(), KisImage::rootLayer(), and KisImage::setResolution().
|
slot |
scaleNode
| origin | the origin point |
| width | the width |
| height | the height |
| strategy | the scaling strategy. There's several ones amongst these that aren't available in the regular UI.
|
Definition at line 697 of file Node.cpp.
References bounds, d, KisSharedPtr< T >::data(), KisBaseNode::exactBounds(), KoGenericRegistry< T >::get(), Node::Private::image, KisFilterStrategyRegistry::instance(), Node::Private::node, KisNode::parent, KisImage::scaleNode(), and KisImage::waitForDone().
|
slot |
setAlphaLocked set the layer to value if the node is paint layer.
Definition at line 168 of file Node.cpp.
References d, KisSharedPtr< T >::data(), Node::Private::node, KisPaintLayer::setAlphaLocked(), and value().
|
slot |
setBlendingMode set the blending mode of the node to the given value
| value | one of the string values from |
Definition at line 185 of file Node.cpp.
References d, Node::Private::image, Node::Private::node, KisProcessingApplicator::runSingleCommandStroke(), value(), and KisImage::waitForDone().
setChildNodes this replaces the existing set of child nodes with the new set.
| nodes | The list of nodes that will become children, bottom-up – the first node, is the bottom-most node in the stack. |
Definition at line 289 of file Node.cpp.
References KisNodeFacade::addNode(), d, KisNode::firstChild(), Node::Private::image, KisNode::nextSibling(), Node::Private::node, node(), and KisNodeFacade::removeNode().
|
slot |
Sets the state of the node to the value of
| collapsed |
Definition at line 391 of file Node.cpp.
References collapsed(), d, Node::Private::node, and KisBaseNode::setCollapsed().
|
slot |
setColorLabel sets a color label index associated to the layer. The actual color of the label and the number of available colors is defined by Krita GUI configuration.
| index | an integer corresponding to the set of available color labels. |
Definition at line 308 of file Node.cpp.
References d, index(), Node::Private::node, and KisBaseNode::setColorLabelIndex().
|
slot |
setColorProfile set the color profile of the image to the given profile. The profile has to be registered with krita and be compatible with the current color model and depth; the image data is not converted.
| colorProfile |
Definition at line 336 of file Node.cpp.
References KisImage::assignLayerProfile(), colorProfile(), d, KisSharedPtr< T >::data(), Node::Private::image, KoColorSpaceRegistry::instance(), Node::Private::node, KoColorSpaceRegistry::profileByName(), and KisImage::waitForDone().
|
slot |
setColorSpace convert the node to the given colorspace
| colorModel | A string describing the color model of the node:
|
| colorDepth | A string describing the color depth of the image:
|
| colorProfile | a valid color profile for this color model and color depth combination. |
Definition at line 347 of file Node.cpp.
References colorDepth(), colorModel(), colorProfile(), KoColorSpaceRegistry::colorSpace(), KisImage::convertLayerColorSpace(), d, Node::Private::image, KoColorSpaceRegistry::instance(), KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), Node::Private::node, KoColorSpaceRegistry::profileByName(), and KisImage::waitForDone().
|
slot |
set the Inherit Alpha flag to the given value
Definition at line 404 of file Node.cpp.
References d, Node::Private::node, and value().
|
slot |
setLayerStyleFromAsl set a new layer style for this node.
| aslContent | a string formatted in ASL format containing the layer style |
Definition at line 772 of file Node.cpp.
References d, KisSharedPtr< T >::data(), Node::Private::image, KisLayer::layerStyle, Node::Private::node, KisAslLayerStyleSerializer::readFromPSDXML(), KisAslLayerStyleSerializer::registerPSDPattern(), KisProcessingApplicator::runSingleCommandStroke(), KisAslLayerStyleSerializer::styles(), and KisImage::waitForDone().
|
slot |
set the Locked flag to the give value
Definition at line 417 of file Node.cpp.
References d, Node::Private::node, KisBaseNode::setUserLocked(), and value().
|
slot |
rename the Node to the given name
Definition at line 434 of file Node.cpp.
References d, name(), Node::Private::node, and KisBaseNode::setName().
|
slot |
set the opacity of the Node to the given value. The opacity is a value between 0 and 255.
Definition at line 447 of file Node.cpp.
References d, Node::Private::node, KisBaseNode::setOpacity(), and value().
|
slot |
Sets whether or not node should be pinned to the Timeline Docker, regardless of selection activity.
Definition at line 373 of file Node.cpp.
References d, Node::Private::node, and KisBaseNode::setPinnedToTimeline().
|
slot |
setPixelData writes the given bytes, of which there must be enough, into the Node, if the Node has writable pixel data:
File layers, Group layers, Clone layers cannot be written to. Calling setPixelData on those layer types will silently do nothing.
| value | the byte array representing the pixels. There must be enough bytes available. Krita will take the raw pointer from the QByteArray and start reading, not stopping before (number of channels * size of channel * w * h) bytes are read. |
| x | the x position to start writing from |
| y | the y position to start writing from |
| w | the width of each row |
| h | the number of rows to write |
Definition at line 602 of file Node.cpp.
References KisPaintDevice::colorSpace(), d, Node::Private::node, KisBaseNode::paintDevice(), KoColorSpace::pixelSize(), value(), and KisPaintDevice::writeBytes().
|
slot |
Set the visibility of the current node to
| visible |
Definition at line 539 of file Node.cpp.
References d, Node::Private::node, KisBaseNode::setVisible(), and visible().
|
slot |
shearNode perform a shear operation on this node.
| angleX | the X-angle in degrees to shear by |
| angleY | the Y-angle in degrees to shear by |
Definition at line 737 of file Node.cpp.
References d, KisSharedPtr< T >::data(), Node::Private::image, Node::Private::node, KisNode::parent, KisImage::shearNode(), and KisImage::waitForDone().
|
slot |
thumbnail create a thumbnail of the given dimensions. The thumbnail is sized according to the layer dimensions, not the image dimensions. If the requested size is too big a null QImage is created. If the current node cannot generate a thumbnail, a transparent QImage of the requested size is generated.
Definition at line 747 of file Node.cpp.
References KisBaseNode::createThumbnail(), d, and Node::Private::node.
|
virtualslot |
type Krita has several types of nodes, split in layers and masks. Group layers can contain other layers, any layer can contain masks.
If the Node object isn't wrapping a valid Krita layer or mask object, and empty string is returned.
Definition at line 463 of file Node.cpp.
References d, and Node::Private::node.
|
slot |
uniqueId uniqueId of the node
Definition at line 811 of file Node.cpp.
References d, Node::Private::node, and KisBaseNode::uuid().
|
slot |
Check whether the current Node is visible in the layer stack
Definition at line 517 of file Node.cpp.
References d, Node::Private::node, and KisBaseNode::visible().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |