Rocket::Core::Colour< ColourType, AlphaDefault > Class Template Reference
#include <Colour.h>
Detailed Description
template<typename ColourType, int AlphaDefault>
class Rocket::Core::Colour< ColourType, AlphaDefault >
Templated class for a four-component RGBA colour.
- Author:
- Peter Curry
Constructor & Destructor Documentation
template<typename ColourType, int AlphaDefault>
| Rocket::Core::Colour< ColourType, AlphaDefault >::Colour |
( |
ColourType |
red, |
|
|
ColourType |
green, |
|
|
ColourType |
blue, |
|
|
ColourType |
alpha = AlphaDefault | |
|
) |
| | [inline] |
Initialising constructor.
- Parameters:
-
| [in] | red | Initial red value of the colour. |
| [in] | green | Initial green value of the colour. |
| [in] | blue | Initial blue value of the colour. |
| [in] | alpha | Initial alpha value of the colour. |
Member Function Documentation
template<typename ColourType, int AlphaDefault>
| Colour< ColourType, AlphaDefault > Rocket::Core::Colour< ColourType, AlphaDefault >::operator+ |
( |
const Colour< ColourType, AlphaDefault > & |
rhs |
) |
const [inline] |
Returns the sum of this colour and another. This does not saturate the channels.
- Parameters:
-
| [in] | rhs | The colour to add this to. |
- Returns:
- The sum of the two colours.
template<typename ColourType, int AlphaDefault>
| Colour< ColourType, AlphaDefault > Rocket::Core::Colour< ColourType, AlphaDefault >::operator- |
( |
const Colour< ColourType, AlphaDefault > & |
rhs |
) |
const [inline] |
Returns the result of subtracting another colour from this colour.
- Parameters:
-
| [in] | rhs | The colour to subtract from this colour. |
- Returns:
- The result of the subtraction.
template<typename ColourType, int AlphaDefault>
Returns the result of multiplying this colour by another.
- Parameters:
-
| [in] | rhs | The colour to multiply by. |
- Returns:
- The result of the multiplication.
template<typename ColourType, int AlphaDefault>
Returns the result of multiplying this colour component-wise by a scalar.
- Parameters:
-
| [in] | rhs | The scalar value to multiply by. |
- Returns:
- The result of the scale.
template<typename ColourType, int AlphaDefault>
Returns the result of dividing this colour component-wise by a scalar.
- Parameters:
-
| [in] | rhs | The scalar value to divide by. |
- Returns:
- The result of the scale.
template<typename ColourType, int AlphaDefault>
Adds another colour to this in-place. This does not saturate the channels.
- Parameters:
-
| [in] | rhs | The colour to add. |
template<typename ColourType, int AlphaDefault>
Subtracts another colour from this in-place.
- Parameters:
-
| [in] | rhs | The colour to subtract. |
template<typename ColourType, int AlphaDefault>
Multiplies this colour component-wise with another in-place.
- Parameters:
-
| [in] | rhs | The colour to multiply by. |
- Returns:
- This colour, post-operation.
template<typename ColourType, int AlphaDefault>
Scales this colour component-wise in-place.
- Parameters:
-
| [in] | rhs | The value to scale this colours's components by. |
template<typename ColourType, int AlphaDefault>
Scales this colour component-wise in-place by the inverse of a value.
- Parameters:
-
| [in] | rhs | The value to divide this colour's components by. |
template<typename ColourType, int AlphaDefault>
Equality operator.
- Parameters:
-
| [in] | rhs | The colour to compare this against. |
- Returns:
- True if the two colours are equal, false otherwise.
template<typename ColourType, int AlphaDefault>
Inequality operator.
- Parameters:
-
| [in] | rhs | The colour to compare this against. |
- Returns:
- True if the two colours are not equal, false otherwise.
template<typename ColourType, int AlphaDefault>
Auto-cast operator.
- Returns:
- A pointer to the first value.
template<typename ColourType, int AlphaDefault>
Constant auto-cast operator.
- Returns:
- A constant pointer to the first value.
The documentation for this class was generated from the following file: