PipeWire: spa/param/video/color.h Source File

PipeWire 0.3.51

color.h
Go to the documentation of this file.
1/* Simple Plugin API
2 *
3 * Copyright © 2018 Wim Taymans
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef SPA_VIDEO_COLOR_H
26#define SPA_VIDEO_COLOR_H
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
41enum spa_video_color_range {
42 SPA_VIDEO_COLOR_RANGE_UNKNOWN = 0,
43 SPA_VIDEO_COLOR_RANGE_0_255,
44 SPA_VIDEO_COLOR_RANGE_16_235
46};
47
52enum spa_video_color_matrix {
53 SPA_VIDEO_COLOR_MATRIX_UNKNOWN = 0,
54 SPA_VIDEO_COLOR_MATRIX_RGB,
55 SPA_VIDEO_COLOR_MATRIX_FCC,
56 SPA_VIDEO_COLOR_MATRIX_BT709,
57 SPA_VIDEO_COLOR_MATRIX_BT601,
58 SPA_VIDEO_COLOR_MATRIX_SMPTE240M,
59 SPA_VIDEO_COLOR_MATRIX_BT2020,
60};
61
66enum spa_video_transfer_function {
67 SPA_VIDEO_TRANSFER_UNKNOWN = 0,
68 SPA_VIDEO_TRANSFER_GAMMA10,
69 SPA_VIDEO_TRANSFER_GAMMA18,
70 SPA_VIDEO_TRANSFER_GAMMA20,
71 SPA_VIDEO_TRANSFER_GAMMA22,
72 SPA_VIDEO_TRANSFER_BT709,
73 SPA_VIDEO_TRANSFER_SMPTE240M,
74 SPA_VIDEO_TRANSFER_SRGB,
75 SPA_VIDEO_TRANSFER_GAMMA28,
76 SPA_VIDEO_TRANSFER_LOG100,
77 SPA_VIDEO_TRANSFER_LOG316,
78 SPA_VIDEO_TRANSFER_BT2020_12,
81 SPA_VIDEO_TRANSFER_ADOBERGB,
82};
83
88enum spa_video_color_primaries {
89 SPA_VIDEO_COLOR_PRIMARIES_UNKNOWN = 0,
90 SPA_VIDEO_COLOR_PRIMARIES_BT709,
91 SPA_VIDEO_COLOR_PRIMARIES_BT470M,
92 SPA_VIDEO_COLOR_PRIMARIES_BT470BG,
93 SPA_VIDEO_COLOR_PRIMARIES_SMPTE170M,
94 SPA_VIDEO_COLOR_PRIMARIES_SMPTE240M,
95 SPA_VIDEO_COLOR_PRIMARIES_FILM,
96 SPA_VIDEO_COLOR_PRIMARIES_BT2020,
97 SPA_VIDEO_COLOR_PRIMARIES_ADOBERGB,
98};
99
105struct spa_video_colorimetry {
106 enum spa_video_color_range range;
109 enum spa_video_color_matrix matrix;
111 enum spa_video_transfer_function transfer;
113 enum spa_video_color_primaries primaries;
115};
116
121#ifdef __cplusplus
122} /* extern "C" */
123#endif
124
125#endif /* SPA_VIDEO_COLOR_H */
spa_video_color_matrix
spa_video_color_matrix
The color matrix is used to convert between Y'PbPr and non-linear RGB (R'G'B')
Definition: color.h:57
spa_video_color_range
spa_video_color_range
Possible color range values.
Definition: color.h:46
spa_video_color_primaries
spa_video_color_primaries
The color primaries define the how to transform linear RGB values to and from the CIE XYZ colorspace.
Definition: color.h:93
spa_video_transfer_function
spa_video_transfer_function
The video transfer function defines the formula for converting between non-linear RGB (R'G'B') and li...
Definition: color.h:71
SPA_VIDEO_COLOR_MATRIX_FCC
@ SPA_VIDEO_COLOR_MATRIX_FCC
FCC color matrix.
Definition: color.h:60
SPA_VIDEO_COLOR_MATRIX_BT709
@ SPA_VIDEO_COLOR_MATRIX_BT709
ITU BT.709 color matrix.
Definition: color.h:61
SPA_VIDEO_COLOR_MATRIX_UNKNOWN
@ SPA_VIDEO_COLOR_MATRIX_UNKNOWN
unknown matrix
Definition: color.h:58
SPA_VIDEO_COLOR_MATRIX_SMPTE240M
@ SPA_VIDEO_COLOR_MATRIX_SMPTE240M
SMTPE 240M color matrix.
Definition: color.h:63
SPA_VIDEO_COLOR_MATRIX_BT601
@ SPA_VIDEO_COLOR_MATRIX_BT601
ITU BT.601 color matrix.
Definition: color.h:62
SPA_VIDEO_COLOR_MATRIX_RGB
@ SPA_VIDEO_COLOR_MATRIX_RGB
identity matrix
Definition: color.h:59
SPA_VIDEO_COLOR_MATRIX_BT2020
@ SPA_VIDEO_COLOR_MATRIX_BT2020
ITU-R BT.2020 color matrix.
Definition: color.h:64
SPA_VIDEO_COLOR_RANGE_16_235
@ SPA_VIDEO_COLOR_RANGE_16_235
[16..235] for 8 bit components.
Definition: color.h:49
SPA_VIDEO_COLOR_RANGE_UNKNOWN
@ SPA_VIDEO_COLOR_RANGE_UNKNOWN
unknown range
Definition: color.h:47
SPA_VIDEO_COLOR_RANGE_0_255
@ SPA_VIDEO_COLOR_RANGE_0_255
[0..255] for 8 bit components
Definition: color.h:48
SPA_VIDEO_COLOR_PRIMARIES_BT709
@ SPA_VIDEO_COLOR_PRIMARIES_BT709
BT709 primaries.
Definition: color.h:95
SPA_VIDEO_COLOR_PRIMARIES_UNKNOWN
@ SPA_VIDEO_COLOR_PRIMARIES_UNKNOWN
unknown color primaries
Definition: color.h:94
SPA_VIDEO_COLOR_PRIMARIES_SMPTE240M
@ SPA_VIDEO_COLOR_PRIMARIES_SMPTE240M
SMPTE240M primaries.
Definition: color.h:99
SPA_VIDEO_COLOR_PRIMARIES_BT470M
@ SPA_VIDEO_COLOR_PRIMARIES_BT470M
BT470M primaries.
Definition: color.h:96
SPA_VIDEO_COLOR_PRIMARIES_ADOBERGB
@ SPA_VIDEO_COLOR_PRIMARIES_ADOBERGB
Adobe RGB primaries.
Definition: color.h:102
SPA_VIDEO_COLOR_PRIMARIES_SMPTE170M
@ SPA_VIDEO_COLOR_PRIMARIES_SMPTE170M
SMPTE170M primaries.
Definition: color.h:98
SPA_VIDEO_COLOR_PRIMARIES_FILM
@ SPA_VIDEO_COLOR_PRIMARIES_FILM
Generic film.
Definition: color.h:100
SPA_VIDEO_COLOR_PRIMARIES_BT2020
@ SPA_VIDEO_COLOR_PRIMARIES_BT2020
BT2020 primaries.
Definition: color.h:101
SPA_VIDEO_COLOR_PRIMARIES_BT470BG
@ SPA_VIDEO_COLOR_PRIMARIES_BT470BG
BT470BG primaries.
Definition: color.h:97
SPA_VIDEO_TRANSFER_ADOBERGB
@ SPA_VIDEO_TRANSFER_ADOBERGB
Gamma 2.19921875.
Definition: color.h:86
SPA_VIDEO_TRANSFER_LOG316
@ SPA_VIDEO_TRANSFER_LOG316
Logarithmic transfer characteristic 316.22777:1 range.
Definition: color.h:82
SPA_VIDEO_TRANSFER_SRGB
@ SPA_VIDEO_TRANSFER_SRGB
Gamma 2.4 curve with a linear segment in the lower range.
Definition: color.h:79
SPA_VIDEO_TRANSFER_SMPTE240M
@ SPA_VIDEO_TRANSFER_SMPTE240M
Gamma 2.2 curve with a linear segment in the lower range.
Definition: color.h:78
SPA_VIDEO_TRANSFER_GAMMA28
@ SPA_VIDEO_TRANSFER_GAMMA28
Gamma 2.8 curve.
Definition: color.h:80
SPA_VIDEO_TRANSFER_GAMMA10
@ SPA_VIDEO_TRANSFER_GAMMA10
linear RGB, gamma 1.0 curve
Definition: color.h:73
SPA_VIDEO_TRANSFER_BT2020_12
@ SPA_VIDEO_TRANSFER_BT2020_12
Gamma 2.2 curve with a linear segment in the lower range.
Definition: color.h:83
SPA_VIDEO_TRANSFER_GAMMA22
@ SPA_VIDEO_TRANSFER_GAMMA22
Gamma 2.2 curve.
Definition: color.h:76
SPA_VIDEO_TRANSFER_BT709
@ SPA_VIDEO_TRANSFER_BT709
Gamma 2.2 curve with a linear segment in the lower range.
Definition: color.h:77
SPA_VIDEO_TRANSFER_UNKNOWN
@ SPA_VIDEO_TRANSFER_UNKNOWN
unknown transfer function
Definition: color.h:72
SPA_VIDEO_TRANSFER_LOG100
@ SPA_VIDEO_TRANSFER_LOG100
Logarithmic transfer characteristic 100:1 range.
Definition: color.h:81
SPA_VIDEO_TRANSFER_GAMMA20
@ SPA_VIDEO_TRANSFER_GAMMA20
Gamma 2.0 curve.
Definition: color.h:75
SPA_VIDEO_TRANSFER_GAMMA18
@ SPA_VIDEO_TRANSFER_GAMMA18
Gamma 1.8 curve.
Definition: color.h:74
spa_video_colorimetry
spa_video_colorimetry:
Definition: color.h:110
spa_video_colorimetry::range
enum spa_video_color_range range
The color range.
Definition: color.h:111
spa_video_colorimetry::matrix
enum spa_video_color_matrix matrix
the color matrix.
Definition: color.h:114
spa_video_colorimetry::transfer
enum spa_video_transfer_function transfer
The transfer function.
Definition: color.h:116
spa_video_colorimetry::primaries
enum spa_video_color_primaries primaries
Color primaries.
Definition: color.h:118