26 #ifndef __SYNFIG_SURFACE_H
27 #define __SYNFIG_SURFACE_H
34 #include <ETL/surface>
48 class Target_Scanline;
66 const float a(1.0
f/x.
get_a());
92 class Surface :
public etl::surface<Color, ColorAccumulator, ColorPrep>
100 Surface(
const size_type::value_type &w,
const size_type::value_type &h):
106 template <
typename _pen>
107 Surface(
const _pen &_begin,
const _pen &_end):
111 {
return blit_to(pen,0,0, get_w(),get_h()); }
113 template <
class _pen>
void
114 blit_to(_pen& DEST_PEN,
int x,
int y,
int w,
int h)
121 void blit_to(alpha_pen& DEST_PEN,
int x,
int y,
int w,
int h);
130 class CairoSurface :
public etl::surface<CairoColor, CairoColorAccumulator, CairoColorPrep>
134 cairo_surface_t *cs_;
137 cairo_surface_t *cs_image_;
146 if(cs_!= NULL) cairo_surface_destroy(cs_);
147 if(cs_image_!=NULL) cairo_surface_destroy(cs_image_); }
153 void set_wh(
int w,
int h,
int pitch=0);
156 void set_wh(
int w,
int h,
unsigned char* data,
int pitch)
160 void blit_to(alpha_pen& DEST_PEN,
int x,
int y,
int w,
int h);
192 template <
class C,
typename A=Color::value_type>
199 C operator()(
const C &a,
const C &b,
const A &t)
const
201 return C::blend(b,a,t,blend_method);
216 class Surface::alpha_pen :
public etl::alpha_pen< etl::generic_pen<Color, ColorAccumulator>, Color::value_type, _BlendFunc<Color> >
224 alpha_pen(
const etl::generic_pen<Color, ColorAccumulator>& pen,
const Color::value_type &a = 1,
const _BlendFunc<Color> &func = _BlendFunc<Color>()):
246 class CairoSurface::alpha_pen :
public etl::alpha_pen< etl::generic_pen<CairoColor, CairoColorAccumulator>, float, _BlendFunc<CairoColor> >
250 alpha_pen(
const etl::alpha_pen< etl::generic_pen<CairoColor, CairoColorAccumulator>,
float, _BlendFunc<CairoColor> > &x):
254 alpha_pen(
const etl::generic_pen<CairoColor, CairoColorAccumulator>& pen,
const float &a = 1,
const _BlendFunc<CairoColor> &func = _BlendFunc<CairoColor>()):