Color with 4 floating point components: red, green, blue and alpha (r, g, b, a).
More...
#include <kanzi/core/math/color_rgba.hpp>
|
| ColorRGBA () |
| Default constructor, initializes the color to (0.0, 0.0, 0.0, 0.0). More...
|
|
| ColorRGBA (float r, float g, float b) |
| Constructor, initializes the color to (r, g, b, 1.0). More...
|
|
| ColorRGBA (float r, float g, float b, float a) |
| Constructor, initializes the color to (r, g, b, a). More...
|
|
const float & | operator[] (size_t index) const |
| Access to individual elements of the color. More...
|
|
float & | operator[] (size_t index) |
| Access to individual elements of the color. More...
|
|
ColorRGBA & | operator*= (float scalar) |
| Multiplies each color element with a scalar. More...
|
|
ColorRGBA & | operator/= (float scalar) |
| Divides each color element with a scalar. More...
|
|
ColorRGBA & | operator+= (const ColorRGBA &v) |
| Modifies this color by adding another color. More...
|
|
ColorRGBA & | operator-= (const ColorRGBA &v) |
| Modifies this color by subtracting another color from this color. More...
|
|
float | getRed () const |
| Returns the red element of the color. More...
|
|
float | getGreen () const |
| Returns the green element of the color. More...
|
|
float | getBlue () const |
| Returns the blue element of the color. More...
|
|
float | getAlpha () const |
| Returns the alpha element of the color. More...
|
|
void | setRed (float value) |
| Sets the red element of the color. More...
|
|
void | setGreen (float value) |
| Sets the green element of the color. More...
|
|
void | setBlue (float value) |
| Sets the blue element of the color. More...
|
|
void | setAlpha (float value) |
| Sets the alpha element of the color. More...
|
|
bool | isNaN () const |
| Returns true if and only if at least one of the color values is NaN. More...
|
|
Color with 4 floating point components: red, green, blue and alpha (r, g, b, a).
kanzi::ColorRGBA::ColorRGBA |
( |
| ) |
|
|
inlineexplicit |
Default constructor, initializes the color to (0.0, 0.0, 0.0, 0.0).
kanzi::ColorRGBA::ColorRGBA |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b |
|
) |
| |
|
inlineexplicit |
Constructor, initializes the color to (r, g, b, 1.0).
- Parameters
-
r | Red component of the color. |
g | Green component of the color. |
b | Blue component of the color. |
kanzi::ColorRGBA::ColorRGBA |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a |
|
) |
| |
|
inlineexplicit |
Constructor, initializes the color to (r, g, b, a).
- Parameters
-
r | Red component of the color. |
g | Green component of the color. |
b | Blue component of the color. |
a | Alpha component of the color. |
const float& kanzi::ColorRGBA::operator[] |
( |
size_t |
index | ) |
const |
|
inline |
Access to individual elements of the color.
- Parameters
-
index | Index of the accessed element. Should be either 0, 1, 2, or 3. |
- Returns
- If index is 0, r element. If index is 1, g element. If index is 2, b element. If index is 3, a element.
float& kanzi::ColorRGBA::operator[] |
( |
size_t |
index | ) |
|
|
inline |
Access to individual elements of the color.
- Parameters
-
index | Index of the accessed element. Should be either 0, 1, 2, or 3. |
- Returns
- If index is 0, r element. If index is 1, g element. If index is 2, b element. If index is 3, a element.
ColorRGBA& kanzi::ColorRGBA::operator*= |
( |
float |
scalar | ) |
|
|
inline |
Multiplies each color element with a scalar.
- Parameters
-
scalar | Multiplier for each color element. |
- Returns
- This color.
ColorRGBA& kanzi::ColorRGBA::operator/= |
( |
float |
scalar | ) |
|
|
inline |
Divides each color element with a scalar.
- Parameters
-
scalar | Divider for each color element. |
- Returns
- This color.
Modifies this color by adding another color.
- Parameters
-
- Returns
- This color.
Modifies this color by subtracting another color from this color.
- Parameters
-
- Returns
- This color.
float kanzi::ColorRGBA::getRed |
( |
| ) |
const |
|
inline |
Returns the red element of the color.
- Returns
- The red element.
float kanzi::ColorRGBA::getGreen |
( |
| ) |
const |
|
inline |
Returns the green element of the color.
- Returns
- The green element.
float kanzi::ColorRGBA::getBlue |
( |
| ) |
const |
|
inline |
Returns the blue element of the color.
- Returns
- The blue element.
float kanzi::ColorRGBA::getAlpha |
( |
| ) |
const |
|
inline |
Returns the alpha element of the color.
- Returns
- The alpha element.
void kanzi::ColorRGBA::setRed |
( |
float |
value | ) |
|
|
inline |
Sets the red element of the color.
- Parameters
-
value | The new value of the red element. |
void kanzi::ColorRGBA::setGreen |
( |
float |
value | ) |
|
|
inline |
Sets the green element of the color.
- Parameters
-
value | The new value of the green element. |
void kanzi::ColorRGBA::setBlue |
( |
float |
value | ) |
|
|
inline |
Sets the blue element of the color.
- Parameters
-
value | The new value of the blue element. |
void kanzi::ColorRGBA::setAlpha |
( |
float |
value | ) |
|
|
inline |
Sets the alpha element of the color.
- Parameters
-
value | The new value of the alpha element. |
Returns the color with each element having the most negative float value.
- Returns
- Color with the lowest possible value.
Returns the color with each element having the most positive float value.
- Returns
- Color with the highest possible value.
Returns the color with each element being NaN.
- Returns
- Color with NaN elements.
bool kanzi::ColorRGBA::isNaN |
( |
| ) |
const |
|
inline |
Returns true if and only if at least one of the color values is NaN.
ColorRGBA kanzi::ColorRGBA::positiveInfinity |
( |
| ) |
|
|
inlinestatic |
Returns the color with each element being the positive infinity.
- Returns
- Color with positive infinity elements.
ColorRGBA kanzi::ColorRGBA::negativeInfinity |
( |
| ) |
|
|
inlinestatic |
Returns the color with each element being the negative infinity.
- Returns
- Color with negative infinity elements.
Returns opaque black color (0.0, 0.0, 0.0, 1.0).
- Returns
- Opaque black.
ColorRGBA kanzi::ColorRGBA::transparentBlack |
( |
| ) |
|
|
inlinestatic |
Returns transparent black color (0.0, 0.0, 0.0, 0.0).
- Returns
- Transparent black color.
The documentation for this class was generated from the following file: