From 48a0d4e20356793d3e244ec1865f01030409e939 Mon Sep 17 00:00:00 2001 From: kramm Date: Fri, 29 Apr 2005 08:48:25 +0000 Subject: [PATCH] added stub for image cache --- pdf2swf/swfoutput.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index febad86..0488bf3 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -2097,12 +2097,20 @@ gfxline_t* SVPtogfxline(ArtSVP*svp) } } +/* TODO */ +static int imageInCache(swfoutput*obj, void*data, int width, int height) +{ + return -1; +} +static void addImageToCache(swfoutput*obj, void*data, int width, int height) +{ +} + static int add_image(swfoutput_internal*i, gfximage_t*img, int targetwidth, int targetheight, int* newwidth, int* newheight) { swfoutput*obj = i->obj; RGBA*newpic = 0; RGBA*mem = (RGBA*)img->data; - int bitid = getNewID(obj); int sizex = img->width; int sizey = img->height; @@ -2160,11 +2168,19 @@ static int add_image(swfoutput_internal*i, gfximage_t*img, int targetwidth, int } printf("\n");*/ - i->tag = swf_AddImage(i->tag, bitid, mem, sizex, sizey, config_jpegquality); + int bitid = -1; + int cacheid = imageInCache(obj, mem, sizex, sizey); + + if(cacheid<=0) { + bitid = getNewID(obj); + i->tag = swf_AddImage(i->tag, bitid, mem, sizex, sizey, config_jpegquality); + addImageToCache(obj, mem, sizex, sizey); + } else { + bitid = cacheid; + } if(newpic) free(newpic); - return bitid; } -- 1.7.10.4