#include <SIBCColor.h>
Public Member Functions |
|
| CSIBCColorb () | |
| CSIBCColorb (const CSIBCColorb &i_Color) | |
| CSIBCColorb (const SI_UByte i_bR, const SI_UByte i_bG, const SI_UByte i_bB, const SI_UByte i_bA=0) | |
| SI_Bool | IsNull () const |
| SI_Bool | IsNullAlpha () const |
| SI_UByte | GetDot (const CSIBCColorb &) const |
| SI_UByte | GetDotAlpha (const CSIBCColorb &) const |
| SI_Float | GetDistanceFrom (const CSIBCColorb &) const |
| SI_Float | GetDistanceFromAlpha (const CSIBCColorb &) const |
| SI_Float | GetLength () const |
| SI_Float | GetLengthAlpha () const |
| SI_Float | GetSquaredLength () const |
| SI_Float | GetSquaredLengthAlpha () const |
| SI_UByte | GetMaxComponent (SI_Int *i_pIndex) const |
| SI_UByte | GetMaxComponentAlpha (SI_Int *i_pIndex) const |
| SI_UByte | GetMinComponent (SI_Int *i_pIndex) const |
| SI_UByte | GetMinComponentAlpha (SI_Int *i_pIndex) const |
| void | Get (SI_UByte *o_pR, SI_UByte *o_pG, SI_UByte *o_pB, SI_UByte *o_pA) const |
| void | Get (SI_UByte *o_pR, SI_UByte *o_pG, SI_UByte *o_pB) const |
| CSIBCColorb & | Set (SI_UByte i_bR, SI_UByte i_bG, SI_UByte i_bB, SI_UByte i_bA=255) |
| CSIBCColorb & | Normalize () |
| CSIBCColorb & | NormalizeAlpha () |
| CSIBCColorb & | SetNull (SI_UByte alpha=0) |
| CSIBCColorb & | SetLength (const SI_Float in_dLength) |
| CSIBCColorb & | SetLengthAlpha (const SI_Float in_dLength) |
| CSIBCColorb & | Negate () |
| CSIBCColorb & | NegateAlpha () |
| CSIBCColorb & | Add (const CSIBCColorb &i_Color) |
| CSIBCColorb & | AddAlpha (const CSIBCColorb &i_Color) |
| CSIBCColorb & | Sub (const CSIBCColorb &i_Color) |
| CSIBCColorb & | SubAlpha (const CSIBCColorb &i_Color) |
| CSIBCColorb & | Scale (const SI_Float i_fFactor) |
| CSIBCColorb & | ScaleAlpha (const SI_Float i_fFactor) |
| CSIBCColorb & | MulComp (const CSIBCColorb &i_Color) |
| CSIBCColorb & | DivComp (const CSIBCColorb &i_Color) |
| SI_Bool | operator== (const CSIBCColorb &i_Color) const |
| SI_Bool | operator!= (const CSIBCColorb &i_Color) const |
| CSIBCColorb | operator+ (const CSIBCColorb &i_Color) |
Public Attributes |
|
| SI_UByte | m_fR |
| SI_UByte | m_fG |
| SI_UByte | m_fB |
| SI_UByte | m_fA |
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.
| CSIBCColorb | ( | const CSIBCColorb & | i_Color | ) |
Copy Constructor. Creates a new color object, based on the values in the i_Color object.
| i_Color | Color object to copy values from for the new object. |
| CSIBCColorb | ( | const SI_UByte | i_bR, | |
| const SI_UByte | i_bG, | |||
| const SI_UByte | i_bB, | |||
| const SI_UByte | i_bA = 0 |
|||
| ) |
Constructor. Creates a new color with the given color component values.
| 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). |
| SI_Bool IsNull | ( | ) | const |
Determines whether all component values (excluding alpha) of this color are zero.
Determines whether all component values (including alpha) of this color are zero.
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).
| i_Color | Color object to get this object's dot product with. |
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).
| i_Color | Color object to get this object's dot product with. |
Computes the distance between the this color and i_Color in RGB space (i.e excluding alpha).
| i_Color | Color object to get this object's distance from. |
Computes the distance between the this color and i_Color in RGBA space (i.e including alpha).
| i_Color | Color object to get this object's distance from. |
Computes the length of this object's color vector in RGB space (i.e excluding alpha).
Computes the length of this object's color vector in RGBA space (i.e including alpha).
Computes the squared length of this object's color vector in RGB space (i.e excluding alpha).
Computes the squared length of this object's color vector in RGBA space (i.e including alpha).
Gets the value and index largest color component (excluding alpha).
| i_pIndex | Pointer to a value set to the index of the largest component. (0 = Red, 1 = Green, 2 = Blue). |
Gets the value and index largest color component (including alpha).
| i_pIndex | Pointer to a value set to the index of the largest component. (0 = Red, 1 = Green, 2 = Blue, 3 = Alpha). |
Gets the value and index smallest color component (excluding alpha).
| i_pIndex | Pointer to a value set to the index of the smallest component. (0 = Red, 1 = Green, 2 = Blue). |
Gets the value and index smallest color component (including alpha).
| i_pIndex | Pointer to a value set to the index of the smallest component. (0 = Red, 1 = Green, 2 = Blue, 3 = Alpha). |
Gets the value of each color component in this color object (including alpha).
| 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. |
| void 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).
| 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. |
Sets each of the color components of this color object.
| 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). |
Normalizes the RGB color vector of this color.
Normalizes the RGBA color vector of this color.
Sets the RGB components of this color to zero, and the alpha to alpha.
| alpha | Value to set the alpha component of this color to. |
Sets the length of the RGB vector (i.e excluding alpha) to in_dLength
| in_dLength | The new length for the RGB vector. |
Sets the length of the RGBA vector (i.e including alpha) to in_dLength
| in_dLength | The new length for the RGBA vector. |
Negates all color component values (excluding alpha).
Negates all color component values (including alpha).
Sets the color components of this object to the sum of its components with the components of i_Color (excluding alpha).
| i_Color | Color object to add color component values from. |
Sets the color components of this object to the sum of its components with the components of i_Color (including alpha).
| i_Color | Color object to add color component values from. |
Sets the color components of this object to the difference of its components with the components of i_Color (excluding alpha).
| i_Color | Color object to subtract color component values from. |
Sets the color components of this object to the difference of its components with the components of i_Color (including alpha).
| i_Color | Color object to subtract color component values from. |
Scales the color components of this object by i_fFactor (excluding alpha).
| i_fFactor | Scaling factor to use. |
Scales the color components of this object by i_fFactor (including alpha).
| i_fFactor | Scaling factor to use. |
CSIBCColorb::operator*
Sets this object's color component values to the product of its original values, and the component values in i_Color (including alpha).
| i_Color | The color to multiply component values with. |
Sets this object's color component values to the quotient of its original values, divided by the component values in i_Color (including alpha).
| i_Color | The color to divide component values with. |
Equality operator. Determines whether each color component of i_Color is equal to the corresponding color component in this color.
| i_Color | The color to compare equality with. |
Inequality operator. Determines whether any color component of i_Color are different to the corresponding color component in this color.
| i_Color | The color to compare inequality with. |
Addition operator. Computes a color object with the color components of this objects, and i_Color summed.
| i_Color | The color object to sum components with. |
i_Color's color components.
Member variable representing the value of the Green component of the color.
Member variable representing the value of the Blue component of the color.
Member variable representing the value of the Alpha component of the color.