Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_ARGBColor Class Reference

Color representation using 4 float values for red, green, blue and alpha components. More...

List of all members.

Public Member Functions

Constructor / Destructor
 CP_ARGBColor ()
 Constructor.
 CP_ARGBColor (float inRed, float inGreen, float inBlue, float inAlpha)
 CP_ARGBColor (const CP_ARGBColor &inColor)
 CP_ARGBColor (const CP_RGBColor &inColor)
virtual ~CP_ARGBColor ()
 Destructor.
Components
float red () const
float green () const
float blue () const
float alpha () const
Getters
CP_RGBColor GetRGBColor ()
CP_RGBColor GetRGBColor () const
Operators
bool operator== (const CP_ARGBColor &inColor) const
bool operator!= (const CP_ARGBColor &inColor) const
CP_ARGBColoroperator= (const CP_ARGBColor &inColor)
CP_ARGBColoroperator= (const CP_RGBColor &inColor)
Setters
void Set (float inRed, float inGreen, float inBlue, float inAlpha)
void SetAlpha (float inAlpha)
void Set (const CP_ARGBColor &inColor)
void Set (const CP_RGBColor &inColor)

Protected Attributes

float fRed
float fGreen
float fBlue
float fAlpha


Detailed Description

NOTE: On the Mac a color is composed of 3 floats for the individual compoents. While Windows is composed of 3 chars (max 255). For the Windows version of the color we return the high byte of our float.


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_ARGBColor::CP_ARGBColor  ) 
 

Constructor. Sets the color to black as the default color with full alpha.

Exceptions:
none 

CP_ARGBColor::CP_ARGBColor float  inRed,
float  inGreen,
float  inBlue,
float  inAlpha
 

Constructor.

Parameters:
inRed Red component of the color.
inGreen Green component of the color.
inBlue Blue component of the color.
inAlpha Alpha component of the color.
Exceptions:
none 

CP_ARGBColor::CP_ARGBColor const CP_ARGBColor inColor  ) 
 

Constructor. Sets the colors from the passed in CP_ARGBColor.

Parameters:
inColor A CP_ARGBColor to copy the colors from.
Exceptions:
none 

CP_ARGBColor::CP_ARGBColor const CP_RGBColor inColor  ) 
 

Constructor. Sets the colors from the passed in CP_RGBColor.

Parameters:
inColor A CP_RGBColor to copy the colors from.
Exceptions:
none 

CP_ARGBColor::~CP_ARGBColor  )  [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

float CP_ARGBColor::red  )  const
 

Returns the red component of the color.

Exceptions:
none 
Returns:
float const The red component.

float CP_ARGBColor::green  )  const
 

Returns the green component of the color.

Exceptions:
none 
Returns:
float const The green component.

float CP_ARGBColor::blue  )  const
 

Returns the blue component of the color.

Exceptions:
none 
Returns:
float const The blue component.

float CP_ARGBColor::alpha  )  const
 

Returns the alpha component of the color.

Exceptions:
none 
Returns:
float const The alpha component.

CP_RGBColor CP_ARGBColor::GetRGBColor  ) 
 

Returns the the color as a CP_RGBColor.

Exceptions:
none 
Returns:
CP_RGBColor The color as a CP_RGBColor.

CP_RGBColor CP_ARGBColor::GetRGBColor  )  const
 

Returns the the color as a CP_RGBColor (const version).

Exceptions:
none 
Returns:
CP_RGBColor const The color as a CP_RGBColor.

bool CP_ARGBColor::operator== const CP_ARGBColor inColor  )  const
 

Equality operator. Returns true if the passed in color is the same as this color.

Exceptions:
none 
Returns:
bool const Returns true if this color and the passed in color are the same.

bool CP_ARGBColor::operator!= const CP_ARGBColor inColor  )  const
 

Inequality operator. Returns true if the passed in color is not the same as this color.

Exceptions:
none 
Returns:
bool const Returns true if this color and the passed in color are not the same.

CP_ARGBColor & CP_ARGBColor::operator= const CP_ARGBColor inColor  ) 
 

Assignment operation. Copies the color from the passed in CP_ARGBColor to this one.

Exceptions:
none 
Returns:
CP_ARGBColor This object with the same color as the passed in color.

CP_ARGBColor & CP_ARGBColor::operator= const CP_RGBColor inColor  ) 
 

Assignment operator. Assigns the color from the passed in CP_RGBColor to this one.

Exceptions:
none 
Returns:
CP_ARGBColor This object with the same color as the passed in color.

void CP_ARGBColor::Set float  inRed,
float  inGreen,
float  inBlue,
float  inAlpha
 

Sets the color components from the passed in values.

Parameters:
inRed Red component of the color.
inGreen Green component of the color.
inBlue Blue component of the color.
inAlpha Alpha component of the color.
Exceptions:
none 

void CP_ARGBColor::SetAlpha float  inAlpha  ) 
 

Sets the alpha component of the color.

Parameters:
inAlpha The alpha component of the color.
Exceptions:
none 
Returns:
void

void CP_ARGBColor::Set const CP_ARGBColor inColor  ) 
 

Sets the color values from the passed in CP_ARGBColor.

Parameters:
inColor CP_ARGBColor to set the colors from.
Exceptions:
none 
Returns:
void

void CP_ARGBColor::Set const CP_RGBColor inColor  ) 
 

Sets the color values from the passed in CP_RGBColor.

Parameters:
inColor CP_RGBColor to set the colors from.
Exceptions:
none 
Returns:
void


Member Data Documentation

float CP_ARGBColor::fRed [protected]
 

float CP_ARGBColor::fGreen [protected]
 

The red color component.

float CP_ARGBColor::fBlue [protected]
 

The green color component.

float CP_ARGBColor::fAlpha [protected]
 

The blue color component.


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:32 2005 for CPLAT_MacOS by  doxygen 1.4.0