Public Types | Public Member Functions
CColor4f Class Reference

Detailed Description

A color class represented by single floating values. CColor4f supports the RGBA, HSVA and HLSA color models.

#include <xsi_color4f.h>

List of all members.

Public Types

enum  Type

Public Member Functions

SICPPSDK_INLINE CColor4f ()
SICPPSDK_INLINE CColor4f (float in_R, float in_G, float in_B, float in_A)
SICPPSDK_INLINE CColor4f (float in_Arg1, float in_Arg2, float in_Arg3, float in_A, Type in_eColorType)
SICPPSDK_INLINE CColor4f (const CColor4f &in_color)
 ~CColor4f ()
SICPPSDK_INLINE void Set (float in_R, float in_G, float in_B, float in_A)
SICPPSDK_INLINE void Set (float in_Arg1, float in_Arg2, float in_Arg3, float in_A, Type in_eColorType)
SICPPSDK_INLINE float & PutR (const float in_R)
SICPPSDK_INLINE float & PutG (const float in_G)
SICPPSDK_INLINE float & PutB (const float in_B)
SICPPSDK_INLINE float & PutA (const float in_A)
SICPPSDK_INLINE void GetAsRGBA (float &out_R, float &out_G, float &out_B, float &out_A) const
SICPPSDK_INLINE void GetAsHLSA (float &out_H, float &out_L, float &out_S, float &out_A) const
SICPPSDK_INLINE void GetAsHSVA (float &out_H, float &out_S, float &out_V, float &out_A) const
SICPPSDK_INLINE float GetH () const
SICPPSDK_INLINE float GetL () const
SICPPSDK_INLINE float GetS_HSVA () const
SICPPSDK_INLINE float GetS_HLSA () const
SICPPSDK_INLINE float GetV () const
SICPPSDK_INLINE float & GetR ()
SICPPSDK_INLINE float & GetG ()
SICPPSDK_INLINE float & GetB ()
SICPPSDK_INLINE float & GetA ()
SICPPSDK_INLINE float * GetRGBA ()
SICPPSDK_INLINE const float & GetR () const
SICPPSDK_INLINE const float & GetG () const
SICPPSDK_INLINE const float & GetB () const
SICPPSDK_INLINE const float & GetA () const
SICPPSDK_INLINE const float * GetRGBA () const
SICPPSDK_INLINE operator float * ()
SICPPSDK_INLINE bool operator== (const CColor4f &in_rColor4f) const
SICPPSDK_INLINE bool operator!= (const CColor4f &in_rColor4f) const
SICPPSDK_INLINE bool operator< (const CColor4f &in_rColor4f) const
SICPPSDK_INLINE bool IsNull (float in_fEpsilon) const
SICPPSDK_INLINE CColor4fAdd (const CColor4f &in_col)
SICPPSDK_INLINE CColor4fMul (float in_fFactor)
SICPPSDK_INLINE CColor4fMul (const CColor4f &in_col)
SICPPSDK_INLINE CColor4fSub (const CColor4f &in_col)
SICPPSDK_INLINE CColor4fNegate ()
SICPPSDK_INLINE void PutNull ()
SICPPSDK_INLINE float GetBrightness () const
SICPPSDK_INLINE float GetBrightnessWithAlpha () const
SICPPSDK_INLINE float GetGrayscale () const
SICPPSDK_INLINE float GetGrayscaleWithAlpha () const
SICPPSDK_INLINE CColor4fInverseRGB ()

Member Enumeration Documentation

enum Type

Defines the color model types supported.


Constructor & Destructor Documentation

SICPPSDK_INLINE CColor4f ( )

Default constructor.

SICPPSDK_INLINE CColor4f ( float  in_R,
float  in_G,
float  in_B,
float  in_A 
)

Constructor.

Parameters:
in_RRed component
in_GGreen component
in_BBlue component
in_AAlpha component
SICPPSDK_INLINE CColor4f ( float  in_Arg1,
float  in_Arg2,
float  in_Arg3,
float  in_A,
Type  in_eColorType 
)

Constructor. Creates a new object of a specific color type .

Parameters:
in_Arg1Component 1
in_Arg2Component 2
in_Arg3Component 3
in_AAlpha component
in_eColorTypeColor type
SICPPSDK_INLINE CColor4f ( const CColor4f in_color)

Copy constructor. Cretaes a new object as a RGBA type.

Parameters:
in_colorCColor4f object.
~CColor4f ( ) [inline]

Destructor.


Member Function Documentation

SICPPSDK_INLINE void Set ( float  in_R,
float  in_G,
float  in_B,
float  in_A 
)

Set the object with new values.

Parameters:
in_RRed component
in_GGreen component
in_BBlue component
in_AAlpha component
SICPPSDK_INLINE void Set ( float  in_Arg1,
float  in_Arg2,
float  in_Arg3,
float  in_A,
Type  in_eColorType 
)

Set the object with new values for a specific type.

Parameters:
in_Arg1Component 1
in_Arg2Component 2
in_Arg3Component 3
in_AAlpha component
in_eColorTypeColor type
SICPPSDK_INLINE float & PutR ( const float  in_R)

Set the object's red component.

Parameters:
in_Rvalue
Returns:
Reference to new value
SICPPSDK_INLINE float & PutG ( const float  in_G)

Set the object's green component.

Parameters:
in_Gvalue
Returns:
Reference to new value
SICPPSDK_INLINE float & PutB ( const float  in_B)

Set the object's blue component.

Parameters:
in_Bvalue
Returns:
Reference to new value
SICPPSDK_INLINE float & PutA ( const float  in_A)

Set the object's alpha component.

