color Class Reference

#include <color.hpp>

Inheritance diagram for color:

Inheritance graph
[legend]
Collaboration diagram for color:

Collaboration graph
[legend]

List of all members.


Detailed Description

Definition at line 47 of file color.hpp.


Public Types

enum  component {
  COMPONENT_RED = 0, COMPONENT_GREEN = 1, COMPONENT_BLUE = 2, COMPONENT_ALPHA = 3,
  NUM_COMPONENTS = 4
}

Public Member Functions

 color (const color &c)
 color (float red=1.0f, float green=1.0f, float blue=1.0f, float alpha=1.0f)
const floatget_val () const
floatget_val (const component c)
const floatget_val (const component c) const
coloroperator= (const color &c)
floatoperator[] (const component c)
const floatoperator[] (const component c) const
void set () const
 Sets the current OpenGL color to the value of this color.

Static Public Attributes

static const color BLACK
static const color WHITE

Private Attributes

float val [4]

Member Enumeration Documentation

enum component

Enumerator:
COMPONENT_RED 
COMPONENT_GREEN 
COMPONENT_BLUE 
COMPONENT_ALPHA 
NUM_COMPONENTS 

Definition at line 53 of file color.hpp.


Constructor & Destructor Documentation

color ( float  red = 1.0f,
float  green = 1.0f,
float  blue = 1.0f,
float  alpha = 1.0f 
) [inline]

Definition at line 55 of file color.hpp.

color ( const color c  )  [inline]

Definition at line 63 of file color.hpp.

References color::val.


Member Function Documentation

const float* get_val (  )  const [inline]

Definition at line 87 of file color.hpp.

float& get_val ( const component  c  )  [inline]

Definition at line 78 of file color.hpp.

const float& get_val ( const component  c  )  const [inline]

Definition at line 77 of file color.hpp.

Referenced by material::bind(), light::bind(), and checkered_box::draw().

color& operator= ( const color c  )  [inline]

Definition at line 69 of file color.hpp.

References color::val.

float& operator[] ( const component  c  )  [inline]

Definition at line 81 of file color.hpp.

const float& operator[] ( const component  c  )  const [inline]

Definition at line 80 of file color.hpp.

void set (  )  const


Member Data Documentation

const color BLACK [static]

Definition at line 91 of file color.hpp.

Referenced by checkered_box::draw().

float val[4] [private]

Definition at line 50 of file color.hpp.

Referenced by color::color(), color::operator=(), and color::set().

const color WHITE [static]

Definition at line 92 of file color.hpp.


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

Generated on Sat Mar 1 13:50:07 2008 for Periapsis Project by  doxygen 1.5.5