X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxpoly.h;h=b8329c821d879ca8461fccaaefe6bd49090d6e3e;hp=a75833f420150e995c8670aa1e41bdfc215a04ed;hb=3116692a2512f2bfae346a1074d1fdfa00ea9d2c;hpb=f58dce81384e4324f00f4ca51830f3245d15136b diff --git a/lib/gfxpoly.h b/lib/gfxpoly.h index a75833f..b8329c8 100644 --- a/lib/gfxpoly.h +++ b/lib/gfxpoly.h @@ -28,27 +28,33 @@ extern "C" { #endif #include -#include "../lib/mem.h" -#include "../lib/gfxdevice.h" -#include "../lib/gfxtools.h" +#include "mem.h" +#include "gfxdevice.h" +#include "gfxtools.h" + +/* A "grid" value is the granularity at which polygon intersection operates. + It usually makes sense this to the smallest value that can actually be represented + in the output device (like 0.05 = 1 twip for SWF). */ +#define DEFAULT_GRID (0.05) typedef struct _gfxpoly { } gfxpoly_t; -void gfxpoly_free(gfxpoly_t*); +void gfxpoly_destroy(gfxpoly_t*poly); /* constructors */ -gfxpoly_t* gfxpoly_fillToPoly(gfxline_t*line); -gfxpoly_t* gfxpoly_strokeToPoly(gfxline_t*line, gfxcoord_t width, gfx_capType cap_style, gfx_joinType joint_style, double miterLimit); -gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2); - -/* boolean operations */ -gfxpoly_t* gfxpoly_intersect(gfxpoly_t*line1, gfxpoly_t*line2); -gfxpoly_t* gfxpoly_union(gfxpoly_t*line1, gfxpoly_t*line2); - -/* other things */ -gfxline_t* gfxpoly_to_gfxline(gfxpoly_t*poly); -gfxline_t* gfxline_circularToEvenOdd(gfxline_t*line); +gfxpoly_t* gfxpoly_from_fill(gfxline_t*line, double gridsize); +gfxpoly_t* gfxpoly_from_stroke(gfxline_t*line, gfxcoord_t width, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit, double gridsize); + +/* operators */ +gfxpoly_t* gfxpoly_intersect(gfxpoly_t*p1, gfxpoly_t*p2); +gfxpoly_t* gfxpoly_union(gfxpoly_t*p1, gfxpoly_t*p2); + +/* conversion functions */ +gfxpoly_t* gfxpoly_createbox(double x1, double y1,double x2, double y2, double gridsize); +gfxline_t* gfxline_from_gfxpoly(gfxpoly_t*poly); +gfxline_t* gfxline_from_gfxpoly_with_direction(gfxpoly_t*poly); +gfxline_t* gfxpoly_circular_to_evenodd(gfxline_t*line, double gridsize); #ifdef __cplusplus }