X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fpdf%2FBitmapOutputDev.cc;h=32acd80ca96400170a5964d42f66bd07dae92b4f;hp=2889e5eaf03d83dbd22215e247b0f8e544727957;hb=c10fb05b68fa1c717ef7d62d84bfb29008d41c33;hpb=6dd8c2fc3eae2c30f90696fcc49f89f79817a533 diff --git a/lib/pdf/BitmapOutputDev.cc b/lib/pdf/BitmapOutputDev.cc index 2889e5e..32acd80 100644 --- a/lib/pdf/BitmapOutputDev.cc +++ b/lib/pdf/BitmapOutputDev.cc @@ -30,6 +30,7 @@ #include "../png.h" #include "../devices/record.h" #include "../types.h" +#include "bbox.h" #define UNKNOWN_BOUNDING_BOX 0,0,0,0 @@ -158,64 +159,6 @@ void BitmapOutputDev::setPageMap(int*page2page, int num_pages) this->gfxdev->setPageMap(page2page, num_pages); } -typedef struct _ibbox { - int xmin,ymin,xmax,ymax; - struct _ibbox*next; -} ibbox_t; - -static ibbox_t* ibbox_new(int x1, int y1, int x2, int y2) -{ - ibbox_t*b = (ibbox_t*)rfx_calloc(sizeof(ibbox_t)); - b->xmin = x1; - b->ymin = y1; - b->xmax = x2; - b->ymax = y2; - return b; -} - -static void ibbox_destroy(ibbox_t*b) -{ - while(b) { - ibbox_t*next = b->next; - free(b); - b = next; - } -} - -static ibbox_t*getBitmapBBoxes(Guchar*alpha, int width, int height) -{ - int ymin = -1; - int ymax = -1; - int xmin = width; - int xmax = 0; - - int x,y; - for(y=0;yxmax) xmax = right; - } - } - ibbox_t* bbox = 0; - if(xmingetBitmapWidth(); @@ -230,10 +173,10 @@ void BitmapOutputDev::flushBitmap() Guchar*alpha = rgbbitmap->getAlphaPtr(); Guchar*alpha2 = boolpolybitmap->getAlphaPtr(); - ibbox_t* boxes = getBitmapBBoxes(alpha, width, height); + ibbox_t* boxes = get_bitmap_bboxes((unsigned char*)alpha, width, height); ibbox_t*b; - for(b=boxes;boxes;boxes=boxes->next) { + for(b=boxes;b;b=b->next) { int xmin = b->xmin; int ymin = b->ymin; int xmax = b->xmax;