File indexing completed on 2024-06-16 04:16:01

0001 /*
0002  *  SPDX-License-Identifier: GPL-3.0-or-later
0003  */
0004 
0005 #ifndef KIS_COMMON_COLORS_RECALCULATION_RUNNER_H
0006 #define KIS_COMMON_COLORS_RECALCULATION_RUNNER_H
0007 
0008 #include <QRunnable>
0009 #include <QColor>
0010 #include <QImage>
0011 
0012 class KoColor;
0013 class KisCommonColors;
0014 
0015 
0016 class KisCommonColorsRecalculationRunner : public QRunnable
0017 {
0018 public:
0019     KisCommonColorsRecalculationRunner(QImage data, int numberOfColors, KisCommonColors* parentObj)
0020         : m_imageData(data)
0021         , m_numColors(numberOfColors)
0022         , m_commonColors(parentObj)
0023     {}
0024 
0025     void run() override;
0026     QList<KoColor> extractColors();
0027     QList<QRgb> getColors();
0028 
0029 private:
0030     QImage m_imageData;
0031     int m_numColors;
0032     KisCommonColors* m_commonColors;
0033 };
0034 
0035 #endif // KIS_COMMON_COLORS_RECALCULATION_RUNNER_H