/src/mpv/video/out/gpu/lcms.h
Line | Count | Source |
1 | | #ifndef MP_GL_LCMS_H |
2 | | #define MP_GL_LCMS_H |
3 | | |
4 | | #include <stddef.h> |
5 | | #include <stdbool.h> |
6 | | #include "misc/bstr.h" |
7 | | #include "video/csputils.h" |
8 | | #include <libavutil/buffer.h> |
9 | | |
10 | | extern const struct m_sub_options mp_icc_conf; |
11 | | |
12 | | struct mp_icc_opts { |
13 | | bool use_embedded; |
14 | | char *profile; |
15 | | bool profile_auto; |
16 | | bool cache; |
17 | | char *cache_dir; |
18 | | char *size_str; |
19 | | int intent; |
20 | | int contrast; |
21 | | bool icc_use_luma; |
22 | | }; |
23 | | |
24 | | struct lut3d { |
25 | | uint16_t *data; |
26 | | int size[3]; |
27 | | }; |
28 | | |
29 | | struct mp_log; |
30 | | struct mpv_global; |
31 | | struct gl_lcms; |
32 | | |
33 | | struct gl_lcms *gl_lcms_init(void *talloc_ctx, struct mp_log *log, |
34 | | struct mpv_global *global, |
35 | | struct mp_icc_opts *opts); |
36 | | void gl_lcms_update_options(struct gl_lcms *p); |
37 | | bool gl_lcms_set_memory_profile(struct gl_lcms *p, bstr profile); |
38 | | bool gl_lcms_has_profile(struct gl_lcms *p); |
39 | | bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **, |
40 | | enum pl_color_primaries prim, enum pl_color_transfer trc, |
41 | | struct AVBufferRef *vid_profile); |
42 | | bool gl_lcms_has_changed(struct gl_lcms *p, enum pl_color_primaries prim, |
43 | | enum pl_color_transfer trc, struct AVBufferRef *vid_profile); |
44 | | |
45 | | static inline bool gl_parse_3dlut_size(const char *arg, int *p1, int *p2, int *p3) |
46 | 531 | { |
47 | 531 | if (!arg) |
48 | 36 | return false; |
49 | 495 | if (!strcmp(arg, "auto")) { |
50 | 361 | *p1 = *p2 = *p3 = 0; |
51 | 361 | return true; |
52 | 361 | } |
53 | 134 | if (sscanf(arg, "%dx%dx%d", p1, p2, p3) != 3) |
54 | 134 | return false; |
55 | 0 | for (int n = 0; n < 3; n++) { |
56 | 0 | int s = ((int[]) { *p1, *p2, *p3 })[n]; |
57 | 0 | if (s < 2 || s > 512) |
58 | 0 | return false; |
59 | 0 | } |
60 | 0 | return true; |
61 | 0 | } Unexecuted instantiation: vo_gpu.c:gl_parse_3dlut_size Unexecuted instantiation: vo_gpu_next.c:gl_parse_3dlut_size Unexecuted instantiation: context.c:gl_parse_3dlut_size Unexecuted instantiation: libmpv_gpu.c:gl_parse_3dlut_size Unexecuted instantiation: video.c:gl_parse_3dlut_size Unexecuted instantiation: video_shaders.c:gl_parse_3dlut_size lcms.c:gl_parse_3dlut_size Line | Count | Source | 46 | 531 | { | 47 | 531 | if (!arg) | 48 | 36 | return false; | 49 | 495 | if (!strcmp(arg, "auto")) { | 50 | 361 | *p1 = *p2 = *p3 = 0; | 51 | 361 | return true; | 52 | 361 | } | 53 | 134 | if (sscanf(arg, "%dx%dx%d", p1, p2, p3) != 3) | 54 | 134 | return false; | 55 | 0 | for (int n = 0; n < 3; n++) { | 56 | 0 | int s = ((int[]) { *p1, *p2, *p3 })[n]; | 57 | 0 | if (s < 2 || s > 512) | 58 | 0 | return false; | 59 | 0 | } | 60 | 0 | return true; | 61 | 0 | } |
|
62 | | |
63 | | #endif |