pro fx_lct, lutname ;+ ; NAME ; fx_lct ; ; PURPOSE ; Load colormap from disk file. ; ; HISTORY ; 19 April 1995, Andrew L. Stanger ; 3 May 1996: adapt for use with fx.pro procedure. ;- @fx_common ;--- Declare storage variables. IF (n_elements (r_orig) EQ 0) THEN $ BEGIN r_orig = bindgen (256) g_orig = bindgen (256) b_orig = bindgen (256) END if (n_elements (ncolors) EQ 0) THEN ncolors = !d.table_size if (n_elements (cbot) EQ 0) THEN cbot = 0 index = bytarr (256) red = bytarr (256) green = bytarr (256) blue = bytarr (256) r = bytarr (256) g = bytarr (256) b = bytarr (256) c = byte (0) r = byte (0) g = byte (0) b = byte (0) ; --- Read colormap from ASCII file with the format: ; (4I4), index, red, green, blue openr, 1, lutname for i = 0, 255 do $ begin readf, 1, c, r, g, b index (i) = c red (i) = r green (i) = g blue (i) = b endfor close, 1 ; --- Write RGB values to colormap. IF (ncolors NE 256) THEN $ BEGIN p = (LINDGEN (ncolors) * 255) / (ncolors - 1) r = red (p) g = green (p) b = blue (p) END r_orig (cbot) = r g_orig (cbot) = g b_orig (cbot) = b r_curr = r_orig g_curr = g_orig b_curr = b_orig tvlct, r_orig, g_orig, b_orig, cbot ;print, 'fx_lct> size (r_orig): ', size (r_orig) ;print, 'fx_lct> r_orig: ' ;print, r_orig end