Krita

FillLayer.h
1/*
2 * SPDX-FileCopyrightText: 2017 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
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 */
24class KRITALIBKIS_EXPORT FillLayer : public Node
25{
26 Q_OBJECT
27 Q_DISABLE_COPY(FillLayer)
28
29public:
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;
49public 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
The FillLayer class A fill layer is much like a filter layer in that it takes a name and filter.
Definition FillLayer.h:25
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
virtual QString type() const
type Krita has several types of nodes, split in layers and masks.
Definition Node.cpp:463
Selection represents a selection on Krita.
Definition Selection.h:31
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:06:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.