22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

14.3 Gamma correction<br />

For information about gamma issues, please consult the the Gamma Tutorial in<br />

the PNG specification ([PNG10]).<br />

In the computation of gamma correction, UAs displaying on a CRT may<br />

assume an ideal CRT and ignore any effects on apparent gamma caused by<br />

dithering. That means the minimal handling they need to do on current platforms<br />

is:<br />

PC using MS-Windows<br />

none<br />

Unix using X11<br />

none<br />

Mac using QuickDraw<br />

apply gamma 1.45 [ICC32] (ColorSync-savvy applications may simply pass<br />

the sRGB ICC profile to ColorSync to perform correct color correction)<br />

SGI using X<br />

apply the gamma value from /etc/config/system.glGammaVal (the<br />

default value being 1.70; applications running on Irix 6.2 or above may<br />

simply pass the sRGB ICC profile to the color management system)<br />

NeXT using NeXTStep<br />

apply gamma 2.22<br />

"Applying gamma" means that each of the three R, G and B must be converted<br />

to R’=R gamma , G’=G gamma , B’=B gamma , before being handed to the OS.<br />

This may rapidly be done by building a 256-element lookup table once per<br />

browser invocation thus:<br />

for i := 0 to 255 do<br />

raw := i / 255.0;<br />

corr := pow (raw, gamma);<br />

table[i] := trunc (0.5 + corr * 255.0)<br />

end<br />

which then avoids any need to do transcendental math per color attribute, far<br />

less per pixel.<br />

193

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!