cee::Color3f Class Reference

Class for storing an RGB color triplet. More...

Public Member Functions

 Color3f ()
 Constructs a default color object. More...
 
 Color3f (const Color3f &other)
 Constructs a color as a copy of other. More...
 
 Color3f (float r, float g, float b)
 Constructs a color using the color components r, g, b. More...
 
Color3foperator= (const Color3f &rhs)
 Assigns rhs to this color and returns a reference to this color. More...
 
bool operator== (const Color3f &rhs) const
 Returns true if rhs is equal to this color; otherwise returns false. More...
 
bool operator!= (const Color3f &rhs) const
 Returns true if rhs is not equal to this color; otherwise returns false. More...
 
const float & r () const
 Red color component. More...
 
const float & g () const
 Green color component. More...
 
const float & b () const
 Blue color component. More...
 
float & r ()
 Red color component. More...
 
float & g ()
 Green color component. More...
 
float & b ()
 Green color component. More...
 
bool isValid () const
 Returns true if the color is valid (all components in the range 0.0 -> 1.0) More...
 

Detailed Description

Class for storing an RGB color triplet.

Each color component is floating point value in the interval [0.0, 1.0].

Constructor & Destructor Documentation

cee::Color3f::Color3f ( )

Constructs a default color object.

Initializes all color components to 0.0.

cee::Color3f::Color3f ( const Color3f other)

Constructs a color as a copy of other.

cee::Color3f::Color3f ( float  r,
float  g,
float  b 
)

Constructs a color using the color components r, g, b.

Member Function Documentation

const float & cee::Color3f::b ( ) const

Blue color component.

Used for setting or getting the blue color component of the color, e.g.

color.b = 0.5f;
float blue = color.b;

float & cee::Color3f::b ( )

Green color component.

Used for setting or getting the green color component of the color, e.g.

color.g = 0.5f;
float green = color.g;

const float & cee::Color3f::g ( ) const

Green color component.

Used for setting or getting the green color component of the color, e.g.

color.g = 0.5f;
float green = color.g;

float & cee::Color3f::g ( )

Green color component.

Used for setting or getting the green color component of the color, e.g.

color.g = 0.5f;
float green = color.g;

bool cee::Color3f::isValid ( ) const

Returns true if the color is valid (all components in the range 0.0 -> 1.0)

bool cee::Color3f::operator!= ( const Color3f rhs) const

Returns true if rhs is not equal to this color; otherwise returns false.

Color3f & cee::Color3f::operator= ( const Color3f rhs)

Assigns rhs to this color and returns a reference to this color.

bool cee::Color3f::operator== ( const Color3f rhs) const

Returns true if rhs is equal to this color; otherwise returns false.

const float & cee::Color3f::r ( ) const

Red color component.

Used for setting or getting the red color component of the color, e.g.

color.r = 0.5f;
float red = color.r;

float & cee::Color3f::r ( )

Red color component.

Used for setting or getting the red color component of the color, e.g.

color.r = 0.5f;
float red = color.r;