diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2009-10-09 14:51:29 +0000 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2009-10-09 14:51:29 +0000 |
commit | 7bd23c802f694445e7808356dc3d2ae82c222255 (patch) | |
tree | 2209d17835c04c4e7abaa8cc8202c4f880af21a2 /xps/xpstiff.c | |
parent | c1d47455ec16645304a26c01f8ee805f765c04ad (diff) | |
download | ghostpdl-7bd23c802f694445e7808356dc3d2ae82c222255.tar.gz |
Handle 16-bit samples in getcomp and putcomp used in TIFF BlackIs1 handling.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10158 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'xps/xpstiff.c')
-rw-r--r-- | xps/xpstiff.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xps/xpstiff.c b/xps/xpstiff.c index de9926d2c..7aa088136 100644 --- a/xps/xpstiff.c +++ b/xps/xpstiff.c @@ -451,6 +451,7 @@ getcomp(byte *line, int x, int bpc) case 2: return line[x / 4] >> ((3 - (x % 4)) * 2) & 0x03; case 4: return line[x / 2] >> ((1 - (x % 2)) * 4) & 0x0f; case 8: return line[x]; + case 16: return ((line[x * 2 + 0]) << 8) | (line[x * 2 + 1]); } return 0; } @@ -474,6 +475,7 @@ putcomp(byte *line, int x, int bpc, int value) case 2: line[x / 4] |= value << ((3 - (x % 4)) * 2); break; case 4: line[x / 2] |= value << ((1 - (x % 2)) * 4); break; case 8: line[x] = value; break; + case 16: line[x * 2 + 0] = value >> 8; line[x * 2 + 1] = value & 0xFF; break; } } |