Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!dogie.macc.wisc.edu!indri!lll-winken!uunet!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: comp.windows.x Subject: Re: Fast, infinitely undoable graphics. Message-ID: <4260@ficc.uu.net> Date: 22 May 89 01:06:00 GMT References: <2483@rice-chex.ai.mit.edu> <4243@ficc.uu.net> <2532@wheat-chex.ai.mit.edu> Organization: Xenix Support Lines: 36 In article <2532@wheat-chex.ai.mit.edu>, tmb@wheaties.ai.mit.edu (Thomas M. Breuel) writes: > In article <4243@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes: > > [keep a count of the number of times the bit has been set] > > This doesn't work if you ever draw anything with color 0 (i.e., erase). > Obviously. However, if you have a system that is built on the paradigm > of putting up individual "objects" on the screen such that you can > remove them or manipulate them individually, it doesn't even really > make sense just to draw a rectangle in the background color. Sure it does. Let's say you want to draw a circle with a square hole in it. How do you do this? You draw a circle and then you draw a square in the background color. So how do you undo the square? > However, you can repeat the same trick of counting pixels for several > "layers" or several "colors" (with the obvious semantics of one layer > shadowing another). Except that you lose ordering information, unless you do something like adding a new layer every time you change colors. This would probably save some space, but still wouldn't be able to deal with xor-mode drawing. That would require each xor-mode operation to be cut up into a separate color-1 and color-1 (or whatever pair of colors you select) operation... which would actually increase the memory required if you do a lot of xor-ing... not to mention slowing drawing down quite a bit. You might be able to save some space with a scheme like this. But not more, I think, than something more conventional like run-length-encoded deltas. -- Peter da Silva, Xenix Support, Ferranti International Controls Corporation. Business: uunet.uu.net!ficc!peter, peter@ficc.uu.net, +1 713 274 5180. Personal: ...!texbell!sugar!peter, peter@sugar.hackercorp.com.