Krita Source Code Documentation
Loading...
Searching...
No Matches
KisVisualDiamondSelectorShape.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Mathias Wein <lynx.mw+kde@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7#ifndef KIS_VISUAL_DIAMOND_SELECTOR_SHAPE_H
8#define KIS_VISUAL_DIAMOND_SELECTOR_SHAPE_H
9
11
13{
14 Q_OBJECT
15public:
17 Dimensions dimension,
18 int channel1, int channel2,
19 int margin = 5
20 );
22
23 void setBorderWidth(int /*width*/) override;
24
30 QRect getSpaceForSquare(QRect geom) override;
31 QRect getSpaceForCircle(QRect geom) override;
32 QRect getSpaceForTriangle(QRect geom) override;
33
34protected:
35 QImage renderAlphaMask() const override;
36
37private:
38
39 QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override;
40 QPointF convertWidgetCoordinateToShapeCoordinate(QPointF coordinate) const override;
41
42 QRegion getMaskMap() override;
43 void drawCursor(QPainter &painter) override;
44
45 int m_margin { 5 };
46};
47#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.
void drawCursor(QPainter &painter) override
QRect getSpaceForSquare(QRect geom) override
getSpaceForSquare
QImage renderAlphaMask() const override
render the alpha mask for the widget background the returned image is expected to be QImage::Format_A...
QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override
convertShapeCoordinateToWidgetCoordinate
KisVisualDiamondSelectorShape(KisVisualColorSelector *parent, Dimensions dimension, int channel1, int channel2, int margin=5)
void setBorderWidth(int) override
setBorderWidth set the border of the single dimensional selector.
QPointF convertWidgetCoordinateToShapeCoordinate(QPointF coordinate) const override
convertWidgetCoordinateToShapeCoordinate Convert a coordinate in the widget's height/width to a shape...