diff options
author | Mathias Agopian <mathias@google.com> | 2013-07-26 19:54:11 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-26 19:54:11 +0000 |
commit | 224445c83055e04d2091340b400d8b7d9aee5ead (patch) | |
tree | 072601172d1039e20ca990911f1c87ed00535a11 /include/system | |
parent | 752faf2c18407fd79127fb3f3773910b4ddf669d (diff) | |
parent | 8d9da28ab5f32e3cd83858a5b31f45bb5d03a1fd (diff) | |
download | system_core-224445c83055e04d2091340b400d8b7d9aee5ead.zip system_core-224445c83055e04d2091340b400d8b7d9aee5ead.tar.gz system_core-224445c83055e04d2091340b400d8b7d9aee5ead.tar.bz2 |
Merge "add sRGB pixel formats to the HALs"
Diffstat (limited to 'include/system')
-rw-r--r-- | include/system/graphics.h | 29 |
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 |