diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-01-27 15:49:00 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-01-27 18:03:34 +0000 |
commit | 4623d8d77b3b971208d93b61ebcb6e2de153c110 (patch) | |
tree | 3b03311b6b8a6d4da666f55bb13909a1ec8b77bd /xps/xps_tiff.c | |
parent | 50923a2d9da9023e846bacdf8cc5cc7961c17f7d (diff) | |
download | mupdf-4623d8d77b3b971208d93b61ebcb6e2de153c110.tar.xz |
Remove dependency on fz_obj from the filter creation parameters.
Diffstat (limited to 'xps/xps_tiff.c')
-rw-r--r-- | xps/xps_tiff.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/xps/xps_tiff.c b/xps/xps_tiff.c index 9fae5e2d..934dcc24 100644 --- a/xps/xps_tiff.c +++ b/xps/xps_tiff.c @@ -153,7 +153,7 @@ xps_decode_tiff_packbits(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen static void xps_decode_tiff_lzw(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen) { - fz_stream *stm = fz_open_lzwd(chain, NULL); + fz_stream *stm = fz_open_lzwd(chain, 1); fz_read(stm, wp, wlen); fz_close(stm); } @@ -169,40 +169,21 @@ xps_decode_tiff_flate(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen) static void xps_decode_tiff_fax(struct tiff *tiff, int comp, fz_stream *chain, byte *wp, int wlen) { - fz_context *ctx = tiff->ctx; fz_stream *stm; - fz_obj *params; - fz_obj *columns, *rows, *black_is_1, *k, *encoded_byte_align; - - columns = fz_new_int(ctx, tiff->imagewidth); - rows = fz_new_int(ctx, tiff->imagelength); - black_is_1 = fz_new_bool(ctx, tiff->photometric == 0); - k = fz_new_int(ctx, comp == 4 ? -1 : 0); - encoded_byte_align = fz_new_bool(ctx, comp == 2); - - params = fz_new_dict(ctx, 5); - fz_dict_puts(params, "Columns", columns); - fz_dict_puts(params, "Rows", rows); - fz_dict_puts(params, "BlackIs1", black_is_1); - fz_dict_puts(params, "K", k); - fz_dict_puts(params, "EncodedByteAlign", encoded_byte_align); - - fz_drop_obj(columns); - fz_drop_obj(rows); - fz_drop_obj(black_is_1); - fz_drop_obj(k); - fz_drop_obj(encoded_byte_align); - - stm = fz_open_faxd(chain, params); + int black_is_1 = tiff->photometric == 0; + int k = comp == 4 ? -1 : 0; + int encoded_byte_align = comp == 2; + stm = fz_open_faxd(chain, + k, 0, encoded_byte_align, + tiff->imagewidth, tiff->imagelength, 0, black_is_1); fz_read(stm, wp, wlen); fz_close(stm); - fz_drop_obj(params); } static void xps_decode_tiff_jpeg(struct tiff *tiff, fz_stream *chain, byte *wp, int wlen) { - fz_stream *stm = fz_open_dctd(chain, NULL); + fz_stream *stm = fz_open_dctd(chain, -1); fz_read(stm, wp, wlen); fz_close(stm); } |