From 8c7278a14fb76140ba0a79f00f1f40aea6f2d568 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 28 Jun 2012 12:05:38 +0100 Subject: Update tiff iamge predictor to cope with 16 bits. normal_178.pdf contains a monochrome black and white image, encoded as 16bpc rgb. --- fitz/filt_predict.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fitz/filt_predict.c') diff --git a/fitz/filt_predict.c b/fitz/filt_predict.c index e68743d3..5fbd7d1d 100644 --- a/fitz/filt_predict.c +++ b/fitz/filt_predict.c @@ -31,6 +31,7 @@ static inline int getcomponent(unsigned char *line, int x, int bpc) case 2: return (line[x >> 2] >> ( ( 3 - (x & 3) ) << 1 ) ) & 3; case 4: return (line[x >> 1] >> ( ( 1 - (x & 1) ) << 2 ) ) & 15; case 8: return line[x]; + case 16: return (line[x<<1]<<8)+line[(x<<1)+1]; } return 0; } @@ -43,6 +44,7 @@ static inline void putcomponent(unsigned char *buf, int x, int bpc, int value) case 2: buf[x >> 2] |= value << ((3 - (x & 3)) << 1); break; case 4: buf[x >> 1] |= value << ((1 - (x & 1)) << 2); break; case 8: buf[x] = value; break; + case 16: buf[x<<1] = value>>8; buf[(x<<1)+1] = value; break; } } -- cgit v1.2.3