From 5f57d276562c18ce65c47fa60f442ea427d7033e Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 6 Aug 2012 17:48:30 +0200 Subject: image_writer: add option parsing image_writer now provides its own option parsing, and screenshot.c and the mplayer frontend use it. --- image_writer.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'image_writer.c') diff --git a/image_writer.c b/image_writer.c index 3aca95d963..750dd15426 100644 --- a/image_writer.c +++ b/image_writer.c @@ -51,6 +51,20 @@ const struct image_writer_opts image_writer_opts_defaults = { .jpeg_quality = 85, }; +#undef OPT_BASE_STRUCT +#define OPT_BASE_STRUCT struct image_writer_opts + +const struct m_sub_options image_writer_conf = { + .opts = (m_option_t[]) { + OPT_INTRANGE("jpeg-quality", jpeg_quality, 0, 0, 100), + OPT_INTRANGE("png-compression", png_compression, 0, 0, 9), + OPT_STRING("filetype", filetype, 0), + {0}, + }, + .size = sizeof(struct image_writer_opts), + .defaults = &image_writer_opts_defaults, +}; + struct image_writer_ctx { const struct image_writer_opts *opts; const struct img_writer *writer; -- cgit v1.2.3