X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fmodules%2Fswfbits.c;h=4f6b3101c799133fd90d58e2c44490f212100213;hb=c53aa61d2d061e0fa15f6c8a4fe945766a2733d1;hp=90c85491e214049232a1bd6775850d01abf25871;hpb=56d7005a7ccc3d41c333a0c508a9aef43bc02522;p=swftools.git diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index 90c8549..4f6b310 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -1382,6 +1382,100 @@ 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));