krita

KisSelection Class Reference

#include <kis_selection.h>

Inheritance diagram for KisSelection:

KisPaintDevice List of all members.

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.


Public Member Functions

 KisSelection (KisPaintDeviceSP dev)
 KisSelection ()
 KisSelection (const KisSelection &rhs)
virtual ~KisSelection ()
Q_UINT8 selected (Q_INT32 x, Q_INT32 y)
void setSelected (Q_INT32 x, Q_INT32 y, Q_UINT8 s)
QImage maskImage ()
void select (QRect r)
void invert ()
void clear (QRect r)
void clear ()
bool isTotallyUnselected (QRect r)
bool isProbablyTotallyUnselected (QRect r)
QRect selectedRect () const
QRect selectedExactRect () const
void paintSelection (QImage img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h)
void paintSelection (QImage img, const QRect &scaledImageRect, const QSize &scaledImageSize, const QSize &imageSize)
void startCachingExactRect ()
void stopCachingExactRect ()
void setInterestedInDirtyness (bool b)
bool interestedInDirtyness () const
virtual void setDirty (const QRect &rc)
virtual void setDirty ()

Constructor & Destructor Documentation

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.cc.

KisSelection::KisSelection (  ) 

Create a new KisSelection.

This selection will not have a parent paint device.

Definition at line 48 of file kis_selection.cc.

KisSelection::KisSelection ( const KisSelection rhs  ) 

Copy the selection.

Definition at line 54 of file kis_selection.cc.


Member Function Documentation

void KisSelection::clear (  )  [virtual]

Complete erase the current paint device.

Its size will become 0.

Reimplemented from KisPaintDevice.

Definition at line 128 of file kis_selection.cc.

bool KisSelection::isTotallyUnselected ( QRect  r  ) 

Tests if the the rect is totally outside the selection.

Definition at line 152 of file kis_selection.cc.

bool KisSelection::isProbablyTotallyUnselected ( QRect  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.cc.

QRect 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.cc.

QRect KisSelection::selectedExactRect (  )  const

Slow, but exact way of determining the rectangle that encloses the selection.

Definition at line 177 of file kis_selection.cc.

void KisSelection::setDirty ( const QRect &  rc  )  [virtual]

Add the specified rect top the parent layer (if present).

Reimplemented from KisPaintDevice.

Definition at line 572 of file kis_selection.cc.

void KisSelection::setDirty (  )  [virtual]

Set the parent layer completely dirty, if this paint device has one.

Reimplemented from KisPaintDevice.

Definition at line 578 of file kis_selection.cc.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys