Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CSIBCColorf Class Reference

Class representing RGBA colours. More...

#include <SIBCColor.h>

List of all members.

Public Methods

Public Attributes


Detailed Description

Class representing RGBA colours.

Represents colours and stores RGBA values as floating point values. Member functions with the "Alpha" suffix operate on alpha as well as RGB, whereas their counterparts operate only on RGB color component values. This class is analogous to the CSIBCColorb class, which uses unsigned bytes to represent color components, instead of floating-point numbers.


Constructor & Destructor Documentation

CSIBCColorf::CSIBCColorf  
 

Default constructor. Creates a new color object, with uninitialized color values.

CSIBCColorf::CSIBCColorf const CSIBCColorf &    i_Color
 

Copy Constructor. Creates a new color object, based on the values in the i_Color object.

Parameters:
i_Color  Color object to copy values from for the new object.

CSIBCColorf::CSIBCColorf const SI_Float    i_fR,
const SI_Float    i_fB,
const SI_Float    i_fG,
const SI_Float    i_fA = 1.0f
 

Constructor. Creates a new color with the given color component values.

Parameters:
i_fR  Value to set the red component of the color to.
i_fB  Value to set the blue component of the color to.
i_fG  Value to set the green component of the color to.
i_fA  Value to set the alpha component of the color to (defaults to 1.0f).


Member Function Documentation

CSIBCColorf & CSIBCColorf::Add const CSIBCColorf &    i_Color
 

Sets the color components of this object to the sum of its components with the components of i_Color (excluding alpha).

Parameters:
i_Color  Color object to add color component values from.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::AddAlpha

CSIBCColorf & CSIBCColorf::AddAlpha const CSIBCColorf &    i_Color
 

Sets the color components of this object to the sum of its components with the components of i_Color (including alpha).

Parameters:
i_Color  Color object to add color component values from.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::Add , CSIBCColorf::operator+

CSIBCColorf & CSIBCColorf::DivComp const CSIBCColorf &    i_Color
 

Sets this object's color component values to the quotient of its original values, divided by the component values in i_Color (including alpha).

Parameters:
i_Color  The color to divide component values with.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::MulComp

void CSIBCColorf::Get SI_Float *    o_pR,
SI_Float *    o_pG,
SI_Float *    o_pB
const
 

Gets the value of each color component in this color object (excluding alpha).

Parameters:
o_pR  Pointer to a SI_Float to receive the Red component of this color.
o_pG  Pointer to a SI_Float to receive the Green component of this color.
o_pB  Pointer to a SI_Float to receive the Blue component of this color.
See also:
CSIBCColorf::Set

void CSIBCColorf::Get SI_Float *    o_pR,
SI_Float *    o_pG,
SI_Float *    o_pB,
SI_Float *    o_pA
const
 

Gets the value of each color component in this color object (including alpha).

Parameters:
o_pR  Pointer to a SI_Float to receive the Red component of this color.
o_pG  Pointer to a SI_Float to receive the Green component of this color.
o_pB  Pointer to a SI_Float to receive the Blue component of this color.
o_pA  Pointer to a SI_Float to receive the Alpha component of this color.
See also:
CSIBCColorf::Set

SI_Float CSIBCColorf::GetDistanceFrom const CSIBCColorf &    i_Color const
 

Computes the distance between the this color and i_Color in RGB space (i.e excluding alpha).

Parameters:
i_Color  Color object to get this object's distance from.
Returns:
SI_Float Distance between the two colors in RGB space.
See also:
CSIBCColorf::GetDistanceFromAlpha

SI_Float CSIBCColorf::GetDistanceFromAlpha const CSIBCColorf &    i_Color const
 

Computes the distance between the this color and i_Color in RGBA space (i.e including alpha).

Parameters:
i_Color  Color object to get this object's distance from.
Returns:
SI_Float Distance between the two colors in RGBA space.
See also:
CSIBCColorf::GetDistanceFrom

SI_Float CSIBCColorf::GetDot const CSIBCColorf &    i_Color const
 

Gets the dot-product of this color with another color. This is the sum of the scalar multiplication of all corresponding component values in the two colors (excluding alpha).

Parameters:
i_Color  Color object to get this object's dot product with.
Returns:
SI_Float Dot product of the two colors.
See also:
CSIBCColorf::GetDotAlpha

SI_Float CSIBCColorf::GetDotAlpha const CSIBCColorf &    i_Color const
 

Gets the dot-product of this color with another color. This is the sum of the scalar multiplication of all corresponding component values in the two colors (including alpha).

Parameters:
i_Color  Color object to get this object's dot product with.
Returns:
SI_Float Dot product of the two colors.
See also:
CSIBCColorf::GetDot

SI_Float CSIBCColorf::GetLength   const
 

Computes the length of this object's color vector in RGB space (i.e excluding alpha).

Returns:
SI_Float The length of this color in RGB space.
See also:
CSIBCColorf::GetLengthAlpha , CSIBCColorf::GetSquaredLength

