Path: blob/21.2-virgl/include/android_stub/android/data_space.h
4547 views
/*1* Copyright 2018 The Android Open Source Project2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*/1516/**17* @file data_space.h18*/1920#ifndef ANDROID_DATA_SPACE_H21#define ANDROID_DATA_SPACE_H2223#include <inttypes.h>2425#include <sys/cdefs.h>2627__BEGIN_DECLS2829/**30* ADataSpace.31*/32enum ADataSpace {33/**34* Default-assumption data space, when not explicitly specified.35*36* It is safest to assume the buffer is an image with sRGB primaries and37* encoding ranges, but the consumer and/or the producer of the data may38* simply be using defaults. No automatic gamma transform should be39* expected, except for a possible display gamma transform when drawn to a40* screen.41*/42ADATASPACE_UNKNOWN = 0,4344/**45* scRGB linear encoding:46*47* The red, green, and blue components are stored in extended sRGB space,48* but are linear, not gamma-encoded.49* The RGB primaries and the white point are the same as BT.709.50*51* The values are floating point.52* A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.53* Values beyond the range [0.0 - 1.0] would correspond to other colors54* spaces and/or HDR content.55*/56ADATASPACE_SCRGB_LINEAR = 406913024, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_EXTENDED5758/**59* sRGB gamma encoding:60*61* The red, green and blue components are stored in sRGB space, and62* converted to linear space when read, using the SRGB transfer function63* for each of the R, G and B components. When written, the inverse64* transformation is performed.65*66* The alpha component, if present, is always stored in linear space and67* is left unmodified when read or written.68*69* Use full range and BT.709 standard.70*/71ADATASPACE_SRGB = 142671872, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_FULL7273/**74* scRGB:75*76* The red, green, and blue components are stored in extended sRGB space,77* and gamma-encoded using the SRGB transfer function.78* The RGB primaries and the white point are the same as BT.709.79*80* The values are floating point.81* A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.82* Values beyond the range [0.0 - 1.0] would correspond to other colors83* spaces and/or HDR content.84*/85ADATASPACE_SCRGB = 411107328, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED8687/**88* Display P389*90* Use same primaries and white-point as DCI-P391* but sRGB transfer function.92*/93ADATASPACE_DISPLAY_P3 = 143261696, // STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_FULL9495/**96* ITU-R Recommendation 2020 (BT.2020)97*98* Ultra High-definition television99*100* Use full range, SMPTE 2084 (PQ) transfer and BT2020 standard101*/102ADATASPACE_BT2020_PQ = 163971072, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_FULL103104/**105* Adobe RGB106*107* Use full range, gamma 2.2 transfer and Adobe RGB primaries108* Note: Application is responsible for gamma encoding the data as109* a 2.2 gamma encoding is not supported in HW.110*/111ADATASPACE_ADOBE_RGB = 151715840, // STANDARD_ADOBE_RGB | TRANSFER_GAMMA2_2 | RANGE_FULL112113/**114* ITU-R Recommendation 2020 (BT.2020)115*116* Ultra High-definition television117*118* Use full range, BT.709 transfer and BT2020 standard119*/120ADATASPACE_BT2020 = 147193856, // STANDARD_BT2020 | TRANSFER_SMPTE_170M | RANGE_FULL121122/**123* ITU-R Recommendation 709 (BT.709)124*125* High-definition television126*127* Use limited range, BT.709 transfer and BT.709 standard.128*/129ADATASPACE_BT709 = 281083904, // STANDARD_BT709 | TRANSFER_SMPTE_170M | RANGE_LIMITED130131/**132* SMPTE EG 432-1 and SMPTE RP 431-2.133*134* Digital Cinema DCI-P3135*136* Use full range, gamma 2.6 transfer and D65 DCI-P3 standard137* Note: Application is responsible for gamma encoding the data as138* a 2.6 gamma encoding is not supported in HW.139*/140ADATASPACE_DCI_P3 = 155844608, // STANDARD_DCI_P3 | TRANSFER_GAMMA2_6 | RANGE_FULL141142/**143* sRGB linear encoding:144*145* The red, green, and blue components are stored in sRGB space, but146* are linear, not gamma-encoded.147* The RGB primaries and the white point are the same as BT.709.148*149* The values are encoded using the full range ([0,255] for 8-bit) for all150* components.151*/152ADATASPACE_SRGB_LINEAR = 138477568, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_FULL153};154155__END_DECLS156157#endif // ANDROID_DATA_SPACE_H158159160