Krita Source Code Documentation
Loading...
Searching...
No Matches
KisColorSelectorSimple Class Reference

#include <kis_color_selector_simple.h>

+ Inheritance diagram for KisColorSelectorSimple:

Public Member Functions

 KisColorSelectorSimple (KisColorSelector *parent)
 
void setColor (const KoColor &color) override
 set the color, blibs etc
 
- Public Member Functions inherited from KisColorSelectorComponent
KoColor currentColor ()
 return the color, that was selected by calling mouseEvent
 
int height () const
 
 KisColorSelectorComponent (KisColorSelector *parent)
 
virtual void mouseEvent (int x, int y)
 saves the mouse position, so that a blip can be created.
 
void paintEvent (QPainter *)
 
void setConfiguration (Parameter param, Type type)
 setConfiguration can be ignored (for instance ring and triangle, as they can have only one config)
 
void setDirty ()
 force subsequent redraw of the component
 
void setGamutMask (KoGamutMaskSP gamutMask)
 
void setGeometry (int x, int y, int width, int height)
 
void toggleGamutMask (bool state)
 
void unsetGamutMask ()
 
void updateGamutMaskPreview ()
 
bool wantsGrab (int x, int y)
 returns true, if this component wants to grab the mouse (normally true, if containsPoint returns true)
 
int width () const
 

Protected Member Functions

void paint (QPainter *) override
 
KoColor selectColor (int x, int y) override
 this method must be overloaded to return the color at position x/y and draw a marker on that position
 
- Protected Member Functions inherited from KisColorSelectorComponent
virtual bool allowsColorSelectionAtPoint (const QPoint &) const
 
const KoColorSpacecolorSpace () const
 
virtual bool containsPointInComponentCoords (int x, int y) const
 
bool isDirty () const
 returns true, if ether the color space, the size or the parameters have changed since the last paint event
 
void setLastMousePosition (int x, int y)
 

Private Member Functions

KoColor colorAt (float x, float y)
 

Private Attributes

qreal B {0.0}
 
qreal G {0.0}
 
qreal Gamma {0.0}
 
QPointF m_lastClickPos
 
QImage m_pixelCache
 
qreal R {0.0}
 

Friends

class Acs::PixelCacheRenderer
 

Additional Inherited Members

- Public Types inherited from KisColorSelectorComponent
typedef KisColorSelectorConfiguration::Parameters Parameter
 
typedef KisColorSelectorConfiguration::Type Type
 
- Public Slots inherited from KisColorSelectorComponent
void setParam (qreal hue, qreal hsvSaturation, qreal value, qreal hslSaturation, qreal lightness, qreal hsiSaturation, qreal intensity, qreal hsySaturation, qreal luma)
 
- Signals inherited from KisColorSelectorComponent
void paramChanged (qreal hue, qreal hsvSaturation, qreal value, qreal hslSaturation, qreal lightness, qreal hsiSaturation, qreal intensity, qreal hsySaturation, qreal luma)
 -1, if unaffected
 
void update ()
 request for repaint, for instance, if the hue changes.
 
- Protected Attributes inherited from KisColorSelectorComponent
KoGamutMaskSP m_currentGamutMask
 
bool m_gamutMaskOn {false}
 
qreal m_hsiSaturation {0.0}
 
qreal m_hslSaturation {0.0}
 
qreal m_hsvSaturation {0.0}
 
qreal m_hsySaturation {0.0}
 
qreal m_hue {0.0}
 
qreal m_intensity {0.0}
 
qreal m_lastX {0.0}
 
qreal m_lastY {0.0}
 
qreal m_lightness {0.0}
 
qreal m_luma {0.0}
 
bool m_maskPreviewActive {false}
 
Parameter m_parameter
 
KisColorSelectorm_parent {0}
 
Type m_type
 
qreal m_value {0.0}
 
int m_x {0}
 
int m_y {0}
 

Detailed Description

Definition at line 23 of file kis_color_selector_simple.h.

Constructor & Destructor Documentation

◆ KisColorSelectorSimple()

KisColorSelectorSimple::KisColorSelectorSimple ( KisColorSelector * parent)
explicit

Definition at line 19 of file kis_color_selector_simple.cpp.

