Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CSIBCColorb 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 unsigned byte 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 CSIBCColorf class, which uses floating-point numbers to represent color components, instead of unsigned bytes.


Constructor & Destructor Documentation

CSIBCColorb::CSIBCColorb  
 

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

CSIBCColorb::CSIBCColorb const CSIBCColorb &    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.

CSIBCColorb::CSIBCColorb const SI_UByte    i_fR,
const SI_UByte    i_fG,
const SI_UByte    i_fB,
const SI_UByte    i_fA = 0
 

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

Parameters:
i_bR  Value to set the red component of the color to.
i_bB  Value to set the blue component of the color to.
i_bG  Value to set the green component of the color to.
i_bA  Value to set the alpha component of the color to (defaults to 0).


Member Function Documentation

CSIBCColorb & CSIBCColorb::Add const CSIBCColorb &    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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::AddAlpha

CSIBCColorb & CSIBCColorb::AddAlpha const CSIBCColorb &    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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::Add , CSIBCColorb::operator+

CSIBCColorb & CSIBCColorb::DivComp const CSIBCColorb &    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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::MulComp

void CSIBCColorb::Get SI_UByte *    o_pR,
SI_UByte *    o_pG,
SI_UByte *    o_pB
const
 

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

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

void CSIBCColorb::Get SI_UByte *    o_pR,
SI_UByte *    o_pG,
SI_UByte *    o_pB,
SI_UByte *    o_pA
const
 

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

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

SI_Float CSIBCColorb::GetDistanceFrom const CSIBCColorb &    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:
CSIBCColorb::GetDistanceFromAlpha

SI_Float CSIBCColorb::GetDistanceFromAlpha const CSIBCColorb &    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:
CSIBCColorb::GetDistanceFrom

SI_UByte CSIBCColorb::GetDot const CSIBCColorb &    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_UByte Dot product of the two colors.
See also:
CSIBCColorb::GetDotAlpha

SI_UByte CSIBCColorb::GetDotAlpha const CSIBCColorb &    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_UByte Dot product of the two colors.
See also:
CSIBCColorb::GetDot

SI_Float CSIBCColorb::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:
CSIBCColorb::GetLengthAlpha , CSIBCColorb::GetSquaredLength

SI_Float CSIBCColorb::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:
CSIBCColorb::GetLength , CSIBCColorb::GetSquaredLengthAlpha

SI_UByte CSIBCColorb::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_UByte Value of the largest color component
See also:
CSIBCColorb::GetMaxComponentAlpha , CSIBCColorb::GetMinComponent

SI_UByte CSIBCColorb::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_UByte Value of the largest color component
See also:
CSIBCColorb::GetMaxComponent , CSIBCColorb::GetMinComponentAlpha

SI_UByte CSIBCColorb::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_UByte Value of the smallest color component
See also:
CSIBCColorb::GetMinComponentAlpha , CSIBCColorb::GetMaxComponent

SI_UByte CSIBCColorb::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_UByte Value of the smallest color component
See also:
CSIBCColorb::GetMinComponent , CSIBCColorb::GetMaxComponentAlpha

SI_Float CSIBCColorb::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:
CSIBCColorb::GetLength , CSIBCColorb::GetSquaredLengthAlpha

SI_Float CSIBCColorb::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:
CSIBCColorb::GetLengthAlpha , CSIBCColorb::GetSquaredLength

SI_Bool CSIBCColorb::IsNull   const
 

Determines whether all component values (excluding alpha) of this color are zero.

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

SI_Bool CSIBCColorb::IsNullAlpha   const
 

Determines whether all component values (including alpha) of this color are zero.

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

CSIBCColorb & CSIBCColorb::MulComp const CSIBCColorb &    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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::DivComp

CSIBCColorb & CSIBCColorb::Negate  
 

Negates all color component values (excluding alpha).

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

CSIBCColorb & CSIBCColorb::NegateAlpha  
 

Negates all color component values (including alpha).

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

CSIBCColorb & CSIBCColorb::Normalize  
 

Normalizes the RGB color vector of this color.

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

CSIBCColorb & CSIBCColorb::NormalizeAlpha  
 

Normalizes the RGBA color vector of this color.

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

SI_Bool CSIBCColorb::operator!= const CSIBCColorb &    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.

CSIBCColorb CSIBCColorb::operator+ const CSIBCColorb &    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:
CSIBCColorb Color object representing the color obtained by summing this object and i_Color's color components.
See also:
CSIBCColorb::Add

SI_Bool CSIBCColorb::operator== const CSIBCColorb &    i_Color const
 

Equality operator. Determines whether each color component of i_Color is 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.

CSIBCColorb & CSIBCColorb::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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::ScaleAlpha

CSIBCColorb & CSIBCColorb::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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::Scale , CSIBCColorb::operator *

CSIBCColorb & CSIBCColorb::Set SI_UByte    i_fR,
SI_UByte    i_fG,
SI_UByte    i_fB,
SI_UByte    i_fA = 255
 

Sets each of the color components of this color object.

Parameters:
i_bR  The value to set the Red component to.
i_bG  The value to set the Green component to.
i_bB  The value to set the Blue component to.
i_bA  The value to set the Alpha component to (defaults to 255).
Returns:
CSIBCColorb& Reference to this object.
See also:
CSIBCColorb::Get

CSIBCColorb & CSIBCColorb::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:
CSIBCColorb& Reference to this object.
See also:
CSIBCColorb::SetLengthAlpha , CSIBCColorb::GetLength , CSIBCColorb::GetSquaredLength

CSIBCColorb & CSIBCColorb::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:
CSIBCColorb& Reference to this object.
See also:
CSIBCColorb::SetLength , CSIBCColorb::GetLengthAlpha , CSIBCColorb::GetSquaredLengthAlpha

CSIBCColorb & CSIBCColorb::SetNull SI_UByte    alpha = 0
 

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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::IsNull , CSIBCColorb::IsNullAlpha

CSIBCColorb & CSIBCColorb::Sub const CSIBCColorb &    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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::SubAlpha

CSIBCColorb & CSIBCColorb::SubAlpha const CSIBCColorb &    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:
CSIBCColorb& Reference to this object
See also:
CSIBCColorb::Sub


Member Data Documentation

SI_UByte CSIBCColorb::m_fA
 

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

SI_UByte CSIBCColorb::m_fB
 

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

SI_UByte CSIBCColorb::m_fG
 

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

SI_UByte CSIBCColorb::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.