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

Home » Public Forums » archive » Array Subscripting Puzzle
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Array Subscripting Puzzle [message #30790] Fri, 17 May 2002 10:53 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I have a 24-bit image. You can interleave it anyway
you like that will make the problem described below
trackable. At the moment it is 800 by 600 by 3.

I have the indices of something I want to draw on
the image. Say they are the indices of the outlines
of some continents. For example, like this:

window, xsize=800, ysize=600
map_set, /Cylindrical, position=[0,0,1,1]
map_continents, /fill
a = tvrd()
indices = where(a GT 0)

I want to make all the outline pixels yellow.
I *could* do this:

r = Reform((image[*,*,0]))
g = Reform((image[*,*,1]))
b = Reform((image[*,*,2]))
r[indices] = 255
g[indices] = 255
b[indices] = 0
image[*,*,0] = r
image[*,*,1] = g
image[*,*,2] = b

That seems wasteful and inelegant. There must be
a way to do this in one go. I'm sure it uses REBIN
and REFORM, but I'm not sure in which order. :-(

Can anyone help?

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Problems importing IDL postscript from TV output into Adobe Illustrator
Next Topic: Re: Object programming with data...

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

Current Time: Wed Oct 08 15:52:22 PDT 2025

Total time taken to generate the page: 0.00486 seconds