GVectors::Color Class Reference

Represents a color in RGB style. More...

#include <color.h>

List of all members.

Public Member Functions

 Color ()
 Constructor.
 Color (float r, float g, float b)
 Constructor.
 Color (const Color &c)
 Copy constructor.
 ~Color ()
 Destructor.
const Coloroperator= (const Color &c)
 Assignment operator.
void red (float r)
 Sets the red component.
void green (float g)
 Sets the green component.
void blue (float b)
 Sets the blue component.
float red () const
 Gets the red component.
float green () const
 Gets the green component.
float blue () const
 Gets the blue component.
Color operator+ (const Color &c)
 Add colors.
Color operator- (const Color &c)
 Subtract colors.

Private Attributes

float c_red
 The red component.
float c_green
 The green component.
float c_blue
 The blue component.


Detailed Description

Represents a color in RGB style. It has no special functionality.


Constructor & Destructor Documentation

GVectors::Color::Color (  )  [inline]

Sets all component to zero.

GVectors::Color::Color ( float  r,
float  g,
float  b 
) [inline]

Initializes the color components to the given values.

Parameters:
r Value of the red component.
g Value of the green component.
b Value of the blue component.

GVectors::Color::Color ( const Color c  )  [inline]

Copy constructor.

Parameters:
c A const reference to a Color.

GVectors::Color::~Color (  )  [inline]

Destructor. Just for completeness. Does nothing.


Member Function Documentation

const Color& GVectors::Color::operator= ( const Color c  )  [inline]

Assignment operator.

Parameters:
c A const reference to a Color.
Returns:
A const reference to this.

void GVectors::Color::red ( float  r  )  [inline]

Sets the red component.

Parameters:
r Value of the red component.

void GVectors::Color::green ( float  g  )  [inline]

Sets the green component.

Parameters:
g Value of the green component.

void GVectors::Color::blue ( float  b  )  [inline]

Sets the blue component.

Parameters:
b Value of the blue component.

float GVectors::Color::red (  )  const [inline]

Gets the red component.

Returns:
Value of the red component.

float GVectors::Color::green (  )  const [inline]

Gets the green component.

Returns:
Value of the green component.

float GVectors::Color::blue (  )  const [inline]

Gets the blue component.

Returns:
Value of the blue component.

Color GVectors::Color::operator+ ( const Color c  )  [inline]

Adds another Color to this.

Parameters:
c A const reference to the Color to be added.
Returns:
A Color representing the sum.

Color GVectors::Color::operator- ( const Color c  )  [inline]

Subtracts another Color from this.

Parameters:
c A const reference to the Color to be subtracted.
Returns:
A Color representing the difference.


Member Data Documentation

float GVectors::Color::c_red [private]

The red component of the color.

float GVectors::Color::c_green [private]

The green component of the color.

float GVectors::Color::c_blue [private]

The blue component of the color.


The documentation for this class was generated from the following file:
Generated on Sat Sep 8 19:37:30 2007 for libgvectors by  doxygen 1.4.7