Changeset View
Changeset View
Standalone View
Standalone View
libs/libkis/SelectionMask.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (c) 2017 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU Lesser General Public License as published by | ||||
6 | * the Free Software Foundation; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU Lesser General Public License | ||||
15 | * along with this program; if not, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | #ifndef LIBKIS_SELECTIONMASK_H | ||||
19 | #define LIBKIS_SELECTIONMASK_H | ||||
20 | | ||||
21 | #include <QObject> | ||||
22 | #include "Node.h" | ||||
23 | | ||||
24 | #include <kis_types.h> | ||||
25 | | ||||
26 | #include "kritalibkis_export.h" | ||||
27 | #include "libkis.h" | ||||
28 | | ||||
29 | /** | ||||
30 | * @brief The SelectionMask class | ||||
31 | * A selection mask is a mask type node that can be used | ||||
32 | * to store selections. In the gui, these are refered to | ||||
33 | * as local selections. | ||||
34 | * | ||||
35 | * A selection mask can hold both raster and vector selections, though | ||||
36 | * the API only supports raster selections. | ||||
37 | */ | ||||
38 | class KRITALIBKIS_EXPORT SelectionMask : public Node | ||||
39 | { | ||||
40 | Q_OBJECT | ||||
41 | Q_DISABLE_COPY(SelectionMask) | ||||
42 | | ||||
43 | public: | ||||
44 | explicit SelectionMask(KisImageSP image, QString name, QObject *parent = 0); | ||||
45 | explicit SelectionMask(KisImageSP image, KisSelectionMaskSP mask, QObject *parent = 0); | ||||
46 | ~SelectionMask() override; | ||||
47 | public Q_SLOTS: | ||||
48 | | ||||
49 | /** | ||||
50 | * @brief type Krita has several types of nodes, split in layers and masks. Group | ||||
51 | * layers can contain other layers, any layer can contain masks. | ||||
52 | * | ||||
53 | * @return selectionmask | ||||
54 | * | ||||
55 | * If the Node object isn't wrapping a valid Krita layer or mask object, and | ||||
56 | * empty string is returned. | ||||
57 | */ | ||||
58 | virtual QString type() const override; | ||||
59 | | ||||
60 | Selection *selection() const; | ||||
61 | | ||||
62 | void setSelection(Selection *selection); | ||||
63 | }; | ||||
64 | | ||||
65 | #endif // LIBKIS_SELECTIONMASK_H | ||||
66 | |