KPG1_LUTIN

Transfers a lookup table between arrays that have different numbers of colour indices

Description:

This routine transfers a lookup table between arrays that may have different numbers of colour indices. When they are unequal the lookup table is expanded or contracted to fit the destination array. This may be achieved either by linear interpolation or by the nearest-neighbour method. (There are different sizes presumably because the lookup table was created on a device with a differently sized colour table.) If the arrays are of equal size the lookup table is merely copied between them.

Invocation

CALL KPG1_LUTIN( INEL, INARR, OUTEL, NN, OUTARR, STATUS )

Arguments

INEL = INTEGER (Given)
The number of colour indices in the lookup table.
INARR( 3, 0:INEL-1 ) = REAL (Given)
The source lookup table. The first dimension is RGB. Values should lie in the range 0.0–1.0.
OUTEL = INTEGER (Given)
The number of colour indices available in the destination array. This is usually the number of colour indices available on the chosen graphics device.
NN = LOGICAL (Given)
If true, and the number of input and output colour indices are different, the nearest-neighbour method is used for assigning values in the output array. Otherwise linear interpolation is used. Nearest-neighbour preserves sharp edges in the lookup; linear interpolation is recommended for smoothly varying lookup tables.
OUTARR( 3, 0:OUTEL-1 ) = REAL (Returned)
This is the array into which the table is put. The values will all lie in the range 0.0–1.0, even though the input may beyond this range. (Input values below 0.0 become 0.0 in OUTARR, and those above 1.0 become 1.0)
STATUS = INTEGER (Given)
Global status.