#include <rgba.h>
Public Member Functions | |
Rgba () | |
Initialize all components to zero. | |
Rgba (float c) | |
Initialize all components to the given real number c. | |
Rgba (float _r, float _g, float _b) | |
Initialize the colors to the corresponding given values and the alpha to 1. | |
Rgba (float _r, float _g, float _b, float _a) | |
Initialize all components to the corresponding given values. | |
Rgba | operator+ (const Rgba &other) const |
Add the given RGBA other to this and return the result. | |
Rgba | operator- (const Rgba &other) const |
Subtract the given RGBA other from this and return the result. | |
Rgba | operator+ (float c) const |
Add the given real number c to every component of this and return the result. | |
Rgba & | operator+= (const Rgba &other) |
Add the given RGBA other to this and set this to the result. | |
Rgba | operator* (const Rgba &other) const |
Component-wisely multiply the given RGBA other to this and return the result. | |
Rgba | operator* (float c) const |
Multiply the given real number c with this and return the result. | |
Rgba & | operator*= (const Rgba &other) |
Component-wisely multiply the given RGB other to this and then set this to the result. | |
Rgba | operator/ (const Rgba &other) const |
Divide all the components of this with the corresponding components of other and return the result. | |
Rgba | operator/ (float c) const |
Divide all the components of this with the given real number c and return the result. | |
void | fill_array_4 (float *_a) |
Fill the given array with the values of the components of this. | |
bool | is_near (const Rgba &other, float threshold=EPSILON) |
Check whether all the components of this is within threshold of the corresponding components of other or not. | |
Public Attributes | |
float | r |
the intensity of the color red | |
float | g |
the intensity of the color green | |
float | b |
the intensity of the color blue | |
float | a |
the transparency. |
Rgba::Rgba | ( | ) | [inline] |
Initialize all components to zero.
Rgba::Rgba | ( | float | c | ) | [inline] |
Initialize all components to the given real number c.
Rgba::Rgba | ( | float | _r, | |
float | _g, | |||
float | _b | |||
) | [inline] |
Initialize the colors to the corresponding given values and the alpha to 1.
Rgba::Rgba | ( | float | _r, | |
float | _g, | |||
float | _b, | |||
float | _a | |||
) | [inline] |
Initialize all components to the corresponding given values.
void Rgba::fill_array_4 | ( | float * | _a | ) | [inline] |
Fill the given array with the values of the components of this.
That is: a
[0] is set to r. a
[1] is set to g. a
[2] is set to b. a
[3] is set to a.
bool Rgba::is_near | ( | const Rgba & | other, | |
float | threshold = EPSILON | |||
) | [inline] |
Check whether all the components of this is within threshold of the corresponding components of other or not.
Use this method to test approximate equality.
Rgba Rgba::operator* | ( | float | c | ) | const [inline] |
Multiply the given real number c with this and return the result.
Component-wisely multiply the given RGBA other to this and return the result.
Component-wisely multiply the given RGB other to this and then set this to the result.
Rgba Rgba::operator+ | ( | float | c | ) | const [inline] |
Add the given real number c to every component of this and return the result.
Add the given RGBA other to this and return the result.
Add the given RGBA other to this and set this to the result.
Subtract the given RGBA other from this and return the result.
Rgba Rgba::operator/ | ( | float | c | ) | const [inline] |
Divide all the components of this with the given real number c and return the result.
Divide all the components of this with the corresponding components of other and return the result.
float Rgba::a |
the transparency.
float Rgba::b |
the intensity of the color blue
float Rgba::g |
the intensity of the color green
float Rgba::r |
the intensity of the color red