Odyssey::color Class Reference

Standard, flexible color representation. More...

#include <color.h>

List of all members.

Public Types

enum  ColorSystem {
  CS_RGB, CS_XYZ, CS_Yxy, CS_HSL,
  CS_HSV
}
 The available color systems are represented in this enum. More...

Public Member Functions

 color (float32 v1=1.0f, float32 v2=1.0f, float32 v3=1.0f, float32 alpha=1.0f, ColorSystem cs=CS_RGB)
 Construct a default color, set to all white in RGB.
 color (const color &c)
 Assign the values from this given color to this one.
float32 getAlpha () const
 Returns the alpha channel.
void setAlpha (float32 alpha)
 Assigns the alpha channel.
float32 getValue (uint8 i) const
 Retrieves the channel at the given index.
void setValue (uint8 i, float32 value)
 Assigns the indexed channel.
ColorSystem getColorSystem () const
 Returns the color system.
void setColorSystem (ColorSystem cs)
 Set the color system to one of the values in ColorSystem enum.
float32operator[] (uint8 i)
 Operator access to the color channels.
const float32operator[] (uint8 i) const
 Operator access to the color channels.
coloroperator= (const color &c)

Public Attributes

float32a
float32r
float32g
float32b


Detailed Description

Standard, flexible color representation.

This class is used as the Odyssey standard color data type. color allows for multiple color systems to be stored in one type. This color type also supports an alpha channel.


Member Enumeration Documentation

enum Odyssey::color::ColorSystem
 

The available color systems are represented in this enum.

Enumerator:
CS_RGB 
CS_XYZ 
CS_Yxy 
CS_HSL 
CS_HSV 


Constructor & Destructor Documentation

Odyssey::color::color float32  v1 = 1.0f,
float32  v2 = 1.0f,
float32  v3 = 1.0f,
float32  alpha = 1.0f,
ColorSystem  cs = CS_RGB
 

Construct a default color, set to all white in RGB.

Odyssey::color::color const color c  ) 
 

Assign the values from this given color to this one.


Member Function Documentation

float32 Odyssey::color::getAlpha  )  const
 

Returns the alpha channel.

ColorSystem Odyssey::color::getColorSystem  )  const
 

Returns the color system.

float32 Odyssey::color::getValue uint8  i  )  const
 

Retrieves the channel at the given index.

color& Odyssey::color::operator= const color c  ) 
 

const float32& Odyssey::color::operator[] uint8  i  )  const
 

Operator access to the color channels.

See also:
getValue

float32& Odyssey::color::operator[] uint8  i  ) 
 

Operator access to the color channels.

See also:
getValue

void Odyssey::color::setAlpha float32  alpha  ) 
 

Assigns the alpha channel.

Assign the alpha channel (color system independent).

Parameters:
alpha the new alpha value

void Odyssey::color::setColorSystem ColorSystem  cs  ) 
 

Set the color system to one of the values in ColorSystem enum.

void Odyssey::color::setValue uint8  i,
float32  value
 

Assigns the indexed channel.

This will assign the indexed channel to the given value. The channel indices point to color system dependent values.

Parameters:
i the channel index
value the new channel value


Member Data Documentation

float32& Odyssey::color::a
 

float32 & Odyssey::color::b
 

float32 & Odyssey::color::g
 

float32 & Odyssey::color::r
 


The documentation for this class was generated from the following file:
Generated on Sun Jan 7 01:18:52 2007 for Odyssey Meta-Engine by  doxygen 1.4.6-NO