Engauge Digitizer 2
Loading...
Searching...
No Matches
ColorFilterSettingsStrategyForeground.cpp
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#include "ColorConstants.h"
10#include <qmath.h>
11#include <QTextStream>
12
16
20
22{
23 return double (colorFilterSettings.foregroundHigh () - FOREGROUND_MIN) /
25}
26
27double ColorFilterSettingsStrategyForeground::low (const ColorFilterSettings &colorFilterSettings) const
28{
29 return double (colorFilterSettings.foregroundLow () - FOREGROUND_MIN) /
31}
32
34 QString indentation,
35 QTextStream &str) const
36{
37 str << indentation << "foregroundLow=" << colorFilterSettings.intensityLow () << "\n";
38 str << indentation << "foregroundHigh=" << colorFilterSettings.intensityHigh () << "\n";
39}
40
42 double s0To1)
43{
44 colorFilterSettings.setForegroundHigh (qFloor (FOREGROUND_MIN + s0To1 * (FOREGROUND_MAX - FOREGROUND_MIN)));
45}
46
48 double s0To1)
49{
50 colorFilterSettings.setForegroundLow (qFloor (FOREGROUND_MIN + s0To1 * (FOREGROUND_MAX - FOREGROUND_MIN)));
51}
const int FOREGROUND_MAX
const int FOREGROUND_MIN
virtual void setHigh(ColorFilterSettings &colorFilterSettings, double s0To1)
Set the high value given the normalized value.
virtual double high(const ColorFilterSettings &colorFilterSettings) const
Return the high value normalized to 0 to 1.
virtual void setLow(ColorFilterSettings &colorFilterSettings, double s0To1)
Set the low value given the normalized value.
virtual void printStream(const ColorFilterSettings &colorFilterSettings, QString indentation, QTextStream &str) const
Print the low and high values.
virtual double low(const ColorFilterSettings &colorFilterSettings) const
Return the low value normalized to 0 to 1.
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.
void setForegroundLow(int foregroundLow)
Set method for foreground lower bound.
int intensityHigh() const
Get method for intensity higher bound.
void setForegroundHigh(int foregroundHigh)
Set method for foreground higher bound.
int foregroundHigh() const
Get method for foreground higher bound.
int intensityLow() const
Get method for intensity lower bound.