22 switch (m_colorFilterMode) {
44 LOG4CPP_ERROR_S ((*
mainCat)) <<
"ViewProfileScale::paintEvent unexpected color filter mode " << m_colorFilterMode;
48 QLabel::paintEvent (
event);
51void ViewProfileScale::paintForeground ()
53 if (
qGray (m_rgbBackground) < 127) {
55 paintOneSpectrum (
QColor (m_rgbBackground),
QColor (Qt::white));
58 paintOneSpectrum (
QColor (m_rgbBackground),
QColor (Qt::black));
62void ViewProfileScale::paintHue ()
71 gradient.setColorAt (0.0000, Qt::red);
72 gradient.setColorAt (0.3333, Qt::green);
73 gradient.setColorAt (0.6666, Qt::blue);
74 gradient.setColorAt (1.0000, Qt::red);
88void ViewProfileScale::paintIntensity ()
90 paintOneSpectrum (
QColor (Qt::black),
QColor (Qt::white));
115void ViewProfileScale::paintSaturation ()
117 paintOneSpectrum (
QColor (Qt::white),
QColor (Qt::red));
120void ViewProfileScale::paintValue ()
122 paintOneSpectrum (
QColor (Qt::black),
QColor (Qt::red));
132 m_colorFilterMode = colorFilterMode;
@ COLOR_FILTER_MODE_FOREGROUND
@ COLOR_FILTER_MODE_VALUE
@ COLOR_FILTER_MODE_INTENSITY
@ COLOR_FILTER_MODE_SATURATION
const int INNER_RADIUS_MIN
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT.
log4cpp::Category * mainCat
ViewProfileScale(int minimumWidth, QWidget *parent=0)
Single constructor.
void setBackgroundColor(QRgb rgbBackground)
Save the background color for foreground calculations.
virtual void paintEvent(QPaintEvent *)
Draw the gradient.
void setColorFilterMode(ColorFilterMode colorFilterMode)
Change the gradient type.
#define LOG4CPP_ERROR_S(logger)