synfig-core
1.0.3
|
#include <cairocolor.h>
Public Types | |
typedef uint32_t | value_type |
Public Member Functions | |
unsigned char | ceil_clamp (int x) |
unsigned char | floor_clamp (int x) |
unsigned char | clamp (int x) |
unsigned char | clamp (float x) |
CairoColor & | operator+= (const CairoColor &rhs) |
CairoColor & | operator-= (const CairoColor &rhs) |
CairoColor & | operator*= (const float &rhs) |
CairoColor & | operator/= (const float &rhs) |
CairoColor | operator+ (const CairoColor &rhs) const |
CairoColor | operator- (const CairoColor &rhs) const |
CairoColor | operator* (const float &rhs) const |
CairoColor | operator/ (const float &rhs) const |
bool | operator== (const CairoColor &rhs) const |
bool | operator!= (const CairoColor &rhs) const |
CairoColor | operator~ () const |
bool | is_valid () const |
CairoColor | premult_alpha () const |
CairoColor | demult_alpha () const |
CairoColor () | |
CairoColor (const unsigned char u) | |
CairoColor (const unsigned char R, const unsigned char G, const unsigned char B, const unsigned char A=ceil) | |
CairoColor (const CairoColor &c, const unsigned char A) | |
CairoColor (const CairoColor &c) | |
CairoColor (const Color &c) | |
CairoColor (const CairoColorAccumulator &c) | |
CairoColor (int r, int g, int b, int a) | |
value_type | get_pixel () const |
unsigned char | get_a () const |
unsigned char | get_r () const |
unsigned char | get_g () const |
unsigned char | get_b () const |
unsigned char | get_alpha () const |
const String | get_string (void) const |
void | set_hex (String &str) |
const String | get_hex () const |
CairoColor & | set_r (const unsigned char x) |
CairoColor & | set_g (const unsigned char x) |
CairoColor & | set_b (const unsigned char x) |
CairoColor & | set_a (const unsigned char x) |
CairoColor & | set_alpha (const unsigned char x) |
float | get_y () const |
float | get_u () const |
float | get_v () const |
float | get_s () const |
CairoColor & | set_yuv (const float &y, const float &u, const float &v) |
CairoColor & | set_y (const float &y) |
CairoColor & | set_u (const float &u) |
CairoColor & | set_v (const float &v) |
CairoColor & | set_uv (const float &u, const float &v) |
CairoColor & | set_s (const float &x) |
Angle | get_hue () const |
Angle | get_uv_angle () const |
CairoColor & | set_hue (const Angle &theta) |
CairoColor & | set_uv_angle (const Angle &theta) |
CairoColor & | rotate_uv (const Angle &theta) |
CairoColor & | set_yuv (const float &y, const float &s, const Angle &theta) |
Static Public Member Functions | |
static const String | char2hex (unsigned char c) |
static unsigned char | hex2char (String s) |
static CairoColor | YUV (const float &y, const float &u, const float &v, const unsigned char a=ceil) |
static CairoColor | YUV (const float &y, const float &s, const Angle &theta, const unsigned char a=ceil) |
static CairoColor | alpha () |
static CairoColor | black () |
static CairoColor | white () |
static CairoColor | gray () |
static CairoColor | magenta () |
static CairoColor | red () |
static CairoColor | green () |
static CairoColor | blue () |
static CairoColor | cyan () |
static CairoColor | yellow () |
static CairoColor | blend (CairoColor a, CairoColor b, float amount, Color::BlendMethod type=Color::BLEND_COMPOSITE) |
static bool | is_onto (Color::BlendMethod x) |
static bool | is_straight (Color::BlendMethod x) |
Static Public Attributes | |
static const unsigned char | ceil = 255 |
static const unsigned char | floor = 0 |
static const float | range = CairoColor::ceil - CairoColor::floor |
static const value_type | amask = 0xFF<<24 |
static const value_type | rmask = 0xFF<<16 |
static const value_type | gmask = 0xFF<<8 |
static const value_type | bmask = 0xFF |
Friends | |
class | CairoColorAccumulator |
\ ARGB 32 bits Color class implementation \ for Cairo Image usage. \ Color channels are stored in a 32 bits value native endian aligened \ with this order A, R, G, B \ Operations over color channels \ that overflow or underflow the unsigned char value \ (get the value out of 0-255) aren't allowed and the \ value will remain at 0 or 255. Otherwise, there could \ be color cycling what will produce artifacts, since \ values outside 0-255 aren't allowed.
\ In this class color channels aren't alpha premultiplied \ When used on a alpha premultiplied surface the premultiplication \ and demultiplication has to be explicitly done by the user before \ and after being used on the Cairo Image surface.
typedef uint32_t synfig::CairoColor::value_type |
|
inline |
Referenced by alpha(), black(), blue(), cyan(), demult_alpha(), gray(), green(), magenta(), operator*(), operator+(), operator-(), operator/(), operator~(), premult_alpha(), red(), set_hex(), set_yuv(), white(), yellow(), and YUV().
|
inline |
|
inline |
|
inline |
References set_a().
|
inline |
|
inline |
References synfig::Color::ceil, ceil, floor, synfig::Color::get_a(), synfig::Color::get_b(), synfig::Color::get_g(), synfig::Color::get_r(), set_a(), set_b(), set_g(), and set_r().
|
inline |
|
inline |
|
inline |
References ceil.
Referenced by operator+=().
|
inline |
References floor.
Referenced by operator-=().
|
inline |
Referenced by CairoColor(), clamp(), operator*=(), and operator/=().
|
inline |
References clamp().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References CairoColor().
|
inline |
References CairoColor().
|
inline |
References CairoColor().
|
inline |
References CairoColor().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References CairoColor(), get_a(), get_b(), get_g(), get_r(), and range.
Referenced by Layer_Shade::accelerated_cairorender(), synfig::Layer_SphereDistort::accelerated_cairorender(), SpiralGradient::accelerated_cairorender(), FilledRect::accelerated_cairorender(), CurveGradient::accelerated_cairorender(), cairo_paint_with_alpha_operator(), synfig::cairorender(), synfig::CairoColorPrep::cook(), and synfig::Layer_Shape::feather_cairo_surface().
|
inline |
References alpha(), CairoColor(), get_a(), get_b(), get_g(), get_r(), and range.
Referenced by synfig::Layer_Bitmap::get_cairocolor(), and synfig::CairoColorPrep::uncook().
|
inline |
|
inline |
Referenced by synfig::blendfunc_ADD(), synfig::blendfunc_ALPHA_BRIGHTEN(), synfig::blendfunc_ALPHA_DARKEN(), synfig::blendfunc_ALPHA_OVER(), synfig::blendfunc_BEHIND(), synfig::blendfunc_BRIGHTEN(), synfig::blendfunc_COMPOSITE(), synfig::blendfunc_DARKEN(), synfig::blendfunc_DIFFERENCE(), synfig::blendfunc_DIVIDE(), synfig::blendfunc_HARD_LIGHT(), synfig::blendfunc_MULTIPLY(), synfig::blendfunc_ONTO(), synfig::blendfunc_STRAIGHT(), synfig::blendfunc_STRAIGHT_ONTO(), synfig::blendfunc_SUBTRACT(), synfig::Color::Color(), demult_alpha(), get_alpha(), get_string(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator==(), operator~(), and premult_alpha().
|
inline |
Referenced by synfig::blendfunc_ADD(), synfig::blendfunc_ALPHA_BRIGHTEN(), synfig::blendfunc_ALPHA_DARKEN(), synfig::blendfunc_BRIGHTEN(), synfig::blendfunc_COMPOSITE(), synfig::blendfunc_DARKEN(), synfig::blendfunc_DIFFERENCE(), synfig::blendfunc_DIVIDE(), synfig::blendfunc_HARD_LIGHT(), synfig::blendfunc_MULTIPLY(), synfig::blendfunc_OVERLAY< CairoColor >(), synfig::blendfunc_SCREEN(), synfig::blendfunc_STRAIGHT(), synfig::blendfunc_SUBTRACT(), cairo_png_mptr::cairo_png_mptr(), synfig::Color::Color(), demult_alpha(), synfig::Target_Cairo::gamma_filter(), synfig::Target_Cairo_Tile::gamma_filter(), get_hex(), get_u(), get_v(), get_y(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator==(), operator~(), and premult_alpha().
|
inline |
Referenced by synfig::blendfunc_ADD(), synfig::blendfunc_ALPHA_BRIGHTEN(), synfig::blendfunc_ALPHA_DARKEN(), synfig::blendfunc_BRIGHTEN(), synfig::blendfunc_COMPOSITE(), synfig::blendfunc_DARKEN(), synfig::blendfunc_DIFFERENCE(), synfig::blendfunc_DIVIDE(), synfig::blendfunc_HARD_LIGHT(), synfig::blendfunc_MULTIPLY(), synfig::blendfunc_SCREEN(), synfig::blendfunc_STRAIGHT(), synfig::blendfunc_SUBTRACT(), cairo_png_mptr::cairo_png_mptr(), synfig::Color::Color(), demult_alpha(), synfig::Target_Cairo::gamma_filter(), synfig::Target_Cairo_Tile::gamma_filter(), get_hex(), get_u(), get_v(), get_y(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator==(), operator~(), and premult_alpha().
|
inline |
Referenced by synfig::blendfunc_ADD(), synfig::blendfunc_ALPHA_BRIGHTEN(), synfig::blendfunc_ALPHA_DARKEN(), synfig::blendfunc_BRIGHTEN(), synfig::blendfunc_COMPOSITE(), synfig::blendfunc_DARKEN(), synfig::blendfunc_DIFFERENCE(), synfig::blendfunc_DIVIDE(), synfig::blendfunc_HARD_LIGHT(), synfig::blendfunc_MULTIPLY(), synfig::blendfunc_SCREEN(), synfig::blendfunc_STRAIGHT(), synfig::blendfunc_SUBTRACT(), cairo_png_mptr::cairo_png_mptr(), synfig::Color::Color(), demult_alpha(), synfig::Target_Cairo::gamma_filter(), synfig::Target_Cairo_Tile::gamma_filter(), get_hex(), get_u(), get_v(), get_y(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator==(), operator~(), and premult_alpha().
|
inline |
References get_a().
Referenced by cairo_png_mptr::cairo_png_mptr(), synfig::Target_Cairo::gamma_filter(), and synfig::Target_Cairo_Tile::gamma_filter().
|
static |
References ceil, and synfig::Color::real2hex().
Referenced by get_hex().
|
static |
References synfig::Color::hex2real().
void synfig::CairoColor::set_hex | ( | String & | str | ) |
References CairoColor(), synfig::Color::clamped(), and synfig::Color::set_hex().
|
inline |
References char2hex(), get_b(), get_g(), and get_r().
Referenced by get_string().
|
inline |
References rmask.
Referenced by synfig::blendfunc_ADD(), synfig::blendfunc_BRIGHTEN(), synfig::blendfunc_DIFFERENCE(), synfig::blendfunc_MULTIPLY(), synfig::blendfunc_SCREEN(), synfig::blendfunc_SUBTRACT(), cairo_png_mptr::cairo_png_mptr(), CairoColor(), synfig::Target_Cairo::gamma_filter(), synfig::Target_Cairo_Tile::gamma_filter(), operator*=(), operator+=(), operator-=(), and operator/=().
|
inline |
References gmask.
Referenced by synfig::blendfunc_ADD(), synfig::blendfunc_BRIGHTEN(), synfig::blendfunc_DIFFERENCE(), synfig::blendfunc_MULTIPLY(), synfig::blendfunc_SCREEN(), synfig::blendfunc_SUBTRACT(), cairo_png_mptr::cairo_png_mptr(), CairoColor(), synfig::Target_Cairo::gamma_filter(), synfig::Target_Cairo_Tile::gamma_filter(), operator*=(), operator+=(), operator-=(), and operator/=().
|
inline |
References bmask.
Referenced by synfig::blendfunc_ADD(), synfig::blendfunc_BRIGHTEN(), synfig::blendfunc_DIFFERENCE(), synfig::blendfunc_MULTIPLY(), synfig::blendfunc_SCREEN(), synfig::blendfunc_SUBTRACT(), cairo_png_mptr::cairo_png_mptr(), CairoColor(), synfig::Target_Cairo::gamma_filter(), synfig::Target_Cairo_Tile::gamma_filter(), operator*=(), operator+=(), operator-=(), and operator/=().
|
inline |
References amask.
Referenced by synfig::blendfunc_ALPHA_BRIGHTEN(), synfig::blendfunc_ALPHA_DARKEN(), synfig::blendfunc_ALPHA_OVER(), synfig::blendfunc_BEHIND(), synfig::blendfunc_ONTO(), synfig::blendfunc_STRAIGHT(), synfig::blendfunc_STRAIGHT_ONTO(), CairoColor(), operator*=(), operator+=(), operator-=(), operator/=(), and set_alpha().
|
inline |
References set_a().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References CairoColor(), synfig::DecodeYUV, synfig::Color::set_b(), synfig::Color::set_g(), and synfig::Color::set_r().
Referenced by set_u(), set_uv(), set_v(), set_y(), and set_yuv().
|
inline |
|
inline |
|
inline |
|
inline |
References get_y(), and set_yuv().
Referenced by rotate_uv(), set_hue(), and set_s().
|
inline |
|
inlinestatic |
References CairoColor().
|
inline |
References get_u(), and get_v().
Referenced by get_uv_angle().
|
inline |
References get_s(), and set_uv().
Referenced by set_uv_angle().
|
inline |
References set_hue().
|
inline |
|
inline |
References set_yuv().
|
inlinestatic |
References CairoColor().
|
inlinestatic |
References CairoColor(), and floor.
Referenced by synfig::Layer_SphereDistort::accelerated_cairorender(), synfig::blendfunc_COMPOSITE(), synfig::blendfunc_STRAIGHT(), demult_alpha(), and synfig::Layer_Bitmap::get_cairocolor().
|
inlinestatic |
References CairoColor(), and floor.
|
inlinestatic |
References CairoColor(), and ceil.
|
inlinestatic |
References CairoColor(), and ceil.
|
inlinestatic |
References CairoColor(), ceil, and floor.
|
inlinestatic |
References CairoColor(), ceil, and floor.
|
inlinestatic |
References CairoColor(), ceil, and floor.
|
inlinestatic |
References CairoColor(), ceil, and floor.
|
inlinestatic |
References CairoColor(), ceil, and floor.
|
inlinestatic |
References CairoColor(), ceil, and floor.
|
static |
References synfig::Color::BLEND_END, synfig::blendfunc_OVERLAY< CairoColor >(), and COLOR_EPSILON.
Referenced by synfig::blendfunc_ALPHA_OVER(), synfig::blendfunc_BEHIND(), synfig::blendfunc_HARD_LIGHT(), synfig::blendfunc_OVERLAY< CairoColor >(), synfig::blendfunc_STRAIGHT_ONTO(), and synfig::Layer_Bitmap::get_cairocolor().
|
inlinestatic |
|
inlinestatic |
|
friend |
|
static |
Referenced by blue(), CairoColor(), ceil_clamp(), char2hex(), clamp(), synfig::Color::Color(), cyan(), synfig::Layer_Shape::feather_cairo_surface(), gray(), green(), magenta(), operator~(), red(), white(), and yellow().
|
static |
Referenced by alpha(), black(), blue(), CairoColor(), clamp(), synfig::Color::Color(), cyan(), floor_clamp(), green(), magenta(), red(), and yellow().
|
static |
Referenced by CairoColor(), demult_alpha(), get_u(), get_v(), get_y(), and premult_alpha().
|
static |
Referenced by set_a().
|
static |
Referenced by set_r().
|
static |
Referenced by set_g().
|
static |
Referenced by set_b().