pro SkyDisplay, TermDev, space, rgbo, i, $ tiff8=Tiff8, tiff24=Tiff24, bmp8=Bmp8, bmp24=Bmp24, interleave=Interleave, $ xysize=xysize, stereo=Stereo,left=Left on_error, 2 common SkyDisplaySave, PreviousImage Tiff8 = keyword_set(Tiff8) Tiff24 = keyword_set(Tiff24) Bmp8 = keyword_set(Bmp8) Bmp24 = keyword_set(Bmp24) Stereo = keyword_set(Stereo) Left = keyword_set(Left) Interleave = keyword_set(Interleave) zpix = tvrd() ; 2D byte array zbuf = tvrd(/words,/chan) ; 2D int array: Read depth values from the Z-buffer zpix = voxel_proj(space, rgbo, zpix=zpix, zbuf=zbuf); 3D byte array: true-color image if Interleave then begin case Left of 0: begin PreviousImage = zpix return end 1: begin OddRows = 1+2*indgen(xysize[1]/2) zpix(*,OddRows,*) = PreviousImage(*,OddRows,*) end endcase endif ; The 24-bit Tiff file contains the full 24-bit true color image ; The reduction to an 8-bit pseudo-image is done by COLOR_QUAN. The resulting ; image often has 'dirty' pixels with the wrong colors. ; ; Hijaak Pro can read the 24-bit Tiff files. Adobe Premiere can't. ; For a clean video it is necessary to create 24-bit Tiff files, run them through ; Hijaak Pro and save them as Tiff files. Premiere can read the (clean) Tiff files ; saved by Hijaak. ; The 24-bit Bmp file can be read directly by Premiere, so this is the best way ; to go if a video is required. file = filepath(root=getenv('TUB'),'skyimage'+string(format='(I3.3)',i)) if (1B-Interleave)*Stereo then if Left then file = file+'l' else file = file+'r' set_plot, TermDev reset_colors if Bmp8 then begin file = file+'.bmp' write_bmp, file, color_quan(zpix,3,r,g,b), r,g,b message, /info, 'created: '+file endif else if Bmp24 then begin file = file+'.bmp' write_bmp, file, reverse( transpose(zpix, [2,0,1]) ,1) message, /info, 'created: '+file endif else if Tiff24 then begin ; Writing true-color (24-bit) Tiff-file file = file+'.tif' ; write_tiff, file, red=reverse(zpix[*,*,0],2), gr=reverse(zpix[*,*,1],2), bl=reverse(zpix[*,*,2],2), planarconfig=2 write_tiff, file, red=zpix[*,*,0], gr=zpix[*,*,1], bl=zpix[*,*,2], planarconfig=2 message, /info, 'created: '+file endif else if Tiff8 then begin ; Writing pseudo-color (8-bit) Tiff-file file = file+'.tif' write_tiff, file, reverse( color_quan(zpix,3,r,g,b) ,2), red=r, gr=g, bl=b message, /info, 'created: '+file endif else begin ; set_plot, TermDev twin, /show, xsize=xysize[0], ysize=xysize[1], /nocoordinates, $ center=(1B-Stereo) or Interleave, $ tr =(1B-Interleave)*Stereo*(1B-Left), $ tl =(1B-Interleave)*Stereo*Left if !d.n_colors eq 2L^24 then begin ; True-color display loadct, 0 tv, zpix, true=(where(size(zpix) eq 3))[1] endif else begin ; Convert to 8-bit image for pseudo-display tv, color_quan(zpix,3,r,g,b) tvlct, r,g,b endelse endelse return & end