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.

Color Tables

Number

Name

0

Black and White Linear

1

Blue/White

2

Green/Red/Blue/White

3

Red Temperature

4

Blue/Green/Red/Yellow

5

Standard Gamma-II

6

Prism

7

Red/Purple

8

Green/White Linear

9

Green/White Exponential

10

Green/Pink

11

Blue/Red

12

16 Level

13

16 Level II

14

Steps

15

PV‑WAVE Special

16

Black and White Reversed

 

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

GET_NAMED_COLOR

In the (Undefined variable: pvwave.waveur): LOADCT