diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2017-03-14 15:04:09 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2017-03-14 16:49:43 +0000 |
commit | b2af1e57857a309302c151f4c8f560f5dde3da2f (patch) | |
tree | 823b7273e3fcb5d43a96b359090743b1b3dda3e3 /source/tools/mudraw.c | |
parent | 4c8f6f696882cb4a924c483dfe5a734c7b41de0f (diff) | |
download | mupdf-b2af1e57857a309302c151f4c8f560f5dde3da2f.tar.xz |
Update PWG writer to be a band_writer.
Update mutool to call it.
Diffstat (limited to 'source/tools/mudraw.c')
-rw-r--r-- | source/tools/mudraw.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c index 46609542..f8b8f467 100644 --- a/source/tools/mudraw.c +++ b/source/tools/mudraw.c @@ -376,6 +376,9 @@ file_level_headers(fz_context *ctx) if (output_format == OUT_PS) fz_write_ps_file_header(ctx, out); + + if (output_format == OUT_PWG) + fz_write_pwg_file_header(ctx, out); } static void @@ -432,7 +435,7 @@ static void drawband(fz_context *ctx, fz_page *page, fz_display_list *list, cons if (pix->alpha) fz_unmultiply_pixmap(ctx, pix); - if ((output_format == OUT_PCL && out_cs == CS_MONO) || (output_format == OUT_PBM) || (output_format == OUT_PKM)) + if (((output_format == OUT_PCL || output_format == OUT_PWG) && out_cs == CS_MONO) || (output_format == OUT_PBM) || (output_format == OUT_PKM)) *bit = fz_new_bitmap_from_pixmap_band(ctx, pix, NULL, band_start); } fz_catch(ctx) @@ -757,6 +760,13 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in bander = fz_new_ps_band_writer(ctx, out); else if (output_format == OUT_TGA) bander = fz_new_tga_band_writer(ctx, out, colorspace == fz_device_bgr(ctx)); + else if (output_format == OUT_PWG) + { + if (out_cs == CS_MONO) + bander = fz_new_mono_pwg_band_writer(ctx, out, NULL); + else + bander = fz_new_pwg_band_writer(ctx, out, NULL); + } else if (output_format == OUT_PCL) { if (out_cs == CS_MONO) @@ -787,8 +797,6 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in { if (bander) fz_write_band(ctx, bander, bit ? bit->stride : pix->stride, drawheight, bit ? bit->samples : pix->samples); - else if (output_format == OUT_PWG) - fz_write_pixmap_as_pwg(ctx, out, pix, NULL); fz_drop_bitmap(ctx, bit); bit = NULL; } |