diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2017-03-22 14:38:35 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2017-03-23 17:09:19 -0400 |
commit | 031c7035652d3c967321c9c308dea7cfb1c0e6fa (patch) | |
tree | 58e1d638c18e935e7c98f0ec13034376582fc721 /include | |
parent | 185d530d3b3a6f8be63dd7cfc3f2b7784066707c (diff) | |
download | mupdf-031c7035652d3c967321c9c308dea7cfb1c0e6fa.tar.xz |
Add generic pixmap document writer.
Allow mutool convert to output all image formats we can write.
Add sanity checks for pbm and pkm writers.
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/output-pnm.h | 12 | ||||
-rw-r--r-- | include/mupdf/fitz/writer.h | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/include/mupdf/fitz/output-pnm.h b/include/mupdf/fitz/output-pnm.h index b5fa2a31..1301154d 100644 --- a/include/mupdf/fitz/output-pnm.h +++ b/include/mupdf/fitz/output-pnm.h @@ -11,7 +11,7 @@ /* fz_save_pixmap_as_pnm: Save a pixmap as a PNM image file. */ -void fz_save_pixmap_as_pnm(fz_context *ctx, fz_pixmap *pixmap, char *filename); +void fz_save_pixmap_as_pnm(fz_context *ctx, fz_pixmap *pixmap, const char *filename); void fz_write_pixmap_as_pnm(fz_context *ctx, fz_output *out, fz_pixmap *pixmap); @@ -20,7 +20,7 @@ fz_band_writer *fz_new_pnm_band_writer(fz_context *ctx, fz_output *out); /* fz_save_pixmap_as_pam: Save a pixmap as a PAM image file. */ -void fz_save_pixmap_as_pam(fz_context *ctx, fz_pixmap *pixmap, char *filename); +void fz_save_pixmap_as_pam(fz_context *ctx, fz_pixmap *pixmap, const char *filename); void fz_write_pixmap_as_pam(fz_context *ctx, fz_output *out, fz_pixmap *pixmap); @@ -29,19 +29,23 @@ fz_band_writer *fz_new_pam_band_writer(fz_context *ctx, fz_output *out); /* fz_save_bitmap_as_pbm: Save a bitmap as a PBM image file. */ -void fz_save_bitmap_as_pbm(fz_context *ctx, fz_bitmap *bitmap, char *filename); +void fz_save_bitmap_as_pbm(fz_context *ctx, fz_bitmap *bitmap, const char *filename); void fz_write_bitmap_as_pbm(fz_context *ctx, fz_output *out, fz_bitmap *bitmap); fz_band_writer *fz_new_pbm_band_writer(fz_context *ctx, fz_output *out); +void fz_save_pixmap_as_pbm(fz_context *ctx, fz_pixmap *pixmap, const char *filename); + /* fz_save_bitmap_as_pkm: Save a 4bpp cmyk bitmap as a PAM image file. */ -void fz_save_bitmap_as_pkm(fz_context *ctx, fz_bitmap *bitmap, char *filename); +void fz_save_bitmap_as_pkm(fz_context *ctx, fz_bitmap *bitmap, const char *filename); void fz_write_bitmap_as_pkm(fz_context *ctx, fz_output *out, fz_bitmap *bitmap); fz_band_writer *fz_new_pkm_band_writer(fz_context *ctx, fz_output *out); +void fz_save_pixmap_as_pkm(fz_context *ctx, fz_pixmap *pixmap, const char *filename); + #endif diff --git a/include/mupdf/fitz/writer.h b/include/mupdf/fitz/writer.h index bf6a9175..fc005f76 100644 --- a/include/mupdf/fitz/writer.h +++ b/include/mupdf/fitz/writer.h @@ -29,12 +29,12 @@ void fz_drop_document_writer(fz_context *ctx, fz_document_writer *wri); fz_document_writer *fz_new_cbz_writer(fz_context *ctx, const char *path, const char *options); fz_document_writer *fz_new_pdf_writer(fz_context *ctx, const char *path, const char *options); -fz_document_writer *fz_new_png_writer(fz_context *ctx, const char *path, const char *options); fz_document_writer *fz_new_svg_writer(fz_context *ctx, const char *path, const char *options); +fz_document_writer *fz_new_pixmap_writer(fz_context *ctx, const char *path, const char *options, const char *default_path, int n, + void (*save)(fz_context *ctx, fz_pixmap *pix, const char *filename)); extern const char *fz_cbz_write_options_usage; extern const char *fz_pdf_write_options_usage; -extern const char *fz_png_write_options_usage; extern const char *fz_svg_write_options_usage; #endif |