Engauge Digitizer  2
ColorFilterSettings.h
Go to the documentation of this file.
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 COLOR_FILTER_SETTINGS_H
8 #define COLOR_FILTER_SETTINGS_H
9 
11 #include "ColorFilterMode.h"
12 #include <QMap>
13 
14 class QTextStream;
15 class QXmlStreamReader;
16 class QXmlStreamWriter;
17 
20 {
21 public:
24 
27  int intensityLow,
28  int intensityHigh,
29  int foregroundLow,
30  int foregroundHigh,
31  int hueLow,
32  int hueHigh,
33  int saturationLow,
34  int saturationHigh,
35  int valueLow,
36  int valueHigh);
37 
40 
42  ColorFilterSettings (QXmlStreamReader &reader);
43 
46 
49 
52 
55 
57  int foregroundHigh () const;
58 
60  int foregroundLow () const;
61 
64  double high () const;
65 
67  int hueHigh () const;
68 
70  int hueLow () const;
71 
73  int intensityHigh () const;
74 
76  int intensityLow () const;
77 
79  void loadXml(QXmlStreamReader &reader);
80 
83  double low () const;
84 
86  void printStream (QString indentation,
87  QTextStream &str) const;
88 
90  int saturationHigh () const;
91 
93  int saturationLow () const;
94 
96  void saveXml(QXmlStreamWriter &writer,
97  const QString &curveName) const;
98 
101 
104 
106  void setForegroundLow (int foregroundLow);
107 
109  void setHigh (double s0To1);
110 
112  void setHueHigh (int hueHigh);
113 
115  void setHueLow (int hueLow);
116 
118  void setIntensityHigh (int intensityHigh);
119 
121  void setIntensityLow (int intensityLow);
122 
124  void setLow (double s0To1);
125 
128 
130  void setSaturationLow (int saturationLow);
131 
133  void setValueHigh (int valueHigh);
134 
136  void setValueLow (int valueLow);
137 
139  int valueHigh () const;
140 
142  int valueLow () const;
143 
144 private:
145 
146  void createStrategies ();
147 
148  ColorFilterMode m_colorFilterMode;
149  int m_intensityLow;
150  int m_intensityHigh;
151  int m_foregroundLow;
152  int m_foregroundHigh;
153  int m_hueLow;
154  int m_hueHigh;
155  int m_saturationLow;
156  int m_saturationHigh;
157  int m_valueLow;
158  int m_valueHigh;
159 
160  // Strategies for mode-specific computations
161  QMap<ColorFilterMode, ColorFilterSettingsStrategyAbstractBase*> m_strategies;
162 };
163 
164 #endif // COLOR_FILTER_SETTINGS_H
ColorFilterMode
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
int foregroundLow() const
Get method for foreground lower bound.
~ColorFilterSettings()
Destructor deallocates memory.
void setIntensityLow(int intensityLow)
Set method for intensity lower bound.
void setForegroundLow(int foregroundLow)
Set method for foreground lower bound.
int saturationLow() const
Get method for saturation lower bound.
ColorFilterSettings()
Default constructor only for use when this class is being stored by a container that requires the def...
void setValueLow(int valueLow)
Set method for value low.
void setValueHigh(int valueHigh)
Set method for value high.
void setSaturationLow(int saturationLow)
Set method for saturation low.
double low() const
Low value of foreground, hue, intensity, saturation or value according to current filter mode,...
void setHueLow(int hueLow)
Set method for hue lower bound.
int intensityHigh() const
Get method for intensity higher bound.
void setHigh(double s0To1)
Set the high value for the current filter mode.
ColorFilterSettings & operator=(const ColorFilterSettings &other)
Assignment operator.
int saturationHigh() const
Get method for saturation higher bound.
static ColorFilterSettings defaultFilter()
Initial default for any Curve.
void setColorFilterMode(ColorFilterMode colorFilterMode)
Set method for filter mode.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
ColorFilterMode colorFilterMode() const
Get method for filter mode.
void saveXml(QXmlStreamWriter &writer, const QString &curveName) const
Save curve filter to stream.
int valueLow() const
Get method for value low.
void setForegroundHigh(int foregroundHigh)
Set method for foreground higher bound.
void loadXml(QXmlStreamReader &reader)
Load curve filter to stream.
int hueHigh() const
Get method for hue higher bound.
double high() const
High value of foreground, hue, intensity, saturation or value according to current filter mode,...
int foregroundHigh() const
Get method for foreground higher bound.
void setLow(double s0To1)
Set the low value for the current filter mode.
void setIntensityHigh(int intensityHigh)
Set method for intensity higher bound.
int intensityLow() const
Get method for intensity lower bound.
void setSaturationHigh(int saturationHigh)
Set method for saturation high.
void setHueHigh(int hueHigh)
Set method for hue higher bound.
int hueLow() const
Get method for hue lower bound.
int valueHigh() const
Get method for value high.