Krita Source Code Documentation
Loading...
Searching...
No Matches
KisVisualRectangleSelectorShape Class Reference

#include <KisVisualRectangleSelectorShape.h>

+ Inheritance diagram for KisVisualRectangleSelectorShape:

Public Types

enum  singelDTypes { vertical , horizontal , border , borderMirrored }
 
- Public Types inherited from KisVisualColorSelectorShape
enum  Dimensions { onedimensional , twodimensional }
 The Dimensions enum Whether or not the shape is single or two dimensional. More...
 

Public Member Functions

QRect getSpaceForCircle (QRect geom) override
 
QRect getSpaceForSquare (QRect geom) override
 getSpaceForSquare
 
QRect getSpaceForTriangle (QRect geom) override
 
 KisVisualRectangleSelectorShape (KisVisualColorSelector *parent, Dimensions dimension, int channel1, int channel2, int width=20, KisVisualRectangleSelectorShape::singelDTypes d=KisVisualRectangleSelectorShape::vertical)
 
void setBorderWidth (int width) override
 setBorderWidth set the border of the single dimensional selector.
 
void setOneDimensionalType (singelDTypes type)
 
 ~KisVisualRectangleSelectorShape () override
 
- Public Member Functions inherited from KisVisualColorSelectorShape
int channel (int dimension) const
 channel Get the channel index associated with a selector shape dimension
 
quint32 channelMask () const
 
void forceImageUpdate ()
 forceImageUpdate force the image to recache.
 
QColor getColorFromConverter (KoColor c)
 getColorFromConverter
 
KoColor getCurrentColor ()
 getCurrentColor
 
QPointF getCursorPosition () const
 getCursorPosition
 
Dimensions getDimensions () const
 getDimensions
 
const QImage & getImageMap ()
 getImageMap returns the updated base image
 
bool isHueControl () const
 
 KisVisualColorSelectorShape (KisVisualColorSelector *parent, KisVisualColorSelectorShape::Dimensions dimension, int channel1, int channel2)
 
void setAcceptTabletEvents (bool on)
 
void setChannelValues (QVector4D channelValues, quint32 channelFlags)
 setChannelValues Set the current channel values; Note that channel values controlled by the shape itself have no effect unless setCursor is true. This will trigger a full widget repaint.
 
void setCursorPosition (QPointF position, bool signal=false)
 setCursorPosition Set the cursor to normalized shape coordinates. This will only repaint the cursor.
 
virtual bool supportsGamutMask () const
 
virtual void updateGamutMask ()
 Notify shape that the gamut mask changed.
 
 ~KisVisualColorSelectorShape () override
 

Protected Member Functions

QRect getAvailableSpace (QRect geom, bool stretch)
 
QImage renderAlphaMask () const override
 render the alpha mask for the widget background the returned image is expected to be QImage::Format_Alpha8
 
QImage renderStaticAlphaMask () const override
 
- Protected Member Functions inherited from KisVisualColorSelectorShape
KisVisualColorSelectorcolorSelector () const
 
virtual QImage compositeBackground () const
 
QImage convertImageMap (const quint8 *rawColor, quint32 bufferSize, QSize imgSize) const
 convertImageMap convert image data containing raw KoColor data into a QImage
 
void mouseMoveEvent (QMouseEvent *e) override
 
virtual QPointF mousePositionToShapeCoordinate (const QPointF &pos, const QPointF &dragStart) const
 default implementation just calls convertWidgetCoordinateToShapeCoordinate(pos)
 
void mousePressEvent (QMouseEvent *e) override
 
void mouseReleaseEvent (QMouseEvent *e) override
 
void paintEvent (QPaintEvent *) override
 
virtual QImage renderBackground (const QVector4D &channelValues, const QImage &alpha) const
 renderBackground Render the widget background visible inside the widget's mask in current color space Rendering shall be done with the conversion functions of KisVisualColorSelector
 
