Engauge Digitizer  2
Public Member Functions | List of all members
ColorFilterStrategyHue Class Reference

Leaf class for hue strategy for ColorFilter. More...

#include <ColorFilterStrategyHue.h>

Inheritance diagram for ColorFilterStrategyHue:
Inheritance graph
Collaboration diagram for ColorFilterStrategyHue:
Collaboration graph

Public Member Functions

 ColorFilterStrategyHue ()
 Single constructor. More...
 
virtual ~ColorFilterStrategyHue ()
 
virtual double pixelToZeroToOne (const QColor &pixel, QRgb rgbBackground) const
 Return a normalized value of 0 to 1 given input pixel. More...
 
virtual int zeroToOneToValue (double s) const
 Return the low value normalized to 0 to 1. More...
 
- Public Member Functions inherited from ColorFilterStrategyAbstractBase
 ColorFilterStrategyAbstractBase ()
 Single constructor. More...
 
virtual ~ColorFilterStrategyAbstractBase ()
 

Detailed Description

Leaf class for hue strategy for ColorFilter.

Definition at line 13 of file ColorFilterStrategyHue.h.

Constructor & Destructor Documentation

◆ ColorFilterStrategyHue()

ColorFilterStrategyHue::ColorFilterStrategyHue ( )

Single constructor.

Definition at line 12 of file ColorFilterStrategyHue.cpp.

13 {
14 }

◆ ~ColorFilterStrategyHue()

ColorFilterStrategyHue::~ColorFilterStrategyHue ( )
virtual

Definition at line 16 of file ColorFilterStrategyHue.cpp.

17 {
18 }

Member Function Documentation

◆ pixelToZeroToOne()

double ColorFilterStrategyHue::pixelToZeroToOne ( const QColor &  pixel,
QRgb  rgbBackground 
) const
virtual

Return a normalized value of 0 to 1 given input pixel.

Implements ColorFilterStrategyAbstractBase.

Definition at line 20 of file ColorFilterStrategyHue.cpp.

22 {
23  double s = pixel.hueF();
24  if (s < 0) {
25  // Color is achromatic (r=g=b) so it has no hue
26  }
27 
28  return s;
29 }

◆ zeroToOneToValue()

int ColorFilterStrategyHue::zeroToOneToValue ( double  s) const
virtual

Return the low value normalized to 0 to 1.

Implements ColorFilterStrategyAbstractBase.

Definition at line 31 of file ColorFilterStrategyHue.cpp.

32 {
33  return qFloor (HUE_MIN + s * (HUE_MAX - HUE_MIN));
34 }
const int HUE_MAX
const int HUE_MIN

The documentation for this class was generated from the following files: