Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Color Class Reference

#include <color.h>

List of all members.

Public Methods

 Color (float r=1, float g=1, float b=1, float a=1)
 Color (float *color)
 ~Color ()
void set (float r=-1, float g=-1, float b=-1, float a=-1)
void set (float *color)
const float * RGBA ()
float r ()
float g ()
float b ()
float a ()
Color operator * (const Color &c)
Color operator+ (const Color &c)
Color operator- (const Color &c)
Color operator= (const Color &c)

Private Methods

void clamp ()

Private Attributes

float rgba [4]


Detailed Description

Simple colour class
Author:
T Kontkanen


Constructor & Destructor Documentation

Color::Color float   r = 1,
float   g = 1,
float   b = 1,
float   a = 1
 

Create new colour with initial RGBA values. All values are clamped between 0.0 and 1.0.

Color::Color float *   color
 

Create new colour with initial RGBA values. All values are clamped between 0.0 and 1.0. Vales are copied from array of 4 floats.

Color::~Color  
 

Destructor.


Member Function Documentation

const float* Color::RGBA   [inline]
 

Return RGBA-values in array of four floats.

float Color::a   [inline]
 

Return alpha value.

float Color::b   [inline]
 

Return blue value.

void Color::clamp   [private]
 

Clamp RGBA values between 0.0 and 1.0.

float Color::g   [inline]
 

Return green value.

Color Color::operator * const Color &   c
 

Multiply color values with other Color.

Color Color::operator+ const Color &   c
 

Add color values with other Color.

Color Color::operator- const Color &   c
 

Subtract color values with other Color.

Color Color::operator= const Color &   c
 

Equal operator.

float Color::r   [inline]
 

Return red value.

void Color::set float *   color
 

Set new RGBA-values, value -1 doesn't modify existing value. Values are read from array of four floats.

void Color::set float   r = -1,
float   g = -1,
float   b = -1,
float   a = -1
 

Set new RGBA-values, value -1 doesn't modify existing value.


Member Data Documentation

float Color::rgba[4] [private]
 


The documentation for this class was generated from the following file:
Generated at Fri Oct 5 20:23:53 2001 for Executor by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001