JWAVE_LOADCT Procedure
Loads a predefined color table.
Usage
JWAVE_LOADCT, table_num
Input Parameters
table_number—A number between 0 and 16; each number is associated with a predefined color table. You must set this parameter in the client application with the JWaveView.setParam method.
Input Keywords
Silent—If nonzero, suppresses the message indicating that the color table is being loaded.
Output Keywords
Range_Of_Colors—Retrieves the a 2-element array containing the range of colors that are available for use by images. The first element represents the first color in the range, and the second element represents the last color. This range is equivalent to the number of colors in the color table minus the number of named colors that have been retrieved with GET_NAMED_COLORS. See the Discussion for information on how this keyword is used.
Discussion
The color tables associated with JWAVE wrappers are subsetted into two parts. First, all of the colors retrieved by GET_NAMED_COLORS are stored in the color table. Then, when JWAVE_LOADCT is called, the remaining color table positions are filled with colors from the specified color table.
note | Call GET_NAMED_COLOR before calling JWAVE_LOADCT. This ensures that the colors retrieved by GET_NAMED_COLOR will be stored in the color table. The JWAVE_LOADCT procedure stores colors in the remaining color table positions. |
Predefined color tables are stored in the file
colors.tbl. There are 17 predefined color tables, with indices ranging from 0 to 16, as shown in
Color Tables.
note | Values returned by the Range_Of_Colors keyword in previous calls to GET_NAMED_COLOR may no longer be valid. Use the value of the Range_Of_Colors keyword from the last call to either GET_NAMED_COLOR or JWAVE_LOADCT. |
Examples
This example demonstrates the use of the Range_Of_Colors keyword. The color table range returned by Range_Of_Colors is used in a BYTSCL call to “smooth” the image portion of the color table.
; Retrieve a color. This color is stored in the color table.
lc = GET_NAMED_COLOR('LINE', DefaultRGB='FFFFFF'xL)
; Load a color table. These colors are loaded into the remaining
; positions of the color table.
JWAVE_LOADCT, 15, Range_Of_Colors=range
; Byte scale range of colors that were stored in ”image” portion
; of the color table.
TV, BYTSCL(my_image, Top=range(1)-range(0)) + range(0)
; Make a plot using the color retrieved by GET_NAMED_COLOR.
PLOTS, overlay_data, Color=lc
See Also
In the PV‑WAVE Reference: LOADCT
Version 3.6
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.