Engauge Digitizer 2
Loading...
Searching...
No Matches
DlgFilterWorker.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef DLG_FILTER_WORKER_H
8#define DLG_FILTER_WORKER_H
9
10#include "ColorFilterMode.h"
11#include "DlgFilterCommand.h"
12#include <QImage>
13#include <QList>
14#include <QObject>
15#include <QPixmap>
16#include <QRgb>
17#include <QTimer>
18
19typedef QList<DlgFilterCommand> FilterCommandQueue;
20
22class DlgFilterWorker : public QObject
23{
24 Q_OBJECT;
25
26public:
28 DlgFilterWorker(const QPixmap &pixmapOriginal,
29 QRgb m_rgbBackground);
30
31public slots:
33 void slotNewParameters (ColorFilterMode colorFilterMode,
34 double low,
35 double high);
36
37private slots:
38 void slotRestartTimeout ();
39
40signals:
42 void signalTransferPiece (int xLeft,
43 QImage image);
44
45private:
47
48 QImage m_imageOriginal; // Use QImage rather than QPixmap so we can access pixel by pixel
49 QRgb m_rgbBackground;
50
51 FilterCommandQueue m_inputCommandQueue;
52 ColorFilterMode m_colorFilterMode; // Set when processing restarts
53 double m_low;
54 double m_high;
55
56 int m_xLeft;
57 QTimer m_restartTimer; // Decouple slotRestartProcessing from the processing that this class performs
58};
59
60#endif // DLG_FILTER_WORKER_H
ColorFilterMode
QList< DlgFilterCommand > FilterCommandQueue
void signalTransferPiece(int xLeft, QImage image)
Send a processed vertical piece of the original pixmap. The destination is between xLeft and xLeft+pi...
DlgFilterWorker(const QPixmap &pixmapOriginal, QRgb m_rgbBackground)
Single constructor.
void slotNewParameters(ColorFilterMode colorFilterMode, double low, double high)
Start processing with a new set of parameters. Any ongoing processing is interrupted when m_filterMod...