19 :
21 m_lastClickPos(-1,-1)
22{
23}
KisColorSelectorComponent(KisColorSelector *parent)

Member Function Documentation

◆ colorAt()

KoColor KisColorSelectorSimple::colorAt ( float x,
float y )
private

Definition at line 323 of file kis_color_selector_simple.cpp.

324{
325 qreal xRel = x/qreal(width());
326 qreal yRel = 1.-y/qreal(height());
327 qreal relPos;
328 if(height()>width())
329 relPos = 1.-y/qreal(height());
330 else
331 relPos = x/qreal(width());
332
334
335 switch(m_parameter) {
337 color = m_parent->converter()->fromHslF(m_hue, xRel, yRel);
338 break;
340 color = m_parent->converter()->fromHsvF(m_hue, xRel, yRel);
341 break;
343 color = m_parent->converter()->fromHsvF(m_hue, xRel, xRel + (1.0-xRel)*yRel);
344 break;
346 color = m_parent->converter()->fromHsiF(m_hue, xRel, yRel);
347 break;
349 color = m_parent->converter()->fromHsyF(m_hue, xRel, yRel, R, G, B, Gamma);
350 break;
352 color = m_parent->converter()->fromHsvF(xRel, yRel, m_value);
353 break;
355 color = m_parent->converter()->fromHslF(xRel, yRel, m_lightness);
356 break;
358 color = m_parent->converter()->fromHsiF(xRel, yRel, m_intensity);
359 break;
361 color = m_parent->converter()->fromHsyF(xRel, yRel, m_luma, R, G, B, Gamma);
362 break;
364 color = m_parent->converter()->fromHsvF(xRel, m_hsvSaturation, yRel);
365 break;
367 color = m_parent->converter()->fromHslF(xRel, m_hslSaturation, yRel);
368 break;
370 color = m_parent->converter()->fromHsiF(xRel, m_hsiSaturation, yRel);
371 break;
373 color = m_parent->converter()->fromHsyF(xRel, m_hsySaturation, yRel, R, G, B, Gamma);
374 break;
376 color = m_parent->converter()->fromHsvF(relPos, 1, 1);
377 break;
379 color = m_parent->converter()->fromHsyF(relPos, 1, m_luma, R, G, B, Gamma);
380 break;
382 color = m_parent->converter()->fromHsvF(m_hue, relPos, m_value);
383 break;
385 color = m_parent->converter()->fromHslF(m_hue, relPos, m_lightness);
386 break;
388 color = m_parent->converter()->fromHsvF(m_hue, m_hsvSaturation, relPos);
389 break;
391 color = m_parent->converter()->fromHslF(m_hue, m_hslSaturation, relPos);
392 break;
394 color = m_parent->converter()->fromHsiF(m_hue, relPos, m_intensity);
395 break;
397 color = m_parent->converter()->fromHsiF(m_hue, m_hsiSaturation, relPos);
398 break;
400 color = m_parent->converter()->fromHsyF(m_hue, relPos, m_luma, R, G, B, Gamma);
401 break;
403 color = m_parent->converter()->fromHsyF(m_hue, m_hsySaturation, relPos, R, G, B, Gamma);
404 break;
405 default:
406 Q_ASSERT(false);
407
408 return color;
409 }
410
411 return color;
412}
KisDisplayColorConverter * converter() const
const KoColorSpace * colorSpace() const
KoColor fromHsiF(qreal h, qreal s, qreal i)
KoColor fromHslF(qreal h, qreal s, qreal l, qreal a=1.0)
KoColor fromHsyF(qreal h, qreal s, qreal y, qreal R=0.2126, qreal G=0.7152, qreal B=0.0722, qreal gamma=2.2)
KoColor fromHsvF(qreal h, qreal s, qreal v, qreal a=1.0)
static KoColor createTransparent(const KoColorSpace *cs)
Definition KoColor.cpp:681

