fixed staircase issue with poly2bitmap
authorMatthias Kramm <kramm@quiss.org>
Tue, 2 Feb 2010 19:48:35 +0000 (11:48 -0800)
committerMatthias Kramm <kramm@quiss.org>
Tue, 2 Feb 2010 19:48:35 +0000 (11:48 -0800)
lib/devices/swf.c
lib/pdf/BitmapOutputDev.cc
spec/layers2.pdf
spec/layers2.py

index 3be81d5..af5d284 100644 (file)
@@ -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);
index 6eaea6b..25c4c81 100644 (file)
@@ -226,10 +226,10 @@ void BitmapOutputDev::flushBitmap()
                }
            } else {
                for(x=0;x<rangex;x++) {
-                   if(!(ain2[(x+xmin)/8]&(0x80>>(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
index 5b9a234..faceaeb 100644 (file)
Binary files a/spec/layers2.pdf and b/spec/layers2.pdf differ
index 91402fd..f0ade05 100644 (file)
@@ -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)