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

Color Class Reference

#include <color.h>

Collaboration diagram for Color:

Collaboration graph
[legend]
List of all members.

Detailed Description

Color abstraction Color represented by 4 float (32 bit), RGBA order.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 Color ()
 Color (unsigned int uiColor)
 Color (float fR, float fG, float fB, float fA=1.0f)
void Set (float fR, float fG, float fB, float fA=1.0f)
void Set (unsigned int uiColor)
void Set (const Color &rkColor)
 operator float * ()
 operator const float * () const
float & operator[] (int iComponent)
const float & operator[] (int iComponent) const
Coloroperator= (const Color &rkColor)
bool operator== (const Color &rkColor) const
bool operator!= (const Color &rkColor) const

Public Attributes

float r
float g
float b
float a

Static Public Attributes

const NE_STATIC Color BLACK
const NE_STATIC Color WHITE
const NE_STATIC Color RED
const NE_STATIC Color GREEN
const NE_STATIC Color BLUE


Constructor & Destructor Documentation

Color  )  [inline]
 

Reset to [0,0,0,1]

Color unsigned int  uiColor  )  [inline]
 

Set values from 32bit integer (one byte per channel) color

Parameters:
uiColor color

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

Set values

Parameters:
fR Red
fG Green
fB Blue
fA Alpha


Member Function Documentation

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

Set values

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

void Set unsigned int  uiColor  )  [inline]
 

Set values

Parameters:
uiColor color as 32bit integer

void Set const Color rkColor  )  [inline]
 

Set values

Parameters:
rkColor Color reference

operator float *  )  [inline]
 

Conversion, to allow easy component access

operator const float *  )  const [inline]
 

Conversion, to allow easy component access

float& operator[] int  iComponent  )  [inline]
 

Array access to elements

const float& operator[] int  iComponent  )  const [inline]
 

Array access to elements

Color& operator= const Color rkColor  )  [inline]
 

Copy

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

bool operator== const Color rkColor  )  const [inline]
 

Compare

Parameters:
rkColor Values to compare with
Returns:
true if components equal (no EPSILON test!)

bool operator!= const Color rkColor  )  const [inline]
 

Compare

Parameters:
rkColor Values to compare with
Returns:
true if components differ (no EPSILON test!)


Member Data Documentation

float r
 

Components

float g
 

Components

float b
 

Components

float a
 

Components

const NE_STATIC Color BLACK [static]
 

Predefined color, black

const NE_STATIC Color WHITE [static]
 

Predefined color, white

const NE_STATIC Color RED [static]
 

Predefined color, white

const NE_STATIC Color GREEN [static]
 

Predefined color, white

const NE_STATIC Color BLUE [static]
 

Predefined color, white


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