From 5073104a68ca52a8b0e875fc4c5dbacaff98f073 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 21 Jul 2010 23:46:12 +0000 Subject: Only initialise the 1-bit image unpacking tables when we encounter a monobit image. --- draw/imageunpack.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'draw') diff --git a/draw/imageunpack.c b/draw/imageunpack.c index 5b39283c..6d09253b 100644 --- a/draw/imageunpack.c +++ b/draw/imageunpack.c @@ -1,8 +1,6 @@ #include "fitz.h" -/* - * Unpack image samples and optionally pad pixels with opaque alpha - */ +/* Unpack image samples and optionally pad pixels with opaque alpha */ #define get1(buf,x) ((buf[x >> 3] >> ( 7 - (x & 7) ) ) & 1 ) #define get2(buf,x) ((buf[x >> 2] >> ( ( 3 - (x & 3) ) << 1 ) ) & 3 ) @@ -57,7 +55,8 @@ fz_unpacktile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, in if (dst->n > n) pad = 255; - initget1tables(); + if (depth == 1) + initget1tables(); for (y = 0; y < dst->h; y++) { @@ -159,9 +158,7 @@ fz_unpacktile(fz_pixmap *dst, unsigned char * restrict src, int n, int depth, in } } -/* - * Apply decode parameters and scale integers - */ +/* Apply decode array */ void fz_decodetile(fz_pixmap *pix, float *decode) -- cgit v1.2.3