#include <kis_color_selector_component.h>
|
| void | setParam (qreal hue, qreal hsvSaturation, qreal value, qreal hslSaturation, qreal lightness, qreal hsiSaturation, qreal intensity, qreal hsySaturation, qreal luma) |
| |
|
| 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.
|
| |
|
| 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 *) |
| |
| virtual void | setColor (const KoColor &color) |
| | set the color, blibs etc
|
| |
| 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 |
| |
◆ Parameter
◆ Type
◆ KisColorSelectorComponent()
| KisColorSelectorComponent::KisColorSelectorComponent |
( |
KisColorSelector * | parent | ) |
|
|
explicit |
Definition at line 17 of file kis_color_selector_component.cpp.
17 :
18 QObject(parent),
40{
41 Q_ASSERT(parent);
42}
const KoColorSpace * m_lastColorSpace
KisColorSelector * m_parent
KoGamutMaskSP m_currentGamutMask
◆ allowsColorSelectionAtPoint()
| bool KisColorSelectorComponent::allowsColorSelectionAtPoint |
( |
const QPoint & | | ) |
const |
|
protectedvirtual |
a subclass can implement this method to note that the point, although it is in containsPointInComponentCoords area, still cannot be selected as a color (e.g. it is masked out). Default implementation always returns true.
Reimplemented in KisColorSelectorWheel.
Definition at line 128 of file kis_color_selector_component.cpp.
129{
130 return true;
131}
◆ colorSpace()
| const KoColorSpace * KisColorSelectorComponent::colorSpace |
( |
| ) |
const |
|
protected |
◆ containsPointInComponentCoords()
| bool KisColorSelectorComponent::containsPointInComponentCoords |
( |
int | x, |
|
|
int | y ) const |
|
protectedvirtual |
◆ currentColor()
| KoColor KisColorSelectorComponent::currentColor |
( |
| ) |
|
return the color, that was selected by calling mouseEvent
Definition at line 133 of file kis_color_selector_component.cpp.
134{
136}
virtual KoColor selectColor(int x, int y)=0
this method must be overloaded to return the color at position x/y and draw a marker on that position
References m_lastX, m_lastY, and selectColor().
◆ height()
| int KisColorSelectorComponent::height |
( |
| ) |
const |
◆ isDirty()
| bool KisColorSelectorComponent::isDirty |
( |
| ) |
const |
|
protected |
◆ mouseEvent()
| void KisColorSelectorComponent::mouseEvent |
( |
int | x, |
|
|
int | y ) |
|
virtual |
saves the mouse position, so that a blip can be created.
Definition at line 64 of file kis_color_selector_component.cpp.
65{
66 int newX=qBound(0, (x-
m_x),
width());
68
73 }
74}
virtual bool allowsColorSelectionAtPoint(const QPoint &) const
KoColor m_lastSelectedColor
References allowsColorSelectionAtPoint(), height(), m_lastSelectedColor, m_lastX, m_lastY, m_x, m_y, selectColor(), and width().
◆ paint()
| virtual void KisColorSelectorComponent::paint |
( |
QPainter * | | ) |
|
|
protectedpure virtual |
◆ paintEvent()
| void KisColorSelectorComponent::paintEvent |
( |
QPainter * | painter | ) |
|
◆ paramChanged
| void KisColorSelectorComponent::paramChanged |
( |
qreal | hue, |
|
|
qreal | hsvSaturation, |
|
|
qreal | value, |
|
|
qreal | hslSaturation, |
|
|
qreal | lightness, |
|
|
qreal | hsiSaturation, |
|
|
qreal | intensity, |
|
|
qreal | hsySaturation, |
|
|
qreal | luma ) |
|
signal |
◆ selectColor()
| virtual KoColor KisColorSelectorComponent::selectColor |
( |
int | x, |
|
|
int | y ) |
|
protectedpure virtual |
◆ setColor()
| void KisColorSelectorComponent::setColor |
( |
const KoColor & | color | ) |
|
|
virtual |
◆ setConfiguration()
◆ setDirty()
| void KisColorSelectorComponent::setDirty |
( |
| ) |
|
◆ setGamutMask()
◆ setGeometry()
| void KisColorSelectorComponent::setGeometry |
( |
int | x, |
|
|
int | y, |
|
|
int | width, |
|
|
int | height ) |
◆ setLastMousePosition()
| void KisColorSelectorComponent::setLastMousePosition |
( |
int | x, |
|
|
int | y ) |
|
protected |
◆ setParam
| void KisColorSelectorComponent::setParam |
( |
qreal | hue, |
|
|
qreal | hsvSaturation, |
|
|
qreal | value, |
|
|
qreal | hslSaturation, |
|
|
qreal | lightness, |
|
|
qreal | hsiSaturation, |
|
|
qreal | intensity, |
|
|
qreal | hsySaturation, |
|
|
qreal | luma ) |
|
slot |
set hue, saturation, value or/and lightness unused parameters should be set to -1
Definition at line 138 of file kis_color_selector_component.cpp.
139{
149 return;
150
151 if (hue >= 0) {
152 m_hue = qMin(hue, qreal(1));
153 }
154
155 if (hsvSaturation >= 0) {
160 }
161
167 }
168
169 if (hslSaturation >= 0) {
174 }
175
176 if (lightness >= 0) {
181 }
182
183 if (hsiSaturation >= 0) {
188 }
189
190 if (intensity >= 0) {
195 }
196
197 if (hsySaturation >= 0) {
202 }
203
204 if (luma >= 0) {
205 m_luma = qMin(luma, qreal(1));
209 }
210
213}
float value(const T *src, size_t ch)
void update()
request for repaint, for instance, if the hue changes.
static bool qFuzzyCompare(half p1, half p2)
References m_dirty, m_hsiSaturation, m_hslSaturation, m_hsvSaturation, m_hsySaturation, m_hue, m_intensity, m_lightness, m_luma, m_value, qFuzzyCompare(), update(), and value().
◆ toggleGamutMask()
| void KisColorSelectorComponent::toggleGamutMask |
( |
bool | state | ) |
|
◆ unsetGamutMask()
| void KisColorSelectorComponent::unsetGamutMask |
( |
| ) |
|
◆ update
| void KisColorSelectorComponent::update |
( |
| ) |
|
|
signal |
request for repaint, for instance, if the hue changes.
◆ updateGamutMaskPreview()
| void KisColorSelectorComponent::updateGamutMaskPreview |
( |
| ) |
|
◆ wantsGrab()
| bool KisColorSelectorComponent::wantsGrab |
( |
int | x, |
|
|
int | y ) |
|
inline |
◆ width()
| int KisColorSelectorComponent::width |
( |
| ) |
const |
◆ m_currentGamutMask
◆ m_dirty
| bool KisColorSelectorComponent::m_dirty {false} |
|
private |
◆ m_gamutMaskOn
| bool KisColorSelectorComponent::m_gamutMaskOn {false} |
|
protected |
◆ m_height
| int KisColorSelectorComponent::m_height {0} |
|
private |
◆ m_hsiSaturation
| qreal KisColorSelectorComponent::m_hsiSaturation {0.0} |
|
protected |
◆ m_hslSaturation
| qreal KisColorSelectorComponent::m_hslSaturation {0.0} |
|
protected |
◆ m_hsvSaturation
| qreal KisColorSelectorComponent::m_hsvSaturation {0.0} |
|
protected |
◆ m_hsySaturation
| qreal KisColorSelectorComponent::m_hsySaturation {0.0} |
|
protected |
◆ m_hue
| qreal KisColorSelectorComponent::m_hue {0.0} |
|
protected |
◆ m_intensity
| qreal KisColorSelectorComponent::m_intensity {0.0} |
|
protected |
◆ m_lastColorSpace
| const KoColorSpace* KisColorSelectorComponent::m_lastColorSpace {0} |
|
private |
◆ m_lastSelectedColor
| KoColor KisColorSelectorComponent::m_lastSelectedColor |
|
private |
◆ m_lastX
| qreal KisColorSelectorComponent::m_lastX {0.0} |
|
protected |
◆ m_lastY
| qreal KisColorSelectorComponent::m_lastY {0.0} |
|
protected |
◆ m_lightness
| qreal KisColorSelectorComponent::m_lightness {0.0} |
|
protected |
◆ m_luma
| qreal KisColorSelectorComponent::m_luma {0.0} |
|
protected |
◆ m_maskPreviewActive
| bool KisColorSelectorComponent::m_maskPreviewActive {false} |
|
protected |
◆ m_parameter
| Parameter KisColorSelectorComponent::m_parameter |
|
protected |
◆ m_parent
◆ m_type
| Type KisColorSelectorComponent::m_type |
|
protected |
◆ m_value
| qreal KisColorSelectorComponent::m_value {0.0} |
|
protected |
◆ m_width
| int KisColorSelectorComponent::m_width {0} |
|
private |
◆ m_x
| int KisColorSelectorComponent::m_x {0} |
|
protected |
◆ m_y
| int KisColorSelectorComponent::m_y {0} |
|
protected |
The documentation for this class was generated from the following files: