cColorb Struct Reference
[Graphics]

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

GLfloat cColorb::getA (  )  const [inline]

Read the alpha component.

GLfloat cColorb::getB (  )  const [inline]

Read the blue component.

cColorf cColorb::getColorf ( void   )  const

Return this color converted to cColorf format.

Converts current color to cColorf format.

GLfloat cColorb::getG (  )  const [inline]

Read the green component.

GLfloat cColorb::getR (  )  const [inline]

Read the red component.

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

Return a pointer to the raw color array.

Returns:
Return memory location of color array.

void cColorb::render (  )  const [inline]

Render this color in OpenGL (sets it to be the current color). Does not confirm that GL color-tracking is enabled.

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::setA ( const GLubyte  a_alpha  )  [inline]

Set the alpha component.

Parameters:
a_alpha Alpha component.

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

Set the blue component.

Parameters:
a_blue Blue component.

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

Set the green component.

Parameters:
a_green Green 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.


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


CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.