Changeset View
Changeset View
Standalone View
Standalone View
libs/libkis/FilterLayer.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_FILTERLAYER_H | ||||
19 | #define LIBKIS_FILTERLAYER_H | ||||
20 | | ||||
21 | #include <QObject> | ||||
22 | #include "Node.h" | ||||
23 | #include <Filter.h> | ||||
24 | #include <Selection.h> | ||||
25 | | ||||
26 | #include <kis_types.h> | ||||
27 | | ||||
28 | #include "kritalibkis_export.h" | ||||
29 | #include "libkis.h" | ||||
30 | /** | ||||
31 | * @brief The FilterLayer class | ||||
32 | * A filter layer will, when compositing, take the composited | ||||
33 | * image up to the point of the loction of the filter layer | ||||
34 | * in the stack, create a copy and apply a filter. | ||||
35 | * | ||||
36 | * This means you can use blending modes on the filter layers, | ||||
37 | * which will be used to blend the filtered image with the original. | ||||
38 | * | ||||
39 | * Similarly, you can activate things like alpha inheritance, or | ||||
40 | * you can set grayscale pixeldata on the filter layer to act as | ||||
41 | * a mask. | ||||
42 | * | ||||
43 | * Filter layers can be animated. | ||||
44 | */ | ||||
45 | class KRITALIBKIS_EXPORT FilterLayer : public Node | ||||
46 | { | ||||
47 | Q_OBJECT | ||||
48 | Q_DISABLE_COPY(FilterLayer) | ||||
49 | | ||||
50 | public: | ||||
51 | explicit FilterLayer(KisImageSP image, QString name, Filter &filter, Selection &selection, QObject *parent = 0); | ||||
52 | explicit FilterLayer(KisAdjustmentLayerSP layer, QObject *parent = 0); | ||||
53 | ~FilterLayer() override; | ||||
54 | public Q_SLOTS: | ||||
55 | | ||||
56 | /** | ||||
57 | * @brief type Krita has several types of nodes, split in layers and masks. Group | ||||
58 | * layers can contain other layers, any layer can contain masks. | ||||
59 | * | ||||
60 | * @return "filterlayer" | ||||
61 | */ | ||||
62 | QString type() const override; | ||||
63 | | ||||
64 | void setFilter(Filter &filter); | ||||
65 | | ||||
66 | Filter * filter(); | ||||
67 | }; | ||||
68 | | ||||
69 | #endif // LIBKIS_FILTERLAYER_H | ||||
70 | |