Merge "add sRGB pixel formats to the HALs"

This commit is contained in:
Mathias Agopian 2013-07-26 19:54:11 +00:00 committed by Android (Google) Code Review
commit 224445c830

View file

@ -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