comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Colors with XOR plotting: How to do it
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Colors with XOR plotting: How to do it [message #468] Sat, 25 July 1992 08:31
dpkemp is currently offline  dpkemp
Messages: 4
Registered: July 1992
Junior Member
An alternative to XOR that may be useful is using drawing surfaces.
For example if you have a red line and you want to slide a blue disc
along it, you may do so by drawing them on separate surfaces. Depending
on your colormap assignment, the disk is made to appear either above
or below the line.

As an example, assume you have a background axis with a red line, yellow
tick marks, and green labels. You want to slide a blue marker along
below the axis. Set up your two surfaces as follows:

Surface 1 (Axis) Surface 2 (Marker) Colormap
Write mask: 011 100 000 Gray
Transparent 00 Background (grey) 0 001 Red
Red 01 Marker (blue) 1 010 Yellow
Yellow 10 011 Green
Green 11 100 Blue
101 Red
110 Yellow
111 Green

To make the marker appear on top of the axis, just change the
last three entries in the colormap to all be Blue. That has the
interpretation of Axis color 00 = Gray, and Marker color 0 = Transparent.

The only trick here is to figure out from the manual how to set the
write mask. If the mask is 011, drawing operations affect just the
axis surface; if it is 100, they affect just the marker surface.
Use normal (Source) drawing mode instead of XOR, and when moving
the marker, you can just erase the whole surface, or redraw the
marker in the background color, whichever turns out to be faster.

This technique can be used for any number of independent surfaces
as long as the sum of the bits in the surfaces doesn't exceed the
number of bits in your colormap. (For example an 8 bit colormap
(256 colors) can support 8 separate 1 bit surfaces, or 2 4 bit
surfaces, or the usual 1 8 bit surface.)

----

With regard to a previous poster's acerbic comment, I agree that
the net is no substitute for reading the manuals and playing around
(oops, conducting research), but I have often been in the position
of having spent hours or days working on something because I missed
something or wasn't aware of a particular technique. Mr. Austin
didn't appear to be lazy, just inexperienced. We can all learn
from each other - let's keep the flame wars in alt.politics.greek
and news.admin.

--
Dave Kemp dpkemp@afterlife.ncsc.mil
------------------------------------------------------------ -----------------
"The use of history as therapy means the corruption of history as history."
-- Arthur Schlesinger (quote stolen from Chet Ramey, CWRU)
[Message index]
 
Read Message
Previous Topic: Re: Colors with XOR plotting
Next Topic: SUMMARY: formatted printing of structures

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:58:01 PDT 2025

Total time taken to generate the page: 1.60153 seconds