Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

Color32 Class Reference

#include <color.h>

Collaboration diagram for Color32:

Collaboration graph
[legend]
List of all members.

Detailed Description

Color abstraction in device native format storage, accessible through RGBA order Color represented by 32 bit unsigned int (8 bit unsigned char per element), RGBA (A high bit, R low bit) or BGRA (A high bit, B low bit) storage order. Access to components are always made through RGBA order with red as component 0 and alpha as component 3.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 Color32 ()
 Color32 (unsigned char ucR, unsigned char ucG, unsigned char ucB, unsigned char ucA=0xFF)
 Color32 (unsigned char *pucComponents)
 Color32 (const Color &rkColor)
 Color32 (float *pfComponents)
 Color32 (float fR, float fG, float fB, float fA=1.0f)
void Set (unsigned char ucR, unsigned char ucG, unsigned char ucB, unsigned char ucA=0xFF)
void Set (unsigned char *pucComponents)
void Set (const Color &rkColor)
void Set (float fR, float fG, float fB, float fA=1.0f)
 operator const unsigned int & () const
 operator unsigned char * ()
unsigned char & operator[] (int iComponent)
const unsigned char & operator[] (int iComponent) const
Color32operator= (const Color32 &rkColor)
Color32operator= (const Color &rkColor)
Color32operator= (unsigned int uiColor)

Static Public Attributes

unsigned int s_uiShift [4]
unsigned int s_uiComponent [4]

Private Attributes

NeoEngine::Color32::Color32Union m_uiColor
 Union for easy access as unsigned int or unsigned char[].


Constructor & Destructor Documentation

Color32  )  [inline]
 

Reset to black [0,0,0,1]

Color32 unsigned char  ucR,
unsigned char  ucG,
unsigned char  ucB,
unsigned char  ucA = 0xFF
[inline]
 

Set values

Parameters:
ucR Red
ucG Green
ucB Blue
ucA Alpha

Color32 unsigned char *  pucComponents  )  [inline]
 

Set values from component array in RGBA order

Parameters:
pucComponents Components in RGBA order

Color32 const Color rkColor  )  [inline]
 

Set values from Color object

Parameters:
rkColor Color

Color32 float *  pfComponents  )  [inline]
 

Set values (components in range [0,1] )

Parameters:
pfComponents Color channels array as floats in rgba order

Color32 float  fR,
float  fG,
float  fB,
float  fA = 1.0f
[inline]
 

Set values (components in range [0,1] )

Parameters:
fR Red
fG Green
fB Blue
fA Alpha


Member Function Documentation

void Set unsigned char  ucR,
unsigned char  ucG,
unsigned char  ucB,
unsigned char  ucA = 0xFF
[inline]
 

Set values

Parameters:
ucR Red
ucG Green
ucB Blue
ucA Alpha

void Set unsigned char *  pucComponents  )  [inline]
 

Set values from component array

Parameters:
pucComponents Components

void Set const Color rkColor  )  [inline]
 

Set values

Parameters:
rkColor Color reference

void Set float  fR,
float  fG,
float  fB,
float  fA = 1.0f
[inline]
 

Set values (components in range [0,1] )

Parameters:
fR Red
fG Green
fB Blue
fA Alpha (defaults to 1.0f)

operator const unsigned int &  )  const [inline]
 

Conversion, FOR NATIVE USE ONLY!

operator unsigned char *  )  [inline]
 

Conversion, FOR NATIVE USE ONLY!

unsigned char& operator[] int  iComponent  )  [inline]
 

Array access to elements in RGBA order, with r = 0, g = 1, b = 2 and a =3

const unsigned char& operator[] int  iComponent  )  const [inline]
 

Array access to elements

Color32& operator= const Color32 rkColor  )  [inline]
 

Copy

Parameters:
rkColor Values to copy
Returns:
ref to resulting color (this)

Color32& operator= const Color rkColor  )  [inline]
 

Copy

Parameters:
rkColor Values to copy
Returns:
ref to resulting color (this)

Color32& operator= unsigned int  uiColor  )  [inline]
 

Set value from unigned int value in RGBA order

Parameters:
uiColor Color
Returns:
ref to resulting color (this)


Member Data Documentation

unsigned int s_uiShift[4] [static]
 

Internal engine data

unsigned int s_uiComponent[4] [static]
 

Internal engine data


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:10 2004 for NeoEngine by doxygen 1.3.5