Color Class Reference

Color class. More...

#include <Color.h>

Inheritance diagram for Color:

Object

List of all members.

Public Member Functions

 Color ()
 Standard constructor.
 Color (const enum colorCode &code)
 Constructor with initialization.
 Color (const GLubyte &red, const GLubyte &green, const GLubyte &blue)
 Constructor with initialization.
 Color (const GLubyte &red, const GLubyte &green, const GLubyte &blue, const GLubyte &alpha)
 Constructor with initialization.
 Color (const Color &source)
 Copy constructor.
 ~Color ()
 Destructor.
void colorGl (const bool &alpha)
 Uses this color in OpenGl;.
GLubyte getRed ()
 Getter for red.
GLubyte getGreen ()
 Getter for green.
GLubyte getBlue ()
 Getter for blue.
GLubyte getAlpha ()
 Getter for alpha.
void setRed (const GLubyte &red)
 Setter for red.
void setGreen (const GLubyte &green)
 Setter for green.
void setBlue (const GLubyte &blue)
 Setter for blue.
void setAlpha (const GLubyte &alpha)
 Setter for alpha.
virtual string toString () const
 Returns a textual representation.
virtual string className () const
 Returns the class name of the object.
virtual enum classId classId () const
 Returns the class id of the object.
Color operator= (const Color &color)
 Operator =.

Private Attributes

GLubyte channels [4]
 The color values.


Detailed Description

Color class.

Color objects model colors in the RGBA space and provide means to use them in OpenGL.


Constructor & Destructor Documentation

Color::Color (  ) 

Standard constructor.

Creates a black color

Color::Color ( const enum colorCode code  ) 

Constructor with initialization.

Creates a color by initialization.

Parameters:
code The color code to be used

Color::Color ( const GLubyte &  red,
const GLubyte &  green,
const GLubyte &  blue 
)

Constructor with initialization.

Creates a color by initialization.

Parameters:
red The red channel value of the color
green The green channel value of the color
blue The blue channel value of the color

Color::Color ( const GLubyte &  red,
const GLubyte &  green,
const GLubyte &  blue,
const GLubyte &  alpha 
)

Constructor with initialization.

Creates a color by initialization.

Parameters:
red The red channel value of the color
green The green channel value of the color
blue The blue channel value of the color
alpha The alpha channel value of the color

Color::Color ( const Color source  ) 

Copy constructor.

Creates a new color by cloning a source

Parameters:
source The color to be cloned

Color::~Color (  ) 

Destructor.


Member Function Documentation

void Color::colorGl ( const bool &  alpha  ) 

Uses this color in OpenGl;.

GLubyte Color::getRed (  ) 

Getter for red.

Returns:
value of the red channel

GLubyte Color::getGreen (  ) 

Getter for green.

Returns:
value of the green channel

GLubyte Color::getBlue (  ) 

Getter for blue.

Returns:
value of the blue channel

GLubyte Color::getAlpha (  ) 

Getter for alpha.

Returns:
value of the alpha channel

void Color::setRed ( const GLubyte &  red  ) 

Setter for red.

Parameters:
red the new value for the red channel

void Color::setGreen ( const GLubyte &  green  ) 

Setter for green.

Parameters:
green the new value for the green channel

void Color::setBlue ( const GLubyte &  blue  ) 

Setter for blue.

Parameters:
blue the new value for the blue channel

void Color::setAlpha ( const GLubyte &  alpha  ) 

Setter for alpha.

Parameters:
alpha the new value for the alpha channel

string Color::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

Reimplemented from Object.

string Color::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

Reimplemented from Object.

enum classId Color::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Reimplemented from Object.

Color Color::operator= ( const Color color  )  [inline]

Operator =.


Member Data Documentation

GLubyte Color::channels[4] [private]

The color values.


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

Generated on Mon Jul 7 13:30:33 2008 for Firefly by  doxygen 1.5.6