Krita Source Code Documentation
Loading...
Searching...
No Matches
KisVisualColorSelector.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Wolthera van Hovell tot Westerflier <griffinvalley@gmail.com>
3 * SPDX-FileCopyrightText: 2022 Mathias Wein <lynx.mw+kde@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7#ifndef KIS_VISUAL_COLOR_SELECTOR_H
8#define KIS_VISUAL_COLOR_SELECTOR_H
9
10#include <QWidget>
11#include <QScopedPointer>
12
14
16#include "KisVisualColorModel.h"
17#include "kritawidgets_export.h"
18
19class QVector4D;
21
30class KRITAWIDGETS_EXPORT KisVisualColorSelector : public KisColorSelectorInterface
31{
32 Q_OBJECT
33public:
34
38 CompositeBackground
39 };
40
46 explicit KisVisualColorSelector(QWidget *parent = 0, KisVisualColorModelSP model = KisVisualColorModelSP());
47 ~KisVisualColorSelector() override;
48
49 QSize minimumSizeHint() const override;
50 void setSelectorModel(KisVisualColorModelSP model);
51 KisVisualColorModelSP selectorModel() const;
59 void setConfig(bool forceCircular, bool forceSelfUpdate) override;
60 const KisColorSelectorConfiguration& configuration() const;
70 void setConfiguration(const KisColorSelectorConfiguration *config);
71 void setAcceptTabletEvents(bool on);
72 KoColor getCurrentColor() const override;
73 void setMinimumSliderWidth(int width);
74 const KoColorDisplayRendererInterface* displayRenderer() const;
75 RenderMode renderMode() const;
76 void setRenderMode(RenderMode mode);
84 bool autoAdjustExposure() const;
85 void setAutoAdjustExposure(bool enabled);
86 bool proofColors() const;
87 void setProofColors(bool enabled);
92 void setSliderPosition(Qt::Edge edge);
93 KoGamutMask* activeGamutMask() const;
94
95public Q_SLOTS:
96 void slotSetColor(const KoColor &c) override;
97 void slotSetColorSpace(const KoColorSpace *cs) override;
98 void slotConfigurationChanged();
99 void setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer) override;
100 void slotGamutMaskChanged(KoGamutMaskSP mask);
101 void slotGamutMaskUnset();
102 void slotGamutMaskPreviewUpdate();
103
104private Q_SLOTS:
105 void slotChannelValuesChanged(const QVector4D &values, quint32 channelFlags);
106 void slotColorModelChanged();
107 void slotColorSpaceChanged();
108 void slotCursorMoved(QPointF pos);
109 void slotDisplayConfigurationChanged();
110 void slotReloadConfiguration();
111
112Q_SIGNALS:
118 void sigInteraction(bool active);
124 void sigGamutMaskSupportChanged(bool supported);
125
126protected:
127 void resizeEvent(QResizeEvent *) override;
128
129private:
130 bool useHorizontalSlider();
131 void rebuildSelector();
132 void loadACSConfig();
133 void switchDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer);
134 QVector4D calculateMaxChannelValues();
135 static KisColorSelectorConfiguration validatedConfiguration(const KisColorSelectorConfiguration &cfg);
136
137 struct Private;
138 const QScopedPointer<Private> m_d;
139};
140
141#endif // KIS_VISUAL_COLOR_SELECTOR_H
QSharedPointer< KisVisualColorModel > KisVisualColorModelSP
virtual void slotSetColor(const KoColor &c)=0
virtual void slotSetColorSpace(const KoColorSpace *cs)
slotSetColorSpace Set the color space the selector should cover
virtual void setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer)
virtual void setConfig(bool forceCircular, bool forceSelfUpdate)
virtual KoColor getCurrentColor() const =0
The KisVisualColorSelector class.
const QScopedPointer< Private > m_d
void sigInteraction(bool active)
sigInteraction is emitted whenever mouse interaction status changes
void sigGamutMaskSupportChanged(bool supported)
sigGamutMaskSupportChanged Signals whether gamut masks are supported by the current selector shape.
The resource type for gamut masks used by the artistic color selector.
Definition KoGamutMask.h:44