[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Animating in Color



Rachel (RachelP@goplay.com) writes:

> Is there an easy way to animate a series of color images in IDL other than a
> simple for loop from the command line?  I was trying to use XINTERANIMATE
> but could only make it do black and white.  The images are plotted on the
> screen then read into an array with tvrd(true=3).  I can get them to
> redisplay in color, but not as an animation in Xinteranimate. Thanks for any
> advice.

You are correct that you can't get color images if you
try to load the images into XINTERANIMATE with the IMAGE
keyword. But XINTERANIMATE can be used to animate RGB
image data.

Suppose, for example, imageArray is a (400,300,3,15) image
array containing 15 row-interleaved RGB images. To use 
XINTERANIMATE with such an array, the code will look something
like this (on a 24-bit display, obviously):

   Device, Decomposed=1
   XInterAnimate, Set=[400,300,15], /Showload
   FOR j=0,14 DO BEGIN
      TV, imageArray[*,*,*,j], True=3
      XInterAnimate, Window=!D.Window, Frame=j
   ENDFOR
   XInterAnimate, 50

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155