cpe::color Class Reference

Container class for (r,g,b) color. Each component is an integer in [0,255]. More...

List of all members.

Public Member Functions

 color ()
 empty constructor (0,0,0)
 color (const unsigned char &gray)
 direct constructor with gray value (r,b,g)=(gray,gray,gray)
 color (const unsigned char &r, const unsigned char &g, const unsigned char &b)
 direct constructor with (r,b,g) value
void set (const unsigned char &r, const unsigned char &g, const unsigned char &b)
 set color value
void get (unsigned char *r, unsigned char *g, unsigned char *b) const
 get color values
const unsigned char & r () const
 get red value
unsigned char & r ()
 get red value
const unsigned char & g () const
 get green value
unsigned char & g ()
 get green value
const unsigned char & b () const
 get blue value
unsigned char & b ()
 get blue value

Static Public Member Functions

static color interpolate_linear (const color &c1, const color &c2, double alpha)
 linear interpolation of colors

Private Attributes

unsigned char internal_r
 internal red component
unsigned char internal_g
 internal green component
unsigned char internal_b
 internal blue component

Friends

std::ostream & operator<< (std::ostream &stream, const color &c)
 standard output

Detailed Description

Container class for (r,g,b) color. Each component is an integer in [0,255].


Constructor & Destructor Documentation

cpe::color::color (  ) 

empty constructor (0,0,0)

Referenced by interpolate_linear().

cpe::color::color ( const unsigned char &  gray  ) 

direct constructor with gray value (r,b,g)=(gray,gray,gray)

cpe::color::color ( const unsigned char &  r,
const unsigned char &  g,
const unsigned char &  b 
)

direct constructor with (r,b,g) value


Member Function Documentation

unsigned char & cpe::color::b (  ) 

get blue value

References internal_b.

const unsigned char & cpe::color::b (  )  const
unsigned char & cpe::color::g (  ) 

get green value

References internal_g.

const unsigned char & cpe::color::g (  )  const
void cpe::color::get ( unsigned char *  r,
unsigned char *  g,
unsigned char *  b 
) const

get color values

References internal_b, internal_g, and internal_r.

color cpe::color::interpolate_linear ( const color c1,
const color c2,
double  alpha 
) [static]

linear interpolation of colors

References b(), color(), g(), and r().

Here is the call graph for this function:

unsigned char & cpe::color::r (  ) 

get red value

References internal_r.

const unsigned char & cpe::color::r (  )  const
void cpe::color::set ( const unsigned char &  r,
const unsigned char &  g,
const unsigned char &  b 
)

set color value

References internal_b, internal_g, and internal_r.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const color c 
) [friend]

standard output


Member Data Documentation

unsigned char cpe::color::internal_b [private]

internal blue component

Referenced by b(), get(), and set().

unsigned char cpe::color::internal_g [private]

internal green component

Referenced by g(), get(), and set().

unsigned char cpe::color::internal_r [private]

internal red component

Referenced by get(), r(), and set().


The documentation for this class was generated from the following files:
Generated on Mon Apr 18 20:43:33 2011 by  doxygen 1.6.3