diff options
Diffstat (limited to 'include/system/graphics.h')
-rw-r--r-- | include/system/graphics.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/include/system/graphics.h b/include/system/graphics.h index ed493f5..be86ae4 100644 --- a/include/system/graphics.h +++ b/include/system/graphics.h @@ -42,15 +42,40 @@ 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, HAL_PIXEL_FORMAT_RGB_565 = 4, HAL_PIXEL_FORMAT_BGRA_8888 = 5, - 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_X_8888 = 0xD, /* * 0x100 - 0x1FF @@ -268,6 +293,8 @@ enum { HAL_TRANSFORM_ROT_180 = 0x03, /* rotate source image 270 degrees clockwise */ HAL_TRANSFORM_ROT_270 = 0x07, + /* don't use. see system/window.h */ + HAL_TRANSFORM_RESERVED = 0x08, }; #ifdef __cplusplus |