Newsgroups: comp.windows.x
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines
From: mouse@lightning.mcrcim.mcgill.EDU (der Mouse)
Subject: Re:  question on using GC Functions for levels of overlap
Message-ID: <9105021410.AA18438@lightning.McRCIM.McGill.EDU>
Sender: daemon@athena.mit.edu (Mr Background)
Organization: The Internet
Date: 2 May 91 14:10:15 GMT
Lines: 33

> Can anyone give me some ideas on drawing overlapping objects on the
> screen in such a way that the colors indicate the level of overlap
> (i.e. single, double, triple, ...).  I have a slow brute force
> version, but I am interested in a technique that would work during
> the drawing of each object.  I have been looking at the GC Functions
> (GXxor, GXand, etc) and thinking that there must be a clever way to
> accomplish this.  I have 8 bitplanes, so potentially 256 different
> levels of overlap could be kept track of.

Ken Lee then replies

> Most college text books on raster graphics describe techniques for
> setting up a colormap to do what you want.  The idea is to chose your
> pixel values so that addition and subtraction do intelligent things.

Right.  Then all you need to do is describe how to draw something using
addition or subtraction instead of copy, OR, XOR, etc.  GXadd,
GXsubtract, etc, don't exist.

> These techniques were pretty popular in early CAD and image
> processing applications, but are not well supported in many modern
> window systems (other than X).

I'd say they're not supported at all in X.  If you want the equivalent
of GXadd, you have to GetImage the pictures back to the client, add
them there, and send them back to the server, or else do bit-by-bit
addition with XCopyPlane and plane-masks and such.  All alternatives
are ugly and likely to be slow.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu
