7 #include "ColorConstants.h" 8 #include "ColorFilterStrategyForeground.h" 16 ColorFilterStrategyForeground::~ColorFilterStrategyForeground ()
21 QRgb rgbBackground)
const 23 double distance = qSqrt (pow ((
double) pixel.red() - qRed (rgbBackground), 2) +
24 pow ((
double) pixel.green() - qGreen (rgbBackground), 2) +
25 pow ((
double) pixel.blue() - qBlue (rgbBackground), 2));
26 return distance / qSqrt (255.0 * 255.0 + 255.0 * 255.0 + 255.0 * 255.0);
31 return FOREGROUND_MIN + s * (FOREGROUND_MAX - FOREGROUND_MIN);
ColorFilterStrategyForeground()
Single constructor.
virtual double pixelToZeroToOne(const QColor &pixel, QRgb rgbBackground) const
Return a normalized value of 0 to 1 given input pixel.
virtual int zeroToOneToValue(double s) const
Return the low value normalized to 0 to 1.