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

Home » Public Forums » archive » Re: Array indices and lookup tables
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: Array indices and lookup tables [message #39713 is a reply to message #39712] Thu, 10 June 2004 06:57 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Haje Korth writes:

> oops, you are right, the 360 should have been a 720. I have worked with
> triangulate and trigrid in the past and what I learned is that you do NOT
> use these in time-critical operations. This is even slower than looping
> through a lookup table.

Well, if that's the case, then here is an example that works,
more or less:

IDL> filename = Filepath(Subdir=['examples', 'data'], 'rose.jpg')
IDL> Read_JPEG, filename, rose
IDL> help, rose
ROSE BYTE = Array[3, 227, 149]
IDL> a=indgen(227,149) ; Look-up table
IDL> a = shift(a, 100) ; Shift it so it looks different
IDL> r = bytarr(3, 227, 149) ; The new image, r.
IDL> r[0,*,*] = (rose[0,*,*])[a]
IDL> r[1,*,*] = (rose[1,*,*])[a]
IDL> r[2,*,*] = (rose[2,*,*])[a]
IDL> window, xsize=2*227, ysize=149
IDL> tv, rose, 0, true=1
IDL> tv, r, 1, true=1

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Object Graphics Fonts
Next Topic: IsoSurface Contour projection

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

Current Time: Sat Oct 11 07:01:41 PDT 2025

Total time taken to generate the page: 0.32280 seconds