1 /*
2  * Copyright (C) 2024 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 package android.media;
18 
19 /**
20  * Ref: frameworks/native/include/media/hardware/VideoAPI.h
21  *
22  * Framework defined color aspects. These are based mainly on ISO 23001-8 spec. As this standard
23  * continues to evolve, new values may be defined in the future. Use OTHER for these future values
24  * as well as for values not listed here, as those are not supported by the framework.
25  */
26 parcelable AidlColorAspects {
27     @Backing(type="int")
28     enum Range {
29         UNSPECIFIED,  // Unspecified
30         FULL,         // Full range
31         LIMITED,      // Limited range (if defined), or not full range
32 
33         OTHER = 0xff, // Not one of the above values
34     }
35 
36     // Color primaries
37     @Backing(type="int")
38     enum Primaries {
39         UNSPECIFIED,  // Unspecified
40         BT709_5,      // Rec.ITU-R BT.709-5 or equivalent
41         BT470_6M,     // Rec.ITU-R BT.470-6 System M or equivalent
42         BT601_6_625,  // Rec.ITU-R BT.601-6 625 or equivalent
43         BT601_6_525,  // Rec.ITU-R BT.601-6 525 or equivalent
44         GENERIC_FILM, // Generic Film
45         BT2020,       // Rec.ITU-R BT.2020 or equivalent
46 
47         OTHER = 0xff, // Not one of the above values
48     }
49 
50     // Transfer characteristics
51     @Backing(type="int")
52     enum Transfer {
53         UNSPECIFIED,  // Unspecified
54         LINEAR,       // Linear transfer characteristics
55         SRGB,         // sRGB or equivalent
56         SMPTE170M,    // SMPTE 170M or equivalent (e.g. BT.601/709/2020)
57         GAMMA22,      // Assumed display gamma 2.2
58         GAMMA28,      // Assumed display gamma 2.8
59         ST2084,       // SMPTE ST 2084 for 10/12/14/16 bit systems
60         HLG,          // ARIB STD-B67 hybrid-log-gamma
61 
62         // values unlikely to be required by Android follow here
63         SMPTE240M = 0x40, // SMPTE 240M
64         XVYCC,        // IEC 61966-2-4
65         BT1361,       // Rec.ITU-R BT.1361 extended gamut
66         ST428,        // SMPTE ST 428-1
67 
68         OTHER = 0xff, // Not one of the above values
69     }
70 
71     // YUV <-> RGB conversion
72     @Backing(type="int")
73     enum MatrixCoeffs {
74         UNSPECIFIED,    // Unspecified
75         BT709_5,        // Rec.ITU-R BT.709-5 or equivalent
76         BT470_6M,       // KR=0.30, KB=0.11 or equivalent
77         BT601_6,        // Rec.ITU-R BT.601-6 625 or equivalent
78         SMPTE240M,      // SMPTE 240M or equivalent
79         BT2020,         // Rec.ITU-R BT.2020 non-constant luminance
80         BT2020CONSTANT, // Rec.ITU-R BT.2020 constant luminance
81 
82         OTHER = 0xff,   // Not one of the above values
83     }
84 
85     Range range;
86     Primaries primaries;
87     Transfer transfer;
88     MatrixCoeffs matrixCoeffs;
89 }
90