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 #endif // ANDROID_DATA_SPACE_H