X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxpoly.c;h=dd97ff437fbe410dec99cb46906f9c41ede37197;hb=3d7393729761993b7d7e1d8db602560d339adac2;hp=a08899de6c721442d27b84017f26fce00a81d241;hpb=66a03382aab040571f94b0861719753bda3ff8f1;p=swftools.git diff --git a/lib/gfxpoly.c b/lib/gfxpoly.c index a08899d..dd97ff4 100644 --- a/lib/gfxpoly.c +++ b/lib/gfxpoly.c @@ -25,15 +25,9 @@ #include "gfxtools.h" #include "gfxpoly.h" #include "mem.h" -#ifdef INTERNAL_LIBART #include "art/libart.h" #include "art/art_svp_intersect.h" #include "art/art_svp_ops.h" -#else -#include -#include -#include -#endif #include "log.h" #include #include @@ -265,7 +259,7 @@ intbbox_t get_svp_bbox(ArtSVP*svp, double zoom) if(x1 < b.xmin) b.xmin = x1; if(y1 < b.ymin) b.ymin = y1; if(x2 > b.xmax) b.xmax = x2; - if(y2 > b.xmax) b.ymax = y2; + if(y2 > b.ymax) b.ymax = y2; } } if(b.xmax > (int)(MAX_WIDTH*zoom)) @@ -302,51 +296,39 @@ intbbox_t get_svp_bbox(ArtSVP*svp, double zoom) #define B00000010 0x02 #define B00000001 0x01 -int compare_bitmaps(intbbox_t*bbox, unsigned char*data1, unsigned char*data2) +static int compare_bitmaps(intbbox_t*bbox, unsigned char*data1, unsigned char*data2) { - int similar = 0; + if(!data1 || !data2) + return 0; int x,y; int height = bbox->height; int width = bbox->width; int width8 = (width+7) >> 3; unsigned char*l1 = &data1[width8]; unsigned char*l2 = &data2[width8]; - int fail = 0; for(y=1;y Converting circular-filled gfxline of %d segments to even-odd filled gfxline", gfxline_len(line)); ArtSVP* svp = gfxfillToSVP(line, 1); - /* TODO: ART_WIND_RULE_POSITIVE means that a shape is visible if - positive and negative line segments add up to something positive. - I *think* that clockwise fill in PDF is defined in a way, however, - that the *last* shape's direction will determine whether something - is filled */ ArtSVP* svp_rewinded; - svp_rewinded = run_intersector(svp, ART_WIND_RULE_POSITIVE); + svp_rewinded = run_intersector(svp, ART_WIND_RULE_NONZERO); if(!svp_rewinded) { art_svp_free(svp); return 0;