Engauge Digitizer 2
Loading...
Searching...
No Matches
ColorFilterSettingsStrategyIntensity.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
21double ColorFilterSettingsStrategyIntensity::high (const ColorFilterSettings &colorFilterSettings) const
22{
23 return double (colorFilterSettings.intensityHigh () - INTENSITY_MIN) /
25}
26
27double ColorFilterSettingsStrategyIntensity::low (const ColorFilterSettings &colorFilterSettings) const
28{
29 return double (colorFilterSettings.intensityLow () - INTENSITY_MIN) /
31}
32
34 QString indentation,
35 QTextStream &str) const
36{
37 str << indentation << "intensityLow=" << colorFilterSettings.intensityLow () << "\n";
38 str << indentation << "intensityHigh=" << colorFilterSettings.intensityHigh () << "\n";
39}
40
42 double s0To1)
43{
44 colorFilterSettings.setIntensityHigh (qFloor (INTENSITY_MIN + s0To1 * (INTENSITY_MAX - INTENSITY_MIN)));
45}
46
48 double s0To1)
49{
50 colorFilterSettings.setIntensityLow (qFloor (INTENSITY_MIN + s0To1 * (INTENSITY_MAX - INTENSITY_MIN)));
51}
const int INTENSITY_MAX
const int INTENSITY_MIN
Constants for use by CurveFilter and other curve-related classes.
virtual void printStream(const ColorFilterSettings &colorFilterSettings, QString indentation, QTextStream &str) const
Print the low and high values.
virtual void setLow(ColorFilterSettings &colorFilterSettings, double s0To1)
Set the low value given the normalized value.
virtual void setHigh(ColorFilterSettings &colorFilterSettings, double s0To1)
Set the high value given the normalized value.
virtual double low(const ColorFilterSettings &colorFilterSettings) const
Return the low value normalized to 0 to 1.
virtual double high(const ColorFilterSettings &colorFilterSettings) const
Return the high value normalized to 0 to 1.
Color filter parameters for one curve. For a class, this is handled the same as LineStyle and PointSt...
void setIntensityLow(int intensityLow)
Set method for intensity lower bound.
int intensityHigh() const
Get method for intensity higher bound.
void setIntensityHigh(int intensityHigh)
Set method for intensity higher bound.
int intensityLow() const
Get method for intensity lower bound.