bitplane planeing

Rodian Paul rpaul at comanche.omni.co
Mon Apr 29 20:37:57 AEST 1991


Dan Karron writes:
> Is there any way to control the allocation of bit planes into OVERDRAW
> mode ? I want to draw an intricate picture into the NORMALDRAW bitplanes, 
> then draw various processed pixels from that image on top of it into the
> OVERDRAW mode bitplanes. I need at least as many bitplanes as in the 
> NORMALDRAW bitplanes (24 bits for my application).
> 
> I want to be able to show how an image processing algorithm (a variant 
> edge detection) draws line with respect to its base image.
> 

I'm pretty sure that the maximum no. of overlay planes on a VGX is 8 bits, 
and only 2 on a personal (but I may be wrong).

However, I have some old code kicking around somewhere, where I was able to
draw a 24bit picture into the Z-buffer of a personal, and still have 24bits 
left over for an image in NORMALDRAW planes. 

So in effect you can use the zbuffer planes for some kind of stencil 
(has Quantel got it's greedy paws on the "Alpha-Plane" in the US yet?) 
or matte.

A couple of other considerations are in order when it comes to using the
overlay planes. The first is that if your window is passed a REDRAW token
you will call reshapeviewport(), and probably do a clear() and redraw your
window. 

Normally the window manager takes care of cleaning up the position where your 
old window was located, however it doesn't handle the overlay planes. You 
just end up with junk in the overlay planes where your window used to be. 

A quick fix is to go into overdraw()/fullscrn() mode and perform a clear() 
and then reset the viewport afterwards. This isn't too considerate 
if more than 1 application is using the overlay planes. A more elegant 
approach is to set the scrnmask() to where your old window was when you enter 
fullscrn() mode, that way you are less likely to trash another application's
overlay planes. Another trick that helps is to queue INPUTCHANGE and clear
the overlay planes when the user moves out of your window, but that can have
a disconcerting effect visually, depending on what you're drawing.

Anyway, if you want a copy of the "zpic" code, gimme a yell and I'll dig
it out.

Cheers.
-------------------------------------------------------------------------------
rpaul%crow at ccut.cc.u-tokyo.ac.jp	phone: +81 (3) 5706-8357
ccut.cc.u-tokyo.ac.jp!crow!rpaul	  FAX: +81 (3) 5706-8437



More information about the Comp.sys.sgi mailing list