Engauge Digitizer  2
Public Slots | Signals | Public Member Functions | List of all members
DlgFilterWorker Class Reference

Class for processing new filter settings. This is based on http://blog.debao.me/2013/08/how-to-use-qworker-in-the-right-way-part-1/. More...

#include <DlgFilterWorker.h>

Inheritance diagram for DlgFilterWorker:
Inheritance graph
Collaboration diagram for DlgFilterWorker:
Collaboration graph

Public Slots

void slotNewParameters (ColorFilterMode colorFilterMode, double low, double high)
 Start processing with a new set of parameters. Any ongoing processing is interrupted when m_filterMode changes. More...
 

Signals

void signalTransferPiece (int xLeft, QImage image)
 Send a processed vertical piece of the original pixmap. The destination is between xLeft and xLeft+pixmap.width() More...
 

Public Member Functions

 DlgFilterWorker (const QPixmap &pixmapOriginal, QRgb m_rgbBackground)
 Single constructor. More...
 

Detailed Description

Class for processing new filter settings. This is based on http://blog.debao.me/2013/08/how-to-use-qworker-in-the-right-way-part-1/.

Definition at line 22 of file DlgFilterWorker.h.

Constructor & Destructor Documentation

◆ DlgFilterWorker()

DlgFilterWorker::DlgFilterWorker ( const QPixmap &  pixmapOriginal,
QRgb  m_rgbBackground 
)

Single constructor.

Definition at line 15 of file DlgFilterWorker.cpp.

16  :
17  m_imageOriginal (pixmapOriginal.toImage()),
18  m_rgbBackground (rgbBackground),
19  m_colorFilterMode (NUM_COLOR_FILTER_MODES),
20  m_low (-1.0),
21  m_high (-1.0)
22 {
23  m_restartTimer.setSingleShot (false);
24  connect (&m_restartTimer, SIGNAL (timeout ()), this, SLOT (slotRestartTimeout()));
25 }

Member Function Documentation

◆ signalTransferPiece

void DlgFilterWorker::signalTransferPiece ( int  xLeft,
QImage  image 
)
signal

Send a processed vertical piece of the original pixmap. The destination is between xLeft and xLeft+pixmap.width()

◆ slotNewParameters

void DlgFilterWorker::slotNewParameters ( ColorFilterMode  colorFilterMode,
double  low,
double  high 
)
slot

Start processing with a new set of parameters. Any ongoing processing is interrupted when m_filterMode changes.

Definition at line 27 of file DlgFilterWorker.cpp.

30 {
31  LOG4CPP_INFO_S ((*mainCat)) << "DlgFilterWorker::slotNewParameters filterMode=" << colorFilterMode
32  << " low=" << low
33  << " high=" << high;
34 
35  // Push onto queue
36  DlgFilterCommand command (colorFilterMode,
37  low,
38  high);
39  m_inputCommandQueue.push_back (command);
40 
41  if (!m_restartTimer.isActive()) {
42 
43  // Timer is not currently active so start it up
44  m_restartTimer.start (NO_DELAY);
45  }
46 }
Command pattern object for receiving new parameters in DlgFilterWorker from GUI thread.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
const int NO_DELAY

The documentation for this class was generated from the following files: