Add support for sRGB surfaces
authorAntti S. Lankila <alankila@bel.fi>
Sun, 29 Jul 2012 18:46:58 +0000 (21:46 +0300)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Mon, 30 Jul 2012 19:37:26 +0000 (15:37 -0400)
commit7460457f80b1482338318f0ddcdf5311659fae7b
tree7004b38e2b38b02034149ebf559357d18a5c2059
parent1dcca0f7ae64e9a96f2feba85dd728c636744009
Add support for sRGB surfaces

sRGB format is defined as a new format type, PIXMAN_TYPE_ARGB_SRGB. One form of
this type is provided, PIXMAN_a8r8g8b8_sRGB. Use of an sRGB format triggers
wide processing, and the pixel fetch/store functions handle the relevant
conversion between color spaces. Pixman itself is thought to compose in the
linearized sRGB color space.

sRGB conversion is tabularized. For sRGB to linear, we are using only 256
values because the current source format uses 8 bits per component precision.
For linear to sRGB, it turns out that only 4096 brightness levels are required
to generate all of the 256 sRGB color values, and therefore only 12 bits per
component are considered during store. As a special case, a no-op
sRGB->linear->sRGB conversion is constructed to be lossless by adjusting the
sRGB->linear conversion table where necessary.
.gitignore
pixman/Makefile.sources
pixman/make-srgb.pl [new file with mode: 0644]
pixman/pixman-access.c
pixman/pixman-image.c
pixman/pixman-private.h
pixman/pixman.c
pixman/pixman.h