2012-10-24 19:00:49 +02:00
|
|
|
#ifndef MPLAYER_SWS_UTILS_H
|
|
|
|
#define MPLAYER_SWS_UTILS_H
|
|
|
|
|
2012-10-19 19:11:58 +02:00
|
|
|
#include <stdbool.h>
|
2012-10-24 19:00:49 +02:00
|
|
|
|
2013-07-18 13:17:56 +02:00
|
|
|
#include "mp_image.h"
|
|
|
|
|
2012-10-24 19:00:49 +02:00
|
|
|
struct mp_image;
|
2014-06-10 22:41:14 +02:00
|
|
|
struct sws_opts;
|
2012-10-24 19:00:49 +02:00
|
|
|
|
|
|
|
// libswscale currently requires 16 bytes alignment for row pointers and
|
|
|
|
// strides. Otherwise, it will print warnings and use slow codepaths.
|
|
|
|
// Guaranteed to be a power of 2 and > 1.
|
|
|
|
#define SWS_MIN_BYTE_ALIGN 16
|
|
|
|
|
2013-07-18 13:48:57 +02:00
|
|
|
extern const int mp_sws_hq_flags;
|
2013-08-10 00:27:41 +02:00
|
|
|
extern const int mp_sws_fast_flags;
|
2013-07-18 13:48:57 +02:00
|
|
|
|
2012-10-19 19:11:58 +02:00
|
|
|
bool mp_sws_supported_format(int imgfmt);
|
|
|
|
|
2015-01-15 20:10:08 +01:00
|
|
|
int mp_image_swscale(struct mp_image *dst, struct mp_image *src,
|
|
|
|
int my_sws_flags);
|
2012-10-24 19:11:42 +02:00
|
|
|
|
2015-01-15 20:10:08 +01:00
|
|
|
int mp_image_sw_blur_scale(struct mp_image *dst, struct mp_image *src,
|
|
|
|
float gblur);
|
2012-11-25 00:06:16 +01:00
|
|
|
|
2013-07-18 13:17:56 +02:00
|
|
|
struct mp_sws_context {
|
2013-12-21 17:57:10 +01:00
|
|
|
// Can be set for verbose error printing.
|
|
|
|
struct mp_log *log;
|
2013-07-18 13:17:56 +02:00
|
|
|
// User configuration. These can be changed freely, at any time.
|
|
|
|
// mp_sws_scale() will handle the changes transparently.
|
|
|
|
int flags;
|
|
|
|
int brightness, contrast, saturation;
|
|
|
|
bool force_reload;
|
|
|
|
// These are also implicitly set by mp_sws_scale(), and thus optional.
|
|
|
|
// Setting them before that call makes sense when using mp_sws_reinit().
|
|
|
|
struct mp_image_params src, dst;
|
|
|
|
|
|
|
|
// Changing these requires setting force_reload=true.
|
|
|
|
// By default, they are NULL.
|
|
|
|
// Freeing the mp_sws_context will deallocate these if set.
|
|
|
|
struct SwsFilter *src_filter, *dst_filter;
|
2013-07-22 14:41:33 +02:00
|
|
|
double params[2];
|
2013-07-18 13:17:56 +02:00
|
|
|
|
|
|
|
// Cached context (if any)
|
|
|
|
struct SwsContext *sws;
|
2015-03-01 22:31:35 +01:00
|
|
|
bool supports_csp;
|
2013-07-18 13:17:56 +02:00
|
|
|
|
|
|
|
// Contains parameters for which sws is valid
|
|
|
|
struct mp_sws_context *cached;
|
|
|
|
};
|
|
|
|
|
2013-11-01 17:33:11 +01:00
|
|
|
struct mp_sws_context *mp_sws_alloc(void *talloc_ctx);
|
2013-07-18 13:17:56 +02:00
|
|
|
int mp_sws_reinit(struct mp_sws_context *ctx);
|
2014-06-10 22:41:14 +02:00
|
|
|
void mp_sws_set_from_cmdline(struct mp_sws_context *ctx, struct sws_opts *opts);
|
2013-07-18 13:17:56 +02:00
|
|
|
int mp_sws_scale(struct mp_sws_context *ctx, struct mp_image *dst,
|
|
|
|
struct mp_image *src);
|
|
|
|
|
2013-09-30 00:31:10 +02:00
|
|
|
struct vf_seteq;
|
|
|
|
int mp_sws_set_vf_equalizer(struct mp_sws_context *sws, struct vf_seteq *eq);
|
|
|
|
int mp_sws_get_vf_equalizer(struct mp_sws_context *sws, struct vf_seteq *eq);
|
|
|
|
|
2015-02-06 23:20:41 +01:00
|
|
|
struct mp_image *mp_img_swap_to_native(struct mp_image *img);
|
|
|
|
|
2012-10-24 19:00:49 +02:00
|
|
|
#endif /* MP_SWS_UTILS_H */
|
|
|
|
|
|
|
|
// vim: ts=4 sw=4 et tw=80
|