|
Public Types |
typedef ColorReal | value_type |
enum | BlendMethod {
BLEND_COMPOSITE = 0,
BLEND_STRAIGHT = 1,
BLEND_BRIGHTEN = 2,
BLEND_DARKEN = 3,
BLEND_ADD = 4,
BLEND_SUBTRACT = 5,
BLEND_MULTIPLY = 6,
BLEND_DIVIDE = 7,
BLEND_COLOR = 8,
BLEND_HUE = 9,
BLEND_SATURATION = 10,
BLEND_LUMINANCE = 11,
BLEND_BEHIND = 12,
BLEND_ONTO = 13,
BLEND_SCREEN = 16,
BLEND_OVERLAY = 20,
BLEND_DIFFERENCE = 18,
BLEND_HARD_LIGHT = 17,
BLEND_ALPHA_BRIGHTEN = 14,
BLEND_ALPHA_DARKEN = 15,
BLEND_ALPHA_OVER = 19,
BLEND_STRAIGHT_ONTO = 21,
BLEND_END = 22
} |
Public Member Functions |
Color & | operator+= (const Color &rhs) |
Color & | operator-= (const Color &rhs) |
Color & | operator *= (const float &rhs) |
Color & | operator/= (const float &rhs) |
Color | operator+ (const Color &rhs) const |
Color | operator- (const Color &rhs) const |
Color | operator * (const float &rhs) const |
Color | operator/ (const float &rhs) const |
bool | operator== (const Color &rhs) const |
bool | operator!= (const Color &rhs) const |
Color | operator- () const |
Color | operator~ () const |
| Effectively 1.0-color.
|
bool | is_valid () const |
Color | premult_alpha () const |
Color | demult_alpha () const |
| Color () |
| Color (const value_type &f) |
| Color (int f) |
| Color (const value_type &R, const value_type &G, const value_type &B, const value_type &A=1) |
| Color (const Color &c, const value_type &A) |
| Color (const Color &c) |
| Copy constructor.
|
const value_type & | get_r () const |
| Returns the RED component.
|
const value_type & | get_g () const |
| Returns the GREEN component.
|
const value_type & | get_b () const |
| Returns the BLUE component.
|
const value_type & | get_a () const |
| Returns the amount of opacity (alpha).
|
const value_type & | get_alpha () const |
| Synonym for get_a().
|
Color & | set_r (const value_type &x) |
| Sets the RED component to x.
|
Color & | set_g (const value_type &x) |
| Sets the GREEN component to x.
|
Color & | set_b (const value_type &x) |
| Sets the BLUE component to x.
|
Color & | set_a (const value_type &x) |
| Sets the opacity (alpha) to x.
|
Color & | set_alpha (const value_type &x) |
| Synonym for set_a().
|
float | get_y () const |
| Returns color's luminance.
|
float | get_u () const |
| Returns U component of chromanance.
|
float | get_v () const |
| Returns V component of chromanance.
|
float | get_s () const |
| Returns the color's saturation.
|
Color & | set_yuv (const float &y, const float &u, const float &v) |
| Sets the luminance (y) and chromanance (u and v).
|
Color & | set_y (const float &y) |
| Sets color luminance.
|
Color & | set_u (const float &u) |
| Set U component of chromanance.
|
Color & | set_v (const float &v) |
| Set V component of chromanance.
|
Color & | set_uv (const float &u, const float &v) |
| Set the U and V components of chromanance.
|
Color & | set_s (const float &x) |
| Sets the color's saturation.
|
Angle | get_hue () const |
| Returns the hue of the chromanance.
|
Angle | get_uv_angle () const |
| Synonym for get_hue().
|
Color & | set_hue (const Angle &theta) |
| Sets the color's hue.
|
Color & | set_uv_angle (const Angle &theta) |
| Synonym for set_hue().
|
Color & | rotate_uv (const Angle &theta) |
| Rotates the chromanance vector by amount specified by theta.
|
Color & | set_yuv (const float &y, const float &s, const Angle &theta) |
| Sets the luminance (y) and chromanance (s and theta).
|
Color | clamped () const |
| Clamps a color so that its values are in range. Ignores attempting to visualize negative colors.
|
Color | clamped_negative () const |
| Clamps a color so that its values are in range.
|
Static Public Member Functions |
static Color | YUV (const float &y, const float &u, const float &v, const value_type &a=1) |
| YUV Color constructor.
|
static Color | YUV (const float &y, const float &s, const Angle &theta, const value_type &a=1) |
| YUV color constructor where the chroma is in the saturation/hue form.
|
static Color | blend (Color a, Color b, float amount, BlendMethod type=BLEND_COMPOSITE) |
static bool | is_onto (BlendMethod x) |
|
static Color | alpha () |
| Preset Color Constructors.
|
static Color | black () |
| Preset Color Constructors.
|
static Color | white () |
| Preset Color Constructors.
|
static Color | gray () |
| Preset Color Constructors.
|
static Color | magenta () |
| Preset Color Constructors.
|
static Color | red () |
| Preset Color Constructors.
|
static Color | green () |
| Preset Color Constructors.
|
static Color | blue () |
| Preset Color Constructors.
|
static Color | cyan () |
| Preset Color Constructors.
|
static Color | yellow () |
| Preset Color Constructors.
|