Engauge Digitizer 2
Loading...
Searching...
No Matches
ViewProfileScale Class Reference

Linear horizontal scale, with the spectrum reflecting the active filter parameter. More...

#include <ViewProfileScale.h>

Inheritance diagram for ViewProfileScale:
Inheritance graph
Collaboration diagram for ViewProfileScale:
Collaboration graph

Public Member Functions

 ViewProfileScale (int minimumWidth, QWidget *parent=0)
 Single constructor.
virtual void paintEvent (QPaintEvent *)
 Draw the gradient.
void setBackgroundColor (QRgb rgbBackground)
 Save the background color for foreground calculations.
void setColorFilterMode (ColorFilterMode colorFilterMode)
 Change the gradient type.

Detailed Description

Linear horizontal scale, with the spectrum reflecting the active filter parameter.

Definition at line 16 of file ViewProfileScale.h.

Constructor & Destructor Documentation

◆ ViewProfileScale()

ViewProfileScale::ViewProfileScale ( int minimumWidth,
QWidget * parent = 0 )
explicit

Single constructor.

Definition at line 12 of file ViewProfileScale.cpp.

13 :
14 QLabel (parent),
15 m_colorFilterMode (COLOR_FILTER_MODE_FOREGROUND)
16{
17 setMinimumWidth(minimumWidth);
18}
@ COLOR_FILTER_MODE_FOREGROUND

Member Function Documentation

◆ paintEvent()

void ViewProfileScale::paintEvent ( QPaintEvent * event)
virtual

Draw the gradient.

Definition at line 20 of file ViewProfileScale.cpp.

21{
22 switch (m_colorFilterMode) {
24 paintForeground ();
25 break;
26
28 paintHue ();
29 break;
30
32 paintIntensity ();
33 break;
34
36 paintSaturation ();
37 break;
38
40 paintValue ();
41 break;
42
43 default:
44 LOG4CPP_ERROR_S ((*mainCat)) << "ViewProfileScale::paintEvent unexpected color filter mode " << m_colorFilterMode;
45 ENGAUGE_ASSERT (false);
46 }
47
48 QLabel::paintEvent (event);
49}
@ COLOR_FILTER_MODE_VALUE
@ COLOR_FILTER_MODE_INTENSITY
@ COLOR_FILTER_MODE_SATURATION
@ COLOR_FILTER_MODE_HUE
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
log4cpp::Category * mainCat
Definition Logger.cpp:14
#define LOG4CPP_ERROR_S(logger)
Definition convenience.h:12

◆ setBackgroundColor()

void ViewProfileScale::setBackgroundColor ( QRgb rgbBackground)

Save the background color for foreground calculations.

Definition at line 125 of file ViewProfileScale.cpp.

126{
127 m_rgbBackground = rgbBackground;
128}

◆ setColorFilterMode()

void ViewProfileScale::setColorFilterMode ( ColorFilterMode colorFilterMode)

Change the gradient type.

Definition at line 130 of file ViewProfileScale.cpp.

131{
132 m_colorFilterMode = colorFilterMode;
133 update ();
134}

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