| MIL 10 Reference
| Customize Help
| Save Settings

MgenLutFunction



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Previous
Synopsis
Generate data into a LUT buffer using a specified standard mathematical function, or a specified colormap (pseudo-color palette).
Syntax
void MgenLutFunction(
MIL_ID LutBufId, //in
MIL_INT Func, //in
MIL_DOUBLE a, //in
MIL_DOUBLE b, //in
MIL_DOUBLE c, //in
MIL_INT StartIndex, //in
MIL_DOUBLE StartXValue, //in
MIL_INT EndIndex //in
)
Description

This function generates a value for each LUT index according to the specified mathematical function or colormap (pseudo-color palette). When generating values based on a mathematical function, you can limit generation to a specified range of LUT indices (StartIndex to EndIndex inclusive).

The supported mathematical functions take a single variable (x). The StartXValue parameter specifies the initial x value. The remaining entries of the index range are generated by incrementing the value of x by 1 for each index. All results are converted to integer by truncation, except when using a floating-point LUT buffer. Note, if the given parameters cause an overflow or underflow, indeterminate results will be written in the destination LUT.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
LutBufId

Specifies the identifier of the LUT in which to generate values. This parameter must be given a valid LUT buffer identifier, allocated using MbufAlloc1d() or MbufAllocColor() with M_LUT. If the LUT is a multi-band LUT (allocated with MbufAllocColor()), the same data is written to all bands, except when filling the LUT buffer with a colormap. For a LUT buffer allocated with MbufAllocColor(), the buffer height (SizeY parameter) must have been set to a value of 1.

When filling the LUT buffer with a colormap, the buffer must be a 3-band, unsigned or floating-point LUT buffer.

Func

Specifies the mathematical function or colormap to use for calculations.

To fill the LUT using a mathematical function, set this parameter to one of the following:

function map For specifying the mathematical function
CollapseValue Description
Collapse M_COS

Uses the following formula for calculation: a cos (b x) + c . x is considered to be in degrees.

(summarize)
Collapse M_EXP

Uses the following formula for calculation: a bx + c .

Collapse M_LOG

Uses the following formula for calculation: a log b (x) + c .

Collapse M_POWER

Uses the following formula for calculation: a x b + c .

Collapse M_QUAD

Uses the following formula for calculation: a x 2 + b x + c .

Collapse M_SIN

Uses the following formula for calculation: a sin (b x) + c . x is considered to be in degrees.

(summarize)
Collapse M_TAN

Uses the following formula for calculation: a tan (b x) + c . x is considered to be in degrees.

(summarize)

To fill the LUT with a colormap (pseudo-color palette), set this parameter to one of the following:

function map For specifying a colormap
CollapseValue Description
Collapse M_COLORMAP_HOT

Fills the LUT buffer with a hot colormap. This colormap transitions from black, to red, to yellow, and then, to white along the RGB cube as the indices increase. This colormap can be useful for displaying infrared images.

(summarize)
Collapse M_COLORMAP_HUE

Fills the LUT buffer with a hue colormap. This colormap transitions from red, to yellow, to green, to cyan, to blue, to magenta, and then, to red along the edge of the hue circle as the indices increase. This colormap is useful for displaying the hue component of an HSL image.

(summarize)
Collapse M_COLORMAP_JET

Fills the LUT buffer with a jet colormap. This colormap transitions from dark blue, to blue, to cyan, to yellow, to red, and then, to dark red along the RGB cube as the indices increase. This colormap can be useful for displaying 3D elevation maps and thermal imaging.

(summarize)
Collapse M_COLORMAP_SPECTRUM

Fills the LUT buffer with a spectrum colormap. This colormap transitions from red, to yellow, to green, to blue, and then, to violet along the RGB cube as the indices increase. This colormap is a representation of the visual spectrum according to wavelengths. It can also be useful for displaying 3D elevation maps and thermal imaging.

(summarize)
a

Specifies the constant a for the specified mathematical function, if applicable. If filling the LUT with a colormap, set this to M_DEFAULT.

function map For specifying the first constant
CollapseValue Description
Collapse M_DEFAULT

Specifies that this parameter is not used. This setting is only applicable when filling the LUT with a colormap. In this case, this is the only possible option.

(summarize)
Collapse Value

Specifies the first constant's value.

b

Specifies the constant b for the specified mathematical function, if applicable. If filling the LUT with a colormap, set this to M_DEFAULT.

function map For specifying the second constant
CollapseValue Description
Collapse M_DEFAULT

Specifies that this parameter is not used. This setting is only applicable when filling the LUT with a colormap. In this case, this is the only possible option.

(summarize)
Collapse Value

Specifies the second constant's value.

c

Specifies the constant c for the specified mathematical function, if applicable. If filling the LUT with a colormap, set this to M_DEFAULT.

function map For specifying the third constant
CollapseValue Description
Collapse M_DEFAULT

Specifies that this parameter is not used. This setting is only applicable when filling the LUT with a colormap. In this case, this is the only possible option.

(summarize)
Collapse Value

Specifies the third constant's value.

StartIndex

Specifies the first LUT index entry for which to generate values.

function map For specifying the first index
CollapseValue Description
Collapse M_DEFAULT

Specifies the first index entry of the LUT (index 0); this setting is only applicable to colormaps, and is the only possible option.

Collapse Value >= 0

Specifies the first index entry to affect.

StartXValue

Specifies the initial value of x in the mathematical function. If filling the LUT with a colormap, set this to M_DEFAULT.

function map For specifying the initial x value
CollapseValue Description
Collapse M_DEFAULT

Specifies that this parameter is not used. This setting is only applicable to colormaps, and is the only possible option.

(summarize)
Collapse Value

Specifies the first x value to use during calculation.

EndIndex

Specifies the last LUT index entry for which to generate values.

function map For specifying the last index
CollapseValue Description
Collapse M_DEFAULT

Specifies the last index entry of the LUT; this setting is only applicable to colormaps, and is the only possible option.

Collapse StartIndex <= Value <= LUT size -1

Specifies the last index entry to affect.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
COS EXP LOG POWER QUAD SIN TAN COLORMAP HOT COLORMAP HUE COLORMAP JET COLORMAP SPECTRUM DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT