cColorb Struct Reference

cColorb describes a color composed of 4 bytes. More...

#include <CColor.h>

List of all members.

Public Member Functions

 cColorb ()
 cColorb (const GLubyte a_red, const GLubyte a_green, const GLubyte a_blue, const GLubyte a_alpha=0xff)
 ~cColorb ()
void set (const GLubyte a_red, const GLubyte a_green, const GLubyte a_blue, const GLubyte a_alpha=0xff)
void setMem3 (const GLubyte *a_colorRGB)
void setMem4 (const GLubyte *a_colorRGBA)
void setR (const GLubyte a_red)
GLfloat getR () const
void setG (const GLubyte a_green)
GLfloat getG () const
void setB (const GLubyte a_blue)
GLfloat getB () const
void setA (const GLubyte a_alpha)
GLfloat getA () const
void render () const
const GLubyte * pColor () const
cColorf getColorf () const

Public Attributes

GLubyte m_color [4]
 Color in GLubyte format [R,G,B,A].


Detailed Description

cColorb describes a color composed of 4 bytes.


Constructor & Destructor Documentation

cColorb::cColorb (  )  [inline]

Constructor of cColorb.

cColorb::cColorb ( const GLubyte  a_red,
const GLubyte  a_green,
const GLubyte  a_blue,
const GLubyte  a_alpha = 0xff 
) [inline]

Constructor of cColorb. Define a color by passing its RGBA components. as parameters.

Parameters:
a_red Red component.
a_green Green component.
a_blue Blue component.
a_alpha Alpha component.

cColorb::~cColorb (  )  [inline]

Destructor of cColorf.


Member Function Documentation

void cColorb::set ( const GLubyte  a_red,
const GLubyte  a_green,
const GLubyte  a_blue,
const GLubyte  a_alpha = 0xff 
) [inline]

Set a color by passing its RGBA components as parameters.

Parameters:
a_red Red component.
a_green Green component.
a_blue Blue component.
a_alpha Alpha component.

void cColorb::setMem3 ( const GLubyte *  a_colorRGB  )  [inline]

Set color by copying three floats from an external array, each describing an RGB component. Alpha is set to 0xff.

Parameters:
a_colorRGB Pointer to array of type GLubyte.

void cColorb::setMem4 ( const GLubyte *  a_colorRGBA  )  [inline]

Set color by copying four floats from an external array, each describing an RGBA component

Parameters:
a_colorRGBA Pointer to an array of type GLubyte

void cColorb::setR ( const GLubyte  a_red  )  [inline]

Set the red component.

Parameters:
a_red Red component

GLfloat cColorb::getR (  )  const [inline]

Read the red component

void cColorb::setG ( const GLubyte  a_green  )  [inline]

Set the green component

Parameters:
a_green Green component

GLfloat cColorb::getG (  )  const [inline]

Read the green component

void cColorb::setB ( const GLubyte  a_blue  )  [inline]

Set the blue component

Parameters:
a_blue Blue component

GLfloat cColorb::getB (  )  const [inline]

Read the blue component

void cColorb::setA ( const GLubyte  a_alpha  )  [inline]

Set the alpha component

Parameters:
a_alpha Alpha component

GLfloat cColorb::getA (  )  const [inline]

Read the alpha component.

void cColorb::render (  )  const [inline]

Render this color in OpenGL (sets it to be the currnent color)

Does not confirm that GL color-tracking is enabled

const GLubyte* cColorb::pColor (  )  const [inline]

Return a pointer to the raw color array

Returns:
Return memory location of color array

cColorf cColorb::getColorf (  )  const [inline]

Return this color converted to cColorf format.

This method is the only method defined outside the class definition, to avoid a recursive referencing problem with the cColorf class.


The documentation for this struct was generated from the following file:
Generated on Mon Jun 11 09:41:47 2007 for CHAI 3D by  doxygen 1.5.2