Engauge Digitizer  2
DocumentModelColorFilter.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 DOCUMENT_MODEL_COLOR_FILTER_H
8 #define DOCUMENT_MODEL_COLOR_FILTER_H
9 
10 #include "ColorFilterSettings.h"
11 #include "DocumentModelAbstractBase.h"
12 #include <QHash>
13 
14 // Lookup-table by curve name
15 typedef QHash<QString, ColorFilterSettings> ColorFilterSettingsList;
16 
17 class CoordSystem;
18 class QTextStream;
19 
22 {
23 public:
26 
29 
31  DocumentModelColorFilter(const CoordSystem &coordSystem);
32 
35 
37  ColorFilterMode colorFilterMode(const QString &curveName) const;
38 
40  const ColorFilterSettings colorFilterSettings (const QString &curveName) const;
41 
43  const ColorFilterSettingsList &colorFilterSettingsList () const;
44 
46  int foregroundHigh (const QString &curveName) const;
47 
49  int foregroundLow (const QString &curveName) const;
50 
53  double high (const QString &curveName) const;
54 
56  int hueHigh (const QString &curveName) const;
57 
59  int hueLow (const QString &curveName) const;
60 
62  int intensityHigh (const QString &curveName) const;
63 
65  int intensityLow (const QString &curveName) const;
66 
67  virtual void loadXml(QXmlStreamReader &reader);
68 
71  double low (const QString &curveName) const;
72 
74  void printStream (QString indentation,
75  QTextStream &str) const;
76 
78  int saturationHigh (const QString &curveName) const;
79 
81  int saturationLow (const QString &curveName) const;
82 
83  virtual void saveXml(QXmlStreamWriter &writer) const;
84 
86  void setColorFilterMode(const QString &curveName,
87  ColorFilterMode colorFilterMode);
88 
90  void setForegroundHigh (const QString &curveName,
91  int foregroundHigh);
92 
94  void setForegroundLow (const QString &curveName,
95  int foregroundLow);
96 
98  void setHigh (const QString &curveName,
99  double s0To1);
100 
102  void setHueHigh (const QString &curveName,
103  int hueHigh);
104 
106  void setHueLow (const QString &curveName,
107  int hueLow);
108 
110  void setIntensityHigh (const QString &curveName,
111  int intensityHigh);
112 
114  void setIntensityLow (const QString &curveName,
115  int intensityLow);
116 
118  void setLow (const QString &curveName,
119  double s0To1);
120 
122  void setSaturationHigh (const QString &curveName,
123  int saturationHigh);
124 
126  void setSaturationLow (const QString &curveName,
127  int saturationLow);
128 
130  void setValueHigh (const QString &curveName,
131  int valueHigh);
132 
134  void setValueLow (const QString &curveName,
135  int valueLow);
136 
138  int valueHigh (const QString &curveName) const;
139 
141  int valueLow (const QString &curveName) const;
142 
143 private:
144 
145  ColorFilterSettingsList m_colorFilterSettingsList;
146 };
147 
148 #endif // DOCUMENT_MODEL_COLOR_FILTER_H
int intensityHigh(const QString &curveName) const
Get method for intensity higher bound.
const ColorFilterSettingsList & colorFilterSettingsList() const
Get method for copying all color filters in one step.
int valueHigh(const QString &curveName) const
Get method for value high.
DocumentModelColorFilter()
Default constructor.
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
int valueLow(const QString &curveName) const
Get method for value low.
Abstract base class for document models. This class enforces a common interface for the leaf subclass...
void setColorFilterMode(const QString &curveName, ColorFilterMode colorFilterMode)
Set method for filter mode.
int hueHigh(const QString &curveName) const
Get method for hue higher bound.
int saturationLow(const QString &curveName) const
Get method for saturation lower bound.
int foregroundHigh(const QString &curveName) const
Get method for foreground higher bound.
Storage of data belonging to one coordinate system.
Definition: CoordSystem.h:42
const ColorFilterSettings colorFilterSettings(const QString &curveName) const
Get method for copying one color filter. Cannot return just a reference or else there is a warning ab...
ColorFilterMode colorFilterMode(const QString &curveName) const
Get method for filter mode.
void setValueLow(const QString &curveName, int valueLow)
Set method for value low.
int hueLow(const QString &curveName) const
Get method for hue lower bound.
int saturationHigh(const QString &curveName) const
Get method for saturation higher bound.
DocumentModelColorFilter & operator=(const DocumentModelColorFilter &other)
Assignment constructor.
void setForegroundLow(const QString &curveName, int foregroundLow)
Set method for foreground lower bound.
void setHueLow(const QString &curveName, int hueLow)
Set method for hue lower bound.
double high(const QString &curveName) const
High value of foreground, hue, intensity, saturation or value according to current filter mode...
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
int intensityLow(const QString &curveName) const
Get method for intensity lower bound.
void setIntensityLow(const QString &curveName, int intensityLow)
Set method for intensity lower bound.
void setHigh(const QString &curveName, double s0To1)
Set the high value for the current filter mode.
void setForegroundHigh(const QString &curveName, int foregroundHigh)
Set method for foreground higher bound.
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void setIntensityHigh(const QString &curveName, int intensityHigh)
Set method for intensity higher bound.
int foregroundLow(const QString &curveName) const
Get method for foreground lower bound.
void setLow(const QString &curveName, double s0To1)
Set the low value for the current filter mode.
void setSaturationLow(const QString &curveName, int saturationLow)
Set method for saturation low.
void setSaturationHigh(const QString &curveName, int saturationHigh)
Set method for saturation high.
void setHueHigh(const QString &curveName, int hueHigh)
Set method for hue higher bound.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setValueHigh(const QString &curveName, int valueHigh)
Set method for value high.
double low(const QString &curveName) const
Low value of foreground, hue, intensity, saturation or value according to current filter mode normali...