Sunshine
v2026.319.132152
Self-hosted game stream host for Moonlight.
video_colorspace.h
Go to the documentation of this file.
1
5
#pragma once
6
7
extern
"C"
{
8
#include <libavutil/pixfmt.h>
9
}
10
11
namespace
video {
12
13
enum class
colorspace_e
{
14
rec601
,
15
rec709
,
16
bt2020sdr
,
17
bt2020
,
18
};
19
20
struct
sunshine_colorspace_t
{
21
colorspace_e
colorspace;
22
bool
full_range;
23
unsigned
bit_depth;
24
};
25
26
bool
colorspace_is_hdr(
const
sunshine_colorspace_t
&colorspace);
27
28
// Declared in video.h
29
struct
config_t
;
30
31
sunshine_colorspace_t
colorspace_from_client_config(
const
config_t
&config,
bool
hdr_display);
32
33
struct
avcodec_colorspace_t
{
34
AVColorPrimaries primaries;
35
AVColorTransferCharacteristic transfer_function;
36
AVColorSpace matrix;
37
AVColorRange range;
38
int
software_format;
39
};
40
41
avcodec_colorspace_t
avcodec_colorspace_from_sunshine_colorspace(
const
sunshine_colorspace_t
&sunshine_colorspace);
42
43
struct
alignas
(16)
color_t
{
44
float
color_vec_y[4];
45
float
color_vec_u[4];
46
float
color_vec_v[4];
47
float
range_y[2];
48
float
range_uv[2];
49
};
50
61
const
color_t
*
color_vectors_from_colorspace
(
const
sunshine_colorspace_t
&colorspace,
bool
unorm_output);
62
}
// namespace video
video::avcodec_colorspace_t
Definition
video_colorspace.h:33
video::color_t
Definition
video_colorspace.h:43
video::config_t
Definition
video.h:23
video::sunshine_colorspace_t
Definition
video_colorspace.h:20
video::color_vectors_from_colorspace
const color_t * color_vectors_from_colorspace(const sunshine_colorspace_t &colorspace, bool unorm_output)
Get static RGB->YUV color conversion matrix. This matrix expects RGB input in UNORM (0....
Definition
video_colorspace.cpp:123
video::colorspace_e
colorspace_e
Definition
video_colorspace.h:13
video::colorspace_e::bt2020
@ bt2020
Rec. 2020 HDR.
video::colorspace_e::rec709
@ rec709
Rec. 709.
video::colorspace_e::bt2020sdr
@ bt2020sdr
Rec. 2020 SDR.
video::colorspace_e::rec601
@ rec601
Rec. 601.
src
video_colorspace.h
Generated by
1.12.0