summaryrefslogtreecommitdiff
path: root/draw
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-07-21 23:46:12 +0000
committerTor Andersson <tor@ghostscript.com>2010-07-21 23:46:12 +0000
commit5073104a68ca52a8b0e875fc4c5dbacaff98f073 (patch)
treeb02e73c9846760169372b226bf47a1350a899f89 /draw
parent9baad7f04bd421138461457399fa74e757a44ec3 (diff)
downloadmupdf-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.c11
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)