MaskedForm class where is it?

Dan Ingalls DanI at wdi.disney.com
Mon Jan 26 16:09:23 UTC 1998


"John-Reed Maffeo \(rlpa80\)" <rlpa80 at email.sps.mot.com> wrote...

>I have been playing with a set of code called Draw80. It is trying to envoke a
>method called mask: in the class Form. Squeak does not recognize mask:.
>
>I found a class called MaskedForm in the Squeak sources file. MaskedForm seems to
>respond to mask:, but MaskedForm does not appear in the Browser.
>
>I am confused. Should MaskedForm be included in Squeak? If so, why can't I see it?
>If not, why is it in the source file?
>
>I copied the code which describes MaskedForm into a file and tried filein. The bangs
>are out of sequence and I don't know how to fix them.

MaskedForm was mainly used to provide transparency in B/W and color images.  For several releases now, we have been improving the support for transparent color.  Recently we added ColorForm -- a generalization of Form that includes a color map.  This made it possible to do a number of things more cleanly than before, including all the jobs that had been done using MaskedForm.  For this reason we removed MaskedForm from the system.  It still exists in the sources file because we have not condensed that file recently.

One approach for understanding how to supplant uses of MaskedForm with ColorForm would be to find all uses of MaskedForm in an old Squeak, and see how they are implemented in 1.3.  The basic idea in recent Squeaks is that BitBlt's "paint" mode stores all source pixels that are non-zero, but leaves the destination unchanged if the source is zero.  So for black, white and transparent, you use a 2-bit deep ColorForm with a color array that includes black, white and transparent (and some other dont-care).  This generalizes to other color depths.

The end result of the new scheme is that it usually doesn't require a second bitmap nor multiple calls on bitblt so it is simpler smaller and faster.  I apologize that it isn't better commented right now, but we hope to improve that situation over the coming months.


>Draw80 is code that has been put in the public domain by KSC. I am trying to
>learn Smalltalk/Squeak by trying to get code to run.

Cool.  I'm sure everyone in Squeakville would be interested in the result.

	- Dan





More information about the Squeak-dev mailing list