TVSCL Procedure
The TVSCL procedure scales the intensity values of Image into the range of the Direct Graphics image display device and outputs the data to the image display at the specified location. The array is scaled so the minimum data value becomes 0 and the maximum value becomes the maximum number of available colors (held in the system variable !D.TABLE_SIZE) as follows:
where the maximum and minimum are found by scanning the array. The parameters and keywords of the TVSCL procedure are identical to those accepted by the TV procedure. For additional information about each parameter, consult the description of TV.
Examples
Display a floating-point array as an image using the TV command:
TV, DIST(200)
Note that the image is not easily visible because the values in the array have not been scaled into the full range of display values. Now display the image with the TVSCL command by entering:
TVSCL, DIST(200)
Notice how much brighter the image appears.
Syntax
TVSCL, Image [, Position] [, /CENTIMETERS] [, /INCHES] [, /NAN] [, /ORDER] [, TOP=value] [, TRUE={1 | 2 | 3}] [, /WORDS] [, XSIZE=value] [, YSIZE=value]
or
TVSCL, Image [, X, Y [, Channel] [, /CENTIMETERS] [, /INCHES] [, /NAN] [, /ORDER] [, TOP=value] [, TRUE={1 | 2 | 3}] [, /WORDS] [, XSIZE=value] [, YSIZE=value]]
Graphics Keywords: [, CHANNEL=value] [, /DATA | , /DEVICE | , /NORMAL] [, /T3D] [, Z=value]
Note: The T3D and Z keywords are only honored when the DATA keyword is also set. Note also that when the T3D keyword is set, the X and Y arguments and the Z keyword position the lower left corner of the image displayed by TVSCL, but do not change its orientation. Use the POLY_2D routine to warp the image into 3D space.
Arguments
Image
A two-dimensional array to be displayed as an image. If this argument is not already of byte type, it is converted prior to use.
X, Y
If X and Y are present, they specify the lower left coordinate of the displayed image.
Position
Image position. See the discussion of Position under TV Procedure for a full description.
Channel
Some image display devices are capable of storing more than a single image or can combine three single color images to form a TrueColor image. Channel specifies the memory channel to be written. It is assumed to be zero if not specified. This parameter is ignored on display systems that have only one memory channel. The Channel argument is identical to the CHANNEL graphics keyword.
Keywords
CENTIMETERS
Set this keyword to indicate that the X, Y, Xsize, Ysize, and Z arguments are given in centimeters from the origin. This system is useful when working with devices, such as PostScript printers, that do not provide a direct relationship between image pixels and the size of the resulting image.
INCHES
Set this keyword to indicate that all position and size values are given in inches from the origin. This system is useful when working with devices, such as PostScript printers, that do not provide a direct relationship between image pixels and the size of the resulting image.
NAN
Set this keyword to cause TVSCL to treat elements of Image that are not numbers (that is, elements that have the special IEEE floating-point values Infinity or NaN) as missing data, and display them using color index 0 (zero). Note that color index 0 is also used to display elements that have the minimum value in the Image array.
ORDER
If specified, ORDER overrides the current setting of the !ORDER system variable for the current image only. If set, the image is drawn from the top down instead of the normal bottom up.
TOP
The maximum value of the scaled result. If TOP is not specified, !D.TABLE_SIZE-1 is used. Note that the minimum value of the scaled result is always 0.
TRUE
Set this keyword to a nonzero value to indicate that a TrueColor (16-, 24-, or 32-bit) image is to be displayed. The value assigned to TRUE specifies the index of the dimension over which color is interleaved. The image parameter must have three dimensions, one of which must be equal to three. For example, set TRUE to 1 to display an image that is pixel interleaved and has dimensions of (3, m, n). Specify 2 for row-interleaved images, of size (m, 3, n), and 3 for band-interleaved images of the form (m, n, 3).
WORDS
Set this keyword to indicate that words (short integers) instead of 8-bit bytes are to be transferred to the device. This keyword is valid only when using devices that can transfer 16-bit pixels. The normal transfer uses 8-bit pixels. If this keyword is set, the Image parameter is converted to short integer type, if necessary, and then written to the display.
XSIZE
The width of the resulting image. On devices with scalable pixel size (such as PostScript), if XSIZE is specified the image will be scaled to fit the specified width. If neither XSIZE nor YSIZE is specified, the image will be scaled to fill the plotting area, while preserving the image’s aspect ratio. This keyword is ignored by pixel-based devices that are unable to change the size of their pixels.
YSIZE
The height of the resulting image. On devices with scalable pixel size (such as PostScript), if YSIZE is specified the image will be scaled to fit the specified height. If neither XSIZE nor YSIZE is specified, the image will be scaled to fill the plotting area, while preserving the image’s aspect ratio. This keyword is ignored by pixel-based devices that are unable to change the size of their pixels.
Thread Pool Keywords
This routine is written to make use of IDL’s thread pool, which can increase execution speed on systems with multiple CPUs. The values stored in the !CPU system variable control whether IDL uses the thread pool for a given computation. In addition, you can use the thread pool keywords TPOOL_MAX_ELTS, TPOOL_MIN_ELTS, and TPOOL_NOTHREAD to override the defaults established by !CPU for a single invocation of this routine.
Version History
Original |
Introduced |
See Also
ERASE Procedure, SLIDE_IMAGE Procedure, TV Procedure, WIDGET_DRAW, WRITE_BMP, and the DECOMPOSED keyword to the DEVICE Procedure routine