mirror of
https://github.com/mpv-player/mpv
synced 2025-01-12 01:49:33 +00:00
vo_gpu_next: use inverse mapping functions to tag screenshots
Screenshots using the hardware renderer should now include color tags that map directly from the libplacebo tags, so the if/else logic only needs to be included once.
This commit is contained in:
parent
8217b186f6
commit
4defd8bb27
@ -1247,21 +1247,12 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
|
||||
if (!args->res)
|
||||
goto done;
|
||||
|
||||
if (args->scaled) {
|
||||
// Provide tagging for target CSP info (if known)
|
||||
const struct gl_video_opts *opts = p->opts_cache->opts;
|
||||
args->res->params.color.primaries = opts->target_prim;
|
||||
args->res->params.color.gamma = opts->target_trc;
|
||||
args->res->params.color.levels = p->output_levels;
|
||||
args->res->params.color.sig_peak = opts->target_peak;
|
||||
args->res->params.color.primaries = mp_prim_from_pl(target.color.primaries);
|
||||
args->res->params.color.gamma = mp_trc_from_pl(target.color.transfer);
|
||||
args->res->params.color.levels = mp_levels_from_pl(target.repr.levels);
|
||||
args->res->params.color.sig_peak = target.color.hdr.max_luma / MP_REF_WHITE;
|
||||
if (args->scaled)
|
||||
args->res->params.p_w = args->res->params.p_h = 1;
|
||||
} else if (args->native_csp) {
|
||||
args->res->params.color = mpi->params.color;
|
||||
args->res->params.color.space = MP_CSP_RGB;
|
||||
} else {
|
||||
args->res->params.color.primaries = MP_CSP_PRIM_BT_709;
|
||||
args->res->params.color.gamma = MP_CSP_TRC_SRGB;
|
||||
}
|
||||
|
||||
bool ok = pl_tex_download(gpu, pl_tex_transfer_params(
|
||||
.tex = fbo,
|
||||
|
Loading…
Reference in New Issue
Block a user