switched several parts of the polygon processor to a more compact polygon representation
[swftools.git] / lib / gfxpoly / convert.h
1 #ifndef __poly_convert_h__
2 #define __poly_convert_h__
3
4 #include "../gfxdevice.h"
5 #include "poly.h"
6
7 gfxpoly_t* gfxpoly_from_gfxline(gfxline_t*line, double gridsize);
8 gfxpoly_t* gfxpoly_from_file(const char*filename, double gridsize);
9 gfxpoly_t* gfxpoly_from_gfxcompactpoly(gfxcompactpoly_t*poly);
10
11 typedef struct _polywriter
12 {
13     void(*moveto)(struct _polywriter*, int x, int y);
14     void(*lineto)(struct _polywriter*, int x, int y);
15     void(*setgridsize)(struct _polywriter*, double g);
16     void*(*finish)(struct _polywriter*);
17     void*internal;
18 } polywriter_t;
19
20 void gfxpolywriter_init(polywriter_t*w);
21 void gfxcompactpolywriter_init(polywriter_t*w);
22
23 gfxcompactpoly_t* gfxcompactpoly_from_gfxline(gfxline_t*line, double gridsize);
24 gfxcompactpoly_t* gfxcompactpoly_from_file(const char*filename, double gridsize);
25
26 void gfxcompactpoly_destroy(gfxcompactpoly_t*poly);
27
28 #endif //__poly_convert_h__