Debian Codegraph @

plugins/dockers/widegamutcolorselector/WGMyPaintShadeSelector.h

raw
1 /*
2 * SPDX-FileCopyrightText: 2021 Mathias Wein <[email protected]>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
7 #ifndef WGMYPAINTSHADESELECTOR_H
8 #define WGMYPAINTSHADESELECTOR_H
9
10 #include "WGSelectorWidgetBase.h"
11
12 #include <kis_types.h>
13
14 /**
15 * @brief A port of MyPaint's "Crossed Bowl" color selector
16 */
17
18 class WGMyPaintShadeSelector : public WGSelectorWidgetBase
19 {
20 Q_OBJECT
21 public:
22 WGMyPaintShadeSelector(WGSelectorDisplayConfigSP displayConfig, QWidget *parent, UiMode mode);
23 ~WGMyPaintShadeSelector() override;
24
25 void setModel(KisVisualColorModelSP model) override;
26
27 protected:
28 void mousePressEvent(QMouseEvent *event) override;
29 void mouseMoveEvent(QMouseEvent *event) override;
30 void mouseReleaseEvent(QMouseEvent *event) override;
31 void paintEvent(QPaintEvent *) override;
32 void resizeEvent(QResizeEvent *event) override;
33
34 bool getChannelValues(QPoint pos, QVector4D &values, QVector4D &blendValues);
35 void pickColorAt(const QPointF &posF);
36 void recalculateSizeHD();
37
38 private Q_SLOTS:
39 void slotSetChannelValues(const QVector4D &values);
40
41 private:
42 KisVisualColorModelSP m_model;
43 KisPaintDeviceSP m_realPixelCache;
44 KisPaintDeviceSP m_realCircleBorder;
45 float m_colorH {0.0f};
46 float m_colorS {0.0f};
47 float m_colorV {0.0f};
48 int m_sizeHD;
49 int m_widthHD;
50 int m_heightHD;
51 bool m_allowUpdates {true};
52 };
53
54 #endif // WGMYPAINTSHADESELECTOR_H