2
* Copyright 2018 The Android Open Source Project
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
21
#ifndef ANDROID_DATA_SPACE_H
22
#define ANDROID_DATA_SPACE_H
26
#include <sys/cdefs.h>
35
* Default-assumption data space, when not explicitly specified.
37
* It is safest to assume the buffer is an image with sRGB primaries and
38
* encoding ranges, but the consumer and/or the producer of the data may
39
* simply be using defaults. No automatic gamma transform should be
40
* expected, except for a possible display gamma transform when drawn to a
43
ADATASPACE_UNKNOWN = 0,
46
* scRGB linear encoding:
48
* The red, green, and blue components are stored in extended sRGB space,
49
* but are linear, not gamma-encoded.
50
* The RGB primaries and the white point are the same as BT.709.
52
* The values are floating point.
53
* A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
54
* Values beyond the range [0.0 - 1.0] would correspond to other colors
55
* spaces and/or HDR content.
57
ADATASPACE_SCRGB_LINEAR = 406913024, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_EXTENDED
60
* sRGB gamma encoding:
62
* The red, green and blue components are stored in sRGB space, and
63
* converted to linear space when read, using the SRGB transfer function
64
* for each of the R, G and B components. When written, the inverse
65
* transformation is performed.
67
* The alpha component, if present, is always stored in linear space and
68
* is left unmodified when read or written.
70
* Use full range and BT.709 standard.
72
ADATASPACE_SRGB = 142671872, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_FULL
77
* The red, green, and blue components are stored in extended sRGB space,
78
* and gamma-encoded using the SRGB transfer function.
79
* The RGB primaries and the white point are the same as BT.709.
81
* The values are floating point.
82
* A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
83
* Values beyond the range [0.0 - 1.0] would correspond to other colors
84
* spaces and/or HDR content.
86
ADATASPACE_SCRGB = 411107328, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED
91
* Use same primaries and white-point as DCI-P3
92
* but sRGB transfer function.
94
ADATASPACE_DISPLAY_P3 = 143261696, // STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_FULL
97
* ITU-R Recommendation 2020 (BT.2020)
99
* Ultra High-definition television
101
* Use full range, SMPTE 2084 (PQ) transfer and BT2020 standard
103
ADATASPACE_BT2020_PQ = 163971072, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_FULL
108
* Use full range, gamma 2.2 transfer and Adobe RGB primaries
109
* Note: Application is responsible for gamma encoding the data as
110
* a 2.2 gamma encoding is not supported in HW.
112
ADATASPACE_ADOBE_RGB = 151715840, // STANDARD_ADOBE_RGB | TRANSFER_GAMMA2_2 | RANGE_FULL
115
* ITU-R Recommendation 2020 (BT.2020)
117
* Ultra High-definition television
119
* Use full range, BT.709 transfer and BT2020 standard
121
ADATASPACE_BT2020 = 147193856, // STANDARD_BT2020 | TRANSFER_SMPTE_170M | RANGE_FULL
124
* ITU-R Recommendation 709 (BT.709)
126
* High-definition television
128
* Use limited range, BT.709 transfer and BT.709 standard.
130
ADATASPACE_BT709 = 281083904, // STANDARD_BT709 | TRANSFER_SMPTE_170M | RANGE_LIMITED
133
* SMPTE EG 432-1 and SMPTE RP 431-2.
135
* Digital Cinema DCI-P3
137
* Use full range, gamma 2.6 transfer and D65 DCI-P3 standard
138
* Note: Application is responsible for gamma encoding the data as
139
* a 2.6 gamma encoding is not supported in HW.
141
ADATASPACE_DCI_P3 = 155844608, // STANDARD_DCI_P3 | TRANSFER_GAMMA2_6 | RANGE_FULL
144
* sRGB linear encoding:
146
* The red, green, and blue components are stored in sRGB space, but
147
* are linear, not gamma-encoded.
148
* The RGB primaries and the white point are the same as BT.709.
150
* The values are encoded using the full range ([0,255] for 8-bit) for all
153
ADATASPACE_SRGB_LINEAR = 138477568, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_FULL
158
#endif // ANDROID_DATA_SPACE_H