References B, KisColorSelectorBase::colorSpace(), KisColorSelectorBase::converter(), KoColor::createTransparent(), KisDisplayColorConverter::fromHsiF(), KisDisplayColorConverter::fromHslF(), KisDisplayColorConverter::fromHsvF(), KisDisplayColorConverter::fromHsyF(), G, KisColorSelectorConfiguration::H, KisColorSelectorComponent::height(), KisColorSelectorConfiguration::Hluma, KisColorSelectorConfiguration::hsiS, KisColorSelectorConfiguration::hsiSH, KisColorSelectorConfiguration::hslS, KisColorSelectorConfiguration::hslSH, KisColorSelectorConfiguration::hsvS, KisColorSelectorConfiguration::hsvSH, KisColorSelectorConfiguration::hsyS, KisColorSelectorConfiguration::hsySH, KisColorSelectorConfiguration::I, KisColorSelectorConfiguration::IH, KisColorSelectorConfiguration::L, KisColorSelectorConfiguration::LH, KisColorSelectorComponent::m_hsiSaturation, KisColorSelectorComponent::m_hslSaturation, KisColorSelectorComponent::m_hsvSaturation, KisColorSelectorComponent::m_hsySaturation, KisColorSelectorComponent::m_hue, KisColorSelectorComponent::m_intensity, KisColorSelectorComponent::m_lightness, KisColorSelectorComponent::m_luma, KisColorSelectorComponent::m_parameter, KisColorSelectorComponent::m_parent, KisColorSelectorComponent::m_value, R, KisColorSelectorConfiguration::SI, KisColorSelectorConfiguration::SL, KisColorSelectorConfiguration::SV, KisColorSelectorConfiguration::SV2, KisColorSelectorConfiguration::SY, KisColorSelectorConfiguration::V, KisColorSelectorConfiguration::VH, KisColorSelectorComponent::width(), KisColorSelectorConfiguration::Y, and KisColorSelectorConfiguration::YH.

◆ paint()

void KisColorSelectorSimple::paint ( QPainter * )
overrideprotectedvirtual

paint component using given painter the component should respect width() and height() (eg. scale to width and height), but doesn't have to care about x/y coordinates (top left corner)

Implements KisColorSelectorComponent.

Definition at line 254 of file kis_color_selector_simple.cpp.

255{
256 if(isDirty()) {
257 KisPaintDeviceSP realPixelCache;
258 QPoint pixelCacheOffset;
261 QRect(0, 0, width(), height()),
262 realPixelCache,
264 pixelCacheOffset,
265 painter->device()->devicePixelRatioF());
266
267// if (!pixelCacheOffset.isNull()) {
268// warnKrita << "WARNING: offset of the rectangle selector is not null!";
269// }
270 }
271
272 painter->drawImage(0,0, m_pixelCache);
273
274 // draw blip
275 if(m_lastClickPos!=QPointF(-1,-1) && m_parent->displayBlip()) {
276 switch (m_parameter) {
287 if(width()>height()) {
288 painter->setPen(QColor(0,0,0));
289 painter->drawLine(m_lastClickPos.x()*width()-1, 0, m_lastClickPos.x()*width()-1, height());
290 painter->setPen(QColor(255,255,255));
291 painter->drawLine(m_lastClickPos.x()*width()+1, 0, m_lastClickPos.x()*width()+1, height());
292 }
293 else {
294 painter->setPen(QColor(0,0,0));
295 painter->drawLine(0, m_lastClickPos.x()*height()-1, width(), m_lastClickPos.x()*height()-1);
296 painter->setPen(QColor(255,255,255));
297 painter->drawLine(0, m_lastClickPos.x()*height()+1, width(), m_lastClickPos.x()*height()+1);
298 }
299 break;
313 painter->setPen(QColor(0,0,0));
314 painter->drawEllipse(m_lastClickPos.x()*width()-5, m_lastClickPos.y()*height()-5, 10, 10);
315 painter->setPen(QColor(255,255,255));
316 painter->drawEllipse(m_lastClickPos.x()*width()-4, m_lastClickPos.y()*height()-4, 8, 8);
317 break;
318 }
319
320 }
321}
static void render(Sampler *sampler, const KisDisplayColorConverter *converter, const QRect &sampleRect, KisPaintDeviceSP &realPixelCache, QImage &pixelCache, QPoint &pixelCacheOffset, qreal devicePixelRatioF)
bool isDirty() const
returns true, if ether the color space, the size or the parameters have changed since the last paint ...
bool displayBlip() const

