Standard Library procedure that linearly expands the range of thecolor table currently loaded to cover an arbitrary range of pixel values.
high The highest pixel value in the selected range; in other words, this is the pixel value that will be the highest color index available on a particular device (normally 255 on an eight-bit plane device). (Default: !D.N_Colors - 1)
For example, the command:
STRETCH, 100, 150
To revert to a normal color table, call STRETCH with no parameters.
mandril = BYTARR(512, 512) OPENR, unit, !Data_dir + 'mandril.img',/Get_lun READU, unit, mandril FREE_LUN, unit
WINDOW, /Free, Colors=128, XSize=512, YSize=512 TVSCL, mandril
LOADCT, 4 COLOR_PALETTE
!Err = 0 WHILE !Err LE 0 DO BEGIN
CURSOR, x, y, /Change, /Normal
range = FIX(y * 128.0 + 5.0)
STRETCH, 64-range, 64+range
ENDWHILE
PRO STRETCH, lo, hi
COMMON colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
t = BYTSCL(INDGEN(256), Min = lo, Max = hi)
TVLCT, r_orig(t), g_orig(t), b_orig(t)
RETURN END
For more information about how to access the three color variables in the color table common block, see Retrieving Information About the Current Color Table in Chapter 11 of the PV-WAVE User's Guide.
For more information about stretching color tables, see Stretching the Color Table in Chapter 11 of the PV-WAVE User's Guide.