From 07678423fb737e7c12f1b513d68ab1c99b44d853 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Apr 2015 23:02:20 +0200 Subject: image_writer: minor cleanup Instead of using int like bool, use bool directly. --- video/image_writer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video/image_writer.h') diff --git a/video/image_writer.h b/video/image_writer.h index 7db4293712..d7cdd99125 100644 --- a/video/image_writer.h +++ b/video/image_writer.h @@ -48,8 +48,8 @@ const char *image_writer_file_ext(const struct image_writer_opts *opts); * accordingly. Setting w and width or h and height to different values * can be used to store snapshots of anamorphic video. */ -int write_image(struct mp_image *image, const struct image_writer_opts *opts, - const char *filename, struct mp_log *log); +bool write_image(struct mp_image *image, const struct image_writer_opts *opts, + const char *filename, struct mp_log *log); // Debugging helper. void dump_png(struct mp_image *image, const char *filename, struct mp_log *log); -- cgit v1.2.3 From 2469cb5d1f6056f770ef3e454773595b9f720faa Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 20 Apr 2015 23:04:34 +0200 Subject: image_writer: factor image conversion into a separate function Needed for a later commit. --- video/image_writer.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'video/image_writer.h') diff --git a/video/image_writer.h b/video/image_writer.h index d7cdd99125..b27db3981a 100644 --- a/video/image_writer.h +++ b/video/image_writer.h @@ -51,5 +51,11 @@ const char *image_writer_file_ext(const struct image_writer_opts *opts); bool write_image(struct mp_image *image, const struct image_writer_opts *opts, const char *filename, struct mp_log *log); +/* Return the image converted to the given format. If the pixel aspect ratio is + * not 1:1, the image is scaled as well. Returns NULL on failure. + */ +struct mp_image *convert_image(struct mp_image *image, int destfmt, + struct mp_log *log); + // Debugging helper. void dump_png(struct mp_image *image, const char *filename, struct mp_log *log); -- cgit v1.2.3