mirror of
https://github.com/mpv-player/mpv
synced 2025-01-14 02:51:26 +00:00
mp_image: one utility function to set image parameters
This commit is contained in:
parent
b81f5e2757
commit
dc73b200db
@ -430,6 +430,17 @@ void mp_image_params_from_image(struct mp_image_params *params,
|
||||
};
|
||||
}
|
||||
|
||||
void mp_image_set_params(struct mp_image *image,
|
||||
const struct mp_image_params *params)
|
||||
{
|
||||
mp_image_setfmt(image, params->imgfmt);
|
||||
mp_image_set_size(image, params->w, params->h);
|
||||
mp_image_set_display_size(image, params->d_w, params->d_h);
|
||||
image->colorspace = params->colorspace;
|
||||
image->levels = params->colorlevels;
|
||||
image->chroma_location = params->chroma_location;
|
||||
}
|
||||
|
||||
void mp_image_set_colorspace_details(struct mp_image *image,
|
||||
struct mp_csp_details *csp)
|
||||
{
|
||||
|
@ -143,6 +143,9 @@ bool mp_image_params_equals(const struct mp_image_params *p1,
|
||||
void mp_image_params_from_image(struct mp_image_params *params,
|
||||
const struct mp_image *image);
|
||||
|
||||
void mp_image_set_params(struct mp_image *image,
|
||||
const struct mp_image_params *params);
|
||||
|
||||
struct AVFrame;
|
||||
void mp_image_copy_fields_from_av_frame(struct mp_image *dst,
|
||||
struct AVFrame *src);
|
||||
|
Loading…
Reference in New Issue
Block a user