|
Krita Source Code Documentation
|
#include <Selection.h>
Inheritance diagram for Selection:Public Slots | |
| void | add (Selection *selection) |
| void | border (int xRadius, int yRadius) |
| void | clear () |
| void | contract (int value) |
| void | copy (Node *node) |
| copy copies the area defined by the selection from the node to the clipboard. | |
| void | cut (Node *node) |
| cut erases the area defined by the selection from the node and puts a copy on the clipboard. | |
| 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) |
| paste pastes the content of the clipboard to the given node, limited by the area of the current selection. | |
| QByteArray | pixelData (int x, int y, int w, int h) const |
| 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. | |
| 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) |
| setPixelData writes the given bytes, of which there must be enough, into the Selection. | |
| 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 |
Public Member Functions | |
| bool | operator!= (const Selection &other) const |
| bool | operator== (const Selection &other) const |
| Selection (KisSelectionSP selection, QObject *parent=0) | |
| Selection (QObject *parent=0) | |
| ~Selection () override | |
Private Member Functions | |
| KisSelectionSP | selection () const |
Private Attributes | |
| Private *const | d |
Friends | |
| class | Document |
| class | FillLayer |
| class | FilterLayer |
| class | FilterMask |
| class | SelectionMask |
| class | TransparencyMask |
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.
| Selection::Selection | ( | KisSelectionSP | selection, |
| QObject * | parent = 0 ) |
For internal use only.
Definition at line 26 of file Selection.cpp.
References d, krita::Selection::Private::selection, and selection().
|
explicit |
Create a new, empty selection object.
Definition at line 34 of file Selection.cpp.
References d, and krita::Selection::Private::selection.
|
override |
Add the given selection's selected pixels to the current selection.
Definition at line 273 of file Selection.cpp.
References KisPixelSelection::applySelection(), d, KisSelection::pixelSelection, krita::Selection::Private::selection, selection(), and SELECTION_ADD.
|
slot |
Border the selection with the given radius.
Definition at line 199 of file Selection.cpp.
References KisBorderSelectionFilter::changeRect(), d, KisPaintDevice::defaultBounds(), KisSelection::pixelSelection, KisBorderSelectionFilter::process(), KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
|
slot |
Make the selection entirely unselected.
Definition at line 101 of file Selection.cpp.
References KisSelection::clear(), d, and krita::Selection::Private::selection.
|
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.
References d, height(), KisSelection::pixelSelection, KisPixelSelection::select(), krita::Selection::Private::selection, value(), width(), x(), and y().
copy copies the area defined by the selection from the node to the clipboard.
| node | the node from where the pixels will be copied. |
Definition at line 113 of file Selection.cpp.
References KoColorSpace::applyAlphaNormedFloatMask(), KisPaintDevice::colorSpace(), KisPainter::copyAreaOptimized(), KisPaintDevice::createHLineIteratorNG(), d, KisBaseNode::exactBounds(), KisBaseNode::hasEditablePaintDevice(), KisClipboard::instance(), KisBaseConstIteratorNG::nextPixel(), KisHLineConstIteratorNG::nextRow(), Node::node(), KisBaseConstAccessor::oldRawData(), KoColorSpace::opacityF(), KisBaseNode::paintDevice(), KisSelection::projection(), KisSelection::selectedExactRect(), krita::Selection::Private::selection, KisClipboard::setClip(), x(), and y().
cut erases the area defined by the selection from the node and puts a copy on the clipboard.
| node | the node from which the selection will be cut. |
Definition at line 154 of file Selection.cpp.
References KisPaintDevice::clearSelection(), copy(), d, KisBaseNode::exactBounds(), KisBaseNode::hasEditablePaintDevice(), Node::node(), KisBaseNode::paintDevice(), KisSelection::selectedExactRect(), krita::Selection::Private::selection, and KisNode::setDirty().
|
slot |
Dilate the selection with a radius of 1 pixel.
Definition at line 191 of file Selection.cpp.
References KisDilateSelectionFilter::changeRect(), d, KisPaintDevice::defaultBounds(), KisSelection::pixelSelection, KisDilateSelectionFilter::process(), KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
|
slot |
Definition at line 56 of file Selection.cpp.
References d, krita::Selection::Private::selection, and Selection().
|
slot |
Erode the selection with a radius of 1 pixel.
Definition at line 183 of file Selection.cpp.
References KisErodeSelectionFilter::changeRect(), d, KisPaintDevice::defaultBounds(), KisSelection::pixelSelection, KisErodeSelectionFilter::process(), KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
|
slot |
Feather the selection with the given radius.
Definition at line 207 of file Selection.cpp.
References KisFeatherSelectionFilter::changeRect(), d, KisPaintDevice::defaultBounds(), KisSelection::pixelSelection, KisFeatherSelectionFilter::process(), KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
|
slot |
Grow the selection with the given radius.
Definition at line 215 of file Selection.cpp.
References KisGrowSelectionFilter::changeRect(), d, KisPaintDevice::defaultBounds(), KisSelection::pixelSelection, KisGrowSelectionFilter::process(), KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
|
slot |
Definition at line 68 of file Selection.cpp.
References d, KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
Intersect the given selection with this selection.
Definition at line 285 of file Selection.cpp.
References KisPixelSelection::applySelection(), d, KisSelection::pixelSelection, krita::Selection::Private::selection, selection(), and SELECTION_INTERSECT.
|
slot |
Invert the selection.
Definition at line 241 of file Selection.cpp.
References KisInvertSelectionFilter::changeRect(), d, KisPaintDevice::defaultBounds(), KisSelection::pixelSelection, KisInvertSelectionFilter::process(), KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
|
slot |
Move the selection's top-left corner to the given coordinates.
Definition at line 94 of file Selection.cpp.
References d, KisPixelSelection::moveTo(), KisSelection::pixelSelection, krita::Selection::Private::selection, x(), and y().
| bool Selection::operator!= | ( | const Selection & | other | ) | const |
| bool Selection::operator== | ( | const Selection & | other | ) | const |
Definition at line 46 of file Selection.cpp.
References d, and krita::Selection::Private::selection.
paste pastes the content of the clipboard to the given node, limited by the area of the current selection.
| 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.
References KisClipboard::clip, KisPainter::copyAreaOptimized(), d, KisClipboard::instance(), Node::node(), KisBaseNode::paintDevice(), krita::Selection::Private::selection, KisNode::setDirty(), x(), and y().
|
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.
| 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 |
Definition at line 298 of file Selection.cpp.
References d, KisSelection::projection(), KisPaintDevice::readBytes(), krita::Selection::Private::selection, x(), and y().
Replace the current selection's selection with the one of the given selection.
Definition at line 267 of file Selection.cpp.
References KisPixelSelection::applySelection(), d, KisSelection::pixelSelection, krita::Selection::Private::selection, selection(), and SELECTION_REPLACE.
|
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.
References d, KisSelection::pixelSelection, KisPixelSelection::select(), krita::Selection::Private::selection, x(), and y().
|
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.
References d, KisSelection::pixelSelection, KisPixelSelection::select(), krita::Selection::Private::selection, value(), x(), and y().
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.
References d, KisBaseNode::exactBounds(), Node::node(), KisSelection::pixelSelection, KisPixelSelection::select(), krita::Selection::Private::selection, and value().
|
private |
Definition at line 318 of file Selection.cpp.
References d, and krita::Selection::Private::selection.
|
slot |
setPixelData writes the given bytes, of which there must be enough, into the Selection.
| 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.
References d, KisSelection::pixelSelection, krita::Selection::Private::selection, value(), KisPaintDevice::writeBytes(), x(), and y().
|
slot |
Shrink the selection with the given radius.
Definition at line 224 of file Selection.cpp.
References KisShrinkSelectionFilter::changeRect(), d, KisPaintDevice::defaultBounds(), KisSelection::pixelSelection, KisShrinkSelectionFilter::process(), KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
|
slot |
Smooth the selection.
Definition at line 232 of file Selection.cpp.
References KisSmoothSelectionFilter::changeRect(), d, KisPaintDevice::defaultBounds(), KisSelection::pixelSelection, KisSmoothSelectionFilter::process(), KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
Subtract the given selection's selected pixels from the current selection.
Definition at line 279 of file Selection.cpp.
References KisPixelSelection::applySelection(), d, KisSelection::pixelSelection, krita::Selection::Private::selection, selection(), and SELECTION_SUBTRACT.
Intersect with the inverse of the given selection with this selection.
Definition at line 291 of file Selection.cpp.
References KisPixelSelection::applySelection(), d, KisSelection::pixelSelection, krita::Selection::Private::selection, selection(), and SELECTION_SYMMETRICDIFFERENCE.
|
slot |
Definition at line 62 of file Selection.cpp.
References d, KisSelection::selectedExactRect(), and krita::Selection::Private::selection.
|
slot |
Definition at line 74 of file Selection.cpp.
References d, KisSelection::hasNonEmptyPixelSelection(), KisSelection::selectedExactRect(), krita::Selection::Private::selection, and KisSelection::x().
|
slot |
Definition at line 84 of file Selection.cpp.
References d, KisSelection::hasNonEmptyPixelSelection(), KisSelection::selectedExactRect(), krita::Selection::Private::selection, and KisSelection::y().
|
friend |
Definition at line 231 of file Selection.h.
|
friend |
Definition at line 233 of file Selection.h.
|
friend |
Definition at line 232 of file Selection.h.
|
friend |
Definition at line 236 of file Selection.h.
|
friend |
Definition at line 234 of file Selection.h.
|
friend |
Definition at line 235 of file Selection.h.
|
private |
Definition at line 241 of file Selection.h.