Engauge Digitizer  2
ViewSegmentFilter.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_SEGMENT_FILTER_H
8 #define VIEW_SEGMENT_FILTER_H
9 
10 #include "ColorFilterSettings.h"
11 #include <QColor>
12 #include <QLabel>
13 
14 class QPixmap;
15 
18 class ViewSegmentFilter : public QLabel
19 {
20 public:
22  ViewSegmentFilter(QWidget *parent = 0);
23 
25  virtual void paintEvent(QPaintEvent *event);
26 
28  void setColorFilterSettings (const ColorFilterSettings &colorFilterSettings,
29  const QPixmap &pixmap);
30 
32  void setEnabled (bool enabled);
33 
36 
37 private:
38 
39  QColor colorFromSetting (ColorFilterMode colorFilterMode,
40  int foreground,
41  int hue,
42  int intensity,
43  int saturation,
44  int value) const;
45  QColor colorHigh () const;
46  QColor colorLow () const;
47 
48  ColorFilterSettings m_colorFilterSettings;
49  bool m_filterIsDefined;
50  QColor m_rgbBackground;
51 
52  bool m_enabled;
53 };
54 
55 #endif // VIEW_SEGMENT_FILTER_H
void setColorFilterSettings(const ColorFilterSettings &colorFilterSettings, const QPixmap &pixmap)
Apply the color filter of the currently selected curve. The pixmap is included so the background colo...
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
Class that displays the current Segment Filter in a MainWindow toolbar.
void setEnabled(bool enabled)
Show the style with semi-transparency or full-transparency to indicate if associated Curve is active ...
ViewSegmentFilter(QWidget *parent=0)
Single constructor.
virtual void paintEvent(QPaintEvent *event)
Paint with a horizontal linear gradient.
void unsetColorFilterSettings()
Apply no color filter.