Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAsyncColorSamplerHelper.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2022 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KISASYNCCOLORSAMPLERHELPER_H
8#define KISASYNCCOLORSAMPLERHELPER_H
9
10#include "kritaui_export.h"
11
12#include <QScopedPointer>
13#include <QObject>
14
15#include "kis_types.h"
16
17class QPainter;
18class KoViewConverter;
20class KisCanvas2;
21class KoColor;
22
23class KRITAUI_EXPORT KisAsyncColorSamplerHelper : public QObject
24{
25 Q_OBJECT
26public:
29
30 bool isActive() const;
31
32 void activate(bool sampleCurrentLayer, bool pickFgColor);
33 void deactivate();
34
35 void startAction(const QPointF &docPoint, int radius, int blend);
36 void continueAction(const QPointF &docPoint);
37 void endAction();
38
39 QRectF colorPreviewDocRect(const QPointF &docPoint);
40 void paint(QPainter &gc, const KoViewConverter &converter);
41
42 void updateCursor(bool sampleCurrentLayer, bool pickFgColor);
43
44 void setUpdateGlobalColor(bool value);
45 bool updateGlobalColor() const;
46
47Q_SIGNALS:
49 void sigRequestCursor(const QCursor &cursor);
55 void sigRawColorSelected(const KoColor &color);
56
61 void sigColorSelected(const KoColor &color);
62
70 void sigFinalColorSelected(const KoColor &color);
71
72private Q_SLOTS:
73 void activateDelayedPreview();
74 void slotAddSamplingJob(const QPointF &docPoint);
75 void slotColorSamplingFinished(const KoColor &rawColor);
76
77private:
78 struct Private;
79 QScopedPointer<Private> m_d;
80};
81
82#endif // KISASYNCCOLORSAMPLERHELPER_H
float value(const T *src, size_t ch)
void sigFinalColorSelected(const KoColor &color)
void sigRequestCursor(const QCursor &cursor)
void sigColorSelected(const KoColor &color)
void sigRawColorSelected(const KoColor &color)