; +++ Movie2.pro : Movie procedure for MS Windows platform, 2006/12 by VNIJ ++ ; ++ Mouse Left button -> Slower ++ ; ++ Mouse Right button -> Faster ++ ; ++ Shit Key + Mouse Left button -> Quit ++ ; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ; ; $Id: movie.pro,v 1.2 1997/12/19 18:57:27 landers Exp $ ; pro movie2, images, rate, order = order ;Image is an (n,m,k) images to show as fast ;as we can. !Order is set to 1 and restored. ;+ ; NAME: MOVIE ; PURPOSE: Show a cyclic sequence of images stored in a 3D array. ; CATEGORY: Image display ; CALLING SEQUENCE: ; Movie2, Images [,Rate] ; INPUTS: ; Images = (n,m,nframes) byte array of image data, consisting of ; nframes images, each of n by m. This array should be ; stored with the top row first, (order = 1) for maximum ; efficiency. ; OPTIONAL INPUT PARAMETERS: ; Rate = initial rate, in APPROXIMATE frames per second. If ; omitted, the inter-frame delay is set to 0.01 second. ; KEYWORD PARAMETERS: ; Order = image ordering. Order = 0 for images ordered bottom up, ; or = 1 for images ordered top down (the default). ; OUTPUTS: ; No explicit outputs. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; Images are displayed in the lower left corner of the currently ; selected window. ; RESTRICTIONS: ; As SunView has no zoom or pan, we have to write each image to ; the display. Restricting the maximum rate, etc. Experience has ; shown that you can count on a rate of approximately 10 frames / second ; with 192 by 192 images. This varies according to the type of ; computer, amount of physical memory, and number of frames. ; ; The amount of available memory also restricts the maximum amount ; of data that can be displayed in a loop. ; PROCEDURE: ; Straightforward. ; MODIFICATION HISTORY: ; DMS, Nov, 1988. ;- on_error,2 ;Return to caller if an error occurs old_order = !order s = size(images) if n_elements(rate) ne 0 then delay = 1./rate else delay = 0.01 if s(0) ne 3 then message, "movie.not_3d", /Lookup ;Default order is top down cause its faster. if n_elements(order) ne 0 then !order = order else !order = 1 ;PRINT, STRLOOKUP('movie.instructions') ; "S for slower, F for faster, Q to quit." PRINT, "Mouse Left button for slower, Right for faster, Shif Key+Left button to quit." i = 0 REP: !err=0 tv,images(*,*,i) wait,delay Cursor,x,y,/Nowait,/Device ;Print,i,delay,!err i = i + 1 if i eq s(3) then i = 0 If (!Err Eq 1) Then delay = delay * 1.5 ;-- Mouse Left -- If (!Err Eq 4) Then delay = delay / 1.5 ;-- Mouse Right -- If (!Err Eq 2) Then begin ;-- Shift key + Mouse Left -- !order=old_order ;Restore order. return EndIf Goto, rep end