diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-07-21 23:46:12 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-07-21 23:46:12 +0000 |
commit | 5073104a68ca52a8b0e875fc4c5dbacaff98f073 (patch) | |
tree | b02e73c9846760169372b226bf47a1350a899f89 /draw | |
parent | 9baad7f04bd421138461457399fa74e757a44ec3 (diff) | |
download | mupdf-5073104a68ca52a8b0e875fc4c5dbacaff98f073.tar.xz |
Only initialise the 1-bit image unpacking tables when we encounter a monobit image.
Diffstat (limited to 'draw')
-rw-r--r-- | draw/imageunpack.c | 11 |
1 files changed, 4 insertions, 7 deletions
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) |