void resizeEvent (QResizeEvent *) override
 
KisVisualColorModelselectorModel () const
 
void tabletEvent (QTabletEvent *event) override
 

Private Member Functions

QPointF convertShapeCoordinateToWidgetCoordinate (QPointF coordinate) const override
 convertShapeCoordinateToWidgetCoordinate
 
QPointF convertWidgetCoordinateToShapeCoordinate (QPointF coordinate) const override
 convertWidgetCoordinateToShapeCoordinate Convert a coordinate in the widget's height/width to a shape coordinate.
 
void drawCursor (QPainter &painter) override
 
QRegion getMaskMap () override
 getPixmap
 
QImage renderAlphaMaskImpl (qreal ratioStart, qreal ratioEnd) const
 

Private Attributes

int m_barWidth
 
singelDTypes m_type
 

Additional Inherited Members

- Signals inherited from KisVisualColorSelectorShape
void sigCursorMoved (QPointF pos)
 

Detailed Description

Definition at line 11 of file KisVisualRectangleSelectorShape.h.

Member Enumeration Documentation

◆ singelDTypes

Constructor & Destructor Documentation

◆ KisVisualRectangleSelectorShape()

KisVisualRectangleSelectorShape::KisVisualRectangleSelectorShape ( KisVisualColorSelector * parent,
Dimensions dimension,
int channel1,
int channel2,
int width = 20,
KisVisualRectangleSelectorShape::singelDTypes d = KisVisualRectangleSelectorShape::vertical )
explicit

Definition at line 17 of file KisVisualRectangleSelectorShape.cpp.

22 : KisVisualColorSelectorShape(parent, dimension, channel1, channel2)
23{
24 //qDebug() << "creating KisVisualRectangleSelectorShape" << this;
25 m_type = d;
26 m_barWidth = width;
27}
KisVisualColorSelectorShape(KisVisualColorSelector *parent, KisVisualColorSelectorShape::Dimensions dimension, int channel1, int channel2)

References m_barWidth, and m_type.

◆ ~KisVisualRectangleSelectorShape()

KisVisualRectangleSelectorShape::~KisVisualRectangleSelectorShape ( )
override

Definition at line 29 of file KisVisualRectangleSelectorShape.cpp.

30{
31 //qDebug() << "deleting KisVisualRectangleSelectorShape" << this;
32}

Member Function Documentation

◆ convertShapeCoordinateToWidgetCoordinate()

QPointF KisVisualRectangleSelectorShape::convertShapeCoordinateToWidgetCoordinate ( QPointF ) const
overrideprivatevirtual

convertShapeCoordinateToWidgetCoordinate

Returns
take the position in the shape and convert it to screen coordinates.

Implements KisVisualColorSelectorShape.

Definition at line 92 of file KisVisualRectangleSelectorShape.cpp.

