summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-27 17:30:26 +0200
committerwm4 <wm4@nowhere>2012-11-01 02:07:45 +0100
commitcaa64363c5bdcd6de43b5d594ae44db9e50a9ff4 (patch)
tree3d960f0f02230e30a0a24898c3f3e3cc83b5d49d
parentc62efc52c6c5f9dc9cf8e335f6e934e69a721331 (diff)
downloadmpv-caa64363c5bdcd6de43b5d594ae44db9e50a9ff4.tar.bz2
mpv-caa64363c5bdcd6de43b5d594ae44db9e50a9ff4.tar.xz
image_writer: add dump_png() function as debugging helper
-rw-r--r--image_writer.c7
-rw-r--r--image_writer.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/image_writer.c b/image_writer.c
index 2ac2c223a1..dc7ff96199 100644
--- a/image_writer.c
+++ b/image_writer.c
@@ -318,3 +318,10 @@ int write_image(struct mp_image *image, const struct image_writer_opts *opts,
return success;
}
+
+void dump_png(struct mp_image *image, const char *filename)
+{
+ struct image_writer_opts opts = image_writer_opts_defaults;
+ opts.format = "png";
+ write_image(image, &opts, filename);
+}
diff --git a/image_writer.h b/image_writer.h
index f92c2f800d..e73b526c7e 100644
--- a/image_writer.h
+++ b/image_writer.h
@@ -48,3 +48,6 @@ const char *image_writer_file_ext(const struct image_writer_opts *opts);
*/
int write_image(struct mp_image *image, const struct image_writer_opts *opts,
const char *filename);
+
+// Debugging helper.
+void dump_png(struct mp_image *image, const char *filename);