Sunshine v2025.118.151840
Self-hosted game stream host for Moonlight.
video_colorspace.h
Go to the documentation of this file.
1
5#pragma once
6
7extern "C" {
8#include <libavutil/pixfmt.h>
9}
10
11namespace video {
12
13 enum class colorspace_e {
14 rec601,
15 rec709,
16 bt2020sdr,
17 bt2020,
18 };
19
21 colorspace_e colorspace;
22 bool full_range;
23 unsigned bit_depth;
24 };
25
26 bool
27 colorspace_is_hdr(const sunshine_colorspace_t &colorspace);
28
29 // Declared in video.h
30 struct config_t;
31
33 colorspace_from_client_config(const config_t &config, bool hdr_display);
34
36 AVColorPrimaries primaries;
37 AVColorTransferCharacteristic transfer_function;
38 AVColorSpace matrix;
39 AVColorRange range;
40 int software_format;
41 };
42
44 avcodec_colorspace_from_sunshine_colorspace(const sunshine_colorspace_t &sunshine_colorspace);
45
46 struct alignas(16) color_t {
47 float color_vec_y[4];
48 float color_vec_u[4];
49 float color_vec_v[4];
50 float range_y[2];
51 float range_uv[2];
52 };
53
54 const color_t *
55 color_vectors_from_colorspace(const sunshine_colorspace_t &colorspace);
56
57 const color_t *
58 color_vectors_from_colorspace(colorspace_e colorspace, bool full_range);
59
71 const color_t *
73} // namespace video
Definition video_colorspace.h:35
Definition video_colorspace.h:46
Definition video.h:21
Definition video_colorspace.h:20
const color_t * new_color_vectors_from_colorspace(const sunshine_colorspace_t &colorspace)
New version of color_vectors_from_colorspace() function that better adheres to the standards....
Definition video_colorspace.cpp:186
colorspace_e
Definition video_colorspace.h:13
@ bt2020
Rec. 2020 HDR.
@ bt2020sdr
Rec. 2020 SDR.