#include <kis_selection.h>
Public Member Functions | |
| KisSelection (KisPaintDeviceSP dev) | |
| KisSelection () | |
| KisSelection (const KisSelection &rhs) | |
| TQ_UINT8 | selected (TQ_INT32 x, TQ_INT32 y) |
| void | setSelected (TQ_INT32 x, TQ_INT32 y, TQ_UINT8 s) |
| TQImage | maskImage () |
| void | select (TQRect r) |
| void | invert () |
| void | clear (TQRect r) |
| void | clear () |
| bool | isTotallyUnselected (TQRect r) |
| bool | isProbablyTotallyUnselected (TQRect r) |
| TQRect | selectedRect () const |
| TQRect | selectedExactRect () const |
| void | paintSelection (TQImage img, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) |
| void | paintSelection (TQImage img, const TQRect &scaledImageRect, const TQSize &scaledImageSize, const TQSize &imageSize) |
| void | startCachingExactRect () |
| void | stopCachingExactRect () |
| void | setInterestedInDirtyness (bool b) |
| bool | interestedInDirtyness () const |
| virtual void | setDirty (const TQRect &rc) |
| virtual void | setDirty () |
| KisPaintDeviceSP | parentPaintDevice () |
| Public Member Functions inherited from KisPaintDevice | |
| KisPaintDevice (KisColorSpace *colorSpace, const char *name=0) | |
| KisPaintDevice (KisLayer *parentLayer, KisColorSpace *colorSpace, const char *name=0) | |
| KisPaintDevice (const KisPaintDevice &rhs) | |
| virtual DCOPObject * | dcopObject () |
| void | lock (bool lock) |
| virtual bool | write (KoStore *store) |
| virtual bool | read (KoStore *store) |
| virtual void | move (TQ_INT32 x, TQ_INT32 y) |
| virtual void | move (const TQPoint &pt) |
| virtual KNamedCommand * | moveCommand (TQ_INT32 x, TQ_INT32 y) |
| bool | contains (TQ_INT32 x, TQ_INT32 y) const |
| bool | contains (const TQPoint &pt) const |
| bool | extentIsValid () const |
| void | setExtentIsValid (bool isValid) |
| void | crop (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) |
| void | crop (TQRect r) |
| void | fill (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, const TQ_UINT8 *fillPixel) |
| virtual void | readBytes (TQ_UINT8 *data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) |
| virtual void | writeBytes (const TQ_UINT8 *data, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h) |
| TQ_INT32 | numContiguousColumns (TQ_INT32 x, TQ_INT32 minY, TQ_INT32 maxY) |
| TQ_INT32 | numContiguousRows (TQ_INT32 y, TQ_INT32 minX, TQ_INT32 maxX) |
| TQ_INT32 | rowStride (TQ_INT32 x, TQ_INT32 y) |
| TDE_DEPRECATED const TQ_UINT8 * | pixel (TQ_INT32 x, TQ_INT32 y) |
| TDE_DEPRECATED TQ_UINT8 * | writablePixel (TQ_INT32 x, TQ_INT32 y) |
| virtual void | convertTo (KisColorSpace *dstColorSpace, TQ_INT32 renderingIntent=INTENT_PERCEPTUAL) |
| virtual void | setProfile (KisProfile *profile) |
| virtual void | convertFromTQImage (const TQImage &img, const TQString &srcProfileName, TQ_INT32 offsetX=0, TQ_INT32 offsetY=0) |
| virtual TQImage | convertToTQImage (KisProfile *dstProfile, TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, TQ_INT32 h, float exposure=0.0f) |
| virtual TQImage | convertToTQImage (KisProfile *dstProfile, float exposure=0.0f) |
| KisPaintDeviceSP | createThumbnailDevice (TQ_INT32 w, TQ_INT32 h) |
| virtual TQImage | createThumbnail (TQ_INT32 maxw, TQ_INT32 maxh) |
| bool | pixel (TQ_INT32 x, TQ_INT32 y, TQColor *c, TQ_UINT8 *opacity) |
| bool | pixel (TQ_INT32 x, TQ_INT32 y, KisColor *kc) |
| KisColor | colorAt (TQ_INT32 x, TQ_INT32 y) |
| bool | setPixel (TQ_INT32 x, TQ_INT32 y, const TQColor &c, TQ_UINT8 opacity) |
| bool | setPixel (TQ_INT32 x, TQ_INT32 y, const KisColor &kc) |
| KisColorSpace * | colorSpace () const |
| KisDataManagerSP | dataManager () const |
| void | setData (KisDataManagerSP data, KisColorSpace *colorSpace) |
| TQ_INT32 | getX () const |
| TQ_INT32 | getY () const |
| void | setX (TQ_INT32 x) |
| void | setY (TQ_INT32 y) |
| virtual TQ_INT32 | pixelSize () const |
| virtual TQ_INT32 | nChannels () const |
| KisImage * | image () const |
| KisLayer * | parentLayer () const |
| void | setParentLayer (KisLayer *parentLayer) |
| void | mirrorX () |
| void | mirrorY () |
| KisMementoSP | getMemento () |
| void | rollback (KisMementoSP memento) |
| void | rollforward (KisMementoSP memento) |
| KisRectIteratorPixel | createRectIterator (TQ_INT32 left, TQ_INT32 top, TQ_INT32 w, TQ_INT32 h, bool writable) |
| KisHLineIteratorPixel | createHLineIterator (TQ_INT32 x, TQ_INT32 y, TQ_INT32 w, bool writable) |
| KisVLineIteratorPixel | createVLineIterator (TQ_INT32 x, TQ_INT32 y, TQ_INT32 h, bool writable) |
| KisRandomAccessorPixel | createRandomAccessor (TQ_INT32 x, TQ_INT32 y, bool writable) |
| KisRandomSubAccessorPixel | createRandomSubAccessor () |
| KisSelectionSP | selection () |
| void | addSelection (KisSelectionSP selection) |
| void | subtractSelection (KisSelectionSP selection) |
| bool | hasSelection () |
| bool | selectionDeselected () |
| void | deselect () |
| void | reselect () |
| void | clearSelection () |
| void | applySelectionMask (KisSelectionSP mask) |
| KisSelectionSP | setSelection (KisSelectionSP selection) |
| void | emitSelectionChanged () |
| void | emitSelectionChanged (const TQRect &r) |
| KisUndoAdapter * | undoAdapter () const |
| KisExifInfo * | exifInfo () |
| bool | hasExifInfo () |
Additional Inherited Members | |
| Signals inherited from KisPaintDevice | |
| void | positionChanged (KisPaintDeviceSP device) |
| void | ioProgress (TQ_INT8 percentage) |
| void | profileChanged (KisProfile *profile) |
| Protected Attributes inherited from KisPaintDevice | |
| KisDataManagerSP | m_datamanager |
Detailed Description
KisSelection contains a byte-map representation of a layer, where the value of a byte signifies whether a corresponding pixel is selected, or not.
NOTE: If you need to manually call emitSelectionChanged on the owner paint device of a selection. KisSelection does not emit any signals by itself because often you want to combine several actions in to perfom one operation and you do not want recomposition to happen all the time.
Definition at line 43 of file kis_selection.h.
Constructor & Destructor Documentation
◆ KisSelection() [1/3]
| KisSelection::KisSelection | ( | KisPaintDeviceSP | dev | ) |
Create a new KisSelection.
- Parameters
-
dev the parent paint device. The selection will never be bigger than the parent paint device.
Definition at line 37 of file kis_selection.cpp.
◆ KisSelection() [2/3]
| KisSelection::KisSelection | ( | ) |
Create a new KisSelection.
This selection will not have a parent paint device.
Definition at line 48 of file kis_selection.cpp.
◆ KisSelection() [3/3]
| KisSelection::KisSelection | ( | const KisSelection & | rhs | ) |
Copy the selection.
Definition at line 54 of file kis_selection.cpp.
◆ ~KisSelection()
|
virtual |
Definition at line 60 of file kis_selection.cpp.
Member Function Documentation
◆ clear() [1/2]
|
virtual |
Complete erase the current paint device.
Its size will become 0.
Reimplemented from KisPaintDevice.
Definition at line 128 of file kis_selection.cpp.
◆ clear() [2/2]
| void KisSelection::clear | ( | TQRect | r | ) |
Definition at line 121 of file kis_selection.cpp.
◆ interestedInDirtyness()
|
inline |
Definition at line 114 of file kis_selection.h.
◆ invert()
| void KisSelection::invert | ( | ) |
Definition at line 135 of file kis_selection.cpp.
◆ isProbablyTotallyUnselected()
| bool KisSelection::isProbablyTotallyUnselected | ( | TQRect | r | ) |
Tests if the the rect is totally outside the selection, but uses selectedRect instead of selectedRect, and this is faster (but might deliver false positives!).
XXX: This comment makes no sense anymore! (BSAR)
Definition at line 160 of file kis_selection.cpp.
◆ isTotallyUnselected()
| bool KisSelection::isTotallyUnselected | ( | TQRect | r | ) |
Tests if the the rect is totally outside the selection.
Definition at line 152 of file kis_selection.cpp.
◆ maskImage()
| TQImage KisSelection::maskImage | ( | ) |
Definition at line 82 of file kis_selection.cpp.
◆ paintSelection() [1/2]
| void KisSelection::paintSelection | ( | TQImage | img, |
| const TQRect & | scaledImageRect, | ||
| const TQSize & | scaledImageSize, | ||
| const TQSize & | imageSize ) |
Definition at line 375 of file kis_selection.cpp.
◆ paintSelection() [2/2]
| void KisSelection::paintSelection | ( | TQImage | img, |
| TQ_INT32 | x, | ||
| TQ_INT32 | y, | ||
| TQ_INT32 | w, | ||
| TQ_INT32 | h ) |
Definition at line 251 of file kis_selection.cpp.
◆ parentPaintDevice()
|
inline |
Definition at line 118 of file kis_selection.h.
◆ select()
| void KisSelection::select | ( | TQRect | r | ) |
Definition at line 112 of file kis_selection.cpp.
◆ selected()
| TQ_UINT8 KisSelection::selected | ( | TQ_INT32 | x, |
| TQ_INT32 | y ) |
Definition at line 64 of file kis_selection.cpp.
◆ selectedExactRect()
| TQRect KisSelection::selectedExactRect | ( | ) | const |
Slow, but exact way of determining the rectangle that encloses the selection.
Definition at line 177 of file kis_selection.cpp.
◆ selectedRect()
| TQRect KisSelection::selectedRect | ( | ) | const |
Rough, but fastish way of determining the area of the tiles used by the selection.
Definition at line 169 of file kis_selection.cpp.
◆ setDirty() [1/2]
|
virtual |
Set the parent layer completely dirty, if this paint device has one.
Reimplemented from KisPaintDevice.
Definition at line 578 of file kis_selection.cpp.
◆ setDirty() [2/2]
|
virtual |
Add the specified rect top the parent layer (if present).
Reimplemented from KisPaintDevice.
Definition at line 572 of file kis_selection.cpp.
◆ setInterestedInDirtyness()
|
inline |
Definition at line 113 of file kis_selection.h.
◆ setSelected()
| void KisSelection::setSelected | ( | TQ_INT32 | x, |
| TQ_INT32 | y, | ||
| TQ_UINT8 | s ) |
Definition at line 73 of file kis_selection.cpp.
◆ startCachingExactRect()
| void KisSelection::startCachingExactRect | ( | ) |
Definition at line 194 of file kis_selection.cpp.
◆ stopCachingExactRect()
| void KisSelection::stopCachingExactRect | ( | ) |
Definition at line 187 of file kis_selection.cpp.
The documentation for this class was generated from the following files:
