Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

InSpace::Color Class Reference

#include <Color.H>

List of all members.

Public Member Functions

 Color ()
 Color (const Color &c)
 Color (const float r, const float g, const float b, const float a=1.0)
 Color (str_ptr colstr)
virtual ~Color ()
void set (const float r, const float g, const float b, const float a=1.0)
void set (str_ptr colstr)
 can call this with a CONFIGval, for example

float r () const
float g () const
float b () const
float a () const
void setHLS (const float h, const float l, const float s, const float a=1.0)
 set the color in HLS mode: "h" (hue 0.0-360.0), "l" (lightness 0.0-1.0), and "s" (saturation 0.0-1.0)

void getHLS (float &h, float &l, float &s)
 get color in HLS mode: "h" (hue 0.0-360.0), "l" (lightness 0.0-1.0), and "s" (saturation 0.0-1.0)

bool setLAB (const float L, const float a, const float b, const float alpha=1.0)
 Set the color in LAB mode--if LAB is invalid, closest rgb color is set and false returned; else, true returned.

void getLAB (float &L, float &a, float &b)
 get the color in LAB mode: "L" (lightness), "a" (green to red), and "b" (blue to yellow)

void getXYZ (float &X, float &Y, float &Z)
 get the color in CIEXYZ mode

void LABtoXYZ (const float L, const float A, const float B, float &X, float &Y, float &Z)
 convert from LAB mode to XYZ mode

float * array ()
bool operator== (const Color &c) const
float operator[] (const int index) const
float & operator[] (const int index)

Static Public Member Functions

float getLABChroma (const float L, const float a, const float b)
 get the chroma (0.0-100.0), assumes valid LAB values

float getLABSaturation (const float L, const float a, const float b)
 get the saturation (0.0-100.0), assumes valid LAB values

float getLABHue (const float L, const float a, const float b)
 get the hue angle (0.0-360.0), assumes valid LAB values -- note: does not correspond to 'H' in HLS

void setLABLightnessChromaHue (const float L, float &a, float &b, const float chroma, const float hue)
 the following four functions set LAB values, to actually set the RGB value, setLAB() needs to be called

void setLABChromaSaturationHue (float &L, float &a, float &b, const float chroma, const float saturation, const float hue)
void setLABLightnessSaturationHue (const float L, float &a, float &b, const float saturation, const float hue)
void setLABSaturationAB (float &L, const float a, const float b, const float saturation)
float getLABColorDifference (const float L1, const float a1, const float b1, const float L2, const float a2, const float b2)
 returns the a value of difference in color

bool findMaxL_LAB (float &L, const float a, const float b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
 the following functions find the max/min for a particular value when the other two values are constant

bool findMinL_LAB (float &L, const float a, const float b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMaxA_LAB (const float L, float &a, const float b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMinA_LAB (const float L, float &a, const float b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMaxB_LAB (const float L, const float a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMinB_LAB (const float L, const float a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMaxL_LA_LAB (float &L, float &a, const float b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMinL_LA_LAB (float &L, float &a, const float b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMaxA_LA_LAB (float &L, float &a, const float b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMinA_LA_LAB (float &L, float &a, const float b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMaxL_LB_LAB (float &L, const float a, float &b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMinL_LB_LAB (float &L, const float a, float &b, const float minL=MIN_L, const float maxL=MAX_L, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMaxB_LB_LAB (float &L, const float a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMinB_LB_LAB (float &L, const float a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMaxA_AB_LAB (const float L, float &a, float &b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMinA_AB_LAB (const float L, float &a, float &b, const float minA=MIN_A, const float maxA=MAX_A, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMaxB_AB_LAB (const float L, float &a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)
bool findMinB_AB_LAB (const float L, float &a, float &b, const float minB=MIN_B, const float maxB=MAX_B, const float interval=INITIAL_INTERVAL, const bool recursiveSuccess=false)

Static Public Attributes

const Color black
const Color white
const Color grey
const Color red
const Color green
const Color yellow
const Color blue
const Color magenta
const Color cyan
const Color pink
const Color brown
const Color tan
const Color orange
const Color firebrick
const double RGBtoXYZarray [3][3]
const double XYZtoRGBarray [3][3]

Static Protected Member Functions

double value (double n1, double n2, double hue)
 helps the HLS conversion

double Labf (const double ratio)
 These help the LAB conversion.

double Labfinv (const double ratio)

Protected Attributes

float _col [4]


Constructor & Destructor Documentation

InSpace::Color::Color (   )  [inline]
 

InSpace::Color::Color (  const Color &  c  )  [inline]
 

InSpace::Color::Color (  const float  r,
const float  g,
const float  b,
const float  a = 1.0
)  [inline]
 

InSpace::Color::Color (  str_ptr  colstr  )  [inline]
 

virtual InSpace::Color::~Color (   )  [inline, virtual]
 


Member Function Documentation

float InSpace::Color::a (   )  const [inline]
 

float* InSpace::Color::array (   )  [inline]
 

float InSpace::Color::b (   )  const [inline]
 

bool InSpace::Color::findMaxA_AB_LAB (  const float  L,
float &  a,
float &  b,
const float  minA = MIN_A,
const float  maxA = MAX_A,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMaxA_LA_LAB (  float &  L,
float &  a,
const float  b,
const float  minA = MIN_A,
const float  maxA = MAX_A,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMaxA_LAB (  const float  L,
float &  a,
const float  b,
const float  minA = MIN_A,
const float  maxA = MAX_A,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMaxB_AB_LAB (  const float  L,
float &  a,
float &  b,
const float  minB = MIN_B,
const float  maxB = MAX_B,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMaxB_LAB (  const float  L,
const float  a,
float &  b,
const float  minB = MIN_B,
const float  maxB = MAX_B,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMaxB_LB_LAB (  float &  L,
const float  a,
float &  b,
const float  minB = MIN_B,
const float  maxB = MAX_B,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMaxL_LA_LAB (  float &  L,
float &  a,
const float  b,
const float  minL = MIN_L,
const float  maxL = MAX_L,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMaxL_LAB (  float &  L,
const float  a,
const float  b,
const float  minL = MIN_L,
const float  maxL = MAX_L,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

the following functions find the max/min for a particular value when the other two values are constant

bool InSpace::Color::findMaxL_LB_LAB (  float &  L,
const float  a,
float &  b,
const float  minL = MIN_L,
const float  maxL = MAX_L,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinA_AB_LAB (  const float  L,
float &  a,
float &  b,
const float  minA = MIN_A,
const float  maxA = MAX_A,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinA_LA_LAB (  float &  L,
float &  a,
const float  b,
const float  minA = MIN_A,
const float  maxA = MAX_A,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinA_LAB (  const float  L,
float &  a,
const float  b,
const float  minA = MIN_A,
const float  maxA = MAX_A,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinB_AB_LAB (  const float  L,
float &  a,
float &  b,
const float  minB = MIN_B,
const float  maxB = MAX_B,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinB_LAB (  const float  L,
const float  a,
float &  b,
const float  minB = MIN_B,
const float  maxB = MAX_B,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinB_LB_LAB (  float &  L,
const float  a,
float &  b,
const float  minB = MIN_B,
const float  maxB = MAX_B,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinL_LA_LAB (  float &  L,
float &  a,
const float  b,
const float  minL = MIN_L,
const float  maxL = MAX_L,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinL_LAB (  float &  L,
const float  a,
const float  b,
const float  minL = MIN_L,
const float  maxL = MAX_L,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

bool InSpace::Color::findMinL_LB_LAB (  float &  L,
const float  a,
float &  b,
const float  minL = MIN_L,
const float  maxL = MAX_L,
const float  interval = INITIAL_INTERVAL,
const bool  recursiveSuccess = false
)  [static]
 

float InSpace::Color::g (   )  const [inline]
 

void InSpace::Color::getHLS (  float &  h,
float &  l,
float &  s
) 
 

get color in HLS mode: "h" (hue 0.0-360.0), "l" (lightness 0.0-1.0), and "s" (saturation 0.0-1.0)

void InSpace::Color::getLAB (  float &  L,
float &  a,
float &  b
) 
 

get the color in LAB mode: "L" (lightness), "a" (green to red), and "b" (blue to yellow)

float InSpace::Color::getLABChroma (  const float  L,
const float  a,
const float  b
)  [static]
 

get the chroma (0.0-100.0), assumes valid LAB values

float InSpace::Color::getLABColorDifference (  const float  L1,
const float  a1,
const float  b1,
const float  L2,
const float  a2,
const float  b2
)  [static]
 

returns the a value of difference in color

float InSpace::Color::getLABHue (  const float  L,
const float  a,
const float  b
)  [static]
 

get the hue angle (0.0-360.0), assumes valid LAB values -- note: does not correspond to 'H' in HLS

float InSpace::Color::getLABSaturation (  const float  L,
const float  a,
const float  b
)  [static]
 

get the saturation (0.0-100.0), assumes valid LAB values

void InSpace::Color::getXYZ (  float &  X,
float &  Y,
float &  Z
) 
 

get the color in CIEXYZ mode

double InSpace::Color::Labf (  const double  ratio  )  [inline, static, protected]
 

These help the LAB conversion.

double InSpace::Color::Labfinv (  const double  ratio  )  [inline, static, protected]
 

void InSpace::Color::LABtoXYZ (  const float  L,
const float  A,
const float  B,
float &  X,
float &  Y,
float &  Z
) 
 

convert from LAB mode to XYZ mode

bool InSpace::Color::operator== (  const Color &  c  )  const [inline]
 

float& InSpace::Color::operator[] (  const int  index  )  [inline]
 

float InSpace::Color::operator[] (  const int  index  )  const [inline]
 

float InSpace::Color::r (   )  const [inline]
 

void InSpace::Color::set (  str_ptr  colstr  ) 
 

can call this with a CONFIGval, for example

void InSpace::Color::set (  const float  r,
const float  g,
const float  b,
const float  a = 1.0
)  [inline]
 

void InSpace::Color::setHLS (  const float  h,
const float  l,
const float  s,
const float  a = 1.0
) 
 

set the color in HLS mode: "h" (hue 0.0-360.0), "l" (lightness 0.0-1.0), and "s" (saturation 0.0-1.0)

bool InSpace::Color::setLAB (  const float  L,
const float  a,
const float  b,
const float  alpha = 1.0
) 
 

Set the color in LAB mode--if LAB is invalid, closest rgb color is set and false returned; else, true returned.

void InSpace::Color::setLABChromaSaturationHue (  float &  L,
float &  a,
float &  b,
const float  chroma,
const float  saturation,
const float  hue
)  [static]
 

void InSpace::Color::setLABLightnessChromaHue (  const float  L,
float &  a,
float &  b,
const float  chroma,
const float  hue
)  [static]
 

the following four functions set LAB values, to actually set the RGB value, setLAB() needs to be called

void InSpace::Color::setLABLightnessSaturationHue (  const float  L,
float &  a,
float &  b,
const float  saturation,
const float  hue
)  [static]
 

void InSpace::Color::setLABSaturationAB (  float &  L,
const float  a,
const float  b,
const float  saturation
)  [static]
 

double InSpace::Color::value (  double  n1,
double  n2,
double  hue
)  [static, protected]
 

helps the HLS conversion


Member Data Documentation

float InSpace::Color::_col[4] [protected]
 

const Color InSpace::Color::black [static]
 

const Color InSpace::Color::blue [static]
 

const Color InSpace::Color::brown [static]
 

const Color InSpace::Color::cyan [static]
 

const Color InSpace::Color::firebrick [static]
 

const Color InSpace::Color::green [static]
 

const Color InSpace::Color::grey [static]
 

const Color InSpace::Color::magenta [static]
 

const Color InSpace::Color::orange [static]
 

const Color InSpace::Color::pink [static]
 

const Color InSpace::Color::red [static]
 

const double InSpace::Color::RGBtoXYZarray[3][3] [static]
 

const Color InSpace::Color::tan [static]
 

const Color InSpace::Color::white [static]
 

const double InSpace::Color::XYZtoRGBarray[3][3] [static]
 

const Color InSpace::Color::yellow [static]
 


The documentation for this class was generated from the following file:
Generated on Thu Jul 8 15:19:30 2004 for inspace by doxygen 1.3.4