References KisColorSelectorBase::converter(), KisColorSelector::displayBlip(), KisColorSelectorConfiguration::H, KisColorSelectorComponent::height(), KisColorSelectorConfiguration::Hluma, KisColorSelectorConfiguration::hsiS, KisColorSelectorConfiguration::hsiSH, KisColorSelectorConfiguration::hslS, KisColorSelectorConfiguration::hslSH, KisColorSelectorConfiguration::hsvS, KisColorSelectorConfiguration::hsvSH, KisColorSelectorConfiguration::hsyS, KisColorSelectorConfiguration::hsySH, KisColorSelectorConfiguration::I, KisColorSelectorConfiguration::IH, KisColorSelectorComponent::isDirty(), KisColorSelectorConfiguration::L, KisColorSelectorConfiguration::LH, m_lastClickPos, KisColorSelectorComponent::m_parameter, KisColorSelectorComponent::m_parent, m_pixelCache, Acs::PixelCacheRenderer::render(), KisColorSelectorConfiguration::SI, KisColorSelectorConfiguration::SL, KisColorSelectorConfiguration::SV, KisColorSelectorConfiguration::SV2, KisColorSelectorConfiguration::SY, KisColorSelectorConfiguration::V, KisColorSelectorConfiguration::VH, KisColorSelectorComponent::width(), KisColorSelectorConfiguration::Y, and KisColorSelectorConfiguration::YH.

◆ selectColor()

KoColor KisColorSelectorSimple::selectColor ( int x,
int y )
overrideprotectedvirtual

this method must be overloaded to return the color at position x/y and draw a marker on that position

Implements KisColorSelectorComponent.

Definition at line 25 of file kis_color_selector_simple.cpp.

26{
27 m_lastClickPos.setX(x/qreal(width()));
28 m_lastClickPos.setY(y/qreal(height()));
29
30 qreal xRel = x/qreal(width());
31 qreal yRel = 1.-y/qreal(height());
32 qreal relPos;
33 if(height()>width())
34 relPos = 1.-y/qreal(height());
35 else
36 relPos = x/qreal(width());
37
38 switch (m_parameter) {
40 Q_EMIT paramChanged(relPos, -1, -1, -1, -1, -1, -1, -1, -1);
41 break;
43 Q_EMIT paramChanged(relPos, -1, -1, -1, -1, -1, -1, -1, -1);
44 break;
46 Q_EMIT paramChanged(-1, relPos, -1, -1, -1, -1, -1, -1, -1);
47 break;
49 Q_EMIT paramChanged(-1, -1, -1, relPos, -1, -1, -1, -1, -1);
50 break;
52 Q_EMIT paramChanged(-1, -1, -1, -1, -1, relPos, -1, -1, -1);
53 break;
55 Q_EMIT paramChanged(-1, -1, -1, -1, -1, -1, -1, relPos, -1);
56 break;
58 Q_EMIT paramChanged(-1, -1, relPos, -1, -1, -1, -1, -1, -1);
59 break;
61 Q_EMIT paramChanged(-1, -1, -1, -1, relPos, -1, -1, -1, -1);
62 break;
64 Q_EMIT paramChanged(-1, -1, -1, -1, -1, -1, relPos, -1, -1);
65 break;
67 Q_EMIT paramChanged(-1, -1, -1, -1, -1, -1, -1, -1, relPos);
68 break;
70 Q_EMIT paramChanged(-1, -1, -1, xRel, yRel, -1, -1, -1, -1);
71 break;
73 Q_EMIT paramChanged(-1, -1, -1, -1, -1, xRel, yRel, -1, -1);
74 break;
76 Q_EMIT paramChanged(-1, -1, -1, -1, -1, -1, -1, xRel, yRel);
77 break;
80 Q_EMIT paramChanged(-1, xRel, yRel, -1, -1, -1, -1, -1, -1);
81 break;
83 Q_EMIT paramChanged(xRel, yRel, -1, -1, -1, -1, -1, -1, -1);
84 break;
86 Q_EMIT paramChanged(xRel, -1, -1, yRel, -1, -1, -1, -1, -1);
87 break;
89 Q_EMIT paramChanged(xRel, -1, -1, -1, -1, yRel, -1, -1, -1);
90 break;
92 Q_EMIT paramChanged(xRel, -1, -1, -1, -1, -1, -1, yRel, -1);
93 break;
95 Q_EMIT paramChanged(xRel, -1, yRel, -1, -1, -1, -1, -1, -1);
96 break;
98 Q_EMIT paramChanged(xRel, -1, -1, -1, yRel, -1, -1, -1, -1);
99 break;
101 Q_EMIT paramChanged(xRel, -1, -1, -1, -1, -1, yRel, -1, -1);
102 break;
104 Q_EMIT paramChanged(xRel, -1, -1, -1, -1, -1, -1, -1, yRel);
105 break;
106 }
107
108 Q_EMIT update();
109 return colorAt(x, y);
110}
void update()
request for repaint, for instance, if the hue changes.
void paramChanged(qreal hue, qreal hsvSaturation, qreal value, qreal hslSaturation, qreal lightness, qreal hsiSaturation, qreal intensity, qreal hsySaturation, qreal luma)
-1, if unaffected
KoColor colorAt(float x, float y)

