• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

修訂d6164f2b5b36158ce2170640db8d9ce43d148e37 (tree)
時間2016-10-05 23:13:55
作者Courtney Goeltzenleuchter <courtneygo@goog...>
CommiterGerrit Code Review

Log Message

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

Change Summary

差異

--- a/include/system/graphics.h
+++ b/include/system/graphics.h
@@ -1039,6 +1039,236 @@ typedef enum android_dataspace {
10391039 } android_dataspace_t;
10401040
10411041 /*
1042+ * Color modes that may be supported by a display.
1043+ *
1044+ * Definitions:
1045+ * Rendering intent generally defines the goal in mapping a source (input)
1046+ * color to a destination device color for a given color mode.
1047+ *
1048+ * It is important to keep in mind three cases where mapping may be applied:
1049+ * 1. The source gamut is much smaller than the destination (display) gamut
1050+ * 2. The source gamut is much larger than the destination gamut (this will
1051+ * ordinarily be handled using colorimetric rendering, below)
1052+ * 3. The source and destination gamuts are roughly equal, although not
1053+ * completely overlapping
1054+ * Also, a common requirement for mappings is that skin tones should be
1055+ * preserved, or at least remain natural in appearance.
1056+ *
1057+ * Colorimetric Rendering Intent (All cases):
1058+ * Colorimetric indicates that colors should be preserved. In the case
1059+ * that the source gamut lies wholly within the destination gamut or is
1060+ * about the same (#1, #3), this will simply mean that no manipulations
1061+ * (no saturation boost, for example) are applied. In the case where some
1062+ * source colors lie outside the destination gamut (#2, #3), those will
1063+ * need to be mapped to colors that are within the destination gamut,
1064+ * while the already in-gamut colors remain unchanged.
1065+ *
1066+ * Non-colorimetric transforms can take many forms. There are no hard
1067+ * rules and it's left to the implementation to define.
1068+ * Two common intents are described below.
1069+ *
1070+ * Stretched-Gamut Enhancement Intent (Source < Destination):
1071+ * When the destination gamut is much larger than the source gamut (#1), the
1072+ * source primaries may be redefined to reflect the full extent of the
1073+ * destination space, or to reflect an intermediate gamut.
1074+ * Skin-tone preservation would likely be applied. An example might be sRGB
1075+ * input displayed on a DCI-P3 capable device, with skin-tone preservation.
1076+ *
1077+ * Within-Gamut Enhancement Intent (Source >= Destination):
1078+ * When the device (destination) gamut is not larger than the source gamut
1079+ * (#2 or #3), but the appearance of a larger gamut is desired, techniques
1080+ * such as saturation boost may be applied to the source colors. Skin-tone
1081+ * preservation may be applied. There is no unique method for within-gamut
1082+ * enhancement; it would be defined within a flexible color mode.
1083+ *
1084+ */
1085+typedef enum android_color_mode {
1086+
1087+ /*
1088+ * HAL_COLOR_MODE_DEFAULT is the "native" gamut of the display.
1089+ * White Point: Vendor/OEM defined
1090+ * Panel Gamma: Vendor/OEM defined (typically 2.2)
1091+ * Rendering Intent: Vendor/OEM defined (typically 'enhanced')
1092+ */
1093+ HAL_COLOR_MODE_NATIVE = 0,
1094+
1095+ /*
1096+ * HAL_COLOR_MODE_STANDARD_BT601_625 corresponds with display
1097+ * settings that implement the ITU-R Recommendation BT.601
1098+ * or Rec 601. Using 625 line version
1099+ * Rendering Intent: Colorimetric
1100+ * Primaries:
1101+ * x y
1102+ * green 0.290 0.600
1103+ * blue 0.150 0.060
1104+ * red 0.640 0.330
1105+ * white (D65) 0.3127 0.3290
1106+ *
1107+ * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
1108+ * for RGB conversion from the one purely determined by the primaries
1109+ * to minimize the color shift into RGB space that uses BT.709
1110+ * primaries.
1111+ *
1112+ * Gamma Correction (GC):
1113+ *
1114+ * if Vlinear < 0.018
1115+ * Vnonlinear = 4.500 * Vlinear
1116+ * else
1117+ * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
1118+ */
1119+ HAL_COLOR_MODE_STANDARD_BT601_625 = 1,
1120+
1121+ /*
1122+ * Primaries:
1123+ * x y
1124+ * green 0.290 0.600
1125+ * blue 0.150 0.060
1126+ * red 0.640 0.330
1127+ * white (D65) 0.3127 0.3290
1128+ *
1129+ * Use the unadjusted KR = 0.222, KB = 0.071 luminance interpretation
1130+ * for RGB conversion.
1131+ *
1132+ * Gamma Correction (GC):
1133+ *
1134+ * if Vlinear < 0.018
1135+ * Vnonlinear = 4.500 * Vlinear
1136+ * else
1137+ * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
1138+ */
1139+ HAL_COLOR_MODE_STANDARD_BT601_625_UNADJUSTED = 2,
1140+
1141+ /*
1142+ * Primaries:
1143+ * x y
1144+ * green 0.310 0.595
1145+ * blue 0.155 0.070
1146+ * red 0.630 0.340
1147+ * white (D65) 0.3127 0.3290
1148+ *
1149+ * KR = 0.299, KB = 0.114. This adjusts the luminance interpretation
1150+ * for RGB conversion from the one purely determined by the primaries
1151+ * to minimize the color shift into RGB space that uses BT.709
1152+ * primaries.
1153+ *
1154+ * Gamma Correction (GC):
1155+ *
1156+ * if Vlinear < 0.018
1157+ * Vnonlinear = 4.500 * Vlinear
1158+ * else
1159+ * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
1160+ */
1161+ HAL_COLOR_MODE_STANDARD_BT601_525 = 3,
1162+
1163+ /*
1164+ * Primaries:
1165+ * x y
1166+ * green 0.310 0.595
1167+ * blue 0.155 0.070
1168+ * red 0.630 0.340
1169+ * white (D65) 0.3127 0.3290
1170+ *
1171+ * Use the unadjusted KR = 0.212, KB = 0.087 luminance interpretation
1172+ * for RGB conversion (as in SMPTE 240M).
1173+ *
1174+ * Gamma Correction (GC):
1175+ *
1176+ * if Vlinear < 0.018
1177+ * Vnonlinear = 4.500 * Vlinear
1178+ * else
1179+ * Vnonlinear = 1.099 * (Vlinear)^(0.45) – 0.099
1180+ */
1181+ HAL_COLOR_MODE_STANDARD_BT601_525_UNADJUSTED = 4,
1182+
1183+ /*
1184+ * HAL_COLOR_MODE_REC709 corresponds with display settings that implement
1185+ * the ITU-R Recommendation BT.709 / Rec. 709 for high-definition television.
1186+ * Rendering Intent: Colorimetric
1187+ * Primaries:
1188+ * x y
1189+ * green 0.300 0.600
1190+ * blue 0.150 0.060
1191+ * red 0.640 0.330
1192+ * white (D65) 0.3127 0.3290
1193+ *
1194+ * HDTV REC709 Inverse Gamma Correction (IGC): V represents normalized
1195+ * (with [0 to 1] range) value of R, G, or B.
1196+ *
1197+ * if Vnonlinear < 0.081
1198+ * Vlinear = Vnonlinear / 4.5
1199+ * else
1200+ * Vlinear = ((Vnonlinear + 0.099) / 1.099) ^ (1/0.45)
1201+ *
1202+ * HDTV REC709 Gamma Correction (GC):
1203+ *
1204+ * if Vlinear < 0.018
1205+ * Vnonlinear = 4.5 * Vlinear
1206+ * else
1207+ * Vnonlinear = 1.099 * (Vlinear) ^ 0.45 – 0.099
1208+ */
1209+ HAL_COLOR_MODE_STANDARD_BT709 = 5,
1210+
1211+ /*
1212+ * HAL_COLOR_MODE_DCI_P3 corresponds with display settings that implement
1213+ * SMPTE EG 432-1 and SMPTE RP 431-2
1214+ * Rendering Intent: Colorimetric
1215+ * Primaries:
1216+ * x y
1217+ * green 0.265 0.690
1218+ * blue 0.150 0.060
1219+ * red 0.680 0.320
1220+ * white (D65) 0.3127 0.3290
1221+ *
1222+ * Gamma: 2.2
1223+ */
1224+ HAL_COLOR_MODE_DCI_P3 = 6,
1225+
1226+ /*
1227+ * HAL_COLOR_MODE_SRGB corresponds with display settings that implement
1228+ * the sRGB color space. Uses the same primaries as ITU-R Recommendation
1229+ * BT.709
1230+ * Rendering Intent: Colorimetric
1231+ * Primaries:
1232+ * x y
1233+ * green 0.300 0.600
1234+ * blue 0.150 0.060
1235+ * red 0.640 0.330
1236+ * white (D65) 0.3127 0.3290
1237+ *
1238+ * PC/Internet (sRGB) Inverse Gamma Correction (IGC):
1239+ *
1240+ * if Vnonlinear ≤ 0.03928
1241+ * Vlinear = Vnonlinear / 12.92
1242+ * else
1243+ * Vlinear = ((Vnonlinear + 0.055)/1.055) ^ 2.4
1244+ *
1245+ * PC/Internet (sRGB) Gamma Correction (GC):
1246+ *
1247+ * if Vlinear ≤ 0.0031308
1248+ * Vnonlinear = 12.92 * Vlinear
1249+ * else
1250+ * Vnonlinear = 1.055 * (Vlinear)^(1/2.4) – 0.055
1251+ */
1252+ HAL_COLOR_MODE_SRGB = 7,
1253+
1254+ /*
1255+ * HAL_COLOR_MODE_ADOBE_RGB corresponds with the RGB color space developed
1256+ * by Adobe Systems, Inc. in 1998.
1257+ * Rendering Intent: Colorimetric
1258+ * Primaries:
1259+ * x y
1260+ * green 0.210 0.710
1261+ * blue 0.150 0.060
1262+ * red 0.640 0.330
1263+ * white (D65) 0.3127 0.3290
1264+ *
1265+ * Gamma: 2.2
1266+ */
1267+ HAL_COLOR_MODE_ADOBE_RGB = 8
1268+
1269+} android_color_mode_t;
1270+
1271+/*
10421272 * Color transforms that may be applied by hardware composer to the whole
10431273 * display.
10441274 */