summaryrefslogtreecommitdiff
path: root/fitz/filt_faxd.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2012-01-27 15:49:00 +0100
committerRobin Watts <robin.watts@artifex.com>2012-01-27 18:03:34 +0000
commit4623d8d77b3b971208d93b61ebcb6e2de153c110 (patch)
tree3b03311b6b8a6d4da666f55bb13909a1ec8b77bd /fitz/filt_faxd.c
parent50923a2d9da9023e846bacdf8cc5cc7961c17f7d (diff)
downloadmupdf-4623d8d77b3b971208d93b61ebcb6e2de153c110.tar.xz
Remove dependency on fz_obj from the filter creation parameters.
Diffstat (limited to 'fitz/filt_faxd.c')
-rw-r--r--fitz/filt_faxd.c43
1 files changed, 12 insertions, 31 deletions
diff --git a/fitz/filt_faxd.c b/fitz/filt_faxd.c
index 7ccebddb..4e522eb5 100644
--- a/fitz/filt_faxd.c
+++ b/fitz/filt_faxd.c
@@ -659,12 +659,14 @@ close_faxd(fz_context *ctx, void *state_)
fz_free(ctx, fax);
}
+/* Default: columns = 1728, end_of_block = 1, the rest = 0 */
fz_stream *
-fz_open_faxd(fz_stream *chain, fz_obj *params)
+fz_open_faxd(fz_stream *chain,
+ int k, int end_of_line, int encoded_byte_align,
+ int columns, int rows, int end_of_block, int black_is_1)
{
- fz_faxd *fax = NULL;
- fz_obj *obj;
fz_context *ctx = chain->ctx;
+ fz_faxd *fax = NULL;
fz_var(fax);
@@ -676,34 +678,13 @@ fz_open_faxd(fz_stream *chain, fz_obj *params)
fax->ref = NULL;
fax->dst = NULL;
- fax->k = 0;
- fax->end_of_line = 0;
- fax->encoded_byte_align = 0;
- fax->columns = 1728;
- fax->rows = 0;
- fax->end_of_block = 1;
- fax->black_is_1 = 0;
-
- obj = fz_dict_gets(params, "K");
- if (obj) fax->k = fz_to_int(obj);
-
- obj = fz_dict_gets(params, "EndOfLine");
- if (obj) fax->end_of_line = fz_to_bool(obj);
-
- obj = fz_dict_gets(params, "EncodedByteAlign");
- if (obj) fax->encoded_byte_align = fz_to_bool(obj);
-
- obj = fz_dict_gets(params, "Columns");
- if (obj) fax->columns = fz_to_int(obj);
-
- obj = fz_dict_gets(params, "Rows");
- if (obj) fax->rows = fz_to_int(obj);
-
- obj = fz_dict_gets(params, "EndOfBlock");
- if (obj) fax->end_of_block = fz_to_bool(obj);
-
- obj = fz_dict_gets(params, "BlackIs1");
- if (obj) fax->black_is_1 = fz_to_bool(obj);
+ fax->k = k;
+ fax->end_of_line = end_of_line;
+ fax->encoded_byte_align = encoded_byte_align;
+ fax->columns = columns;
+ fax->rows = rows;
+ fax->end_of_block = end_of_block;
+ fax->black_is_1 = black_is_1;
fax->stride = ((fax->columns - 1) >> 3) + 1;
fax->ridx = 0;