• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2018 The Android Open Source Project
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /**
17  * @file data_space.h
18  */
19 #ifndef ANDROID_DATA_SPACE_H
20 #define ANDROID_DATA_SPACE_H
21 #include <inttypes.h>
22 #include <sys/cdefs.h>
23 __BEGIN_DECLS
24 /**
25  * ADataSpace.
26  */
27 enum ADataSpace {
28     /**
29      * Default-assumption data space, when not explicitly specified.
30      *
31      * It is safest to assume the buffer is an image with sRGB primaries and
32      * encoding ranges, but the consumer and/or the producer of the data may
33      * simply be using defaults. No automatic gamma transform should be
34      * expected, except for a possible display gamma transform when drawn to a
35      * screen.
36      */
37     ADATASPACE_UNKNOWN = 0,
38     /**
39      * scRGB linear encoding:
40      *
41      * The red, green, and blue components are stored in extended sRGB space,
42      * but are linear, not gamma-encoded.
43      * The RGB primaries and the white point are the same as BT.709.
44      *
45      * The values are floating point.
46      * A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
47      * Values beyond the range [0.0 - 1.0] would correspond to other colors
48      * spaces and/or HDR content.
49      */
50     ADATASPACE_SCRGB_LINEAR = 406913024, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_EXTENDED
51     /**
52      * sRGB gamma encoding:
53      *
54      * The red, green and blue components are stored in sRGB space, and
55      * converted to linear space when read, using the SRGB transfer function
56      * for each of the R, G and B components. When written, the inverse
57      * transformation is performed.
58      *
59      * The alpha component, if present, is always stored in linear space and
60      * is left unmodified when read or written.
61      *
62      * Use full range and BT.709 standard.
63      */
64     ADATASPACE_SRGB = 142671872, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_FULL
65     /**
66      * scRGB:
67      *
68      * The red, green, and blue components are stored in extended sRGB space,
69      * but are linear, not gamma-encoded.
70      * The RGB primaries and the white point are the same as BT.709.
71      *
72      * The values are floating point.
73      * A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
74      * Values beyond the range [0.0 - 1.0] would correspond to other colors
75      * spaces and/or HDR content.
76      */
77     ADATASPACE_SCRGB = 411107328, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED
78     /**
79      * Display P3
80      *
81      * Use same primaries and white-point as DCI-P3
82      * but sRGB transfer function.
83      */
84     ADATASPACE_DISPLAY_P3 = 143261696, // STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_FULL
85     /**
86      * ITU-R Recommendation 2020 (BT.2020)
87      *
88      * Ultra High-definition television
89      *
90      * Use full range, SMPTE 2084 (PQ) transfer and BT2020 standard
91      */
92     ADATASPACE_BT2020_PQ = 163971072, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_FULL
93 };
94 __END_DECLS
95 #endif // ANDROID_DATA_SPACE_H