Allolib
1.0
C++ Components For Interactive Multimedia
|
Color represented by red, green, and blue components. More...
Public Member Functions | |
RGB (float r, float g, float b) | |
template<class T > | |
RGB (const T *rgb) | |
RGB (float gray=1.f) | |
RGB (const Color &v) | |
RGB (const Colori &v) | |
RGB (const HSV &hsv) | |
RGB (const CIE_XYZ &xyz) | |
RGB (const Lab &lab) | |
RGB (const HCLab &hclab) | |
RGB (const Luv &luv) | |
RGB (const HCLuv &hcluv) | |
float & | operator[] (int i) |
Set color component at index with no bounds checking. | |
const float & | operator[] (int i) const |
Get color component at index with no bounds checking. | |
RGB & | set (const RGB &v) |
Set from another RGB. | |
RGB & | set (float re, float gr, float bl) |
Set from RGB components. | |
RGB & | set (float v) |
Set from gray value. | |
template<class T > | |
RGB & | set (const T *rgb) |
Set from an array of RGB components. | |
RGB & | operator= (float v) |
Set from gray value. | |
RGB & | operator= (double v) |
RGB & | operator= (const HSV &v) |
Set RGB components from HSV. | |
RGB & | operator= (const Color &v) |
Set RGB components from Color. | |
RGB & | operator= (const Colori &v) |
Set RGB components from Colori. | |
RGB & | operator= (const CIE_XYZ &v) |
Set RGB components from CIE_XYZ. | |
RGB & | operator= (const Lab &v) |
Set RGB components from Lab. | |
RGB & | operator= (const HCLab &v) |
Set RGB components from HCLab. | |
RGB & | operator= (const Luv &v) |
Set RGB components from Luv. | |
RGB & | operator= (const HCLuv &v) |
Set RGB components from HCLuv. | |
bool | operator== (const RGB &v) const |
Return true if all components are equal, false otherwise. | |
bool | operator!= (const RGB &v) const |
Return true if components are not equal, false otherwise. | |
RGB & | operator+= (const RGB &v) |
RGB & | operator-= (const RGB &v) |
RGB & | operator*= (const RGB &v) |
RGB & | operator/= (const RGB &v) |
RGB & | operator+= (float v) |
RGB & | operator-= (float v) |
RGB & | operator*= (float v) |
RGB & | operator/= (float v) |
RGB | operator- () const |
RGB | operator+ (const RGB &v) const |
RGB | operator- (const RGB &v) const |
RGB | operator* (const RGB &v) const |
RGB | operator/ (const RGB &v) const |
RGB | operator+ (float v) const |
RGB | operator- (float v) const |
RGB | operator* (float v) const |
RGB | operator/ (float v) const |
RGB & | clamp (float max=1.f) |
Clamp all components into [0,max] range. | |
RGB | inverse () const |
Returns inverted color. | |
RGB & | invert () |
Invert RGB components. | |
float | luminance () const |
Returns luminance value (following ITU-R BT.601) | |
RGB | mix (const RGB &v, float amt=0.5f) const |
Returns self linearly mixed with another color (0 = none) | |
Public Attributes | |
union { | |
struct { | |
float r | |
Red component in [0, 1]. | |
float g | |
Green component in [0, 1]. | |
float b | |
Blue component in [0, 1]. | |
} | |
float components [3] | |
RGB component vector. | |
}; | |
Color represented by red, green, and blue components.
This offers an alternative to the Color class where the alpha component is not required for computation.
Definition at line 503 of file al_Color.hpp.
|
inline |
[in] | r | red component |
[in] | g | green component |
[in] | b | blue component |
Definition at line 516 of file al_Color.hpp.
|
inline |
[in] | rgb | 3-vector of RGB components |
Definition at line 520 of file al_Color.hpp.
|
inline |
[in] | gray | red/green/blue components |
Definition at line 523 of file al_Color.hpp.
|
inline |
[in] | v | RGB color to convert from |
Definition at line 526 of file al_Color.hpp.
|
inline |
[in] | v | Colori to convert from |
Definition at line 529 of file al_Color.hpp.
|
inline |
[in] | hsv | HSV value |
Definition at line 532 of file al_Color.hpp.
|
inline |
[in] | xyz | CIE_XYZ value |
Definition at line 535 of file al_Color.hpp.
|
inline |
[in] | lab | Lab value |
Definition at line 538 of file al_Color.hpp.
|
inline |
[in] | hclab | HCLab value |
Definition at line 541 of file al_Color.hpp.
|
inline |
[in] | luv | Luv value |
Definition at line 544 of file al_Color.hpp.
|
inline |
[in] | hcluv | HCLuv value |
Definition at line 547 of file al_Color.hpp.