2009년 10월 5일 월요일

sRGB to linearRGB

color sRGBtolin(color In) {
color Out;
float i;

float A = 1.0/12.92;
float B = 1.0/1.055;
for (i = 0; i < 3; i += 1) {
Out[i] = In[i] < 0.04045 ?
In[i] * A : pow((I[i] + 0.055) * B, 2.4);
}
return Out;
}