X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxpoly%2Fpoly.h;h=270734f18f2340fc251a7828af5751f33514b447;hb=e0a27e1bd83ff2d60745dd6030e0f5ef7ef97b82;hp=417c6c12a35a3125f0bcda3a7cbc2996c8924ddc;hpb=fec1ab31707e68c2396b186e0e4928632402d649;p=swftools.git diff --git a/lib/gfxpoly/poly.h b/lib/gfxpoly/poly.h index 417c6c1..270734f 100644 --- a/lib/gfxpoly/poly.h +++ b/lib/gfxpoly/poly.h @@ -6,8 +6,11 @@ #include "../types.h" //#define DEBUG -#define CHECKS +//#define CHECKS + +/* features */ #define SPLAY +#define DONT_REMEMBER_CROSSINGS typedef enum {DIR_UP, DIR_DOWN, DIR_UNKNOWN} segment_dir_t; typedef enum {EVENT_CROSS, EVENT_END, EVENT_START, EVENT_HORIZONTAL} eventtype_t; @@ -19,7 +22,7 @@ typedef struct _point { } point_t; typedef struct _fillstyle { - char is_filled; + void*internal; } fillstyle_t; typedef struct _windstate @@ -45,6 +48,7 @@ typedef struct _windrule typedef struct _gfxpolystroke { segment_dir_t dir; + int points_size; int num_points; point_t*points; fillstyle_t*fs; @@ -87,7 +91,9 @@ typedef struct _segment { gfxpolystroke_t*stroke; int stroke_pos; +#ifndef DONT_REMEMBER_CROSSINGS dict_t scheduled_crossings; +#endif } segment_t; #define LINE_EQ(p,s) ((double)(s)->delta.y*(p).x - (double)(s)->delta.x*(p).y - (s)->k) @@ -109,10 +115,14 @@ typedef struct _segment { void gfxpoly_fail(char*expr, char*file, int line, const char*function); char gfxpoly_check(gfxpoly_t*poly); +int gfxpoly_num_segments(gfxpoly_t*poly); int gfxpoly_size(gfxpoly_t*poly); void gfxpoly_dump(gfxpoly_t*poly); void gfxpoly_save(gfxpoly_t*poly, const char*filename); -gfxpoly_t* gfxpoly_process(gfxpoly_t*poly, windrule_t*windrule, windcontext_t*context); +gfxpoly_t* gfxpoly_process(gfxpoly_t*poly1, gfxpoly_t*poly2, windrule_t*windrule, windcontext_t*context); + +gfxpoly_t* gfxpoly_intersect(gfxpoly_t*p1, gfxpoly_t*p2); +gfxpoly_t* gfxpoly_union(gfxpoly_t*p1, gfxpoly_t*p2); #ifndef CHECKS #ifdef assert