Krita
Node.h
42 * @brief alphaLocked checks whether the node is a paint layer and returns whether it is alpha locked
53 * @return the blending mode of the layer. The values of the blending modes are defined in @see KoCompositeOpRegistry.h
77 * @return returns a list of child nodes of the current node. The nodes are ordered from the bottommost up.
86 * @param partialMatch return if the name partially contains the string (case insensitive). Defaults to false.
89 * @return returns a list of child nodes and grand child nodes of the current node that match the search criteria.
91 QList<Node*> findChildNodes(const QString &name = QString(), bool recursive = false, bool partialMatch = false, const QString &type = QString(), int colorLabelIndex = 0) const;
147 * @brief setColorProfile set the color profile of the image to the given profile. The profile has to
148 * be registered with krita and be compatible with the current color model and depth; the image data
176 bool setColorSpace(const QString &colorModel, const QString &colorDepth, const QString &colorProfile);
328 * exist, and returns it as a byte array. The pixel data starts top-left, and is ordered row-first.
352 * and the struct module to interpret the data and construct, for instance, a Pillow Image object.
354 * If you read the pixeldata of a mask, a filter or generator layer, you get the selection bytes,
358 * with setPixelData(). This will only succeed on nodes with writable pixel data, e.g not on groups
371 * @brief pixelDataAtTime a basic function to get pixeldata from an animated node at a given time.
382 * @brief projectionPixelData reads the given rectangle from the Node's projection (that is, what the node
383 * looks like after all sub-Nodes (like layers in a group or masks on a layer) have been applied,
408 * and the struct module to interpret the data and construct, for instance, a Pillow Image object.
414 * with setPixelData(). This will only succeed on nodes with writable pixel data, e.g not on groups
475 * @brief duplicate returns a full copy of the current node. The node is not inserted in the graphic
481 * @brief save exports the given node with this filename. The extension of the filename determines the filetype.
487 * If \p exportRect is empty, then save exactBounds() of the node. If you'd like to save the image-
492 bool save(const QString &filename, double xRes, double yRes, const InfoObject &exportConfiguration, const QRect &exportRect = QRect());
495 * @brief mergeDown merges the given node with the first visible node underneath this node in the layerstack.
505 * @param strategy the scaling strategy. There's several ones amongst these that aren't available in the regular UI.
508 * <li>Bicubic - Adds pixels using the color of surrounding pixels. Produces smoother tonal gradations than Bilinear.</li>
509 * <li>Box - Replicate pixels in the image. Preserves all the original detail, but can produce jagged effects.</li>
510 * <li>Bilinear - Adds pixels averaging the color values of surrounding pixels. Produces medium quality results when the image is scaled from half to two times the original size.</li>
513 * <li>Lanczos3 - Offers similar results than Bicubic, but maybe a little bit sharper. Can produce light and dark halos along strong edges.</li>
544 * QImage is created. If the current node cannot generate a thumbnail, a transparent QImage of the
681 * @brief paintAbility can be used to determine whether this node can be painted on with the current brush preset.
bool alphaLocked() const
alphaLocked checks whether the node is a paint layer and returns whether it is alpha locked
Definition Node.cpp:158
void setBlendingMode(QString value)
setBlendingMode set the blending mode of the node to the given value
Definition Node.cpp:185
void scaleNode(QPointF origin, int width, int height, QString strategy)
scaleNode
Definition Node.cpp:697
void setAlphaLocked(bool value)
setAlphaLocked set the layer to value if the node is paint layer.
Definition Node.cpp:168
void paintPolygon(const QList< QPointF > points, const QString strokeStyle=PaintingResources::defaultStrokeStyle, const QString fillStyle=PaintingResources::defaultFillStyle)
paint a polygon on the canvas.
Definition Node.cpp:902
Node * mergeDown()
mergeDown merges the given node with the first visible node underneath this node in the layerstack.
Definition Node.cpp:685
QList< Channel * > channels() const
channels creates a list of Channel objects that can be used individually to show or hide certain chan...
Definition Node.cpp:197
QList< Node * > findChildNodes(const QString &name=QString(), bool recursive=false, bool partialMatch=false, const QString &type=QString(), int colorLabelIndex=0) const
findChildNodes
Definition Node.cpp:226
void enableAnimation() const
enableAnimation make the current layer animated, so it can have frames.
Definition Node.cpp:367
QString colorDepth() const
colorDepth A string describing the color depth of the image:
Definition Node.cpp:314
QPoint position() const
position returns the position of the paint device of this node.
Definition Node.cpp:628
void setPinnedToTimeline(bool pinned) const
Sets whether or not node should be pinned to the Timeline Docker, regardless of selection activity.
Definition Node.cpp:373
void move(int x, int y)
move the pixels to the given x, y location in the image coordinate space.
Definition Node.cpp:621
void setChildNodes(QList< Node * > nodes)
setChildNodes this replaces the existing set of child nodes with the new set.
Definition Node.cpp:289
void paintEllipse(const QRectF &rect, const QString strokeStyle=PaintingResources::defaultStrokeStyle, const QString fillStyle=PaintingResources::defaultFillStyle)
paint an ellipse on the canvas.
Definition Node.cpp:916
bool visible() const
Check whether the current Node is visible in the layer stack.
Definition Node.cpp:517
QString colorModel() const
colorModel retrieve the current color model of this document:
Definition Node.cpp:321
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.
Definition Node.cpp:867
bool hasKeyframeAtTime(int frameNumber)
Check to see if frame number on layer is a keyframe.
Definition Node.cpp:523
void shearNode(double angleX, double angleY)
shearNode perform a shear operation on this node.
Definition Node.cpp:737
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,...
Definition Node.cpp:602
bool setColorSpace(const QString &colorModel, const QString &colorDepth, const QString &colorProfile)
setColorSpace convert the node to the given colorspace
Definition Node.cpp:347
virtual QString type() const
type Krita has several types of nodes, split in layers and masks.
Definition Node.cpp:463
void paintRectangle(const QRectF &rect, const QString strokeStyle=PaintingResources::defaultStrokeStyle, const QString fillStyle=PaintingResources::defaultFillStyle)
paint a rectangle on the canvas.
Definition Node.cpp:887
bool inheritAlpha() const
inheritAlpha checks whether this node has the inherits alpha flag set
Definition Node.cpp:397
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,...
Definition Node.cpp:546
bool save(const QString &filename, double xRes, double yRes, const InfoObject &exportConfiguration, const QRect &exportRect=QRect())
save exports the given node with this filename.
Definition Node.cpp:653
QString paintAbility()
paintAbility can be used to determine whether this node can be painted on with the current brush pres...
Definition Node.cpp:832
void rotateNode(double radians)
rotateNode rotate this layer by the given radians.
Definition Node.cpp:716
bool setLayerStyleFromAsl(const QString &asl)
setLayerStyleFromAsl set a new layer style for this node.
Definition Node.cpp:772
QString layerStyleToAsl()
layerStyleToAsl retrieve the current layer's style in ASL format.
Definition Node.cpp:753
bool setColorProfile(const QString &colorProfile)
setColorProfile set the color profile of the image to the given profile.
Definition Node.cpp:336
bool addChildNode(Node *child, Node *above)
addChildNode adds the given node in the list of children.
Definition Node.cpp:265
QImage thumbnail(int w, int h)
thumbnail create a thumbnail of the given dimensions.
Definition Node.cpp:747
void paintPath(const QPainterPath &path, const QString strokeStyle=PaintingResources::defaultStrokeStyle, const QString fillStyle=PaintingResources::defaultFillStyle)
paint a custom path on the canvas.
Definition Node.cpp:928
void setInheritAlpha(bool value)
set the Inherit Alpha flag to the given value
Definition Node.cpp:404
bool removeChildNode(Node *child)
removeChildNode removes the given node from the list of children.
Definition Node.cpp:283
Node * parentNode() const
return the Node that is the parent of the current Node, or 0 if this is the root Node.
Definition Node.cpp:456
QByteArray projectionPixelData(int x, int y, int w, int h) const
projectionPixelData reads the given rectangle from the Node's projection (that is,...
Definition Node.cpp:582
void setColorLabel(int index)
setColorLabel sets a color label index associated to the layer.
Definition Node.cpp:308
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.
Definition Node.cpp:560
QRect bounds() const
bounds return the exact bounds of the node's paint device
Definition Node.cpp:615
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 14 2025 11:57:56 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 14 2025 11:57:56 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.