mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 21:12:23 +00:00
fee6b287a5
This currently only works when using lcms-based color management (--icc-profile-*). In principle, we could also support using lcms even when the user has not specified an ICC profile, by generating the profile against a fixed reference (--target-prim/--target-trc) instead. I still might do that some day, simply because 3dlut provides a higher quality conversion than our simple gamut mapping does for stuff like BT.2020, and also because it's now needed to enable embedded ICC profiles. But that would be a separate change, so preserve the status quo for now. (Besides, my opinion is still that you should be using an ICC profile if you care about colors being accurate _at all_)
43 lines
1.1 KiB
C
43 lines
1.1 KiB
C
#ifndef MP_GL_LCMS_H
|
|
#define MP_GL_LCMS_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
#include "misc/bstr.h"
|
|
#include <libavutil/buffer.h>
|
|
|
|
extern const struct m_sub_options mp_icc_conf;
|
|
|
|
struct mp_icc_opts {
|
|
int use_embedded;
|
|
char *profile;
|
|
int profile_auto;
|
|
char *cache_dir;
|
|
char *size_str;
|
|
int intent;
|
|
int contrast;
|
|
};
|
|
|
|
struct lut3d {
|
|
uint16_t *data;
|
|
int size[3];
|
|
};
|
|
|
|
struct mp_log;
|
|
struct mpv_global;
|
|
struct gl_lcms;
|
|
|
|
struct gl_lcms *gl_lcms_init(void *talloc_ctx, struct mp_log *log,
|
|
struct mpv_global *global,
|
|
struct mp_icc_opts *opts);
|
|
void gl_lcms_update_options(struct gl_lcms *p);
|
|
bool gl_lcms_set_memory_profile(struct gl_lcms *p, bstr profile);
|
|
bool gl_lcms_has_profile(struct gl_lcms *p);
|
|
bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **,
|
|
enum mp_csp_prim prim, enum mp_csp_trc trc,
|
|
struct AVBufferRef *vid_profile);
|
|
bool gl_lcms_has_changed(struct gl_lcms *p, enum mp_csp_prim prim,
|
|
enum mp_csp_trc trc, struct AVBufferRef *vid_profile);
|
|
|
|
#endif
|