References colorAt(), KisColorSelectorConfiguration::H, KisColorSelectorComponent::height(), KisColorSelectorConfiguration::Hluma, KisColorSelectorConfiguration::hsiS, KisColorSelectorConfiguration::hsiSH, KisColorSelectorConfiguration::hslS, KisColorSelectorConfiguration::hslSH, KisColorSelectorConfiguration::hsvS, KisColorSelectorConfiguration::hsvSH, KisColorSelectorConfiguration::hsyS, KisColorSelectorConfiguration::hsySH, KisColorSelectorConfiguration::I, KisColorSelectorConfiguration::IH, KisColorSelectorConfiguration::L, KisColorSelectorConfiguration::LH, m_lastClickPos, KisColorSelectorComponent::m_parameter, KisColorSelectorComponent::paramChanged(), KisColorSelectorConfiguration::SI, KisColorSelectorConfiguration::SL, KisColorSelectorConfiguration::SV, KisColorSelectorConfiguration::SV2, KisColorSelectorConfiguration::SY, KisColorSelectorComponent::update(), KisColorSelectorConfiguration::V, KisColorSelectorConfiguration::VH, KisColorSelectorComponent::width(), KisColorSelectorConfiguration::Y, and KisColorSelectorConfiguration::YH.

◆ setColor()

void KisColorSelectorSimple::setColor ( const KoColor & color)
overridevirtual

set the color, blibs etc

Reimplemented from KisColorSelectorComponent.

Definition at line 112 of file kis_color_selector_simple.cpp.