93{
94 // Reminder: in Qt widget space, origin is top-left, but we want zero y to be at the bottom
95 qreal x = 0.5 * width();
96 qreal y = 0.5 * height();
97 qreal offset = 5.0;
101 y = qMin((1.0 - coordinate.x())*(height()-offset*2)+offset, (qreal)height());
103 x = qMin(coordinate.x()*(width()-offset*2)+offset, (qreal)width());
105
106 QRectF innerRect(m_barWidth/2, m_barWidth/2, width()-m_barWidth, height()-m_barWidth);
107 QPointF left (innerRect.left(),innerRect.center().y());
108 QList <QLineF> polygonLines;
109 polygonLines.append(QLineF(left, innerRect.topLeft()));
110 polygonLines.append(QLineF(innerRect.topLeft(), innerRect.topRight()));
111 polygonLines.append(QLineF(innerRect.topRight(), innerRect.bottomRight()));
112 polygonLines.append(QLineF(innerRect.bottomRight(), innerRect.bottomLeft()));
113 polygonLines.append(QLineF(innerRect.bottomLeft(), left));
114
115 qreal totalLength =0.0;
116 Q_FOREACH(QLineF line, polygonLines) {
117 totalLength += line.length();
118 }
119
120 qreal length = coordinate.x()*totalLength;
121 QPointF intersect(x,y);
122 Q_FOREACH(QLineF line, polygonLines) {
123 if (line.length()>length && length>0){
124 intersect = line.pointAt(length/line.length());
125
126 }
127 length-=line.length();
128 }
129 x = qRound(intersect.x());
130 y = qRound(intersect.y());
131
132 }
133 else /*if (m_type == KisVisualRectangleSelectorShape::borderMirrored)*/ {
134
135 QRectF innerRect(m_barWidth/2, m_barWidth/2, width()-m_barWidth, height()-m_barWidth);
136 QPointF bottom (innerRect.center().x(), innerRect.bottom());
137 QList <QLineF> polygonLines;
138 polygonLines.append(QLineF(bottom, innerRect.bottomLeft()));
139 polygonLines.append(QLineF(innerRect.bottomLeft(), innerRect.topLeft()));
140 polygonLines.append(QLineF(innerRect.topLeft(), innerRect.topRight()));
141 polygonLines.append(QLineF(innerRect.topRight(), innerRect.bottomRight()));
142 polygonLines.append(QLineF(innerRect.bottomRight(), bottom));
143
144 qreal totalLength =0.0;
145 Q_FOREACH(QLineF line, polygonLines) {
146 totalLength += line.length();
147 }
148
149 qreal length = coordinate.x()*(totalLength/2);
150 QPointF intersect(x,y);
151 if (coordinate.y()==1) {
152 for (int i = polygonLines.size()-1; i==0; i--) {
153 QLineF line = polygonLines.at(i);
154 if (line.length()>length && length>0){
155 intersect = line.pointAt(length/line.length());
156
157 }
158 length-=line.length();
159 }
160 } else {
161 Q_FOREACH(QLineF line, polygonLines) {
162 if (line.length()>length && length>0){
163 intersect = line.pointAt(length/line.length());
164
165 }
166 length-=line.length();
167 }
168 }
169 x = qRound(intersect.x());
170 y = qRound(intersect.y());
171
172 }
173 } else {
174 x = qMin(coordinate.x()*(width()-offset*2)+offset, (qreal)width());
175 y = qMin((1.0 - coordinate.y())*(height()-offset*2)+offset, (qreal)height());
176 }
177 return QPointF(x,y);
178}
qreal length(const QPointF &vec)
Definition Ellipse.cc:82
Dimensions getDimensions() const
getDimensions
Dimensions
The Dimensions enum Whether or not the shape is single or two dimensional.

References border, KisVisualColorSelectorShape::getDimensions(), horizontal, length(), m_barWidth, m_type, KisVisualColorSelectorShape::onedimensional, and vertical.

◆ convertWidgetCoordinateToShapeCoordinate()

QPointF KisVisualRectangleSelectorShape::convertWidgetCoordinateToShapeCoordinate ( QPointF coordinate) const
overrideprivatevirtual

convertWidgetCoordinateToShapeCoordinate Convert a coordinate in the widget's height/width to a shape coordinate.

Parameters
coordinatethe position your wish to have the shape coordinates of.

Implements KisVisualColorSelectorShape.

Definition at line 180 of file KisVisualRectangleSelectorShape.cpp.

