Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/artisticcolorselector/kis_color_selector.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 58 | public: | |||
---|---|---|---|---|---|
78 | void setBgColor(const KoColor& bgColor); | 78 | void setBgColor(const KoColor& bgColor); | ||
79 | 79 | | |||
80 | void setDefaultHueSteps(int num); | 80 | void setDefaultHueSteps(int num); | ||
81 | void setDefaultSaturationSteps(int num); | 81 | void setDefaultSaturationSteps(int num); | ||
82 | void setDefaultValueScaleSteps(int num); | 82 | void setDefaultValueScaleSteps(int num); | ||
83 | void setShowBgColor(bool value); | 83 | void setShowBgColor(bool value); | ||
84 | void setShowValueScaleNumbers(bool value); | 84 | void setShowValueScaleNumbers(bool value); | ||
85 | void setGamutMask(KoGamutMask* gamutMask); | 85 | void setGamutMask(KoGamutMask* gamutMask); | ||
86 | void setDirty(); | ||||
86 | bool gamutMaskOn(); | 87 | bool gamutMaskOn(); | ||
87 | void setGamutMaskOn(bool gamutMaskOn); | 88 | void setGamutMaskOn(bool gamutMaskOn); | ||
88 | void setEnforceGamutMask(bool enforce); | 89 | void setEnforceGamutMask(bool enforce); | ||
89 | KoGamutMask* gamutMask(); | 90 | KoGamutMask* gamutMask(); | ||
90 | 91 | | |||
91 | bool saturationIsInvertible(); | | |||
92 | | ||||
93 | void saveSettings(); | 92 | void saveSettings(); | ||
94 | void loadSettings(); | 93 | void loadSettings(); | ||
95 | 94 | | |||
96 | KisColor::Type getColorSpace () const { return m_colorSpace; } | 95 | KisColor::Type getColorSpace () const { return m_colorSpace; } | ||
97 | qint32 getNumRings () const { return m_colorRings.size(); } | 96 | qint32 getNumRings () const { return m_colorRings.size(); } | ||
98 | qint32 getNumPieces () const { return m_numPieces; } | 97 | qint32 getNumPieces () const { return m_numPieces; } | ||
99 | qint32 getNumLightPieces () const { return m_numLightPieces; } | 98 | qint32 getNumLightPieces () const { return m_numLightPieces; } | ||
100 | bool isSaturationInverted() const { return m_inverseSaturation; } | 99 | bool isSaturationInverted() const { return m_inverseSaturation; } | ||
Show All 25 Lines | 112 | private: | |||
126 | void recalculateRings(quint8 numRings, quint8 numPieces); | 125 | void recalculateRings(quint8 numRings, quint8 numPieces); | ||
127 | void createRing(ColorRing& wheel, quint8 numPieces, qreal innerRadius, qreal outerRadius); | 126 | void createRing(ColorRing& wheel, quint8 numPieces, qreal innerRadius, qreal outerRadius); | ||
128 | 127 | | |||
129 | void drawRing(QPainter& painter, ColorRing& wheel, const QRect& rect); | 128 | void drawRing(QPainter& painter, ColorRing& wheel, const QRect& rect); | ||
130 | void drawOutline(QPainter& painter, const QRect& rect); | 129 | void drawOutline(QPainter& painter, const QRect& rect); | ||
131 | void drawBlip(QPainter& painter, const QRect& rect); | 130 | void drawBlip(QPainter& painter, const QRect& rect); | ||
132 | void drawLightStrip(QPainter& painter, const QRect& rect); | 131 | void drawLightStrip(QPainter& painter, const QRect& rect); | ||
133 | void drawGamutMaskShape(QPainter& painter, const QRect& rect); | 132 | void drawGamutMaskShape(QPainter& painter, const QRect& rect); | ||
133 | void drawColorPreview(QPainter& painter, const QRect& rect); | ||||
134 | 134 | | |||
135 | qint8 getHueIndex(Radian hue) const; | 135 | qint8 getHueIndex(Radian hue) const; | ||
136 | qreal getHue(int hueIdx, Radian shift=0.0f) const; | 136 | qreal getHue(int hueIdx, Radian shift=0.0f) const; | ||
137 | qint8 getLightIndex(const QPointF& pt) const; | 137 | qint8 getLightIndex(const QPointF& pt) const; | ||
138 | qint8 getLightIndex(qreal light) const; | 138 | qint8 getLightIndex(qreal light) const; | ||
139 | qreal getLight(const QPointF& pt) const; | 139 | qreal getLight(const QPointF& pt) const; | ||
140 | qint8 getSaturationIndex(const QPointF& pt) const; | 140 | qint8 getSaturationIndex(const QPointF& pt) const; | ||
141 | qint8 getSaturationIndex(qreal saturation) const; | 141 | qint8 getSaturationIndex(qreal saturation) const; | ||
Show All 19 Lines | 155 | private: | |||
161 | qint8 m_selectedRing; | 161 | qint8 m_selectedRing; | ||
162 | qint8 m_selectedPiece; | 162 | qint8 m_selectedPiece; | ||
163 | qint8 m_selectedLightPiece; | 163 | qint8 m_selectedLightPiece; | ||
164 | KisColor m_selectedColor; | 164 | KisColor m_selectedColor; | ||
165 | KisColor m_fgColor; | 165 | KisColor m_fgColor; | ||
166 | KisColor m_bgColor; | 166 | KisColor m_bgColor; | ||
167 | QImage m_renderBuffer; | 167 | QImage m_renderBuffer; | ||
168 | QImage m_maskBuffer; | 168 | QImage m_maskBuffer; | ||
169 | QImage m_lightStripBuffer; | ||||
170 | QImage m_colorPreviewBuffer; | ||||
171 | QRect m_widgetArea; | ||||
169 | QRect m_renderArea; | 172 | QRect m_renderArea; | ||
170 | QRect m_lightStripArea; | 173 | QRect m_lightStripArea; | ||
171 | bool m_mouseMoved; | 174 | bool m_mouseMoved; | ||
172 | QPointF m_clickPos; | 175 | QPointF m_clickPos; | ||
173 | qint8 m_clickedRing; | 176 | qint8 m_clickedRing; | ||
174 | QVector<ColorRing> m_colorRings; | 177 | QVector<ColorRing> m_colorRings; | ||
175 | Qt::MouseButtons m_pressedButtons; | 178 | Qt::MouseButtons m_pressedButtons; | ||
176 | 179 | | |||
177 | // docker settings | 180 | // docker settings | ||
178 | quint8 m_defaultHueSteps; | 181 | quint8 m_defaultHueSteps; | ||
179 | quint8 m_defaultSaturationSteps; | 182 | quint8 m_defaultSaturationSteps; | ||
180 | quint8 m_defaultValueScaleSteps; | 183 | quint8 m_defaultValueScaleSteps; | ||
181 | bool m_showValueScaleNumbers; | 184 | bool m_showValueScaleNumbers; | ||
182 | bool m_showBgColor; | 185 | bool m_showBgColor; | ||
183 | 186 | | |||
184 | bool m_gamutMaskOn; | 187 | bool m_gamutMaskOn; | ||
185 | KoGamutMask* m_currentGamutMask; | 188 | KoGamutMask* m_currentGamutMask; | ||
186 | bool m_enforceGamutMask; | 189 | bool m_enforceGamutMask; | ||
187 | QSize m_renderAreaSize; | 190 | QSize m_renderAreaSize; | ||
188 | bool m_maskPreviewActive; | 191 | bool m_maskPreviewActive; | ||
189 | KisGamutMaskViewConverter* m_viewConverter; | 192 | KisGamutMaskViewConverter* m_viewConverter; | ||
190 | 193 | | |||
191 | bool m_widgetUpdatesSelf; | 194 | bool m_widgetUpdatesSelf; | ||
195 | bool m_isDirtyWheel; | ||||
196 | bool m_isDirtyLightStrip; | ||||
197 | bool m_isDirtyGamutMask; | ||||
198 | bool m_isDirtyColorPreview; | ||||
192 | 199 | | |||
193 | qreal m_lumaR; | 200 | qreal m_lumaR; | ||
194 | qreal m_lumaG; | 201 | qreal m_lumaG; | ||
195 | qreal m_lumaB; | 202 | qreal m_lumaB; | ||
196 | qreal m_lumaGamma; | 203 | qreal m_lumaGamma; | ||
197 | 204 | | |||
198 | typedef KisSignalCompressorWithParam<QPair<KisColor, Acs::ColorRole>> ColorCompressorType; | 205 | typedef KisSignalCompressorWithParam<QPair<KisColor, Acs::ColorRole>> ColorCompressorType; | ||
199 | QScopedPointer<ColorCompressorType> m_updateColorCompressor; | 206 | QScopedPointer<ColorCompressorType> m_updateColorCompressor; | ||
200 | }; | 207 | }; | ||
201 | 208 | | |||
202 | #endif // H_KIS_COLOR_SELECTOR_H | 209 | #endif // H_KIS_COLOR_SELECTOR_H |