; ; CALLING SEQUENCE: image=it_add24(img1,img2[,img3]) ; ; PARAMETERS: img1 and img2 are the centered and scaled 8 bit ; arrays to be combined. Make sure the arrays are ; centered and that the disk sizes are the same or ; that they are already scaled to the same disk ; size. ; ; NOTES: This function combines up to three 8 bit arrays into ; one 24 bit array. Each array is placed, centered ; into one of the three channels of a 3x8x8 array. ; ; HISTORY: Drafted by Tony Darnell 14-AUG-97 ; FUNCTION it_add24,img1,img2,hdu1,hdu2,min1,max1,min2,max2, $ table1,table2,img3=img3 sz1=SIZE(img1) sz2=SIZE(img2) xsz=(sz1(1)>sz2(1)) ysz=(sz1(2)>sz2(2)) IF KEYWORD_SET(img3) THEN sz3=SIZE(img3) xc=xsz/2.0 yc=ysz/2.0 xc1=sz1(1)/2.0 yc1=sz1(2)/2.0 xc2=sz2(1)/2.0 yc2=sz2(2)/2.0 IF KEYWORD_SET(img3) THEN BEGIN xc3=sz3(1)/2.0 yc3=sz3(2)/2.0 ENDIF ;comp=intarr(3,xsz,ysz) ;comp(0,(xc-xc1)>0:xc+xc1-1,(yc-yc1)>0:yc+yc1-1)=img1 ;comp(1,(xc-xc2)>0:xc+xc2-1,(yc-yc2)>0:yc+yc2-1)=img2 ;comp(1,*,*)=img2 ;IF KEYWORD_SET(img3) THEN comp(2,*,*)=img3 xpos1=(0 > xc-xc1) ypos1=(0 > yc-yc1) xpos2=(0 > xc-xc2) ypos2=(0 > yc-yc2) WINDOW,0, /PIXMAP, XSIZE=xsz, YSIZE=ysz, RETAIN=2 DEVICE,SET_GRAPHICS_FUNCTION=7 ;load_lut,'blue_white_cp.lut',mn=70,mx=170 ;load special color table for MKIII IF (table1 EQ 1) THEN $ load_lut,'blue_white_cp.lut',mn=min1,mx=max1 $ ELSE BEGIN LOADCT,table1 STRETCH,min1,max1 ENDELSE TVLCT,r,g,b,/GET ;TVLCT,r_curr,g_curr,b_curr ;loadct,1 ;load color table for image 1 ;loadct,3 ;STRETCH,10,170 TVSCL,img1,xpos1,ypos1 ;loadct,8 ;STRETCH,0,215 IF (table2 EQ 1) THEN $ load_lut,'blue_white_cp.lut', mn=min2,mx=max2 $ ELSE BEGIN loadct,table2 STRETCH,min2,max2 ENDELSE TVLCT,r,g,b,/GET TVSCL,img2,xpos2,ypos2 ;tiffscreen,'test.tif' ;final_img=TVRD(TRUE = 1) DEVICE,SET_GRAPHICS_FUNCTION=3 WINDOW,1,XSIZE=(sz1(1)>sz2(1)), YSIZE=(sz1(2)>sz2(2)),RETAIN=2, /FREE DEVICE,COPY=[0,0,xsz,ysz,0,0,0] final_img=TVRD(TRUE=1) ;WRITE_JPEG,'/bail/d/tdarnell/test.jpg',final_img,TRUE=1 ;TIFF_WRITE,'/bail/d/tdarnell/test.tif',REVERSE(final_img,3),1 WRITE_TIFF,'test.tif',final_img RETURN,final_img END