Antti S. Lankila wrote:

I do want to point out one advantage of using, say gamma=2.2 in lieu of the actual sRGB formulas in some situations: exponentiation permits separate treatment of alpha and color components. For instance

(component * alpha)^2.2

is just

component^2.2 * alpha^2.2

and this comes into play when library users read in, say, PNG, and see some alpha values and prepare that texture for pixman. In the past, they would have multiplied the components by alpha (I imagine), but now they must only raise the alpha to 2.2 first before the texture is ready for consumption by pixman. However, full sRGB formula requires:

lin2srgb(srgb2lin(c) * a)

which will be far more work to implement, and the results aren't going to be any different in practice.

Even if you use lookup tables and implement the linear portion of sRGB, I think it is close enough to a gamma curve that you can pretend the function is communative/additive. I would simplify composite calculations by assuming

        srgb2lin(a*b) == srgb2lin(a)*srgb2lin(b)

even though this is not true.

_______________________________________________
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to