Selection
#include <Selection.h>
Public Slots | |
void | add (Selection *selection) |
void | border (int xRadius, int yRadius) |
void | clear () |
void | contract (int value) |
void | copy (Node *node) |
void | cut (Node *node) |
void | dilate () |
Selection * | duplicate () const |
void | erode () |
void | feather (int radius) |
void | grow (int xradius, int yradius) |
int | height () const |
void | intersect (Selection *selection) |
void | invert () |
void | move (int x, int y) |
void | paste (Node *destination, int x, int y) |
QByteArray | pixelData (int x, int y, int w, int h) const |
void | replace (Selection *selection) |
void | resize (int w, int h) |
void | select (int x, int y, int w, int h, int value) |
void | selectAll (Node *node, int value) |
void | setPixelData (QByteArray value, int x, int y, int w, int h) |
void | shrink (int xRadius, int yRadius, bool edgeLock) |
void | smooth () |
void | subtract (Selection *selection) |
void | symmetricdifference (Selection *selection) |
int | width () const |
int | x () const |
int | y () const |
Detailed Description
Selection represents a selection on Krita.
A selection is not necessarily associated with a particular Node or Image.
Definition at line 30 of file Selection.h.
Constructor & Destructor Documentation
◆ Selection() [1/2]
Selection::Selection | ( | KisSelectionSP | selection, |
QObject * | parent = 0 ) |
For internal use only.
Definition at line 26 of file Selection.cpp.
◆ Selection() [2/2]
|
explicit |
Create a new, empty selection object.
Definition at line 34 of file Selection.cpp.
◆ ~Selection()
|
override |
Definition at line 41 of file Selection.cpp.
Member Function Documentation
◆ add
Add the given selection's selected pixels to the current selection.
Definition at line 273 of file Selection.cpp.
◆ border
|
slot |
Border the selection with the given radius.
Definition at line 199 of file Selection.cpp.
◆ clear
|
slot |
Make the selection entirely unselected.
Definition at line 101 of file Selection.cpp.
◆ contract
|
slot |
Make the selection's width and height smaller by the given value.
This will not move the selection's top-left position.
Definition at line 107 of file Selection.cpp.
◆ copy
copy copies the area defined by the selection from the node to the clipboard.
- Parameters
-
node the node from where the pixels will be copied.
Definition at line 113 of file Selection.cpp.
◆ cut
cut erases the area defined by the selection from the node and puts a copy on the clipboard.
- Parameters
-
node the node from which the selection will be cut.
Definition at line 154 of file Selection.cpp.
◆ dilate
|
slot |
Dilate the selection with a radius of 1 pixel.
Definition at line 191 of file Selection.cpp.
◆ duplicate
|
slot |
- Returns
- a duplicate of the selection
Definition at line 56 of file Selection.cpp.
◆ erode
|
slot |
Erode the selection with a radius of 1 pixel.
Definition at line 183 of file Selection.cpp.
◆ feather
|
slot |
Feather the selection with the given radius.
Definition at line 207 of file Selection.cpp.
◆ grow
|
slot |
Grow the selection with the given radius.
Definition at line 215 of file Selection.cpp.
◆ height
|
slot |
- Returns
- the height of the selection
Definition at line 68 of file Selection.cpp.
◆ intersect
Intersect the given selection with this selection.
Definition at line 285 of file Selection.cpp.
◆ invert
|
slot |
Invert the selection.
Definition at line 241 of file Selection.cpp.
◆ move
|
slot |
Move the selection's top-left corner to the given coordinates.
Definition at line 94 of file Selection.cpp.
◆ operator!=()
Definition at line 51 of file Selection.cpp.
◆ operator==()
bool Selection::operator== | ( | const Selection & | other | ) | const |
Definition at line 46 of file Selection.cpp.
◆ paste
paste pastes the content of the clipboard to the given node, limited by the area of the current selection.
- Parameters
-
destination the node where the pixels will be written x the x position at which the clip will be written y the y position at which the clip will be written
Definition at line 166 of file Selection.cpp.
◆ pixelData
|
slot |
pixelData reads the given rectangle from the Selection's mask and returns it as a byte array.
The pixel data starts top-left, and is ordered row-first.
The byte array will contain one byte for every pixel, representing the selectedness. 0 is totally unselected, 255 is fully selected.
You can read outside the Selection's boundaries; those pixels will be unselected.
The byte array is a copy of the original selection data.
- Parameters
-
x x position from where to start reading y y position from where to start reading w row length to read h number of rows to read
- Returns
- a QByteArray with the pixel data. The byte array may be empty.
Definition at line 298 of file Selection.cpp.
◆ replace
Replace the current selection's selection with the one of the given selection.
Definition at line 267 of file Selection.cpp.
◆ resize
|
slot |
Resize the selection to the given width and height.
The top-left position will not be moved.
Definition at line 249 of file Selection.cpp.
◆ select
|
slot |
Select the given area.
The value can be between 0 and 255; 0 is totally unselected, 255 is totally selected.
Definition at line 255 of file Selection.cpp.
◆ selectAll
Select all pixels in the given node.
The value can be between 0 and 255; 0 is totally unselected, 255 is totally selected.
Definition at line 261 of file Selection.cpp.
◆ setPixelData
|
slot |
setPixelData writes the given bytes, of which there must be enough, into the Selection.
- Parameters
-
value the byte array representing the pixels. There must be enough bytes available. Krita will take the raw pointer from the QByteArray and start reading, not stopping before (w * h) bytes are read. x the x position to start writing from y the y position to start writing from w the width of each row h the number of rows to write
Definition at line 310 of file Selection.cpp.
◆ shrink
|
slot |
Shrink the selection with the given radius.
Definition at line 224 of file Selection.cpp.
◆ smooth
|
slot |
Smooth the selection.
Definition at line 232 of file Selection.cpp.
◆ subtract
Subtract the given selection's selected pixels from the current selection.
Definition at line 279 of file Selection.cpp.
◆ symmetricdifference
Intersect with the inverse of the given selection with this selection.
Definition at line 291 of file Selection.cpp.
◆ width
|
slot |
- Returns
- the width of the selection
Definition at line 62 of file Selection.cpp.
◆ x
|
slot |
- Returns
- the left-hand position of the selection.
Definition at line 74 of file Selection.cpp.
◆ y
|
slot |
- Returns
- the top position of the selection.
Definition at line 84 of file Selection.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:53 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.