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

Home » Public Forums » archive » Re: Color Frustration
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: Color Frustration [message #8374 is a reply to message #8373] Fri, 28 February 1997 00:00 Go to previous message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
David Fanning wrote:
>
> JD Smith <jdsmith@astrosun.tn.cornell.edu> writes:
>
> [Some fantastic story about colors, IDL, and mysterious happenings ....]
>
> This can one of only two things:
>
> (1) TGIF has started earlier than usual at Cornell this afternoon, or
>
> (2) programmer error.
>
> I personally believe (on the basis of previous posts from JD) that
> reason (1) is most likely. :-)


Alright, I did stop in for one beer, but I really don't think that put me under.
As a test of my mental accuity, I translated 'Stairway to Heaven' from English into
French, and back into English again. Only two references to the lord of the
underworld surfaced.

As for some more details, I skimped because it's one of these 20 headed beasts that
makes you sigh, and wish you had only known then what you know now.

Anyway, I'll, try and fill in.

I'm not using cursor (let's not be ridiculous), but I am, as I mentioned, doing
some heavy swapping in and out with the pixmap. If the pixmap maintained its own
colors, or had a different sized color table, that could very well be my problem,
but I really don't see how this could be the case.

First, I grab the top color for drawing the symbols, and then I ensure that calls
to stretch (or my variant of it, which will leave the colormap beyond a specified
top index alone) will not lose the lovely green:

tvlct,0B,255B,0B,!D.N_COLORS-1 ;load green into top color
tvlct, r,g,b,/get
r_orig=r & g_orig=g & b_orig=b & r_curr=r & g_curr=g & b_curr=b ;ughh

I do hate that colors common block.

Then, I get the widget going. It has quite a few bells and whistles, but the next
thing that happens of importance is when the user clicks on a pixel. Some magic
happens, and it ends up either doing:

;; erase old
wset,state.drawwin
device,COPY=[p(0),p(1),s,s, $
p(0),p(1),state.pixwin]

to erase the plotted symbol (if said symbol is there), or:

plots,p(0),p(1),psym=8,symsize=float(state.zoom>3)/!D.X_CH_SIZE,/DEVICE, $
THICK=.01,COLOR=!D.N_COLORS-1

to plot a new one. Note that the p's aren't really the same p's in these two
calls. Another possibility is removing *all* of the plotted symbols, with a total
pixmap copy. But anyway, that's about it, as far as this over-plotting feature
goes.

And here's what happens. I start clicking. I get a green diamond (no purple
hearts, blue diamonds, green clovers). I click again. Another green. I click
for my colormap tool A nice smooth gradation of blue to white. I dismiss the
tool. I click a few more greens, and then, out of thin air, a (for instance)
perwinkle diamond appears. The next might be mauve, or khaki, or seaweed. Almost
anything. If I bring up my colormap tool *now*, the crazy colors have taken over
the place, and no loading of a new colormap, or stretching, will remove them. They
sit there taunting at me. Agh. Meanwhile, If I use my zoom function to show a
different piece of the image, things return to normal. The miscreant diamonds toe
the line and become green. And the pattern repeats itself -- a few more clicks and
it's a bad 70's music video again. Note that if I *leave* my color tool up and
commence to bring on the multicolor devils with more clicks, the colormap does not
go crazy too. Only if I dismiss it, and bring up another copy of the colormap tool
do I see the bizarre features. Neither does the whole image jump into electric
tripland when the event occurs. It remains normal throughout (excepting the
individual pixels possessed by minor devils). I may be missing something really
obvious, although the man who would say IDL's color management is obvious may need
to look into some therapy.

Anyway, I'm not sure if there's anything more that's relevant. Note that it
doesn't depend on the color map tool to screw up. It does so even when the tool is
nevered used. Looking at the colormap just revealed to me the severity of the
problem (and that the guache colors seemed glued in place, immovable and
inexorcisable with loadct() or stretch()).

Well, if you made it this far, it's a small miracle,and a testament to your IDL
fanatasism.

And yes, David, it is a "fantastic story", but aren't all the interesting ones?


Thanks in advance,

JD
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: NR_MACHAR hangs under Win95
Next Topic: Re: Printing array on one line

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

Current Time: Sun Apr 26 22:32:35 PDT 2026

Total time taken to generate the page: 0.16038 seconds