Parameters:
in_Avalue
Returns:
Reference to new value
SICPPSDK_INLINE void GetAsRGBA ( float &  out_R,
float &  out_G,
float &  out_B,
float &  out_A 
) const

Returns the object's RGBA values.

Return values:
out_RRed component
out_GGreen component
out_BBlue component
out_AAlpha component
SICPPSDK_INLINE void GetAsHLSA ( float &  out_H,
float &  out_L,
float &  out_S,
float &  out_A 
) const

Returns the object's HLSA values.

Return values:
out_HHue component
out_LLuminance component
out_SSaturation component
out_AAlpha component
SICPPSDK_INLINE void GetAsHSVA ( float &  out_H,
float &  out_S,
float &  out_V,
float &  out_A 
) const

Returns the object's HSVA values.

Return values:
out_HHue component
out_SSaturation component
out_VValue component
out_AAlpha component
SICPPSDK_INLINE float GetH ( ) const

Return the object's hue component.

Returns:
Component value.
SICPPSDK_INLINE float GetL ( ) const

Return the object's luminence component.

Returns:
Component value.
SICPPSDK_INLINE float GetS_HSVA ( ) const

Return the object's saturation component from the HSVA color space.

Returns:
Component value.
SICPPSDK_INLINE float GetS_HLSA ( ) const

Return the object's saturation component from the HLSA color space.

Returns:
Component value.
SICPPSDK_INLINE float GetV ( ) const

Return the object's value component.

Returns:
Component value.
SICPPSDK_INLINE float & GetR ( )

Return the object's red component.

Returns:
Component value.
SICPPSDK_INLINE float & GetG ( )

Return the object's green component.

Returns:
Component value.
SICPPSDK_INLINE float & GetB ( )

Return the object's blue component.

Returns:
Component value.
SICPPSDK_INLINE float & GetA ( )

Return the object's alpha component.

Returns:
Component value.
SICPPSDK_INLINE float * GetRGBA ( )

Return a pointer to the color component array.

Returns:
Component array.
SICPPSDK_INLINE const float & GetR ( ) const

Return a reference on the object's red component.

Returns:
Reference to component value.
SICPPSDK_INLINE const float & GetG ( ) const

Return a reference on the object's green component.

Returns:
Reference to component value.
SICPPSDK_INLINE const float & GetB ( ) const

Return a reference on the object's blue component.

Returns:
Reference to component value.
SICPPSDK_INLINE const float & GetA ( ) const

Return a reference on the object's alpha component.

Returns:
Reference to component value.
SICPPSDK_INLINE const float * GetRGBA ( ) const

Return a read-only pointer the color component array.

Returns:
Pointer to component array.
SICPPSDK_INLINE operator float * ( )

float cast operator which returns a pointer to the color component array.

Returns:
Pointer to component array.
SICPPSDK_INLINE bool operator== ( const CColor4f in_rColor4f) const

Performs exact comparison of two colors.

Parameters:
in_rColor4fColor to compare against
SICPPSDK_INLINE bool operator!= ( const CColor4f in_rColor4f) const

Inequality operator tests the strict inequality of this color with in_rColor4f.

Parameters:
in_rColor4fColor to test against.
SICPPSDK_INLINE bool operator< ( const CColor4f in_rColor4f) const

Less than operator. Performs a comparison with a specified CColor4f to determine if this CColor4f is less than the specified CColor4f. The comparison is arbitrary and not geometrically meaningful, it's only purpose is to make CColor4f compliant with stl for sorting operations.

Parameters:
in_rColor4fCColor4f to compare.
Returns:
true if this CColor4f is less than the specified CColor4f, false otherwise.
Since:
7.5
SICPPSDK_INLINE bool IsNull ( float  in_fEpsilon) const

Returns true if all component are less than a specific tolerance value.

Parameters:
in_fEpsilonTolerance to test against
Returns:
True is the color is null, false otherwise.
SICPPSDK_INLINE CColor4f & Add ( const CColor4f in_col)

Adds input color values to this object.

Parameters:
in_colColor to add.
Returns:
A reference to this color.
SICPPSDK_INLINE CColor4f & Mul ( float  in_fFactor)

Scales this color with a factor value.

Parameters:
in_fFactorMultiply factor.
Returns:
A reference to this color.
SICPPSDK_INLINE CColor4f & Mul ( const CColor4f in_col)

Multiplies this color with an input color (this.R *= c.R, this.G *= c.G, etc...)

Parameters:
in_colColor operand.
Returns:
A reference to this color.
SICPPSDK_INLINE CColor4f & Sub ( const CColor4f in_col)

Subtracts the input color from this one.

Parameters:
in_colMultiply factor.
Returns:
A reference to this color.
SICPPSDK_INLINE CColor4f & Negate ( )

Negates this color (this = - this).

Returns:
A reference to this color.
SICPPSDK_INLINE void PutNull ( )

Sets all color components to 0.

Returns:
A reference to this color.
SICPPSDK_INLINE float GetBrightness ( ) const

Returns the brightness value.

Returns:
Float value.
SICPPSDK_INLINE float GetBrightnessWithAlpha ( ) const

Returns the brightness value multiplied with the alpha component.

Returns:
Float value.
SICPPSDK_INLINE float GetGrayscale ( ) const

Returns the grayscale value.

Returns:
Float value.
SICPPSDK_INLINE float GetGrayscaleWithAlpha ( ) const

Returns the grayscale value multiplied with the alpha component.

Returns:
Float value.
SICPPSDK_INLINE CColor4f & InverseRGB ( )

Inverts the component values for this color.

Returns:
A reference to this color.

The documentation for this class was generated from the following file: