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

ColorC Class Reference

RGBA color class. More...

#include <ColorC.h>

List of all members.

Public Methods

 ColorC (const ColorC &rCol)
 Copy constructor.

 ColorC (float32 f32R=0, float32 f32G=0, float32 f32B=0, float32 f32A=1.0f)
 Default constructor.

 ~ColorC ()
 Default destructor.

void convert_from_uint8 (uint8 ui8R, uint8 ui8G, uint8 ui8B, uint8 ui8A=255)
 Converts color from unsigned integer values.

 operator const float32 * ()
 Constant float pointer cast operator.

float32operator[] (int32 i)
 Returns component of the color.

const float32operator[] (int32 i) const
 Returns component of the color.

ColorC operator- () const
 Returns negated color.

bool operator== (const ColorC &rCol) const
 Returns true if both colors are equal, else false.

bool operator!= (const ColorC &rCol) const
 Returns true if colors are not equal, else false.

ColorC & operator-= (const ColorC &rCol)
 Subtracts the color specified by the argument from the color.

ColorC & operator+= (const ColorC &rCol)
 Adds the color specified by the argument to the color.

ColorC & operator *= (float32 f32S)
 Multiplies each color component by the specified number.

ColorC & operator/= (float32 f32S)
 Divides each color component by the specified number.

ColorC operator * (float32 f32S) const
 Multiplies each color component by the specified number and returns the result.

ColorC operator/ (float32 f32S) const
 Divides each color component by the specified number and returns the result.

ColorC operator- (const ColorC &rCol) const
 Subtracts the color specified by the argument from the color and returns the result.

ColorC operator+ (const ColorC &rCol) const
 Adds the color specified by the argument to the color and returns the result.

ColorC operator * (const ColorC &rCol) const
 Multiplies each component of the color by matching component in the specified argument and returns the result.


Friends

ColorC operator * (float32 f32S, const ColorC &rCol)
 Multiplies each color component by the specified number and returns the result.


Detailed Description

RGBA color class.

Color class defines a four component color type. The components are red, green, blue and alpha. All components are handled similar inside the class.

The assumed color range is 0..1.

This class is implemented by the system.


Constructor & Destructor Documentation

ColorC const ColorC &    rCol
 

Copy constructor.

ColorC float32    f32R = 0,
float32    f32G = 0,
float32    f32B = 0,
float32    f32A = 1.0f
 

Default constructor.

~ColorC  
 

Default destructor.


Member Function Documentation

void convert_from_uint8 uint8    ui8R,
uint8    ui8G,
uint8    ui8B,
uint8    ui8A = 255
 

Converts color from unsigned integer values.

All values are in range 0..255.

ColorC operator * const ColorC &    rCol const [inline]
 

Multiplies each component of the color by matching component in the specified argument and returns the result.

ColorC operator * float32    f32S const
 

Multiplies each color component by the specified number and returns the result.

ColorC& operator *= float32    f32S
 

Multiplies each color component by the specified number.

operator const float32 *  
 

Constant float pointer cast operator.

bool operator!= const ColorC &    rCol const
 

Returns true if colors are not equal, else false.

ColorC operator+ const ColorC &    rCol const [inline]
 

Adds the color specified by the argument to the color and returns the result.

ColorC & operator+= const ColorC &    rCol [inline]
 

Adds the color specified by the argument to the color.

ColorC operator- const ColorC &    rCol const [inline]
 

Subtracts the color specified by the argument from the color and returns the result.

ColorC operator-   const [inline]
 

Returns negated color.

ColorC & operator-= const ColorC &    rCol [inline]
 

Subtracts the color specified by the argument from the color.

ColorC operator/ float32    f32S const
 

Divides each color component by the specified number and returns the result.

ColorC& operator/= float32    f32S
 

Divides each color component by the specified number.

bool operator== const ColorC &    rCol const
 

Returns true if both colors are equal, else false.

const float32& operator[] int32    i const
 

Returns component of the color.

The index values from 0 to 3 corresponds to components R, G, B, and A respectively. There are two versions of this method, this version is for retrieving the values.

float32& operator[] int32    i
 

Returns component of the color.

The index values from 0 to 3 corresponds to components R, G, B, and A respectively. There are two versions of this method, this version enables to assign values.


Friends And Related Function Documentation

ColorC operator * float32    f32S,
const ColorC &    rCol
[friend]
 

Multiplies each color component by the specified number and returns the result.


Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions