summaryrefslogtreecommitdiffstats
path: root/include/system
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-07-25 17:07:11 -0700
committerMathias Agopian <mathias@google.com>2013-07-25 17:07:11 -0700
commit8d9da28ab5f32e3cd83858a5b31f45bb5d03a1fd (patch)
tree1a8c4172665c7912834d9f5c4dd52144ebffa52b /include/system
parent42cf2b5945c6e7cefc84b1146ba5057faae91322 (diff)
downloadsystem_core-8d9da28ab5f32e3cd83858a5b31f45bb5d03a1fd.zip
system_core-8d9da28ab5f32e3cd83858a5b31f45bb5d03a1fd.tar.gz
system_core-8d9da28ab5f32e3cd83858a5b31f45bb5d03a1fd.tar.bz2
add sRGB pixel formats to the HALs
Change-Id: I1d5f9dd14a6485dd3a29fb5960edfa79aa86da42
Diffstat (limited to 'include/system')
-rw-r--r--include/system/graphics.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/system/graphics.h b/include/system/graphics.h
index ed493f5..2ddcc08 100644
--- a/include/system/graphics.h
+++ b/include/system/graphics.h
@@ -42,6 +42,13 @@ extern "C" {
*/
enum {
+ /*
+ * "linear" color pixel formats:
+ *
+ * The pixel formats below contain sRGB data but are otherwise treated
+ * as linear formats, i.e.: no special operation is performed when
+ * reading or writing into a buffer in one of these formats
+ */
HAL_PIXEL_FORMAT_RGBA_8888 = 1,
HAL_PIXEL_FORMAT_RGBX_8888 = 2,
HAL_PIXEL_FORMAT_RGB_888 = 3,
@@ -50,7 +57,27 @@ enum {
HAL_PIXEL_FORMAT_RGBA_5551 = 6,
HAL_PIXEL_FORMAT_RGBA_4444 = 7,
- /* 0x8 - 0xFF range unavailable */
+ /*
+ * sRGB color pixel formats:
+ *
+ * The red, green and blue components are stored in sRGB space, and converted
+ * to linear space when read, using the standard sRGB to linear equation:
+ *
+ * Clinear = Csrgb / 12.92 for Csrgb <= 0.04045
+ * = (Csrgb + 0.055 / 1.055)^2.4 for Csrgb > 0.04045
+ *
+ * When written the inverse transformation is performed:
+ *
+ * Csrgb = 12.92 * Clinear for Clinear <= 0.0031308
+ * = 1.055 * Clinear^(1/2.4) - 0.055 for Clinear > 0.0031308
+ *
+ *
+ * The alpha component, if present, is always stored in linear space and
+ * is left unmodified when read or written.
+ *
+ */
+ HAL_PIXEL_FORMAT_sRGB_A_8888 = 0xC,
+ HAL_PIXEL_FORMAT_sRGB_888 = 0xD,
/*
* 0x100 - 0x1FF