summaryrefslogtreecommitdiff
path: root/source
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
parentb16108d018f625d19508e757a9a4d213165ad84a (diff)
downloadmupdf-7168509ae3cfa884c12d0ea134bc7d43b11a632d.tar.xz
tiff: Support images with 24/32 bits per component.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/draw-unpack.c4
-rw-r--r--source/fitz/load-tiff.c2
2 files changed, 6 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++;
}
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c
index 76df053a..56140e89 100644
--- a/source/fitz/load-tiff.c
+++ b/source/fitz/load-tiff.c
@@ -430,6 +430,8 @@ tiff_paste_tile(fz_context *ctx, struct tiff *tiff, unsigned char *tile, unsigne
case 4: *dst |= (*src >> (4 - 4 * ((col + x) % 2))) & 0xf; break;
case 8: *dst = *src; break;
case 16: dst[0] = src[0]; dst[1] = src[1]; break;
+ case 24: dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; break;
+ case 32: dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2]; dst[3] = src[3]; break;
}
}
}