Engauge Digitizer  2
ViewProfileScale.h
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 VIEW_PROFILE_SCALE_H
8 #define VIEW_PROFILE_SCALE_H
9 
10 #include "ColorFilterMode.h"
11 #include <QColor>
12 #include <QLabel>
13 #include <QRgb>
14 
16 class ViewProfileScale : public QLabel
17 {
18 public:
20  explicit ViewProfileScale(int minimumWidth,
21  QWidget *parent = 0);
22 
24  virtual void paintEvent (QPaintEvent *);
25 
27  void setBackgroundColor (QRgb rgbBackground);
28 
30  void setColorFilterMode (ColorFilterMode colorFilterMode);
31 
32 private:
33 
34  void paintForeground ();
35  void paintHue ();
36  void paintIntensity ();
37  void paintOneSpectrum (const QColor &colorStart,
38  const QColor &colorStop); // Generic processing for painting with only one spectrum
39  void paintSaturation ();
40  void paintValue ();
41 
42  QRgb m_rgbBackground;
43  ColorFilterMode m_colorFilterMode;
44 };
45 
46 #endif // VIEW_PROFILE_SCALE_H
void setBackgroundColor(QRgb rgbBackground)
Save the background color for foreground calculations.
ViewProfileScale(int minimumWidth, QWidget *parent=0)
Single constructor.
Linear horizontal scale, with the spectrum reflecting the active filter parameter.
void setColorFilterMode(ColorFilterMode colorFilterMode)
Change the gradient type.
virtual void paintEvent(QPaintEvent *)
Draw the gradient.