SI_Float CSIBCColorf::GetLengthAlpha   const
 

Computes the length of this object's color vector in RGBA space (i.e including alpha).

Returns:
SI_Float The length of this color in RGBA space.
See also:
CSIBCColorf::GetLength , CSIBCColorf::GetSquaredLengthAlpha

SI_Float CSIBCColorf::GetMaxComponent SI_Int *    i_pIndex const
 

Gets the value and index largest color component (excluding alpha).

Parameters:
i_pIndex  Pointer to a value set to the index of the largest component. (0 = Red, 1 = Green, 2 = Blue).
Returns:
SI_Float Value of the largest color component
See also:
CSIBCColorf::GetMaxComponentAlpha , CSIBCColorf::GetMinComponent

SI_Float CSIBCColorf::GetMaxComponentAlpha SI_Int *    i_pIndex const
 

Gets the value and index largest color component (including alpha).

Parameters:
i_pIndex  Pointer to a value set to the index of the largest component. (0 = Red, 1 = Green, 2 = Blue, 3 = Alpha).
Returns:
SI_Float Value of the largest color component
See also:
CSIBCColorf::GetMaxComponent , CSIBCColorf::GetMinComponentAlpha

SI_Float CSIBCColorf::GetMinComponent SI_Int *    i_pIndex const
 

Gets the value and index smallest color component (excluding alpha).

Parameters:
i_pIndex  Pointer to a value set to the index of the smallest component. (0 = Red, 1 = Green, 2 = Blue).
Returns:
SI_Float Value of the smallest color component
See also:
CSIBCColorf::GetMinComponentAlpha , CSIBCColorf::GetMaxComponent

SI_Float CSIBCColorf::GetMinComponentAlpha SI_Int *    i_pIndex const
 

Gets the value and index smallest color component (including alpha).

Parameters:
i_pIndex  Pointer to a value set to the index of the smallest component. (0 = Red, 1 = Green, 2 = Blue, 3 = Alpha).
Returns:
SI_Float Value of the smallest color component
See also:
CSIBCColorf::GetMinComponent , CSIBCColorf::GetMaxComponentAlpha

SI_Float CSIBCColorf::GetSquaredLength   const
 

Computes the squared length of this object's color vector in RGB space (i.e excluding alpha).

Returns:
SI_Float The length of this color in RGB space.
See also:
CSIBCColorf::GetLength , CSIBCColorf::GetSquaredLengthAlpha

SI_Float CSIBCColorf::GetSquaredLengthAlpha   const
 

Computes the squared length of this object's color vector in RGBA space (i.e including alpha).

Returns:
SI_Float The length of this color in RGBA space.
See also:
CSIBCColorf::GetLengthAlpha , CSIBCColorf::GetSquaredLength

SI_Bool CSIBCColorf::IsAlmostEqualTo const CSIBCColorf &    i_Color,
const SI_Float    i_Thresh
const
 

Determines whether the color i_Color and this color are equal to each other, within a given limit. This is necessary because of floating-point round-off errors.

Parameters:
i_Color  The color to compare this color with.
i_Thresh  Ignored. The comparison uses PICO_EPS for the comparison threshhold.
Returns:
SI_Bool TRUE if all component values of the two colors are no less than PICO_EPS different, FALSE otherwise.
See also:
CSIBCColorf::operator== , CSIBCColorf::operator!=

SI_Bool CSIBCColorf::IsNull   const
 

Determines whether all component values (excluding alpha) of this color are zero. Due to floating-point round-off error, PICO_EPS is used for the zero comparison.

Returns:
SI_Bool TRUE if all component values are equal to zero, FALSE otherwise.
See also:
CSIBCColorf::IsNullAlpha , CSIBCColorf::SetNull

SI_Bool CSIBCColorf::IsNullAlpha   const
 

Determines whether all component values (including alpha) of this color are zero. Due to floating-point round-off error, PICO_EPS is used for the zero comparison.

Returns:
SI_Bool TRUE if all component values are equal to zero, FALSE otherwise.
See also:
CSIBCColorf::IsNull , CSIBCColorf::SetNull

CSIBCColorf & CSIBCColorf::MulComp const CSIBCColorf &    i_Color
 

Sets this object's color component values to the product of its original values, and the component values in i_Color (including alpha).

Parameters:
i_Color  The color to multiply component values with.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::DivComp

CSIBCColorf & CSIBCColorf::Negate  
 

Negates all color component values (excluding alpha).

Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::NegateAlpha

CSIBCColorf & CSIBCColorf::NegateAlpha  
 

Negates all color component values (including alpha).

Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::Negate

CSIBCColorf & CSIBCColorf::Normalize  
 

Normalizes the RGB color vector of this color.

Returns:
CSIBCColorf& Reference to this object.
See also:
CSIBCColorf::NormalizeAlpha

CSIBCColorf & CSIBCColorf::NormalizeAlpha  
 

Normalizes the RGBA color vector of this color.

