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 |
Public Member Functions | |
Selection (KisSelectionSP selection, QObject *parent=0) | |
Selection (QObject *parent=0) | |
bool | operator!= (const Selection &other) const |
bool | operator== (const Selection &other) const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Additional Inherited Members | |
Public Types inherited from QObject | |
typedef | QObjectList |
Properties inherited from QObject | |
objectName | |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
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
|
slot |
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
|
slot |
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
|
slot |
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
|
slot |
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!=()
bool Selection::operator!= | ( | const Selection & | other | ) | const |
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
|
slot |
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
|
slot |
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
|
slot |
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
|
slot |
Subtract the given selection's selected pixels from the current selection.
Definition at line 279 of file Selection.cpp.
◆ symmetricdifference
|
slot |
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 Fri Dec 6 2024 12:12:25 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.