summaryrefslogtreecommitdiff
path: root/source/fitz/writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/fitz/writer.c')
-rw-r--r--source/fitz/writer.c56
1 files changed, 48 insertions, 8 deletions
diff --git a/source/fitz/writer.c b/source/fitz/writer.c
index f9d5b8c1..67a1d5ef 100644
--- a/source/fitz/writer.c
+++ b/source/fitz/writer.c
@@ -61,6 +61,46 @@ fz_document_writer *fz_new_document_writer_of_size(fz_context *ctx, size_t size,
return wri;
}
+fz_document_writer *fz_new_png_pixmap_writer(fz_context *ctx, const char *path, const char *options)
+{
+ return fz_new_pixmap_writer(ctx, path, options, "out-%04.png", 0, fz_save_pixmap_as_png);
+}
+
+fz_document_writer *fz_new_tga_pixmap_writer(fz_context *ctx, const char *path, const char *options)
+{
+ return fz_new_pixmap_writer(ctx, path, options, "out-%04.tga", 0, fz_save_pixmap_as_tga);
+}
+
+fz_document_writer *fz_new_pam_pixmap_writer(fz_context *ctx, const char *path, const char *options)
+{
+ return fz_new_pixmap_writer(ctx, path, options, "out-%04.pam", 0, fz_save_pixmap_as_pam);
+}
+
+fz_document_writer *fz_new_pnm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
+{
+ return fz_new_pixmap_writer(ctx, path, options, "out-%04.pnm", 0, fz_save_pixmap_as_pnm);
+}
+
+fz_document_writer *fz_new_pgm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
+{
+ return fz_new_pixmap_writer(ctx, path, options, "out-%04.pgm", 1, fz_save_pixmap_as_pnm);
+}
+
+fz_document_writer *fz_new_ppm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
+{
+ return fz_new_pixmap_writer(ctx, path, options, "out-%04.ppm", 3, fz_save_pixmap_as_pnm);
+}
+
+fz_document_writer *fz_new_pbm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
+{
+ return fz_new_pixmap_writer(ctx, path, options, "out-%04.pbm", 1, fz_save_pixmap_as_pbm);
+}
+
+fz_document_writer *fz_new_pkm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
+{
+ return fz_new_pixmap_writer(ctx, path, options, "out-%04.pkm", 4, fz_save_pixmap_as_pkm);
+}
+
fz_document_writer *
fz_new_document_writer(fz_context *ctx, const char *path, const char *format, const char *options)
{
@@ -82,21 +122,21 @@ fz_new_document_writer(fz_context *ctx, const char *path, const char *format, co
return fz_new_svg_writer(ctx, path, options);
if (!fz_strcasecmp(format, "png"))
- return fz_new_pixmap_writer(ctx, path, options, "out-%04.png", 0, fz_save_pixmap_as_png);
+ return fz_new_png_pixmap_writer(ctx, path, options);
if (!fz_strcasecmp(format, "tga"))
- return fz_new_pixmap_writer(ctx, path, options, "out-%04.tga", 0, fz_save_pixmap_as_tga);
+ return fz_new_tga_pixmap_writer(ctx, path, options);
if (!fz_strcasecmp(format, "pam"))
- return fz_new_pixmap_writer(ctx, path, options, "out-%04.pam", 0, fz_save_pixmap_as_pam);
+ return fz_new_pam_pixmap_writer(ctx, path, options);
if (!fz_strcasecmp(format, "pnm"))
- return fz_new_pixmap_writer(ctx, path, options, "out-%04.pnm", 0, fz_save_pixmap_as_pnm);
+ return fz_new_pnm_pixmap_writer(ctx, path, options);
if (!fz_strcasecmp(format, "pgm"))
- return fz_new_pixmap_writer(ctx, path, options, "out-%04.pgm", 1, fz_save_pixmap_as_pnm);
+ return fz_new_pgm_pixmap_writer(ctx, path, options);
if (!fz_strcasecmp(format, "ppm"))
- return fz_new_pixmap_writer(ctx, path, options, "out-%04.ppm", 3, fz_save_pixmap_as_pnm);
+ return fz_new_ppm_pixmap_writer(ctx, path, options);
if (!fz_strcasecmp(format, "pbm"))
- return fz_new_pixmap_writer(ctx, path, options, "out-%04.pbm", 1, fz_save_pixmap_as_pbm);
+ return fz_new_pbm_pixmap_writer(ctx, path, options);
if (!fz_strcasecmp(format, "pkm"))
- return fz_new_pixmap_writer(ctx, path, options, "out-%04.pkm", 4, fz_save_pixmap_as_pkm);
+ return fz_new_pkm_pixmap_writer(ctx, path, options);
fz_throw(ctx, FZ_ERROR_GENERIC, "unknown output document format: %s", format);
}