diff options
author | Courtney Goeltzenleuchter | 2016-06-20 15:49:39 -0500 |
---|---|---|
committer | Courtney Goeltzenleuchter | 2016-06-21 15:47:23 -0500 |
commit | bf8132a7c188754a5fe40e08f5becb5909e096d5 (patch) | |
tree | 2a64bae330912b7360dd795329a1cb26b80b88b3 /include/system | |
parent | 9150b1288e13518caae223e8c8570b7a2d0b3a15 (diff) | |
download | platform-system-core-bf8132a7c188754a5fe40e08f5becb5909e096d5.tar.gz platform-system-core-bf8132a7c188754a5fe40e08f5becb5909e096d5.tar.xz platform-system-core-bf8132a7c188754a5fe40e08f5becb5909e096d5.zip |
Add color mode enums
The android_color_mode_t defines the color modes supported
by a display. A display can support multiple different
color modes.
sRGB mode and AdobeRGB are deliberately placed at 7 and 8
so that they match mode ID's used on prior devices.
bug: http://b/27926012
Change-Id: I9ab41b56ec0b495c02539665da5be158ffddf843
Diffstat (limited to 'include/system')
-rw-r--r-- | include/system/graphics.h | 230 |
1 files changed, 230 insertions, 0 deletions
diff --git a/include/system/graphics.h b/include/system/graphics.h index 1ac1a0070..529a562f3 100644 --- a/include/system/graphics.h +++ b/include/system/graphics.h | |||
@@ -1135,6 +1135,236 @@ typedef enum android_dataspace { | |||
1135 | } android_dataspace_t; | 1135 | } android_dataspace_t; |
1136 | 1136 | ||
1137 | /* | 1137 | /* |
1138 | * Color modes that may be supported by a display. | ||
1139 | * | ||
1140 | * Definitions: | ||
1141 | * Rendering intent generally defines the goal in mapping a source (input) | ||
1142 | * color to a destination device color for a given color mode. | ||
1143 | * | ||
1144 | * It is important to keep in mind three cases where mapping may be applied: | ||
1145 | * 1. The source gamut is much smaller than the destination (display) gamut | ||
1146 | * 2. The source gamut is much larger than the destination gamut (this will | ||
1147 | * ordinarily be handled using colorimetric rendering, below) | ||
1148 | * 3. The source and destination gamuts are roughly equal, although not | ||
1149 | * completely overlapping | ||
1150 | * Also, a common requirement for mappings is that skin tones should be | ||
1151 | * preserved, or at least remain natural in appearance. | ||
1152 | * | ||
1153 | * Colorimetric Rendering Intent (All cases): | ||
1154 | * Colorimetric indicates that colors should be preserved. In the case | ||
1155 | * that the source gamut lies wholly within the destination gamut or is | ||
1156 | * about the same (#1, #3), this will simply mean that no manipulations | ||
1157 | * (no saturation boost, for example) are applied. In the case where some | ||
1158 | * source colors lie outside the destination gamut (#2, #3), those will | ||
1159 | * need to be mapped to colors that are within the destination gamut, | ||
1160 | * while the already in-gamut colors remain unchanged. | ||
1161 | * | ||
1162 | * Non-colorimetric transforms can take many forms. There are no hard | ||
1163 | * rules and it's left to the implementation to define. | ||
1164 | * Two common intents are described below. | ||
1165 | * | ||
1166 | * Stretched-Gamut Enhancement Intent (Source < Destination): | ||
1167 | * When the destination gamut is much larger than the source gamut (#1), the | ||
1168 | * source primaries may be redefined to reflect the full extent of the | ||
1169 | * destination space, or to reflect an intermediate gamut. | ||
1170 | * Skin-tone preservation would likely be applied. An example might be sRGB | ||
1171 | * input displayed on a DCI-P3 capable device, with skin-tone preservation. | ||
1172 | * | ||
1173 | * Within-Gamut Enhancement Intent (Source >= Destination): | ||
1174 | * When the device (destination) gamut is not larger than the source gamut | ||
1175 | * (#2 or #3), but the appearance of a larger gamut is desired, techniques | ||
1176 | * such as saturation boost may be applied to the source colors. Skin-tone | ||
1177 | * preservation may be applied. There is no unique method for within-gamut | ||
1178 | * enhancement; it would be defined within a flexible color mode. | ||
1179 | * | ||
1180 | */ | ||
1181 | typedef enum android_color_mode { | ||
1182 | |||
1183 | /* | ||
1184 | * HAL_COLOR_MODE_DEFAULT is the "native" gamut of the display. | ||
1185 | * White Point: Vendor/OEM defined | ||
1186 | * Panel Gamma: Vendor/OEM defined (typically 2.2) | ||
1187 | * Rendering Intent: Vendor/OEM defined (typically 'enhanced') | ||
1188 | */ | ||
1189 | HAL_COLOR_MODE_NATIVE = 0, | ||
1190 | |||
1191 | /* | ||
1192 | * HAL_COLOR_MODE_STANDARD_BT601_625 corresponds with display | ||
1193 | * settings that implement the ITU-R Recommendation BT.601 | ||
1194 | * or Rec 601. Using 625 line version | ||
1195 | * Rendering Intent: Colorimetric | ||
1196 | * Primaries: | ||
1197 | * x y | ||
1198 | * green 0.290 0.600 | ||
1199 | * blue 0.150 0.060 | ||
1200 | * red 0.640 0.330 | ||
1201 | * white (D65) 0.3127 0.3290 | ||
1202 | * | ||
1203 | * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation | ||
1204 | * for RGB conversion from the one purely determined by the primaries | ||
1205 | * to minimize the color shift into RGB space that uses BT.709 | ||
1206 | * primaries. | ||
1207 | * | ||
1208 | * Gamma Correction (GC): | ||
1209 | * | ||
1210 | * if Vlinear < 0.018 | ||
1211 | * Vnonlinear = 4.500 * Vlinear | ||
1212 | * else | ||
1213 | * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099 | ||
1214 | */ | ||
1215 | HAL_COLOR_MODE_STANDARD_BT601_625 = 1, | ||
1216 | |||
1217 | /* | ||
1218 | * Primaries: | ||
1219 | * x y | ||
1220 | * green 0.290 0.600 | ||
1221 | * blue 0.150 0.060 | ||
1222 | * red 0.640 0.330 | ||
1223 | * white (D65) 0.3127 0.3290 | ||
1224 | * | ||
1225 | * Use the unadjusted KR = 0.222, KB = 0.071 luminance interpretation | ||
1226 | * for RGB conversion. | ||
1227 | * | ||
1228 | * Gamma Correction (GC): | ||
1229 | * | ||
1230 | * if Vlinear < 0.018 | ||
1231 | * Vnonlinear = 4.500 * Vlinear | ||
1232 | * else | ||
1233 | * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099 | ||
1234 | */ | ||
1235 | HAL_COLOR_MODE_STANDARD_BT601_625_UNADJUSTED = 2, | ||
1236 | |||
1237 | /* | ||
1238 | * Primaries: | ||
1239 | * x y | ||
1240 | * green 0.310 0.595 | ||
1241 | * blue 0.155 0.070 | ||
1242 | * red 0.630 0.340 | ||
1243 | * white (D65) 0.3127 0.3290 | ||
1244 | * | ||
1245 | * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation | ||
1246 | * for RGB conversion from the one purely determined by the primaries | ||
1247 | * to minimize the color shift into RGB space that uses BT.709 | ||
1248 | * primaries. | ||
1249 | * | ||
1250 | * Gamma Correction (GC): | ||
1251 | * | ||
1252 | * if Vlinear < 0.018 | ||
1253 | * Vnonlinear = 4.500 * Vlinear | ||
1254 | * else | ||
1255 | * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099 | ||
1256 | */ | ||
1257 | HAL_COLOR_MODE_STANDARD_BT601_525 = 3, | ||
1258 | |||
1259 | /* | ||
1260 | * Primaries: | ||
1261 | * x y | ||
1262 | * green 0.310 0.595 | ||
1263 | * blue 0.155 0.070 | ||
1264 | * red 0.630 0.340 | ||
1265 | * white (D65) 0.3127 0.3290 | ||
1266 | * | ||
1267 | * Use the unadjusted KR = 0.212, KB = 0.087 luminance interpretation | ||
1268 | * for RGB conversion (as in SMPTE 240M). | ||
1269 | * | ||
1270 | * Gamma Correction (GC): | ||
1271 | * | ||
1272 | * if Vlinear < 0.018 | ||
1273 | * Vnonlinear = 4.500 * Vlinear | ||
1274 | * else | ||
1275 | * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099 | ||
1276 | */ | ||
1277 | HAL_COLOR_MODE_STANDARD_BT601_525_UNADJUSTED = 4, | ||
1278 | |||
1279 | /* | ||
1280 | * HAL_COLOR_MODE_REC709 corresponds with display settings that implement | ||
1281 | * the ITU-R Recommendation BT.709 / Rec. 709 for high-definition television. | ||
1282 | * Rendering Intent: Colorimetric | ||
1283 | * Primaries: | ||
1284 | * x y | ||
1285 | * green 0.300 0.600 | ||
1286 | * blue 0.150 0.060 | ||
1287 | * red 0.640 0.330 | ||
1288 | * white (D65) 0.3127 0.3290 | ||
1289 | * | ||
1290 | * HDTV REC709 Inverse Gamma Correction (IGC): V represents normalized | ||
1291 | * (with [0 to 1] range) value of R, G, or B. | ||
1292 | * | ||
1293 | * if Vnonlinear < 0.081 | ||
1294 | * Vlinear = Vnonlinear / 4.5 | ||
1295 | * else | ||
1296 | * Vlinear = ((Vnonlinear + 0.099) / 1.099) ^ (1/0.45) | ||
1297 | * | ||
1298 | * HDTV REC709 Gamma Correction (GC): | ||
1299 | * | ||
1300 | * if Vlinear < 0.018 | ||
1301 | * Vnonlinear = 4.5 * Vlinear | ||
1302 | * else | ||
1303 | * Vnonlinear = 1.099 * (Vlinear) ^ 0.45 – 0.099 | ||
1304 | */ | ||
1305 | HAL_COLOR_MODE_STANDARD_BT709 = 5, | ||
1306 | |||
1307 | /* | ||
1308 | * HAL_COLOR_MODE_DCI_P3 corresponds with display settings that implement | ||
1309 | * SMPTE EG 432-1 and SMPTE RP 431-2 | ||
1310 | * Rendering Intent: Colorimetric | ||
1311 | * Primaries: | ||
1312 | * x y | ||
1313 | * green 0.265 0.690 | ||
1314 | * blue 0.150 0.060 | ||
1315 | * red 0.680 0.320 | ||
1316 | * white (D65) 0.3127 0.3290 | ||
1317 | * | ||
1318 | * Gamma: 2.2 | ||
1319 | */ | ||
1320 | HAL_COLOR_MODE_DCI_P3 = 6, | ||
1321 | |||
1322 | /* | ||
1323 | * HAL_COLOR_MODE_SRGB corresponds with display settings that implement | ||
1324 | * the sRGB color space. Uses the same primaries as ITU-R Recommendation | ||
1325 | * BT.709 | ||
1326 | * Rendering Intent: Colorimetric | ||
1327 | * Primaries: | ||
1328 | * x y | ||
1329 | * green 0.300 0.600 | ||
1330 | * blue 0.150 0.060 | ||
1331 | * red 0.640 0.330 | ||
1332 | * white (D65) 0.3127 0.3290 | ||
1333 | * | ||
1334 | * PC/Internet (sRGB) Inverse Gamma Correction (IGC): | ||
1335 | * | ||
1336 | * if Vnonlinear ≤ 0.03928 | ||
1337 | * Vlinear = Vnonlinear / 12.92 | ||
1338 | * else | ||
1339 | * Vlinear = ((Vnonlinear + 0.055)/1.055) ^ 2.4 | ||
1340 | * | ||
1341 | * PC/Internet (sRGB) Gamma Correction (GC): | ||
1342 | * | ||
1343 | * if Vlinear ≤ 0.0031308 | ||
1344 | * Vnonlinear = 12.92 * Vlinear | ||
1345 | * else | ||
1346 | * Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055 | ||
1347 | */ | ||
1348 | HAL_COLOR_MODE_SRGB = 7, | ||
1349 | |||
1350 | /* | ||
1351 | * HAL_COLOR_MODE_ADOBE_RGB corresponds with the RGB color space developed | ||
1352 | * by Adobe Systems, Inc. in 1998. | ||
1353 | * Rendering Intent: Colorimetric | ||
1354 | * Primaries: | ||
1355 | * x y | ||
1356 | * green 0.210 0.710 | ||
1357 | * blue 0.150 0.060 | ||
1358 | * red 0.640 0.330 | ||
1359 | * white (D65) 0.3127 0.3290 | ||
1360 | * | ||
1361 | * Gamma: 2.2 | ||
1362 | */ | ||
1363 | HAL_COLOR_MODE_ADOBE_RGB = 8 | ||
1364 | |||
1365 | } android_color_mode_t; | ||
1366 | |||
1367 | /* | ||
1138 | * Color transforms that may be applied by hardware composer to the whole | 1368 | * Color transforms that may be applied by hardware composer to the whole |
1139 | * display. | 1369 | * display. |
1140 | */ | 1370 | */ |