krita
kis_selection.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KIS_SELECTION_H_
00019 #define KIS_SELECTION_H_
00020
00021 #include <qrect.h>
00022
00023 #include "kis_types.h"
00024 #include "kis_paint_device.h"
00025
00026 #include <koffice_export.h>
00027
00028
00029 enum enumSelectionMode {
00030 SELECTION_ADD,
00031 SELECTION_SUBTRACT
00032 };
00033
00043 class KRITACORE_EXPORT KisSelection : public KisPaintDevice {
00044
00045 typedef KisPaintDevice super;
00046
00047 public:
00053 KisSelection(KisPaintDeviceSP dev);
00054
00058 KisSelection();
00059
00063 KisSelection(const KisSelection& rhs);
00064
00065 virtual ~KisSelection();
00066
00067
00068 Q_UINT8 selected(Q_INT32 x, Q_INT32 y);
00069
00070 void setSelected(Q_INT32 x, Q_INT32 y, Q_UINT8 s);
00071
00072 QImage maskImage();
00073
00074 void select(QRect r);
00075
00076 void invert();
00077
00078 void clear(QRect r);
00079
00080 void clear();
00081
00082
00083 bool isTotallyUnselected(QRect r);
00084
00089 QRect selectedRect();
00090
00095 QRect selectedExactRect();
00096
00097 void paintSelection(QImage img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h);
00098 void paintSelection(QImage img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize);
00099
00100 private:
00101 void paintUniformSelectionRegion(QImage img, const QRect& imageRect, const QRegion& uniformRegion);
00102
00103 private:
00104 KisPaintDeviceSP m_parentPaintDevice;
00105 };
00106
00107 #endif // KIS_SELECTION_H_
|