added two pass support and device filters to gfx library
[swftools.git] / lib / gfxfilter.h
1 #ifndef __gfxfilter_h__
2 #define __gfxfilter_h__
3
4 #include "gfxdevice.h"
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 typedef struct _gfxfilter
11 {
12     int num_passes;
13     const char*name;
14     int pass;
15
16     int (*setparameter)(struct _gfxfilter*in, const char*key, const char*value, struct _gfxdevice*out);
17     void (*startpage)(struct _gfxfilter*in, int width, int height, struct _gfxdevice*out);
18     void (*startclip)(struct _gfxfilter*in, gfxline_t*line, struct _gfxdevice*out);
19     void (*endclip)(struct _gfxfilter*in, struct _gfxdevice*out);
20     void (*stroke)(struct _gfxfilter*in, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, struct _gfxdevice*out);
21     void (*fill)(struct _gfxfilter*in, gfxline_t*line, gfxcolor_t*color, struct _gfxdevice*out);
22     void (*fillbitmap)(struct _gfxfilter*in, gfxline_t*line, gfximage_t*img, gfxmatrix_t*imgcoord2devcoord, gfxcxform_t*cxform, struct _gfxdevice*out); //cxform? tiling?
23     void (*fillgradient)(struct _gfxfilter*in, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*gradcoord2devcoord, struct _gfxdevice*out); //?
24     void (*addfont)(struct _gfxfilter*in, gfxfont_t*font, struct _gfxdevice*out);
25     void (*drawchar)(struct _gfxfilter*in, gfxfont_t*font, int glyph, gfxcolor_t*color, gfxmatrix_t*matrix, struct _gfxdevice*out);
26     void (*drawlink)(struct _gfxfilter*in, gfxline_t*line, const char*action, struct _gfxdevice*out);
27     void (*endpage)(struct _gfxfilter*in, struct _gfxdevice*out);
28     gfxresult_t* (*finish)(struct _gfxfilter*in, struct _gfxdevice*out);
29     void* internal;
30 } gfxfilter_t;
31
32 typedef struct _gfxtwopassfilter
33 {
34     gfxfilter_t pass1;
35     gfxfilter_t pass2;
36 } gfxtwopassfilter_t;
37
38 gfxdevice_t*gfxfilter_apply(gfxfilter_t*filter, gfxdevice_t*dev);
39 gfxdevice_t*gfxtwopassfilter_apply(gfxtwopassfilter_t*filter, gfxdevice_t*dev);
40
41 #ifdef __cplusplus
42 }
43 #endif
44
45 #endif //__gfxfilter_h__