diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-05-21 14:13:59 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-05-21 14:20:50 +0100 |
commit | 23dea6df2cb85a136ba6d8d8e34eebe4e105db24 (patch) | |
tree | 24f17851de0fadc51ac9691361b1cca97a48c332 /apps/mudraw.c | |
parent | e317abb479109200f2ec489b2868e671a060a585 (diff) | |
download | mupdf-23dea6df2cb85a136ba6d8d8e34eebe4e105db24.tar.xz |
Add monochrome PWG output routines.
Diffstat (limited to 'apps/mudraw.c')
-rw-r--r-- | apps/mudraw.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/mudraw.c b/apps/mudraw.c index c12b3964..0b5df0a8 100644 --- a/apps/mudraw.c +++ b/apps/mudraw.c @@ -71,7 +71,7 @@ static const format_cs_table_t format_cs_table[] = { OUT_PGM, CS_GRAY, { CS_GRAY, CS_RGB } }, { OUT_PBM, CS_MONO, { CS_MONO } }, { OUT_SVG, CS_UNSET, { CS_UNSET } }, - { OUT_PWG, CS_RGB, { CS_GRAY, CS_RGB } } + { OUT_PWG, CS_RGB, { CS_MONO, CS_GRAY, CS_RGB } } }; /* @@ -627,7 +627,14 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum) { if (strstr(output, "%d") != NULL) append = 0; - fz_write_pwg(ctx, pix, buf, append, NULL); + if (out_cs == CS_MONO) + { + fz_bitmap *bit = fz_halftone_pixmap(ctx, pix, NULL); + fz_write_pwg_bitmap(ctx, bit, buf, append, NULL); + fz_drop_bitmap(ctx, bit); + } + else + fz_write_pwg(ctx, pix, buf, append, NULL); append = 1; } else if (output_format == OUT_PBM) { |