16 #ifndef AGG_PIXFMT_BASE_INCLUDED 17 #define AGG_PIXFMT_BASE_INCLUDED 19 #include "agg_basics.h" 20 #include "agg_color_gray.h" 21 #include "agg_color_rgba.h" 38 template<
class ColorT,
class Order =
void>
41 typedef ColorT color_type;
42 typedef Order order_type;
43 typedef typename color_type::value_type value_type;
45 static rgba get(value_type r, value_type g, value_type b, value_type a, cover_type cover = cover_full)
47 if (cover > cover_none)
50 color_type::to_double(r),
51 color_type::to_double(g),
52 color_type::to_double(b),
53 color_type::to_double(a));
55 if (cover < cover_full)
57 double x = double(cover) / cover_full;
66 else return rgba::no_color();
69 static rgba get(
const value_type* p, cover_type cover = cover_full)
79 static void set(value_type* p, value_type r, value_type g, value_type b, value_type a)
87 static void set(value_type* p,
const rgba& c)
89 p[order_type::R] = color_type::from_double(c.r);
90 p[order_type::G] = color_type::from_double(c.g);
91 p[order_type::B] = color_type::from_double(c.b);
92 p[order_type::A] = color_type::from_double(c.a);