boolean polygon operations
[swftools.git] / lib / gfxpoly.h
1 /* gfxpoly.h 
2
3    Various boolean polygon functions.
4
5    Part of the swftools package.
6
7    Copyright (c) 2005 Matthias Kramm <kramm@quiss.org> 
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
22
23 #ifndef __gfxpoly_h__
24 #define __gfxpoly_h__
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #include <stdio.h>
31 #include "../lib/mem.h"
32 #include "../lib/gfxdevice.h"
33 #include "../lib/gfxtools.h"
34
35 typedef struct _gfxpoly {
36 } gfxpoly_t;
37
38 void gfxpoly_free(gfxpoly_t*);
39
40 /* constructors */
41 gfxpoly_t* gfxpoly_fillToPoly(gfxline_t*line);
42 gfxpoly_t* gfxpoly_strokeToPoly(gfxline_t*line, gfxcoord_t width, gfx_capType cap_style, gfx_joinType joint_style, double miterLimit);
43 gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2);
44
45 /* boolean operations */
46 gfxpoly_t* gfxpoly_intersect(gfxpoly_t*line1, gfxpoly_t*line2);
47 gfxpoly_t* gfxpoly_union(gfxpoly_t*line1, gfxpoly_t*line2);
48
49 /* other things */
50 gfxline_t* gfxpoly_to_gfxline(gfxpoly_t*poly);
51 gfxline_t* gfxline_circularToEvenOdd(gfxline_t*line);
52
53 #ifdef __cplusplus
54 }
55 #endif
56
57 #endif //__gfxpoly_h__
58