cColorf Struct Reference
[Graphics]

cColorf describes a color composed of 4 GLfloats. More...

#include <CColor.h>

List of all members.

Public Member Functions

 cColorf ()
 cColorf (const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha=1.0)
 ~cColorf ()
void set (const GLfloat a_red, const GLfloat a_green, const GLfloat a_blue, const GLfloat a_alpha=1.0)
void setMem3 (const GLfloat *a_colorRGB)
void setMem4 (const GLfloat *a_colorRGBA)
GLfloat operator[] (const unsigned int n) const
GLfloat & operator[] (const unsigned int n)
void setR (const GLfloat a_red)
GLfloat getR () const
void setG (const GLfloat a_green)
GLfloat getG () const
void setB (const GLfloat a_blue)
GLfloat getB () const
void setA (const GLfloat a_alpha)
GLfloat getA () const
void render () const
const GLfloat * pColor () const
cColorb getColorb () const

Public Attributes

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


Detailed Description

cColorf describes a color composed of 4 GLfloats.

Constructor & Destructor Documentation

cColorf::cColorf (  )  [inline]

Default constructor of cColorf (color defaults to opaque white).

cColorf::cColorf ( const GLfloat  a_red,
const GLfloat  a_green,
const GLfloat  a_blue,
const GLfloat  a_alpha = 1.0 
) [inline]

Constructor of cColorf. 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

cColorf::~cColorf (  )  [inline]

Destructor of cColorf.


Member Function Documentation

GLfloat cColorf::getA (  )  const [inline]

Read the alpha component.

GLfloat cColorf::getB (  )  const [inline]

Read the blue component.

cColorb cColorf::getColorb ( void   )  const

Returns this color, converted to cColorb format.

Converts current color to cColorb format.

GLfloat cColorf::getG (  )  const [inline]

Read the green component.

GLfloat cColorf::getR (  )  const [inline]

Read the red component.

GLfloat& cColorf::operator[] ( const unsigned int  n  )  [inline]

Access the nth component of this color (we provide both const and non-const versions so you can use this operator as an l-value or an r-value).

GLfloat cColorf::operator[] ( const unsigned int  n  )  const [inline]

Access the nth component of this color (we provide both const and non-const versions so you can use this operator as an l-value or an r-value).

const GLfloat* cColorf::pColor (  )  const [inline]

Returns a pointer to the raw color array.

void cColorf::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 cColorf::set ( const GLfloat  a_red,
const GLfloat  a_green,
const GLfloat  a_blue,
const GLfloat  a_alpha = 1.0 
) [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 cColorf::setA ( const GLfloat  a_alpha  )  [inline]

Set the alpha component.

Parameters:
a_alpha Alpha component.

void cColorf::setB ( const GLfloat  a_blue  )  [inline]

Set the blue component.

Parameters:
a_blue Blue component.

void cColorf::setG ( const GLfloat  a_green  )  [inline]

Set the green component.

Parameters:
a_green Green component.

void cColorf::setMem3 ( const GLfloat *  a_colorRGB  )  [inline]

Set color by copying three GLfloats from an external array, each describing one of the RGB components. Alpha is set to 1.0.

Parameters:
a_colorRGB Pointer to an array of type float.

void cColorf::setMem4 ( const GLfloat *  a_colorRGBA  )  [inline]

Set color by copying four GLfloats from an external array, each describing one of the RGBA components.

Parameters:
a_colorRGBA Pointer to an array of type float.

void cColorf::setR ( const GLfloat  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.