Engauge Digitizer 2
Loading...
Searching...
No Matches
DocumentModelColorFilter.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 DOCUMENT_MODEL_COLOR_FILTER_H
8#define DOCUMENT_MODEL_COLOR_FILTER_H
9
10#include "ColorFilterSettings.h"
12#include <QHash>
13
14// Lookup-table by curve name
16
17class CoordSystem;
18class QTextStream;
19
22{
23public:
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
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
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,
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
143private:
144
145 ColorFilterSettingsList m_colorFilterSettingsList;
146};
147
148#endif // DOCUMENT_MODEL_COLOR_FILTER_H
ColorFilterMode
const int INNER_RADIUS_MIN
QHash< QString, ColorFilterSettings > ColorFilterSettingsList
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
Storage of data belonging to one coordinate system.
Definition CoordSystem.h:43
Abstract base class for document models. This class enforces a common interface for the leaf subclass...
Model for DlgSettingsColorFilter and CmdSettingsColorFilter.
double high(const QString &curveName) const
High value of foreground, hue, intensity, saturation or value according to current filter mode.
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...
int hueLow(const QString &curveName) const
Get method for hue lower bound.
DocumentModelColorFilter()
Default constructor.
int hueHigh(const QString &curveName) const
Get method for hue higher bound.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
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 setIntensityLow(const QString &curveName, int intensityLow)
Set method for intensity lower bound.
int foregroundHigh(const QString &curveName) const
Get method for foreground higher bound.
int saturationLow(const QString &curveName) const
Get method for saturation lower bound.
DocumentModelColorFilter & operator=(const DocumentModelColorFilter &other)
Assignment constructor.
int foregroundLow(const QString &curveName) const
Get method for foreground lower bound.
void setHigh(const QString &curveName, double s0To1)
Set the high value for the current filter mode.
void setHueHigh(const QString &curveName, int hueHigh)
Set method for hue higher bound.
void setForegroundHigh(const QString &curveName, int foregroundHigh)
Set method for foreground higher bound.
void setSaturationHigh(const QString &curveName, int saturationHigh)
Set method for saturation high.
void setHueLow(const QString &curveName, int hueLow)
Set method for hue lower bound.
const ColorFilterSettingsList & colorFilterSettingsList() const
Get method for copying all color filters in one step.
int valueLow(const QString &curveName) const
Get method for value low.
int saturationHigh(const QString &curveName) const
Get method for saturation higher bound.
void setValueLow(const QString &curveName, int valueLow)
Set method for value low.
void setSaturationLow(const QString &curveName, int saturationLow)
Set method for saturation low.
void setColorFilterMode(const QString &curveName, ColorFilterMode colorFilterMode)
Set method for filter mode.
int valueHigh(const QString &curveName) const
Get method for value high.
int intensityHigh(const QString &curveName) const
Get method for intensity higher bound.
void setIntensityHigh(const QString &curveName, int intensityHigh)
Set method for intensity higher bound.
void setLow(const QString &curveName, double s0To1)
Set the low value for the current filter mode.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setForegroundLow(const QString &curveName, int foregroundLow)
Set method for foreground lower bound.
int intensityLow(const QString &curveName) const
Get method for intensity lower bound.