pro qView_Movie, state, event, wid_send=wid_send, send_event=send_event @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; qView_Movie ; PURPOSE: ; Generate a animation from the current image cube ; CATEGORY: ; Widget qView ; CALLING SEQUENCE: ; qView_Movie, state ; INPUTS: ; state array[1]; type: structure ; qView state structure ; OUTPUTS: ; (none) ; CALLS: ; qView_SetInfo, qView_GetInfo, MagnifyArray, qImage_cw_MinMax, qImage_TriggerSend ; PROCEDURE: ; The last information send back from the qImage widget is used to decide what part of the ; image cube to animate (this takes into account the area selection and the zoom factor). ; STATE INFO USED: ; widget_control, state.wid_data, get_uvalue=data, /no_copy ; STATE INFO MODIFIED: ; widget_control, state.wid_data, set_uvalue=data, /no_copy ; MODIFICATION HISTORY: ; FEB-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- status = qImage_TriggerSend(event, state.wid_view, state.wid_movie, wid_send, send_event) case status of 0B: ; No qImage widget exists (yet) 1B: return ; Return to event handler to send 'send_event' to 'wid_send' 2B: qView_SetInfo, state, event ; Process QIMAGE_SEND event endcase case qView_GetInfo(state, offset=offset, subdim=subdim, zoom=zoom, box=box, $ zhilo=zhilo, fixz=fixz, zlog=zlog) of 0: begin widget_control, state.wid_data, get_uvalue=data, /no_copy movie = data widget_control, state.wid_data, set_uvalue=data, /no_copy fake_state = [0,0] end 1: begin box = ((box-offset#[1,1]) > 0) < (subdim-1)#[1,1] widget_control, state.wid_data, get_uvalue=data, /no_copy movie = MagnifyArray(data[box[0]:box[2], box[1]:box[3],*], zoom, dims=2) widget_control, state.wid_data, set_uvalue=data, /no_copy fake_state = [fixz, zlog, zhilo] end endcase movie = qImage_cw_MinMax(fake_state, movie, /nostate, /to_byte) sz = size(movie) xinteranimate, set=sz[1:3], group=state.wid_movie for i=0,sz[3]-1 do xinteranimate, frame=i, image=movie[*,*,i] xinteranimate, 10 return & end