summaryrefslogtreecommitdiff
path: root/fitz/filt_predict.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-06-28 12:05:38 +0100
committerRobin Watts <robin.watts@artifex.com>2012-06-28 12:05:38 +0100
commit8c7278a14fb76140ba0a79f00f1f40aea6f2d568 (patch)
tree8509977f0a3683d972e56033e37fa4260ab1c02b /fitz/filt_predict.c
parentbf9d830adbca9978f82439af7f9b742d00d97214 (diff)
downloadmupdf-8c7278a14fb76140ba0a79f00f1f40aea6f2d568.tar.xz
Update tiff iamge predictor to cope with 16 bits.
normal_178.pdf contains a monochrome black and white image, encoded as 16bpc rgb.
Diffstat (limited to 'fitz/filt_predict.c')
-rw-r--r--fitz/filt_predict.c2
1 files changed, 2 insertions, 0 deletions
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;
}
}