File indexing completed on 2024-06-09 04:26:51
0001 /* 0002 * SPDX-FileCopyrightText: 2008 Cyrille Berger <cberger@cberger.net> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef _KIS_SMALL_COLOR_WIDGET_H_ 0008 #define _KIS_SMALL_COLOR_WIDGET_H_ 0009 0010 #include <QWidget> 0011 0012 class KoColor; 0013 class KisDisplayColorConverter; 0014 class KisGLImageWidget; 0015 0016 class KisSmallColorWidget : public QWidget 0017 { 0018 Q_OBJECT 0019 public: 0020 KisSmallColorWidget(QWidget* parent); 0021 ~KisSmallColorWidget() override; 0022 public: 0023 void resizeEvent(QResizeEvent * event) override; 0024 0025 void setDisplayColorConverter(KisDisplayColorConverter *converter); 0026 0027 public: 0028 0029 public Q_SLOTS: 0030 void setHue(qreal h); 0031 void setHSV(qreal h, qreal s, qreal v, bool notifyChanged = true); 0032 void setColor(const KoColor &color); 0033 0034 void slotUpdatePalettes(); 0035 void updateSVPalette(); 0036 0037 Q_SIGNALS: 0038 void colorChanged(const KoColor&); 0039 0040 void sigTellColorChangedInternal(); 0041 0042 private Q_SLOTS: 0043 void slotHueSliderChanged(const QPointF &pos); 0044 void slotValueSliderChanged(const QPointF &pos); 0045 void slotInitiateUpdateDynamicRange(int maxLuminance); 0046 void slotDisplayConfigurationChanged(); 0047 void slotTellColorChanged(); 0048 0049 private: 0050 void updateDynamicRange(int maxLuminance); 0051 0052 private: 0053 0054 void updateHuePalette(); 0055 0056 template<class FillPolicy> 0057 void uploadPaletteData(KisGLImageWidget *widget, const QSize &size); 0058 0059 0060 private: 0061 struct Private; 0062 Private* const d; 0063 }; 0064 0065 #endif