Krita

FillLayer.h
1 /*
2  * SPDX-FileCopyrightText: 2017 Wolthera van Hövell tot Westerflier <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 #ifndef LIBKIS_FILLLAYER_H
7 #define LIBKIS_FILLLAYER_H
8 
9 #include <QObject>
10 #include "Node.h"
11 #include <InfoObject.h>
12 #include <Selection.h>
13 
14 #include <kis_types.h>
15 
16 #include "kritalibkis_export.h"
17 #include "libkis.h"
18 /**
19  * @brief The FillLayer class
20  * A fill layer is much like a filter layer in that it takes a name
21  * and filter. It however specializes in filters that fill the whole canvas,
22  * such as a pattern or full color fill.
23  */
24 class KRITALIBKIS_EXPORT FillLayer : public Node
25 {
26  Q_OBJECT
28 
29 public:
30  /**
31  * @brief FillLayer Create a new fill layer with the given generator plugin
32  * @param image the image this fill layer will belong to
33  * @param name "pattern" or "color"
34  * @param filterConfig a configuration object appropriate to the given generator plugin
35  *
36  * For a "pattern" fill layer, the InfoObject can contain a single "pattern" parameter with
37  * the name of a pattern as known to the resource system: "pattern" = "Cross01.pat".
38  *
39  * For a "color" fill layer, the InfoObject can contain a single "color" parameter with
40  * a QColor, a string that QColor can parse (see https://doc.qt.io/qt-5/qcolor.html#setNamedColor)
41  * or an XML description of the color, which can be derived from a @see ManagedColor.
42  *
43  * @param selection a selection object, can be empty
44  * @param parent
45  */
46  explicit FillLayer(KisImageSP image, QString name, KisFilterConfigurationSP filterConfig, Selection &selection, QObject *parent = 0);
47  explicit FillLayer(KisGeneratorLayerSP layer, QObject *parent = 0);
48  ~FillLayer() override;
49 public Q_SLOTS:
50 
51  /**
52  * @brief type Krita has several types of nodes, split in layers and masks. Group
53  * layers can contain other layers, any layer can contain masks.
54  *
55  * @return The type of the node. Valid types are:
56  * <ul>
57  * <li>paintlayer
58  * <li>grouplayer
59  * <li>filelayer
60  * <li>filterlayer
61  * <li>filllayer
62  * <li>clonelayer
63  * <li>vectorlayer
64  * <li>transparencymask
65  * <li>filtermask
66  * <li>transformmask
67  * <li>selectionmask
68  * <li>colorizemask
69  * </ul>
70  *
71  * If the Node object isn't wrapping a valid Krita layer or mask object, and
72  * empty string is returned.
73  */
74  virtual QString type() const override;
75 
76  /**
77  * @brief setGenerator set the given generator for this fill layer
78  * @param generatorName "pattern" or "color"
79  * @param filterConfig a configuration object appropriate to the given generator plugin
80  * @return true if the generator was correctly created and set on the layer
81  */
82  bool setGenerator(const QString &generatorName, InfoObject *filterConfig);
83  QString generatorName();
84 
85  InfoObject *filterConfig();
86 };
87 
88 #endif // LIBKIS_FILLLAYER_H
virtual QString type() const
type Krita has several types of nodes, split in layers and masks.
Definition: Node.cpp:456
InfoObject wrap a properties map.
Definition: InfoObject.h:19
Q_SLOTSQ_SLOTS
Selection represents a selection on Krita.
Definition: Selection.h:30
The FillLayer class A fill layer is much like a filter layer in that it takes a name and filter.
Definition: FillLayer.h:24
Node represents a layer or mask in a Krita image's Node hierarchy.
Definition: Node.h:21
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 04:09:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.