181{
182 // Reminder: in Qt widget space, origin is top-left, but we want zero y to be at the bottom
183 //default values:
184 qreal x = 0.5;
185 qreal y = 0.5;
186 qreal offset = 5.0;
190 x = 1.0 - (coordinate.y()-offset)/(height()-offset*2);
192 x = (coordinate.x()-offset)/(width()-offset*2);
194 //border
195
196 QRectF innerRect(m_barWidth, m_barWidth, width()-(m_barWidth*2), height()-(m_barWidth*2));
197 QPointF left (innerRect.left(),innerRect.center().y());
198 QList <QLineF> polygonLines;
199 polygonLines.append(QLineF(left, innerRect.topLeft()));
200 polygonLines.append(QLineF(innerRect.topLeft(), innerRect.topRight()));
201 polygonLines.append(QLineF(innerRect.topRight(), innerRect.bottomRight()));
202 polygonLines.append(QLineF(innerRect.bottomRight(), innerRect.bottomLeft()));
203 polygonLines.append(QLineF(innerRect.bottomLeft(), left));
204
205 QLineF radius(coordinate, this->geometry().center());
206 QPointF intersect(0.5,0.5);
207 qreal length = 0.0;
208 qreal totalLength = 0.0;
209 bool foundIntersect = false;
210 Q_FOREACH(QLineF line, polygonLines) {
211 if (line.intersects(radius, &intersect) == QLineF::BoundedIntersection && foundIntersect == false)
212 {
213 foundIntersect = true;
214 length+=QLineF(line.p1(), intersect).length();
215
216 }
217 if (foundIntersect==false) {
218 length+=line.length();
219 }
220 totalLength+=line.length();
221 }
222
223 x = length/totalLength;
224
225 } else /*if (m_type == KisVisualRectangleSelectorShape::borderMirrored)*/ {
226 //border
227
228 QRectF innerRect(m_barWidth, m_barWidth, width()-(m_barWidth*2), height()-(m_barWidth*2));
229 QPointF bottom (innerRect.center().x(), innerRect.bottom());
230 QList <QLineF> polygonLines;
231 polygonLines.append(QLineF(bottom, innerRect.bottomLeft()));
232 polygonLines.append(QLineF(innerRect.bottomLeft(), innerRect.topLeft()));
233 polygonLines.append(QLineF(innerRect.topLeft(), innerRect.topRight()));
234 polygonLines.append(QLineF(innerRect.topRight(), innerRect.bottomRight()));
235 polygonLines.append(QLineF(innerRect.bottomRight(), bottom));
236
237 QLineF radius(coordinate, this->geometry().center());
238 QPointF intersect(0.5,0.5);
239 qreal length = 0.0;
240 qreal totalLength = 0.0;
241 bool foundIntersect = false;
242 Q_FOREACH(QLineF line, polygonLines) {
243 if (line.intersects(radius, &intersect) == QLineF::BoundedIntersection && foundIntersect == false)
244 {
245 foundIntersect = true;
246 length+=QLineF(line.p1(), intersect).length();
247
248 }
249 if (foundIntersect==false) {
250 length+=line.length();
251 }
252 totalLength+=line.length();
253 }
254 int halflength = totalLength/2;
255
256 if (length>halflength) {
257 x = (halflength - (length-halflength))/halflength;
258 y = 1.0;
259 } else {
260 x = length/halflength;
261 y = 0.0;
262 }
263 }
264 }
265 else {
266 x = (coordinate.x()-offset)/(width()-offset*2);
267 y = 1.0 - (coordinate.y()-offset)/(height()-offset*2);
268 }
269 x = qBound((qreal)0.0, x, (qreal)1.0);
270 y = qBound((qreal)0.0, y, (qreal)1.0);
271 return QPointF(x, y);
272}

References border, KisVisualColorSelectorShape::getDimensions(), horizontal, length(), m_barWidth, m_type, KisVisualColorSelectorShape::onedimensional, and vertical.

◆ drawCursor()

void KisVisualRectangleSelectorShape::drawCursor ( QPainter & painter)
overrideprivatevirtual

Implements KisVisualColorSelectorShape.

Definition at line 362 of file KisVisualRectangleSelectorShape.cpp.

