Changeset View
Changeset View
Standalone View
Standalone View
libs/libkis/GroupLayer.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_GROUPLAYER_H | ||||
19 | #define LIBKIS_GROUPLAYER_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 GroupLayer class | ||||
31 | * A group layer is a layer that can contain other layers. | ||||
32 | * In Krita, layers within a group layer are composited | ||||
33 | * first before they are added into the composition code for where | ||||
34 | * the group is in the stack. This has a significant effect on how | ||||
35 | * it is interpreted for blending modes. | ||||
36 | * | ||||
37 | * PassThrough changes this behaviour. | ||||
38 | * | ||||
39 | * Group layer cannot be animated, but can contain animated layers or masks. | ||||
40 | */ | ||||
41 | class KRITALIBKIS_EXPORT GroupLayer : public Node | ||||
42 | { | ||||
43 | Q_OBJECT | ||||
44 | Q_DISABLE_COPY(GroupLayer) | ||||
45 | | ||||
46 | public: | ||||
47 | explicit GroupLayer(KisImageSP image, QString name, QObject *parent = 0); | ||||
48 | explicit GroupLayer(KisGroupLayerSP layer, QObject *parent = 0); | ||||
49 | ~GroupLayer() override; | ||||
50 | public Q_SLOTS: | ||||
51 | | ||||
52 | /** | ||||
53 | * @brief type Krita has several types of nodes, split in layers and masks. Group | ||||
54 | * layers can contain other layers, any layer can contain masks. | ||||
55 | * | ||||
56 | * @return grouplayer | ||||
57 | */ | ||||
58 | virtual QString type() const override; | ||||
59 | | ||||
60 | /** | ||||
61 | * @brief setPassThroughMode | ||||
62 | * This changes the way how compositing works. | ||||
63 | * Instead of compositing all the layers before compositing it with the rest of the image, | ||||
64 | * the group layer becomes a sort of formal way to organise everything. | ||||
65 | * | ||||
66 | * Passthrough mode is the same as it is in photoshop, | ||||
67 | * and the inverse of SVG's isolation attribute(with passthrough=false being the same as | ||||
68 | * isolation="isolate"). | ||||
69 | * | ||||
70 | * @param passthrough whether or not to set the layer to passthrough. | ||||
71 | */ | ||||
72 | void setPassThroughMode(bool passthrough); | ||||
73 | | ||||
74 | /** | ||||
75 | * @brief passThroughMode | ||||
76 | * @return returns whether or not this layer is in passthrough mode. @see setPassThroughMode | ||||
77 | */ | ||||
78 | bool passThroughMode() const; | ||||
79 | }; | ||||
80 | | ||||
81 | #endif // LIBKIS_GROUPLAYER_H | ||||
82 | |