File indexing completed on 2024-06-16 04:16:25
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Mathias Wein <lynx.mw+kde@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #ifndef WGCOMMONCOLORSCALCULATIONRUNNER_H 0008 #define WGCOMMONCOLORSCALCULATIONRUNNER_H 0009 0010 #include <kis_types.h> 0011 0012 #include <QImage> 0013 #include <QObject> 0014 #include <QRgb> 0015 #include <QRunnable> 0016 #include <QSharedPointer> 0017 0018 class KoColor; 0019 0020 class WGCommonColorsCalculationRunner : public QObject, public QRunnable 0021 { 0022 Q_OBJECT 0023 public: 0024 WGCommonColorsCalculationRunner(KisImageSP image, int numberOfColors, 0025 QSharedPointer<QVector<KoColor>> colorStore); 0026 0027 0028 void run() override; 0029 void extractColors(); 0030 QList<QRgb> getColors(); 0031 0032 0033 Q_SIGNALS: 0034 void sigDone(); 0035 0036 private: 0037 QImage m_imageData; 0038 int m_numColors; 0039 QSharedPointer<QVector<KoColor>> m_commonColors; 0040 }; 0041 0042 #endif // WGCOMMONCOLORSCALCULATIONRUNNER_H