User Tools

Site Tools


jvs:cigal:manual:chapter3:map

CIGAL Reference Manual, Chapter 3 (Functions): MAP

MAP -- Copy one variable to another through a lookup table

usage: varb2 = map(varb1,lookuptable,shift)

The MAP command is used to copy an input variable (VARB1) to an output variable (VARB2), using each input value as an index into an array variable (LOOKUPTABLE), and the corresponding array value is then stored as the output value. VARB1 must be of type BYTE or INTEGER. Other data types will generate an error. If the SHIFT argument is specified, then each value in VARB1 will be shifted SHIFT bits to the right (i.e., divided by 2**SHIFT) before being used as an index to the lookup table. If a value in VARB1 is greater than the length of the lookup table, then he highest lookup table value is used.

Negative VARB1 values are replaced by the first entry in the lookup table.

If VARB1 and VARB2 are image processor memories, and your image processor hardware is capable of doing lookup table mapping, then the MAP function will automatically be performed by the hardware. In all other cases, the mapping will be performed by software.

Example:

        declare byte array lut
        lut = 255 - ramp(256)            ; generate: 255 254 253 ... 2 1 0
        @0 = map(@0,lut)                 ; invert image intensities

See Also:
IPROCS(1), LUTS(1), MAKLUT(3), RAMP(3)

CIGAL Home, CIGAL Manual, Functions List, Manual Help

jvs/cigal/manual/chapter3/map.txt · Last modified: 2023/02/23 18:43 (external edit)