363{
364 //qDebug() << this << "KisVisualRectangleSelectorShape::drawCursor: image needs update" << imagesNeedUpdate();
367 QBrush fill(Qt::SolidPattern);
368
369 int cursorwidth = 5;
370
374 QRectF rect;
376 qreal y = qRound(cursorPoint.y());
377 rect.setCoords(1.5, y - cursorwidth + 0.5, width() - 1.5, y + cursorwidth - 0.5);
378 } else {
379 qreal x = qRound(cursorPoint.x());
380 rect.setCoords(x - cursorwidth + 0.5, 1.5, x + cursorwidth - 0.5, height() - 1.5);
381 }
382 painter.setPen(Qt::white);
383 fill.setColor(Qt::white);
384 painter.setBrush(fill);
385 painter.drawRect(rect);
386 fill.setColor(col);
387 painter.setPen(Qt::black);
388 painter.setBrush(fill);
389 painter.drawRect(rect.adjusted(1, 1, -1, -1));
390
392 QRectF innerRect(m_barWidth, m_barWidth, width()-(m_barWidth*2), height()-(m_barWidth*2));
393 painter.setPen(Qt::white);
394 fill.setColor(Qt::white);
395 painter.setBrush(fill);
396 painter.drawEllipse(cursorPoint, cursorwidth, cursorwidth);
397 QPoint mirror(innerRect.center().x()+(innerRect.center().x()-cursorPoint.x()),cursorPoint.y());
398 painter.drawEllipse(mirror, cursorwidth, cursorwidth);
399 fill.setColor(col);
400 painter.setPen(Qt::black);
401 painter.setBrush(fill);
402 painter.drawEllipse(cursorPoint, cursorwidth-1, cursorwidth-1);
403 painter.drawEllipse(mirror, cursorwidth-1, cursorwidth-1);
404
405 } else {
406 painter.setPen(Qt::white);
407 fill.setColor(Qt::white);
408 painter.setBrush(fill);
409 painter.drawEllipse(cursorPoint, cursorwidth, cursorwidth);
410 fill.setColor(col);
411 painter.setPen(Qt::black);
412 painter.setBrush(fill);
413 painter.drawEllipse(cursorPoint, cursorwidth-1.0, cursorwidth-1.0);
414 }
415}
QPointF getCursorPosition() const
getCursorPosition
QColor getColorFromConverter(KoColor c)
getColorFromConverter
QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override
convertShapeCoordinateToWidgetCoordinate

References border, borderMirrored, convertShapeCoordinateToWidgetCoordinate(), KisVisualColorSelectorShape::getColorFromConverter(), KisVisualColorSelectorShape::getCurrentColor(), KisVisualColorSelectorShape::getCursorPosition(), KisVisualColorSelectorShape::getDimensions(), m_barWidth, m_type, KisVisualColorSelectorShape::onedimensional, and vertical.

◆ getAvailableSpace()

QRect KisVisualRectangleSelectorShape::getAvailableSpace ( QRect geom,
bool stretch )
protected

Definition at line 63 of file KisVisualRectangleSelectorShape.cpp.

64{
65 QPoint tl;
66 QPoint br;
67
69 br = geom.bottomRight();
70 tl = QPoint(geom.topLeft().x() + m_barWidth, geom.topLeft().y());
72 br = geom.bottomRight();
73 tl = QPoint(geom.topLeft().x(), geom.topLeft().y() + m_barWidth);
74 } else {
75 tl = QPoint(geom.topLeft().x() + m_barWidth, geom.topLeft().y() + m_barWidth);
76 br = QPoint(geom.bottomRight().x() - m_barWidth, geom.bottomRight().y() - m_barWidth);
77 }
78 QRect available(tl, br);
79 if (!stretch) {
80 int size = qMin(available.height(), available.width());
82 available.moveTop(available.y() + (available.height() - size)/2);
84 available.moveLeft(available.x() + (available.width() - size)/2);
85 }
86 available.setSize(QSize(size, size));
87 }
88
89 return available;
90}
int size(const Forest< T > &forest)
Definition KisForest.h:1232

References horizontal, m_barWidth, m_type, and vertical.

