X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfbits.c;h=88ba8b97dee46cfac6bd382ff3125e78b7735bf5;hb=9e546e0ca2d4472b77020cfc745f281b7864e6f9;hp=90c85491e214049232a1bd6775850d01abf25871;hpb=4826a0831b4d019e3ccb1fa1aea0f6138f80e49c;p=swftools.git diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index 90c8549..88ba8b9 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -1382,6 +1382,97 @@ static void decodeMonochromeImage(RGBA*data, int width, int height, RGBA*colors) } } +static void blurImage(RGBA*src, int width, int height, int r) +{ + int e = 2; // r times e is the sampling interval + double*gauss = (double*)malloc(r*e*sizeof(double)); + double sum=0; + int x; + for(x=0;x> 16; + d[x].g = g >> 16; + d[x].b = b >> 16; + d[x].a = a >> 16; + } + for(x=width-range;x> 16; + d[yy].g = g >> 16; + d[yy].b = b >> 16; + d[yy].a = a >> 16; + yy += width; + } + for(y=0;y4) { + /* high-resolution monochrome images are usually dithered, so + low-pass filter them first to get rid of any moire patterns */ + blurImage(data, width, height, r+1); + } } tmpline = (rgba_int_t*)malloc(width*sizeof(rgba_int_t));