From ce77200a441ffa9ba65aee4308ba32daf014f74d Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 8 Dec 2002 16:53:13 +0000 Subject: [PATCH] added support for mode 6 images. --- src/png2swf.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 95 insertions(+), 7 deletions(-) diff --git a/src/png2swf.c b/src/png2swf.c index 4736939..927504e 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -149,11 +149,11 @@ int png_read_header(FILE*fi, struct png_header*header) f = data[11]; // filter mode (0) i = data[12]; // interlace mode (0) - if(b!=2 && b!=3) { + if(b!=2 && b!=3 && b!=6) { fprintf(stderr, "Image mode %d not supported!\n", b); exit(1); } - if(a!=8 && b==2) { + if(a!=8 && (b==2 || b==6)) { fprintf(stderr, "Bpp %d in mode %d not supported!\n", a); exit(1); } @@ -199,7 +199,7 @@ byte inline PaethPredictor (byte a,byte b,byte c) else return c; } -void applyfilter(int mode, U8*src, U8*old, U8*dest, int width) +void applyfilter3(int mode, U8*src, U8*old, U8*dest, int width) { int x; unsigned char lastr=0; @@ -277,6 +277,89 @@ void applyfilter(int mode, U8*src, U8*old, U8*dest, int width) } +void applyfilter4(int mode, U8*src, U8*old, U8*dest, int width) +{ + int x; + unsigned char lastr=0; + unsigned char lastg=0; + unsigned char lastb=0; + unsigned char lasta=0; + unsigned char upperlastr=0; + unsigned char upperlastg=0; + unsigned char upperlastb=0; + unsigned char upperlasta=0; + + if(mode==0) { + for(x=0;x32 bit conversion */ + /* in case for mode 2, the following also performs 24->32 bit conversion */ for(y=0;y