113{
114 qreal hsvH, hsvS, hsvV;
115 qreal hslH, hslS, hslL;
116 qreal hsiH, hsiS, hsiI;
117 qreal hsyH, hsyS, hsyY;
118 KConfigGroup cfg = KSharedConfig::openConfig()->group("advancedColorSelector");
119 R = cfg.readEntry("lumaR", 0.2126);
120 G = cfg.readEntry("lumaG", 0.7152);
121 B = cfg.readEntry("lumaB", 0.0722);
122 Gamma = cfg.readEntry("gamma", 2.2);
123 m_parent->converter()->getHsvF(color, &hsvH, &hsvS, &hsvV);
124 m_parent->converter()->getHslF(color, &hslH, &hslS, &hslL);
125 //here we add our converter options
126 m_parent->converter()->getHsiF(color, &hsiH, &hsiS, &hsiI);
127 m_parent->converter()->getHsyF(color, &hsyH, &hsyS, &hsyY, R, G, B, Gamma);
128
129 switch (m_parameter) {
131 m_lastClickPos.setX(hslS);
132 m_lastClickPos.setY(1 - hslL);
133 Q_EMIT paramChanged(-1, -1, -1, hslS, hslL, -1, -1, -1, -1);
134 break;
136 m_lastClickPos.setX(hsiS);
137 m_lastClickPos.setY(1 - hsiI);
138 Q_EMIT paramChanged(-1, -1, -1, -1, -1, hsiS, hsiI, -1, -1);
139 break;
141 m_lastClickPos.setX(hsyS);
142 m_lastClickPos.setY(1 - hsyY);
143 Q_EMIT paramChanged(-1, -1, -1, -1, -1, -1, -1, hsyS, hsyY);
144 break;
146 m_lastClickPos.setX(qBound<qreal>(0., hslH, 1.));
147 m_lastClickPos.setY(1 - hslL);
148 Q_EMIT paramChanged(hslH, -1, -1, -1, hslL, -1, -1, -1, -1);
149 break;
151 m_lastClickPos.setX(hsvS);
152 m_lastClickPos.setY(1 - hsvV);
153 Q_EMIT paramChanged(-1, hsvS, hsvV, -1, -1, -1, -1, -1, -1);
154 break;
156 qreal xRel = hsvS;
157 qreal yRel = 0.5;
158
159 if(xRel != 1.0)
160 yRel = 1.0 - qBound<qreal>(0.0, (hsvV - xRel) / (1.0 - xRel), 1.0);
161
162 m_lastClickPos.setX(xRel);
163 m_lastClickPos.setY(yRel);
164 Q_EMIT paramChanged(-1, -1, -1, xRel, yRel, -1, -1, -1, -1);
165 break;
166 }
168 m_lastClickPos.setX(qBound<qreal>(0., hsvH, 1.));
169 m_lastClickPos.setY(1 - hsvV);
170 Q_EMIT paramChanged(hsvH, -1, hsvV, -1, -1, -1, -1, -1, -1);
171 break;
173 m_lastClickPos.setX(qBound<qreal>(0., hsiH, 1.));
174 m_lastClickPos.setY(1 - hsiI);
175 Q_EMIT paramChanged(hsiH, -1, -1, -1, -1, -1, hsiI, -1, -1);
176 break;
178 m_lastClickPos.setX(qBound<qreal>(0., hsyH, 1.));
179 m_lastClickPos.setY(1 - hsyY);
180 Q_EMIT paramChanged(hsyH, -1, -1, -1, -1, -1, -1, -1, hsyY);
181 break;
183 m_lastClickPos.setX(qBound<qreal>(0., hsvH, 1.));
184 m_lastClickPos.setY(1 - hsvS);
185 Q_EMIT paramChanged(hsvH, hsvS, -1, -1, -1, -1, -1, -1, -1);
186 break;
188 m_lastClickPos.setX(qBound<qreal>(0., hslH, 1.));
189 m_lastClickPos.setY(1 - hslS);
190 Q_EMIT paramChanged(hslH, -1, -1, hslS, -1, -1, -1, -1, -1);
191 break;
192
194 m_lastClickPos.setX(qBound<qreal>(0., hsiH, 1.));
195 m_lastClickPos.setY(1 - hsiS);
196 Q_EMIT paramChanged(hsiH, -1, -1, hsiS, -1, -1, -1, -1, -1);
197 break;
198
200 m_lastClickPos.setX(qBound<qreal>(0., hsyH, 1.));
201 m_lastClickPos.setY(1 - hsyS);
202 Q_EMIT paramChanged(hsyH, -1, -1, -1, -1, -1, -1, hsyS, -1);
203 break;
205 m_lastClickPos.setX(qBound<qreal>(0., hslL, 1.));
206 Q_EMIT paramChanged(-1, -1, -1, -1, hslL, -1, -1, -1, -1);
207 break;
209 m_lastClickPos.setX(qBound<qreal>(0., hsiI, 1.));
210 Q_EMIT paramChanged(-1, -1, -1, -1, -1, -1, hsiI, -1, -1);
211 break;
213 m_lastClickPos.setX(hsvV);
214 Q_EMIT paramChanged(-1, -1, hsvV, -1, -1, -1, -1, -1, -1);
215 break;
217 m_lastClickPos.setX(qBound<qreal>(0., hsyY, 1.));
218 Q_EMIT paramChanged(-1, -1, -1, -1, -1, -1, -1, -1, hsyY);
219 break;
221 m_lastClickPos.setX( hsvS );
222 Q_EMIT paramChanged(-1, hsvS, -1, -1, -1, -1, -1, -1, -1);
223 break;
225 m_lastClickPos.setX( hslS );
226 Q_EMIT paramChanged(-1, -1, -1, hslS, -1, -1, -1, -1, -1);
227 break;
229 m_lastClickPos.setX( hsiS );
230 Q_EMIT paramChanged(-1, -1, -1, -1, -1, hsiS, -1, -1, -1);
231 break;
233 m_lastClickPos.setX( hsyS );
234 Q_EMIT paramChanged(-1, -1, -1, -1, -1, -1, -1, hsyS, -1);
235 break;
237 m_lastClickPos.setX(qBound<qreal>(0., hsvH, 1.));
238 Q_EMIT paramChanged(hsvH, -1, -1, -1, -1, -1, -1, -1, -1);
239 break;
241 m_lastClickPos.setX(qBound<qreal>(0., hsyH, 1.));
242 Q_EMIT paramChanged(hsyH, -1, -1, -1, -1, -1, -1, -1, -1);
243 break;
244 default:
245 Q_ASSERT(false);
246 break;
247 }
248 Q_EMIT update();
249 //Workaround for bug 317648
252}
virtual void setColor(const KoColor &color)
set the color, blibs etc
void getHslF(const KoColor &srcColor, qreal *h, qreal *s, qreal *l, qreal *a=0)
void getHsiF(const KoColor &srcColor, qreal *h, qreal *s, qreal *i)
void getHsyF(const KoColor &srcColor, qreal *h, qreal *s, qreal *y, qreal R=0.2126, qreal G=0.7152, qreal B=0.0722, qreal gamma=2.2)
void getHsvF(const KoColor &srcColor, qreal *h, qreal *s, qreal *v, qreal *a=0)

