Krita Source Code Documentation
Loading...
Searching...
No Matches
KisVisualRectangleSelectorShape.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_RECTANGLE_SELECTOR_SHAPE_H
7#define KIS_VISUAL_RECTANGLE_SELECTOR_SHAPE_H
8
10
12{
13 Q_OBJECT
14public:
17 Dimensions dimension,
18 int channel1, int channel2, int width=20,
20 );
22
23 void setBorderWidth(int width) override;
25
31 QRect getSpaceForSquare(QRect geom) override;
32 QRect getSpaceForCircle(QRect geom) override;
33 QRect getSpaceForTriangle(QRect geom) override;
34protected:
35 QRect getAvailableSpace(QRect geom, bool stretch);
36 QImage renderAlphaMask() const override;
37
38private:
39 QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override;
40 QPointF convertWidgetCoordinateToShapeCoordinate(QPointF coordinate) const override;
41
44 QRegion getMaskMap() override;
45 void drawCursor(QPainter &painter) override;
46};
47
48#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 setBorderWidth(int width) override
setBorderWidth set the border of the single dimensional selector.
QRect getSpaceForSquare(QRect geom) override
getSpaceForSquare
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_A...
QPointF convertWidgetCoordinateToShapeCoordinate(QPointF coordinate) const override
convertWidgetCoordinateToShapeCoordinate Convert a coordinate in the widget's height/width to a shape...
KisVisualRectangleSelectorShape(KisVisualColorSelector *parent, Dimensions dimension, int channel1, int channel2, int width=20, KisVisualRectangleSelectorShape::singelDTypes d=KisVisualRectangleSelectorShape::vertical)
QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override
convertShapeCoordinateToWidgetCoordinate