Krita Source Code Documentation
Loading...
Searching...
No Matches
KisVisualEllipticalSelectorShape.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 KISVISUALCOLORSELECTOR_H
7#define KISVISUALCOLORSELECTOR_H
8
10
11#include <QTransform>
12
14{
15 Q_OBJECT
16public:
19 Dimensions dimension,
20 int channel1, int channel2,
21 int barWidth=20,
23 );
25
26 void setBorderWidth(int width) override;
27
33 QRect getSpaceForSquare(QRect geom) override;
34 QRect getSpaceForCircle(QRect geom) override;
35 QRect getSpaceForTriangle(QRect geom) override;
36 bool supportsGamutMask() const override;
37 void updateGamutMask() override;
38protected:
39 QImage renderAlphaMask() const override;
40 QImage renderStaticAlphaMask() const override;
41 void renderGamutMask();
42 QPointF mousePositionToShapeCoordinate(const QPointF &pos, const QPointF &dragStart) const override;
43
44private:
45 QImage renderAlphaMaskImpl(qreal outerBorder, qreal innerBorder) const;
46 QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override;
47 QPointF convertWidgetCoordinateToShapeCoordinate(QPointF coordinate) const override;
48
49 QRegion getMaskMap() override;
50 void drawCursor(QPainter &painter) override;
51 void drawGamutMask(QPainter &painter) override;
52
58};
59
60#endif // KISVISUALCOLORSELECTOR_H
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 setBorderWidth(int width) override
setBorderWidth set the border of the single dimensional selector.
void updateGamutMask() override
Notify shape that the gamut mask changed.
QPointF convertWidgetCoordinateToShapeCoordinate(QPointF coordinate) const override
convertWidgetCoordinateToShapeCoordinate Convert a coordinate in the widget's height/width to a shape...
QImage renderAlphaMaskImpl(qreal outerBorder, qreal innerBorder) const
KisVisualEllipticalSelectorShape(KisVisualColorSelector *parent, Dimensions dimension, int channel1, int channel2, int barWidth=20, KisVisualEllipticalSelectorShape::singelDTypes d=KisVisualEllipticalSelectorShape::border)
QRect getSpaceForSquare(QRect geom) override
getSpaceForSquare
QPointF mousePositionToShapeCoordinate(const QPointF &pos, const QPointF &dragStart) const override
default implementation just calls convertWidgetCoordinateToShapeCoordinate(pos)
QPointF convertShapeCoordinateToWidgetCoordinate(QPointF coordinate) const override
convertShapeCoordinateToWidgetCoordinate