Sunshine latest
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 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
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
51 const color_t *color_vectors_from_colorspace(const sunshine_colorspace_t &colorspace);
52
53 const color_t *color_vectors_from_colorspace(colorspace_e colorspace, bool full_range);
54
67} // namespace video
Definition video_colorspace.h:33
Definition video_colorspace.h:43
Definition video.h:23
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:181
colorspace_e
Definition video_colorspace.h:13
@ bt2020
Rec. 2020 HDR.
@ bt2020sdr
Rec. 2020 SDR.