Krita

Node.h
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef LIBKIS_NODE_H
7#define LIBKIS_NODE_H
8
9#include <QObject>
10
11#include <kis_types.h>
12
13#include "kritalibkis_export.h"
14#include "libkis.h"
15
16#include "PaintingResources.h"
17
18/**
19 * Node represents a layer or mask in a Krita image's Node hierarchy. Group layers can contain
20 * other layers and masks; layers can contain masks.
21 *
22 */
23class KRITALIBKIS_EXPORT Node : public QObject
24{
25 Q_OBJECT
26 Q_DISABLE_COPY(Node)
27
28public:
29 static Node *createNode(KisImageSP image, KisNodeSP node, QObject *parent = 0);
30 ~Node() override;
31 bool operator==(const Node &other) const;
32 bool operator!=(const Node &other) const;
33
34public Q_SLOTS:
35
36 /**
37 * @brief clone clone the current node. The node is not associated with any image.
38 */
39 Node *clone() const;
40
41 /**
42 * @brief alphaLocked checks whether the node is a paint layer and returns whether it is alpha locked
43 * @return whether the paint layer is alpha locked, or false if the node is not a paint layer
44 */
45 bool alphaLocked() const;
46
47 /**
48 * @brief setAlphaLocked set the layer to value if the node is paint layer.
49 */
50 void setAlphaLocked(bool value);
51
52 /**
53 * @return the blending mode of the layer. The values of the blending modes are defined in @see KoCompositeOpRegistry.h
54 */
55 QString blendingMode() const;
56
57 /**
58 * @brief setBlendingMode set the blending mode of the node to the given value
59 * @param value one of the string values from @see KoCompositeOpRegistry.h
60 */
61 void setBlendingMode(QString value);
62
63 /**
64 * @brief channels creates a list of Channel objects that can be used individually to
65 * show or hide certain channels, and to retrieve the contents of each channel in a
66 * node separately.
67 *
68 * Only layers have channels, masks do not, and calling channels on a Node that is a mask
69 * will return an empty list.
70 *
71 * @return the list of channels ordered in by position of the channels in pixel position
72 */
73 QList<Channel*> channels() const;
74
75 /**
76 * @brief childNodes
77 * @return returns a list of child nodes of the current node. The nodes are ordered from the bottommost up.
78 * The function is not recursive.
79 */
80 QList<Node*> childNodes() const;
81
82 /**
83 * @brief findChildNodes
84 * @param name name of the child node to search for. Leaving this blank will return all nodes.
85 * @param recursive whether or not to search recursively. Defaults to false.
86 * @param partialMatch return if the name partially contains the string (case insensitive). Defaults to false.
87 * @param type filter returned nodes based on type
88 * @param colorLabelIndex filter returned nodes based on color label index
89 * @return returns a list of child nodes and grand child nodes of the current node that match the search criteria.
90 */
91 QList<Node*> findChildNodes(const QString &name = QString(), bool recursive = false, bool partialMatch = false, const QString &type = QString(), int colorLabelIndex = 0) const;
92
93 /**
94 * @brief addChildNode adds the given node in the list of children.
95 * @param child the node to be added
96 * @param above the node above which this node will be placed
97 * @return false if adding the node failed
98 */
99 bool addChildNode(Node *child, Node *above);
100
101 /**
102 * @brief removeChildNode removes the given node from the list of children.
103 * @param child the node to be removed
104 */
105 bool removeChildNode(Node *child);
106
107 /**
108 * @brief setChildNodes this replaces the existing set of child nodes with the new set.
109 * @param nodes The list of nodes that will become children, bottom-up -- the first node,
110 * is the bottom-most node in the stack.
111 */
112 void setChildNodes(QList<Node*> nodes);
113
114 /**
115 * colorDepth A string describing the color depth of the image:
116 * <ul>
117 * <li>U8: unsigned 8 bits integer, the most common type</li>
118 * <li>U16: unsigned 16 bits integer</li>
119 * <li>F16: half, 16 bits floating point. Only available if Krita was built with OpenEXR</li>
120 * <li>F32: 32 bits floating point</li>
121 * </ul>
122 * @return the color depth.
123 */
124 QString colorDepth() const;
125
126 /**
127 * @brief colorModel retrieve the current color model of this document:
128 * <ul>
129 * <li>A: Alpha mask</li>
130 * <li>RGBA: RGB with alpha channel (The actual order of channels is most often BGR!)</li>
131 * <li>XYZA: XYZ with alpha channel</li>
132 * <li>LABA: LAB with alpha channel</li>
133 * <li>CMYKA: CMYK with alpha channel</li>
134 * <li>GRAYA: Gray with alpha channel</li>
135 * <li>YCbCrA: YCbCr with alpha channel</li>
136 * </ul>
137 * @return the internal color model string.
138 */
139 QString colorModel() const;
140
141 /**
142 * @return the name of the current color profile
143 */
144 QString colorProfile() const;
145
146 /**
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
149 * is <i>not</i> converted.
150 * @param colorProfile
151 * @return if assigning the color profile worked
152 */
153 bool setColorProfile(const QString &colorProfile);
154
155 /**
156 * @brief setColorSpace convert the node to the given colorspace
157 * @param colorModel A string describing the color model of the node:
158 * <ul>
159 * <li>A: Alpha mask</li>
160 * <li>RGBA: RGB with alpha channel (The actual order of channels is most often BGR!)</li>
161 * <li>XYZA: XYZ with alpha channel</li>
162 * <li>LABA: LAB with alpha channel</li>
163 * <li>CMYKA: CMYK with alpha channel</li>
164 * <li>GRAYA: Gray with alpha channel</li>
165 * <li>YCbCrA: YCbCr with alpha channel</li>
166 * </ul>
167 * @param colorDepth A string describing the color depth of the image:
168 * <ul>
169 * <li>U8: unsigned 8 bits integer, the most common type</li>
170 * <li>U16: unsigned 16 bits integer</li>
171 * <li>F16: half, 16 bits floating point. Only available if Krita was built with OpenEXR</li>
172 * <li>F32: 32 bits floating point</li>
173 * </ul>
174 * @param colorProfile a valid color profile for this color model and color depth combination.
175 */
176 bool setColorSpace(const QString &colorModel, const QString &colorDepth, const QString &colorProfile);
177
178 /**
179 * @brief Krita layers can be animated, i.e., have frames.
180 * @return return true if the layer has frames. Currently, the scripting framework
181 * does not give access to the animation features.
182 */
183 bool animated() const;
184
185 /**
186 * @brief enableAnimation make the current layer animated, so it can have frames.
187 */
188 void enableAnimation() const;
189
190 /**
191 * @brief Sets whether or not node should be pinned to the Timeline Docker,
192 * regardless of selection activity.
193 */
194 void setPinnedToTimeline(bool pinned) const;
195
196 /**
197 * @return Returns true if node is pinned to the Timeline Docker or false if it is not.
198 */
199 bool isPinnedToTimeline() const;
200
201 /**
202 * Sets the state of the node to the value of @param collapsed
203 */
204 void setCollapsed(bool collapsed);
205
206 /**
207 * returns the collapsed state of this node
208 */
209 bool collapsed() const;
210
211 /**
212 * Sets a color label index associated to the layer. The actual
213 * color of the label and the number of available colors is
214 * defined by Krita GUI configuration.
215 */
216 int colorLabel() const;
217
218 /**
219 * @brief setColorLabel sets a color label index associated to the layer. The actual
220 * color of the label and the number of available colors is
221 * defined by Krita GUI configuration.
222 * @param index an integer corresponding to the set of available color labels.
223 */
224 void setColorLabel(int index);
225
226 /**
227 * @brief inheritAlpha checks whether this node has the inherits alpha flag set
228 * @return true if the Inherit Alpha is set
229 */
230 bool inheritAlpha() const;
231
232 /**
233 * set the Inherit Alpha flag to the given value
234 */
235 void setInheritAlpha(bool value);
236
237 /**
238 * @brief locked checks whether the Node is locked. A locked node cannot be changed.
239 * @return true if the Node is locked, false if it hasn't been locked.
240 */
241 bool locked() const;
242
243 /**
244 * set the Locked flag to the give value
245 */
246 void setLocked(bool value);
247
248 /**
249 * @brief does the node have any content in it?
250 * @return if node has any content in it
251 */
252 bool hasExtents();
253
254
255 /**
256 * @return the user-visible name of this node.
257 */
258 QString name() const;
259
260 /**
261 * rename the Node to the given name
262 */
263 void setName(QString name);
264
265 /**
266 * return the opacity of the Node. The opacity is a value between 0 and 255.
267 */
268 int opacity() const;
269
270 /**
271 * set the opacity of the Node to the given value. The opacity is a value between 0 and 255.
272 */
273 void setOpacity(int value);
274
275 /**
276 * return the Node that is the parent of the current Node, or 0 if this is the root Node.
277 */
278 Node* parentNode() const;
279
280 /**
281 * @brief type Krita has several types of nodes, split in layers and masks. Group
282 * layers can contain other layers, any layer can contain masks.
283 *
284 * @return The type of the node. Valid types are:
285 * <ul>
286 * <li>paintlayer
287 * <li>grouplayer
288 * <li>filelayer
289 * <li>filterlayer
290 * <li>filllayer
291 * <li>clonelayer
292 * <li>vectorlayer
293 * <li>transparencymask
294 * <li>filtermask
295 * <li>transformmask
296 * <li>selectionmask
297 * <li>colorizemask
298 * </ul>
299 *
300 * If the Node object isn't wrapping a valid Krita layer or mask object, and
301 * empty string is returned.
302 */
303 virtual QString type() const;
304
305 /**
306 * @brief icon
307 * @return the icon associated with the layer.
308 */
309 QIcon icon() const;
310
311 /**
312 * Check whether the current Node is visible in the layer stack
313 */
314 bool visible() const;
315
316 /**
317 * Check to see if frame number on layer is a keyframe
318 */
319 bool hasKeyframeAtTime(int frameNumber);
320
321 /**
322 * Set the visibility of the current node to @param visible
323 */
324 void setVisible(bool visible);
325
326 /**
327 * @brief pixelData reads the given rectangle from the Node's paintable pixels, if those
328 * exist, and returns it as a byte array. The pixel data starts top-left, and is ordered row-first.
329 *
330 * The byte array can be interpreted as follows: 8 bits images have one byte per channel,
331 * and as many bytes as there are channels. 16 bits integer images have two bytes per channel,
332 * representing an unsigned short. 16 bits float images have two bytes per channel, representing
333 * a half, or 16 bits float. 32 bits float images have four bytes per channel, representing a
334 * float.
335 *
336 * You can read outside the node boundaries; those pixels will be transparent black.
337 *
338 * The order of channels is:
339 *
340 * <ul>
341 * <li>Integer RGBA: Blue, Green, Red, Alpha
342 * <li>Float RGBA: Red, Green, Blue, Alpha
343 * <li>GrayA: Gray, Alpha
344 * <li>Selection: selectedness
345 * <li>LabA: L, a, b, Alpha
346 * <li>CMYKA: Cyan, Magenta, Yellow, Key, Alpha
347 * <li>XYZA: X, Y, Z, A
348 * <li>YCbCrA: Y, Cb, Cr, Alpha
349 * </ul>
350 *
351 * The byte array is a copy of the original node data. In Python, you can use bytes, bytearray
352 * and the struct module to interpret the data and construct, for instance, a Pillow Image object.
353 *
354 * If you read the pixeldata of a mask, a filter or generator layer, you get the selection bytes,
355 * which is one channel with values in the range from 0..255.
356 *
357 * If you want to change the pixels of a node you can write the pixels back after manipulation
358 * with setPixelData(). This will only succeed on nodes with writable pixel data, e.g not on groups
359 * or file layers.
360 *
361 * @param x x position from where to start reading
362 * @param y y position from where to start reading
363 * @param w row length to read
364 * @param h number of rows to read
365 * @return a QByteArray with the pixel data. The byte array may be empty.
366
367 */
368 QByteArray pixelData(int x, int y, int w, int h) const;
369
370 /**
371 * @brief pixelDataAtTime a basic function to get pixeldata from an animated node at a given time.
372 * @param x the position from the left to start reading.
373 * @param y the position from the top to start reader
374 * @param w the row length to read
375 * @param h the number of rows to read
376 * @param time the frame number
377 * @return a QByteArray with the pixel data. The byte array may be empty.
378 */
379 QByteArray pixelDataAtTime(int x, int y, int w, int h, int time) const;
380
381 /**
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,
384 * and returns it as a byte array. The pixel data starts top-left, and is ordered row-first.
385 *
386 * The byte array can be interpreted as follows: 8 bits images have one byte per channel,
387 * and as many bytes as there are channels. 16 bits integer images have two bytes per channel,
388 * representing an unsigned short. 16 bits float images have two bytes per channel, representing
389 * a half, or 16 bits float. 32 bits float images have four bytes per channel, representing a
390 * float.
391 *
392 * You can read outside the node boundaries; those pixels will be transparent black.
393 *
394 * The order of channels is:
395 *
396 * <ul>
397 * <li>Integer RGBA: Blue, Green, Red, Alpha
398 * <li>Float RGBA: Red, Green, Blue, Alpha
399 * <li>GrayA: Gray, Alpha
400 * <li>Selection: selectedness
401 * <li>LabA: L, a, b, Alpha
402 * <li>CMYKA: Cyan, Magenta, Yellow, Key, Alpha
403 * <li>XYZA: X, Y, Z, A
404 * <li>YCbCrA: Y, Cb, Cr, Alpha
405 * </ul>
406 *
407 * The byte array is a copy of the original node data. In Python, you can use bytes, bytearray
408 * and the struct module to interpret the data and construct, for instance, a Pillow Image object.
409 *
410 * If you read the projection of a mask, you get the selection bytes, which is one channel with
411 * values in the range from 0..255.
412 *
413 * If you want to change the pixels of a node you can write the pixels back after manipulation
414 * with setPixelData(). This will only succeed on nodes with writable pixel data, e.g not on groups
415 * or file layers.
416 *
417 * @param x x position from where to start reading
418 * @param y y position from where to start reading
419 * @param w row length to read
420 * @param h number of rows to read
421 * @return a QByteArray with the pixel data. The byte array may be empty.
422 */
423 QByteArray projectionPixelData(int x, int y, int w, int h) const;
424
425 /**
426 * @brief setPixelData writes the given bytes, of which there must be enough, into the
427 * Node, if the Node has writable pixel data:
428 *
429 * <ul>
430 * <li>paint layer: the layer's original pixels are overwritten
431 * <li>filter layer, generator layer, any mask: the embedded selection's pixels are overwritten.
432 * <b>Note:</b> for these
433 * </ul>
434 *
435 * File layers, Group layers, Clone layers cannot be written to. Calling setPixelData on
436 * those layer types will silently do nothing.
437 *
438 * @param value the byte array representing the pixels. There must be enough bytes available.
439 * Krita will take the raw pointer from the QByteArray and start reading, not stopping before
440 * (number of channels * size of channel * w * h) bytes are read.
441 *
442 * @param x the x position to start writing from
443 * @param y the y position to start writing from
444 * @param w the width of each row
445 * @param h the number of rows to write
446 * @return true if writing the pixeldata worked
447 */
448 bool setPixelData(QByteArray value, int x, int y, int w, int h);
449
450 /**
451 * @brief bounds return the exact bounds of the node's paint device
452 * @return the bounds, or an empty QRect if the node has no paint device or is empty.
453 */
454 QRect bounds() const;
455
456 /**
457 * move the pixels to the given x, y location in the image coordinate space.
458 */
459 void move(int x, int y);
460
461 /**
462 * @brief position returns the position of the paint device of this node. The position is
463 * always 0,0 unless the layer has been moved. If you want to know the topleft position of
464 * the rectangle around the actual non-transparent pixels in the node, use bounds().
465 * @return the top-left position of the node
466 */
467 QPoint position() const;
468
469 /**
470 * @brief remove removes this node from its parent image.
471 */
472 bool remove();
473
474 /**
475 * @brief duplicate returns a full copy of the current node. The node is not inserted in the graphic
476 * @return a valid Node object or 0 if the node couldn't be duplicated.
477 */
478 Node* duplicate();
479
480 /**
481 * @brief save exports the given node with this filename. The extension of the filename determines the filetype.
482 * @param filename the filename including extension
483 * @param xRes the horizontal resolution in pixels per pt (there are 72 pts in an inch)
484 * @param yRes the horizontal resolution in pixels per pt (there are 72 pts in an inch)
485 * @param exportConfiguration a configuration object appropriate to the file format.
486 * @param exportRect the export bounds for saving a node as a QRect
487 * If \p exportRect is empty, then save exactBounds() of the node. If you'd like to save the image-
488 * aligned area of the node, just pass image->bounds() there.
489 * See Document->exportImage for InfoObject details.
490 * @return true if saving succeeded, false if it failed.
491 */
492 bool save(const QString &filename, double xRes, double yRes, const InfoObject &exportConfiguration, const QRect &exportRect = QRect());
493
494 /**
495 * @brief mergeDown merges the given node with the first visible node underneath this node in the layerstack.
496 * This will drop all per-layer metadata.
497 */
498 Node *mergeDown();
499
500 /**
501 * @brief scaleNode
502 * @param origin the origin point
503 * @param width the width
504 * @param height the height
505 * @param strategy the scaling strategy. There's several ones amongst these that aren't available in the regular UI.
506 * <ul>
507 * <li>Hermite</li>
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>
511 * <li>Bell</li>
512 * <li>BSpline</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>
514 * <li>Mitchell</li>
515 * </ul>
516 */
517 void scaleNode(QPointF origin, int width, int height, QString strategy);
518
519 /**
520 * @brief rotateNode rotate this layer by the given radians.
521 * @param radians amount the layer should be rotated in, in radians.
522 */
523 void rotateNode(double radians);
524
525 /**
526 * @brief cropNode crop this layer.
527 * @param x the left edge of the cropping rectangle.
528 * @param y the top edge of the cropping rectangle
529 * @param w the right edge of the cropping rectangle
530 * @param h the bottom edge of the cropping rectangle
531 */
532 void cropNode(int x, int y, int w, int h);
533
534 /**
535 * @brief shearNode perform a shear operation on this node.
536 * @param angleX the X-angle in degrees to shear by
537 * @param angleY the Y-angle in degrees to shear by
538 */
539 void shearNode(double angleX, double angleY);
540
541 /**
542 * @brief thumbnail create a thumbnail of the given dimensions. The thumbnail is sized according
543 * to the layer dimensions, not the image dimensions. If the requested size is too big a null
544 * QImage is created. If the current node cannot generate a thumbnail, a transparent QImage of the
545 * requested size is generated.
546 * @return a QImage representing the layer contents.
547 */
548 QImage thumbnail(int w, int h);
549
550 /**
551 * @brief layerStyleToAsl retrieve the current layer's style in ASL format.
552 * @return a QString in ASL format representing the layer style.
553 */
554 QString layerStyleToAsl();
555
556 /**
557 * @brief setLayerStyleFromAsl set a new layer style for this node.
558 * @param aslContent a string formatted in ASL format containing the layer style
559 * @return true if layer style was set, false if failed.
560 */
561 bool setLayerStyleFromAsl(const QString &asl);
562
563 /**
564 * @brief index the index of the node inside the parent
565 * @return an integer representing the node's index inside the parent
566 */
567 int index() const;
568
569 /**
570 * @brief uniqueId uniqueId of the node
571 * @return a QUuid representing a unique id to identify the node
572 */
573 QUuid uniqueId() const;
574
575 /**
576 * @brief paint a line on the canvas. Uses current brush preset
577 * @param pointOne starting point
578 * @param pointTwo end point
579 * @param pressureOne starting pressure
580 * @param pressureTwo end pressure
581 * @param strokeStyle appearance of the outline, one of:
582 * <ul>
583 * <li>None - will use Foreground Color, since line would be invisible otherwise
584 * <li>ForegroundColor</li>
585 * <li>BackgroundColor</li>
586 * </ul>
587 */
588 void paintLine(const QPointF pointOne,
589 const QPointF pointTwo,
590 double pressureOne = 1.0,
591 double pressureTwo = 1.0,
592 const QString strokeStyle = PaintingResources::defaultStrokeStyle);
593
594 /**
595 * @brief paint a rectangle on the canvas. Uses current brush preset
596 * @param rect QRect with x, y, width, and height
597 * @param strokeStyle appearance of the outline, one of:
598 * <ul>
599 * <li>None
600 * <li>ForegroundColor</li>
601 * <li>BackgroundColor</li>
602 * </ul>
603 * Default is ForegroundColor.
604 * @param fillStyle appearance of the fill, one of:
605 * <ul>
606 * <li>None
607 * <li>ForegroundColor</li>
608 * <li>BackgroundColor</li>
609 * <li>Pattern</li>
610 * </ul>
611 * Default is None.
612 */
613 void paintRectangle(const QRectF &rect,
614 const QString strokeStyle = PaintingResources::defaultStrokeStyle,
615 const QString fillStyle = PaintingResources::defaultFillStyle);
616
617 /**
618 * @brief paint a polygon on the canvas. Uses current brush preset
619 * @param list of Qpoints
620 * <ul>
621 * <li>None
622 * <li>ForegroundColor</li>
623 * <li>BackgroundColor</li>
624 * </ul>
625 * Default is ForegroundColor.
626 * @param fillStyle appearance of the fill, one of:
627 * <ul>
628 * <li>None
629 * <li>ForegroundColor</li>
630 * <li>BackgroundColor</li>
631 * <li>Pattern</li>
632 * </ul>
633 * Default is None.
634 */
635 void paintPolygon(const QList<QPointF> points,
636 const QString strokeStyle = PaintingResources::defaultStrokeStyle,
637 const QString fillStyle = PaintingResources::defaultFillStyle);
638 /**
639 * @brief paint an ellipse on the canvas. Uses current brush preset
640 * @param rect QRect with x, y, width, and height
641 * <ul>
642 * <li>None
643 * <li>ForegroundColor</li>
644 * <li>BackgroundColor</li>
645 * </ul>
646 * Default is ForegroundColor.
647 * @param fillStyle appearance of the fill, one of:
648 * <ul>
649 * <li>None
650 * <li>ForegroundColor</li>
651 * <li>BackgroundColor</li>
652 * <li>Pattern</li>
653 * </ul>
654 * Default is None.
655 */
656 void paintEllipse(const QRectF &rect,
657 const QString strokeStyle = PaintingResources::defaultStrokeStyle,
658 const QString fillStyle = PaintingResources::defaultFillStyle);
659 /**
660 * @brief paint a custom path on the canvas. Uses current brush preset
661 * @param path QPainterPath to determine path
662 * <ul>
663 * <li>None
664 * <li>ForegroundColor</li>
665 * <li>BackgroundColor</li>
666 * </ul>
667 * Default is ForegroundColor.
668 * @param fillStyle appearance of the fill, one of:
669 * <ul>
670 * <li>None
671 * <li>ForegroundColor</li>
672 * <li>BackgroundColor</li>
673 * <li>Pattern</li>
674 * </ul>
675 * Default is None.
676 */
677 void paintPath(const QPainterPath &path,
678 const QString strokeStyle = PaintingResources::defaultStrokeStyle,
679 const QString fillStyle = PaintingResources::defaultFillStyle);
680 /**
681 * @brief paintAbility can be used to determine whether this node can be painted on with the current brush preset.
682 * @return QString, one of the following:
683 * <ul>
684 * <li>VECTOR - This node is vector-based.</li>
685 * <li>CLONE - This node is a Clone Layer.</li>
686 * <li>PAINT - This node is paintable by the current brush preset.</li>
687 * <li>UNPAINTABLE - This node is not paintable, or a null preset is somehow selected./li>
688 * <li>MYPAINTBRUSH_UNPAINTABLE - This node's non-RGBA colorspace cannot be painted on by the currently selected MyPaint brush.</li>
689 * </ul>
690 */
691 QString paintAbility();
692
693private:
694
695 friend class Filter;
696 friend class Document;
697 friend class Selection;
698 friend class GroupLayer;
699 friend class FileLayer;
700 friend class FilterLayer;
701 friend class FillLayer;
702 friend class VectorLayer;
703 friend class FilterMask;
704 friend class SelectionMask;
705 friend class TransparencyMask;
706 friend class TransformMask;
707 friend class ColorizeMask;
708 friend class CloneLayer;
709
710 explicit Node(KisImageSP image, KisNodeSP node, QObject *parent = 0);
711
712 /**
713 * @brief paintDevice gives access to the internal paint device of this Node
714 * @return the paintdevice or 0 if the node does not have an editable paint device.
715 */
716 KisPaintDeviceSP paintDevice() const;
717 KisImageSP image() const;
718 KisNodeSP node() const;
719
720 struct Private;
721 Private *const d;
722
723};
724
726
727#endif // LIBKIS_NODE_H
The CloneLayer class A clone layer is a layer that takes a reference inside the image and shows the e...
Definition CloneLayer.h:26
The ColorizeMask class A colorize mask is a mask type node that can be used to color in line art.
The Document class encapsulates a Krita Document/Image.
Definition Document.h:37
The FileLayer class A file layer is a layer that can reference an external image and show said refere...
Definition FileLayer.h:27
The FillLayer class A fill layer is much like a filter layer in that it takes a name and filter.
Definition FillLayer.h:25
The FilterLayer class A filter layer will, when compositing, take the composited image up to the poin...
Definition FilterLayer.h:34
The FilterMask class A filter mask, unlike a filter layer, will add a non-destructive filter to the c...
Definition FilterMask.h:29
Filter: represents a filter and its configuration.
Definition Filter.h:31
The GroupLayer class A group layer is a layer that can contain other layers.
Definition GroupLayer.h:30
InfoObject wrap a properties map.
Definition InfoObject.h:20
Node represents a layer or mask in a Krita image's Node hierarchy.
Definition Node.h:24
The SelectionMask class A selection mask is a mask type node that can be used to store selections.
Selection represents a selection on Krita.
Definition Selection.h:31
The TransformMask class A transform mask is a mask type node that can be used to store transformation...
The TransparencyMask class A transparency mask is a mask type node that can be used to show and hide ...
The VectorLayer class A vector layer is a special layer that stores and shows vector shapes.
Definition VectorLayer.h:32
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:35:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.