The STRETCH procedure stretches the image display color tables so the full range runs from one color index to another. The modified colortable is loaded, but the COLORS common block is not changed. The original colortable can be restored by calling STRETCH with no arguments. A colortable must be loaded before STRETCH can be called.

This routine is written in the IDL language. Its source code can be found in the file stretch.pro in the lib subdirectory of the IDL distribution.

Examples


Load the STD GAMMA-II color table by entering:

LOADCT, 5

Create and display an image by entering:

TVSCL, DIST(300)

Now adjust the color table with STRETCH. Make the entire color table fit in the range 0 to 70 by entering:

STRETCH, 0, 70

Notice that pixel values above 70 are now colored white. Restore the original color table by entering:

STRETCH

 

Note: The window-oriented procedures will not work without a window system.

Syntax


STRETCH [, Low, High [, Gamma]] [, /CHOP]

Arguments


Low

The lowest pixel value to use. If this parameter is omitted, 0 is assumed. Appropriate values range from 0 to the number of available colors-1. If no parameters are supplied, the original color tables are restored.

High

The highest pixel value to use. If this parameter is omitted, the number of colors-1 is assumed. Appropriate values range from 0 to the number of available colors-1.

Gamma

An optional Gamma correction factor. If this value is omitted, 1.0 is assumed. Gamma correction works by raising the color indices to the Gamma power, assuming they are scaled into the range 0 to 1.

Keywords


CHOP

Set this keyword to set color indices above the upper threshold to color index 0. Normally, values above the upper threshold are set to the maximum color index.

Version History


Original

Introduced

See Also


GAMMA_CT, H_EQ_CT