Returns:
CSIBCColorf& Reference to this object.
See also:
CSIBCColorf::Normalize

CSIBCColorf CSIBCColorf::operator * const SI_Float    factor
 

Scaling operator. Computes a color object whose color components are this object's color components multiplied by i_fFactor.

Parameters:
i_fFactor  Scaling factor for color components.
Returns:
CSIBCColorf Color object representing this object's scaled color components.
See also:
CSIBCColorf::ScaleAlpha

SI_Bool CSIBCColorf::operator!= const CSIBCColorf &    i_Color const
 

Inequality operator. Determines whether any color component of i_Color are different to the corresponding color component in this color.

Parameters:
i_Color  The color to compare inequality with.
Returns:
SI_Bool TRUE if the color components in the objects are not identical, FALSE otherwise.
See also:
CSIBCColorf::IsAlmostEqualTo

CSIBCColorf CSIBCColorf::operator+ const CSIBCColorf &    in_vtx
 

Addition operator. Computes a color object with the color components of this objects, and i_Color summed.

Parameters:
i_Color  The color object to sum components with.
Returns:
CSIBCColorf Color object representing the color obtained by summing this object and i_Color's color components.
See also:
CSIBCColorf::Add

SI_Bool CSIBCColorf::operator== const CSIBCColorf &    i_Color const
 

Equality operator. Determines whether each color component of i_Color is exactly equal to the corresponding color component in this color.

Parameters:
i_Color  The color to compare equality with.
Returns:
SI_Bool TRUE if the color components in the objects are identical, FALSE otherwise.
See also:
CSIBCColorf::IsAlmostEqualTo

CSIBCColorf & CSIBCColorf::Scale const SI_Float    i_fFactor
 

Scales the color components of this object by i_fFactor (excluding alpha).

Parameters:
i_fFactor  Scaling factor to use.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::ScaleAlpha

CSIBCColorf & CSIBCColorf::ScaleAlpha const SI_Float    i_fFactor
 

Scales the color components of this object by i_fFactor (including alpha).

Parameters:
i_fFactor  Scaling factor to use.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::Scale , CSIBCColorf::operator *

CSIBCColorf & CSIBCColorf::Set SI_Float    i_fR,
SI_Float    i_fG,
SI_Float    i_fB,
SI_Float    i_fA = 1.0f
 

Sets each of the color components of this color object.

Parameters:
i_fR  The value to set the Red component to.
i_fG  The value to set the Green component to.
i_fB  The value to set the Blue component to.
i_fA  The value to set the Alpha component to (defaults to 1.0f).
Returns:
CSIBCColorf& Reference to this object.
See also:
CSIBCColorf::Get

CSIBCColorf & CSIBCColorf::SetLength const SI_Float    in_dLength
 

Sets the length of the RGB vector (i.e excluding alpha) to in_dLength

Parameters:
in_dLength  The new length for the RGB vector.
Returns:
CSIBCColorf& Reference to this object.
See also:
CSIBCColorf::SetLengthAlpha , CSIBCColorf::GetLength , CSIBCColorf::GetSquaredLength

CSIBCColorf & CSIBCColorf::SetLengthAlpha const SI_Float    in_dLength
 

Sets the length of the RGBA vector (i.e including alpha) to in_dLength

Parameters:
in_dLength  The new length for the RGBA vector.
Returns:
CSIBCColorf& Reference to this object.
See also:
CSIBCColorf::SetLength , CSIBCColorf::GetLengthAlpha , CSIBCColorf::GetSquaredLengthAlpha

CSIBCColorf & CSIBCColorf::SetNull SI_Float    alpha = 1.0f
 

Sets the RGB components of this color to zero, and the alpha to alpha.

Parameters:
alpha  Value to set the alpha component of this color to.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::IsNull , CSIBCColorf::IsNullAlpha

CSIBCColorf & CSIBCColorf::Sub const CSIBCColorf &    i_Color
 

Sets the color components of this object to the difference of its components with the components of i_Color (excluding alpha).

Parameters:
i_Color  Color object to subtract color component values from.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::SubAlpha

CSIBCColorf & CSIBCColorf::SubAlpha const CSIBCColorf &    i_Color
 

Sets the color components of this object to the difference of its components with the components of i_Color (including alpha).

Parameters:
i_Color  Color object to subtract color component values from.
Returns:
CSIBCColorf& Reference to this object
See also:
CSIBCColorf::Sub


Member Data Documentation

SI_Float CSIBCColorf::m_fA
 

Member variable representing the value of the Alpha component of the color.

SI_Float CSIBCColorf::m_fB
 

Member variable representing the value of the Blue component of the color.

SI_Float CSIBCColorf::m_fG
 

Member variable representing the value of the Green component of the color.

SI_Float CSIBCColorf::m_fR
 

Member variable representing the value of the Red component of the color.


The documentation for this class was generated from the following files: © Copyright 2001-2003 Avid Technology, Inc. All rights reserved.

© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.