Krita Source Code Documentation
Loading...
Searching...
No Matches
Selection.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#ifndef LIBKIS_SELECTION_H
7#define LIBKIS_SELECTION_H
8
9#include <QObject>
10
11#include "kritalibkis_export.h"
12#include "libkis.h"
13#include <kis_types.h>
14
30class KRITALIBKIS_EXPORT Selection : public QObject
31{
32 Q_OBJECT
33
34
35public:
36
40 Selection(KisSelectionSP selection, QObject *parent = 0);
41
45 explicit Selection(QObject *parent = 0);
46 ~Selection() override;
47
48 bool operator==(const Selection &other) const;
49 bool operator!=(const Selection &other) const;
50
51public Q_SLOTS:
52
56 Selection *duplicate() const;
57
61 int width() const;
62
66 int height() const;
67
71 int x() const;
72
76 int y() const;
77
81 void move(int x, int y);
82
86 void clear();
87
92 void contract(int value);
93
98 void copy(Node *node);
99
104 void cut(Node *node);
105
113 void paste(Node *destination, int x, int y);
114
118 void erode();
119
123 void dilate();
124
128 void border(int xRadius, int yRadius);
129
133 void feather(int radius);
134
138 void grow(int xradius, int yradius);
139
143 void shrink(int xRadius, int yRadius, bool edgeLock);
144
148 void smooth();
149
153 void invert();
154
158 void resize(int w, int h);
159
164 void select(int x, int y, int w, int h, int value);
165
170 void selectAll(Node *node, int value);
171
175 void replace(Selection *selection);
176
180 void add(Selection *selection);
181
185 void subtract(Selection *selection);
186
190 void intersect(Selection *selection);
191
195 void symmetricdifference(Selection *selection);
196
213 QByteArray pixelData(int x, int y, int w, int h) const;
214
228 void setPixelData(QByteArray value, int x, int y, int w, int h);
229
230private:
231 friend class Document;
232 friend class FilterLayer;
233 friend class FillLayer;
234 friend class SelectionMask;
235 friend class TransparencyMask;
236 friend class FilterMask;
237
238 KisSelectionSP selection() const;
239
240 struct Private;
241 Private *const d;
242
243};
244
245#endif // LIBKIS_SELECTION_H
float value(const T *src, size_t ch)
bool operator==(const KisRegion &lhs, const KisRegion &rhs)
bool operator!=(const KoID &v1, const KoID &v2)
Definition KoID.h:103
The FillLayer class A fill layer is much like a filter layer in that it takes a name and filter....
Definition FillLayer.h:25
The FilterLayer class A filter layer will, when compositing, take the composited image up to the poin...
Definition FilterLayer.h:34
The FilterMask class A filter mask, unlike a filter layer, will add a non-destructive filter to the c...
Definition FilterMask.h:29
Definition Node.h:24
The SelectionMask class A selection mask is a mask type node that can be used to store selections....
Private *const d
Definition Selection.h:241
The TransparencyMask class A transparency mask is a mask type node that can be used to show and hide ...