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)
QRect selectedRect ()
QRect selectedExactRect ()
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)

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 44 of file kis_selection.cc.

KisSelection::KisSelection const KisSelection rhs  ) 
 

Copy the selection.

Definition at line 50 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 125 of file kis_selection.cc.

QRect KisSelection::selectedExactRect  ) 
 

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

Definition at line 165 of file kis_selection.cc.

QRect KisSelection::selectedRect  ) 
 

Rough, but fastish way of determining the area of the tiles used by the selection.

Definition at line 157 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