From: Matthias Kramm Date: Tue, 2 Feb 2010 19:48:35 +0000 (-0800) Subject: fixed staircase issue with poly2bitmap X-Git-Tag: version-0-9-1~169 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=a1587574bba2fe7cffe40aa1bad0fe84aed23825;hp=60c0d1f208a941d251f049bb9c10d5a1a69e076d fixed staircase issue with poly2bitmap --- diff --git a/lib/devices/swf.c b/lib/devices/swf.c index 3be81d5..af5d284 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -102,6 +102,7 @@ typedef struct _swfoutput_internal int config_storeallcharacters; int config_enablezlib; int config_insertstoptag; + int config_showimages; int config_watermark; int config_noclips; int config_flashversion; @@ -2120,6 +2121,8 @@ int swf_setparameter(gfxdevice_t*dev, const char*name, const char*value) i->config_dumpfonts = atoi(value); } else if(!strcmp(name, "animate")) { i->config_animate = atoi(value); + } else if(!strcmp(name, "showimages")) { + i->config_showimages = atoi(value); } else if(!strcmp(name, "disablelinks")) { i->config_disablelinks = atoi(value); } else if(!strcmp(name, "simpleviewer")) { @@ -2359,6 +2362,11 @@ static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxm SHAPE*shape; swf_ShapeNew(&shape); int fsid = swf_ShapeAddBitmapFillStyle(shape,&m,bitid,1); + int lsid = 0; + if(i->config_showimages) { + RGBA pink = {255,255,0,255}; + lsid = swf_ShapeAddLineStyle(shape, 20, &pink); + } swf_SetU16(i->tag, myshapeid); SRECT r = gfxline_getSWFbbox(line); r = swf_ClipRect(i->pagebbox, r); @@ -2366,7 +2374,7 @@ static void swf_fillbitmap(gfxdevice_t*dev, gfxline_t*line, gfximage_t*img, gfxm swf_SetShapeStyles(i->tag,shape); swf_ShapeCountBits(shape,NULL,NULL); swf_SetShapeBits(i->tag,shape); - swf_ShapeSetAll(i->tag,shape,UNDEFINED_COORD,UNDEFINED_COORD,0,fsid,0); + swf_ShapeSetAll(i->tag,shape,UNDEFINED_COORD,UNDEFINED_COORD,lsid,fsid,0); i->swflastx = i->swflasty = UNDEFINED_COORD; drawgfxline(dev, line, 1); swf_ShapeSetEnd(i->tag); diff --git a/lib/pdf/BitmapOutputDev.cc b/lib/pdf/BitmapOutputDev.cc index 6eaea6b..25c4c81 100644 --- a/lib/pdf/BitmapOutputDev.cc +++ b/lib/pdf/BitmapOutputDev.cc @@ -226,10 +226,10 @@ void BitmapOutputDev::flushBitmap() } } else { for(x=0;x>(x&7)))) { + if(!(ain2[(x+xmin)/8]&(0x80>>((x+xmin)&7)))) { /* cut away pixels that we don't remember drawing (i.e., that are - not in the monochrome bitmap. Prevents some "hairlines" showing - up to the left and right of bitmaps */ + not in the monochrome bitmap). Prevents some "hairlines" showing + up to the left and right of bitmaps. */ out[x].r = 0;out[x].g = 0;out[x].b = 0;out[x].a = 0; } else { /* according to endPage()/compositeBackground() in xpdf/SplashOutputDev.cc, we diff --git a/spec/layers2.pdf b/spec/layers2.pdf index 5b9a234..faceaeb 100644 Binary files a/spec/layers2.pdf and b/spec/layers2.pdf differ diff --git a/spec/layers2.py b/spec/layers2.py index 91402fd..f0ade05 100644 --- a/spec/layers2.py +++ b/spec/layers2.py @@ -30,7 +30,7 @@ for i in range(100): PDF_lineto(p, x+5, y) PDF_stroke(p) -PDF_setrgbcolor_fill(p, 1.0, 0, 0) +PDF_setrgbcolor_fill(p, 0.5, 0.5, 1.0) x,y = 100,100 def rect(x,y): PDF_moveto(p, x,y)