summaryrefslogtreecommitdiff
path: root/source/fitz/draw-unpack.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-05-03 02:27:11 +0800
committerSebastian Rasmussen <sebras@gmail.com>2017-09-20 15:56:02 +0200
commit7168509ae3cfa884c12d0ea134bc7d43b11a632d (patch)
treec582d7893e1ab288b1022f16e1045b66eb0dc6c8 /source/fitz/draw-unpack.c
parentb16108d018f625d19508e757a9a4d213165ad84a (diff)
downloadmupdf-7168509ae3cfa884c12d0ea134bc7d43b11a632d.tar.xz
tiff: Support images with 24/32 bits per component.
Diffstat (limited to 'source/fitz/draw-unpack.c')
-rw-r--r--source/fitz/draw-unpack.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/fitz/draw-unpack.c b/source/fitz/draw-unpack.c
index e3c4c5b2..2b6a241e 100644
--- a/source/fitz/draw-unpack.c
+++ b/source/fitz/draw-unpack.c
@@ -10,6 +10,8 @@
#define get4(buf,x) ((buf[x >> 1] >> ( ( 1 - (x & 1) ) << 2 ) ) & 15 )
#define get8(buf,x) (buf[x])
#define get16(buf,x) (buf[x << 1])
+#define get24(buf,x) (buf[(x << 1) + x])
+#define get32(buf,x) (buf[x << 2])
static unsigned char get1_tab_1[256][8];
static unsigned char get1_tab_1p[256][16];
@@ -186,6 +188,8 @@ fz_unpack_tile(fz_context *ctx, fz_pixmap *dst, unsigned char * restrict src, in
case 4: *dp++ = get4(sp, b) * scale; break;
case 8: *dp++ = get8(sp, b); break;
case 16: *dp++ = get16(sp, b); break;
+ case 24: *dp++ = get24(sp, b); break;
+ case 32: *dp++ = get32(sp, b); break;
}
b++;
}