◆ getMaskMap()

QRegion KisVisualRectangleSelectorShape::getMaskMap ( )
overrideprivatevirtual

getPixmap

Returns
the pixmap of this shape.

Implements KisVisualColorSelectorShape.

Definition at line 274 of file KisVisualRectangleSelectorShape.cpp.

275{
276 QRegion mask = QRegion(0,0,width(),height());
278 mask = mask.subtracted(QRegion(m_barWidth, m_barWidth, width()-(m_barWidth*2), height()-(m_barWidth*2)));
279 }
280 return mask;
281}

References border, borderMirrored, m_barWidth, and m_type.

◆ getSpaceForCircle()

QRect KisVisualRectangleSelectorShape::getSpaceForCircle ( QRect geom)
overridevirtual

Implements KisVisualColorSelectorShape.

Definition at line 53 of file KisVisualRectangleSelectorShape.cpp.

54{
55 return getAvailableSpace(geom, false);
56}
QRect getAvailableSpace(QRect geom, bool stretch)

References getAvailableSpace().

◆ getSpaceForSquare()

QRect KisVisualRectangleSelectorShape::getSpaceForSquare ( QRect geom)
overridevirtual

getSpaceForSquare

Parameters
geomthe full widget rectangle
Returns
rectangle with enough space for second widget

Implements KisVisualColorSelectorShape.

Definition at line 48 of file KisVisualRectangleSelectorShape.cpp.

49{
50 return getAvailableSpace(geom, true);
51}

References getAvailableSpace().

◆ getSpaceForTriangle()

QRect KisVisualRectangleSelectorShape::getSpaceForTriangle ( QRect geom)
overridevirtual

Implements KisVisualColorSelectorShape.

Definition at line 58 of file KisVisualRectangleSelectorShape.cpp.

59{
60 return getSpaceForSquare(geom);
61}
QRect getSpaceForSquare(QRect geom) override
getSpaceForSquare

References getSpaceForSquare().

◆ renderAlphaMask()

QImage KisVisualRectangleSelectorShape::renderAlphaMask ( ) const
overrideprotectedvirtual

render the alpha mask for the widget background the returned image is expected to be QImage::Format_Alpha8

Reimplemented from KisVisualColorSelectorShape.

Definition at line 283 of file KisVisualRectangleSelectorShape.cpp.

284{
285 // Hi-DPI aware rendering requires that we determine the device pixel dimension;
286 // actual widget size in device pixels is not accessible unfortunately, it might be 1px smaller...
289 return QImage();
290 }
291 qreal startRatio = 0.0;
292 qreal endRatio = 1.0;
293
295 startRatio = 0.25;
296 }
297
298 return renderAlphaMaskImpl(startRatio, endRatio);
299}
KisVisualColorSelector * colorSelector() const
QImage renderAlphaMaskImpl(qreal ratioStart, qreal ratioEnd) const

References KisVisualColorSelectorShape::colorSelector(), KisVisualColorSelector::CompositeBackground, KisVisualColorSelectorShape::isHueControl(), renderAlphaMaskImpl(), KisVisualColorSelector::renderMode(), and KisVisualColorSelector::StaticBackground.

◆ renderAlphaMaskImpl()

QImage KisVisualRectangleSelectorShape::renderAlphaMaskImpl ( qreal ratioStart,
qreal ratioEnd ) const
private

Definition at line 319 of file KisVisualRectangleSelectorShape.cpp.

