[REPLY] Squeak Alpha Transparency methods...

Raab, Andreas Andreas.Raab at disney.com
Mon Dec 6 04:16:17 UTC 1999


Ali,

> ...just so that i'm sure, this above example runs
> through each color, and replaces the entry with a
> Translucent version of the RGB, but uses the red value
> of the entry for the alpha. 

It just converts every color into a gray scale (that's what asGrayScale
does) and then it uses the gray value as alpha component - in gray scale
images is red=green=blue=gray so this was just a quick and dirty hack to
give an example for creating some different alpha values.

> Does this mean that Squeak
> handles a "rich" transparency mask (ala the grey scale
> mask of a Mac PICT file) by the alpha value of each
> color, not by using a seperate colorMap or image for
> the mask?

I don't know anything about the gray scale mask of a Mac PICT file; in
Squeak a transparent color value is made up of four components - red, green,
blue, and alpha. Alpha is treated as transparency value for the color but
the usage depends on the BitBlt combination rule. As an example rule '24'
(alphaBlend) computes
	dstComponent = (srcComponent * srcAlpha) + (dstComponent * (1.0 -
srcAlpha)
but rule 34 (alphaSourceBlend) uses
	dstComponent = srcComponent + (dstComponent * (1.0 - srcAlpha))
individually for each RGB component. We could probably use some more
combinations here (the GL blend modes come to mind) but that's the way it
works (or is supposed to work ;-) right now.

  Andreas





More information about the Squeak-dev mailing list