[Jprogramming] alpha in gl2
Oleg Kobchenko
olegykj at yahoo.com
Sat Feb 6 13:24:12 HKT 2010
> From: June Kim <juneaftn at gmail.com>
>
> Is there anyway to set the alpha value(transparency) with gl2?
I don't think transparency is supported by gl2 directly,
but it should be easy to achieve though bitblt (glqpixels, glpixels).
See "Image Operations" in J Wiki
http://www.jsoftware.com/jwiki/OlegKobchenko/Image%20Operations
Basically, for a color component, transparency is weighted sum,
the complement of which to 1 is opacity.
C = F*O + B*(1 - O)
C is the new color component value
B is the background value (0..1)
F is the foreground value (0..1)
O is the foreground opacity (0..1)
More information about the Programming
mailing list