320{
321 // Hi-DPI aware rendering requires that we determine the device pixel dimension;
322 // actual widget size in device pixels is not accessible unfortunately, it might be 1px smaller...
323 const int deviceWidth = qCeil(width() * devicePixelRatioF());
324 const int deviceHeight = qCeil(height() * devicePixelRatioF());
325
326 QImage alphaMask(deviceWidth, deviceHeight, QImage::Format_Alpha8);
327 alphaMask.fill(0);
328 alphaMask.setDevicePixelRatio(devicePixelRatioF());
329 QPainter painter(&alphaMask);
330 painter.setRenderHint(QPainter::Antialiasing);
331 painter.setBrush(Qt::white);
332 painter.setPen(Qt::NoPen);
333
334 const int marginMajor = 3;
335 const int marginMinor = 2;
336
337 if (getDimensions() == onedimensional) {
339 const int barWidth = width() - (marginMinor*2);
340 const int start = (barWidth*ratioStart);
341 const int end = (barWidth*ratioEnd) - start;
342 painter.drawRect(start + marginMinor, marginMajor, end, height() - (2*marginMajor));
343
345 const int barWidth = height() - (marginMinor*2);
346 const int start = (barWidth*ratioStart);
347 const int end = (barWidth*ratioEnd) - start;
348 painter.drawRect(marginMajor, start + marginMinor, width() - (2*marginMajor), end);
349
350 } else /*if (m_type == border || m_type == borderMirrored)*/ {
351 painter.drawRect(2, 2, width() - 4, height() - 4);
352 painter.setBrush(Qt::black);
353 painter.drawRect(m_barWidth, m_barWidth, width() - 2 * m_barWidth, height() - 2 * m_barWidth);
354 }
355 } else {
356 painter.drawRect(marginMajor, marginMajor, width() - marginMajor*2, height() - marginMajor*2);
357 }
358
359 return alphaMask;
360}

References KisVisualColorSelectorShape::getDimensions(), horizontal, m_barWidth, m_type, KisVisualColorSelectorShape::onedimensional, and vertical.

◆ renderStaticAlphaMask()

QImage KisVisualRectangleSelectorShape::renderStaticAlphaMask ( ) const
overrideprotectedvirtual

Reimplemented from KisVisualColorSelectorShape.

Definition at line 301 of file KisVisualRectangleSelectorShape.cpp.

302{
303 // Hi-DPI aware rendering requires that we determine the device pixel dimension;
304 // actual widget size in device pixels is not accessible unfortunately, it might be 1px smaller...
307 return QImage();
308 }
309 qreal startRatio = 0.0;
310 qreal endRatio = 1.0;
311
313 endRatio = 0.25;
314 }
315
316 return renderAlphaMaskImpl(startRatio, endRatio);
317}

References KisVisualColorSelectorShape::colorSelector(), KisVisualColorSelector::CompositeBackground, KisVisualColorSelector::DynamicBackground, KisVisualColorSelectorShape::isHueControl(), renderAlphaMaskImpl(), and KisVisualColorSelector::renderMode().

◆ setBorderWidth()

void KisVisualRectangleSelectorShape::setBorderWidth ( int width)
overridevirtual

setBorderWidth set the border of the single dimensional selector.

Parameters
width

Implements KisVisualColorSelectorShape.

Definition at line 34 of file KisVisualRectangleSelectorShape.cpp.

35{
36 m_barWidth = width;
37}

References m_barWidth.

◆ setOneDimensionalType()

void KisVisualRectangleSelectorShape::setOneDimensionalType ( KisVisualRectangleSelectorShape::singelDTypes type)

Definition at line 39 of file KisVisualRectangleSelectorShape.cpp.

40{
41 if (type != m_type) {
42 m_type = type;
44 update();
45 }
46}
void forceImageUpdate()
forceImageUpdate force the image to recache.
bool update(QSpinBox *spinBox)

References KisVisualColorSelectorShape::forceImageUpdate(), and m_type.

Member Data Documentation

◆ m_barWidth

int KisVisualRectangleSelectorShape::m_barWidth
private

Definition at line 45 of file KisVisualRectangleSelectorShape.h.

◆ m_type

singelDTypes KisVisualRectangleSelectorShape::m_type
private

Definition at line 44 of file KisVisualRectangleSelectorShape.h.


The documentation for this class was generated from the following files: