2012-08-06 15:46:42 +00:00
|
|
|
/*
|
2015-04-13 07:36:54 +00:00
|
|
|
* This file is part of mpv.
|
2012-08-06 15:46:42 +00:00
|
|
|
*
|
2017-06-18 13:45:24 +00:00
|
|
|
* mpv is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2012-08-06 15:46:42 +00:00
|
|
|
*
|
2015-04-13 07:36:54 +00:00
|
|
|
* mpv is distributed in the hope that it will be useful,
|
2012-08-06 15:46:42 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2017-06-18 13:45:24 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2012-08-06 15:46:42 +00:00
|
|
|
*
|
2017-06-18 13:45:24 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
|
2012-08-06 15:46:42 +00:00
|
|
|
*/
|
|
|
|
|
2016-09-05 19:04:55 +00:00
|
|
|
#include "options/m_option.h"
|
|
|
|
|
2012-08-06 15:46:42 +00:00
|
|
|
struct mp_image;
|
2013-12-21 16:59:38 +00:00
|
|
|
struct mp_log;
|
2012-08-06 15:46:42 +00:00
|
|
|
|
|
|
|
struct image_writer_opts {
|
2017-03-18 14:03:05 +00:00
|
|
|
int format;
|
2015-04-29 19:05:04 +00:00
|
|
|
int high_bit_depth;
|
2012-08-06 15:46:42 +00:00
|
|
|
int png_compression;
|
2013-06-15 13:14:06 +00:00
|
|
|
int png_filter;
|
2012-08-06 15:46:42 +00:00
|
|
|
int jpeg_quality;
|
2012-08-06 15:51:04 +00:00
|
|
|
int jpeg_optimize;
|
|
|
|
int jpeg_smooth;
|
|
|
|
int jpeg_dpi;
|
|
|
|
int jpeg_progressive;
|
|
|
|
int jpeg_baseline;
|
2015-04-29 19:01:08 +00:00
|
|
|
int jpeg_source_chroma;
|
2019-09-14 20:18:02 +00:00
|
|
|
int webp_lossless;
|
|
|
|
int webp_quality;
|
2019-08-02 14:04:54 +00:00
|
|
|
int webp_compression;
|
Revert "Revert recent vo_opengl related commits"
Omitted a simple, but devastasting check. Fixed the relevant commits
now.
This reverts commit 8d24e9d9b8ad1b5d82139980eca148dc0f4a1eab.
diff --git a/video/out/gl_video.c b/video/out/gl_video.c
index 9c8a643..f1ea03e 100644
--- a/video/out/gl_video.c
+++ b/video/out/gl_video.c
@@ -1034,9 +1034,9 @@ static void compile_shaders(struct gl_video *p)
shader_def_opt(&header_conv, "USE_CONV_GAMMA", use_conv_gamma);
shader_def_opt(&header_conv, "USE_CONST_LUMA", use_const_luma);
shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_BT1886",
- gamma_fun == MP_CSP_TRC_BT_1886);
+ use_linear_light && gamma_fun == MP_CSP_TRC_BT_1886);
shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_SRGB",
- gamma_fun == MP_CSP_TRC_SRGB);
+ use_linear_light && gamma_fun == MP_CSP_TRC_SRGB);
shader_def_opt(&header_conv, "USE_SIGMOID", use_sigmoid);
if (p->opts.alpha_mode > 0 && p->has_alpha && p->plane_count > 3)
shader_def(&header_conv, "USE_ALPHA_PLANE", "3");
2015-02-28 19:15:12 +00:00
|
|
|
int tag_csp;
|
2012-08-06 15:46:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct image_writer_opts image_writer_opts_defaults;
|
|
|
|
|
2016-09-05 19:04:55 +00:00
|
|
|
extern const struct m_option image_writer_opts[];
|
2012-08-06 15:46:42 +00:00
|
|
|
|
|
|
|
// Return the file extension that will be used, e.g. "png".
|
|
|
|
const char *image_writer_file_ext(const struct image_writer_opts *opts);
|
|
|
|
|
2018-02-07 19:18:36 +00:00
|
|
|
// Return whether the selected format likely supports >8 bit per component.
|
|
|
|
bool image_writer_high_depth(const struct image_writer_opts *opts);
|
|
|
|
|
2017-03-18 14:03:05 +00:00
|
|
|
// Map file extension to format ID - return 0 (which is invalid) if unknown.
|
|
|
|
int image_writer_format_from_ext(const char *ext);
|
|
|
|
|
2012-08-06 15:46:42 +00:00
|
|
|
/*
|
|
|
|
* Save the given image under the given filename. The parameters csp and opts
|
|
|
|
* are optional. All pixel formats supported by swscale are supported.
|
|
|
|
*
|
|
|
|
* File format and compression settings are controlled via the opts parameter.
|
|
|
|
*
|
2019-10-31 14:44:09 +00:00
|
|
|
* If global!=NULL, use command line scaler options etc.
|
|
|
|
*
|
2012-08-06 15:46:42 +00:00
|
|
|
* NOTE: The fields w/h/width/height of the passed mp_image must be all set
|
|
|
|
* accordingly. Setting w and width or h and height to different values
|
|
|
|
* can be used to store snapshots of anamorphic video.
|
|
|
|
*/
|
2015-04-20 21:02:20 +00:00
|
|
|
bool write_image(struct mp_image *image, const struct image_writer_opts *opts,
|
2019-10-31 14:44:09 +00:00
|
|
|
const char *filename, struct mpv_global *global,
|
|
|
|
struct mp_log *log);
|
2012-10-27 15:30:26 +00:00
|
|
|
|
|
|
|
// Debugging helper.
|
2013-12-21 16:59:38 +00:00
|
|
|
void dump_png(struct mp_image *image, const char *filename, struct mp_log *log);
|