References B, KisColorSelectorBase::converter(), G, KisDisplayColorConverter::getHsiF(), KisDisplayColorConverter::getHslF(), KisDisplayColorConverter::getHsvF(), KisDisplayColorConverter::getHsyF(), KisColorSelectorConfiguration::H, KisColorSelectorComponent::height(), KisColorSelectorConfiguration::Hluma, KisColorSelectorConfiguration::hsiS, KisColorSelectorConfiguration::hsiSH, KisColorSelectorConfiguration::hslS, KisColorSelectorConfiguration::hslSH, KisColorSelectorConfiguration::hsvS, KisColorSelectorConfiguration::hsvSH, KisColorSelectorConfiguration::hsyS, KisColorSelectorConfiguration::hsySH, KisColorSelectorConfiguration::I, KisColorSelectorConfiguration::IH, KisColorSelectorConfiguration::L, KisColorSelectorConfiguration::LH, m_lastClickPos, KisColorSelectorComponent::m_parameter, KisColorSelectorComponent::m_parent, KisColorSelectorComponent::paramChanged(), R, KisColorSelectorComponent::setColor(), KisColorSelectorComponent::setLastMousePosition(), KisColorSelectorConfiguration::SI, KisColorSelectorConfiguration::SL, KisColorSelectorConfiguration::SV, KisColorSelectorConfiguration::SV2, KisColorSelectorConfiguration::SY, KisColorSelectorComponent::update(), KisColorSelectorConfiguration::V, KisColorSelectorConfiguration::VH, KisColorSelectorComponent::width(), KisColorSelectorConfiguration::Y, and KisColorSelectorConfiguration::YH.

Friends And Related Symbol Documentation

◆ Acs::PixelCacheRenderer

friend class Acs::PixelCacheRenderer
friend

Definition at line 35 of file kis_color_selector_simple.h.

Member Data Documentation

◆ B

qreal KisColorSelectorSimple::B {0.0}
private

Definition at line 43 of file kis_color_selector_simple.h.

43{0.0};

◆ G

qreal KisColorSelectorSimple::G {0.0}
private

Definition at line 42 of file kis_color_selector_simple.h.

42{0.0};

◆ Gamma

qreal KisColorSelectorSimple::Gamma {0.0}
private

Definition at line 44 of file kis_color_selector_simple.h.

44{0.0};

◆ m_lastClickPos

QPointF KisColorSelectorSimple::m_lastClickPos
private

Definition at line 39 of file kis_color_selector_simple.h.

◆ m_pixelCache

QImage KisColorSelectorSimple::m_pixelCache
private

Definition at line 40 of file kis_color_selector_simple.h.

◆ R

qreal KisColorSelectorSimple::R {0.0}
private

Definition at line 41 of file kis_color_selector_simple.h.

41{0.0};

The documentation for this class was generated from the following files: