Krita Source Code Documentation
Loading...
Searching...
No Matches
KisVisualTriangleSelectorShape.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Wolthera van Hovell tot Westerflier <griffinvalley@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef KIS_VISUAL_TRIANGLE_SELECTOR_SHAPE_H
7#define KIS_VISUAL_TRIANGLE_SELECTOR_SHAPE_H
8
10
12{
13 Q_OBJECT
14public:
16 Dimensions dimension,
17 int channel1, int channel2,
18 int margin = 5
19 );
21
22 void setBorderWidth(int /*width*/) override;
23
29 QRect getSpaceForSquare(QRect geom) override;
30 QRect getSpaceForCircle(QRect geom) override;
31 QRect getSpaceForTriangle(QRect geom) override;
32
33protected:
34 QImage renderAlphaMask() const override;
35
36private:
37
38 QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override;
39 QPointF convertWidgetCoordinateToShapeCoordinate(QPointF coordinate) const override;
40
41 QRegion getMaskMap() override;
42 void drawCursor(QPainter &painter) override;
43
44 int m_margin { 5 };
45};
46#endif
The KisVisualColorSelectorShape class A 2d widget can represent at maximum 2 coordinates....
Dimensions
The Dimensions enum Whether or not the shape is single or two dimensional.
The KisVisualColorSelector class.
QImage renderAlphaMask() const override
render the alpha mask for the widget background the returned image is expected to be QImage::Format_A...
void drawCursor(QPainter &painter) override
KisVisualTriangleSelectorShape(KisVisualColorSelector *parent, Dimensions dimension, int channel1, int channel2, int margin=5)
QPointF convertWidgetCoordinateToShapeCoordinate(QPointF coordinate) const override
convertWidgetCoordinateToShapeCoordinate Convert a coordinate in the widget's height/width to a shape...
void setBorderWidth(int) override
setBorderWidth set the border of the single dimensional selector.
QRect getSpaceForSquare(QRect geom) override
getSpaceForSquare
QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override
convertShapeCoordinateToWidgetCoordinate