MgenLutFunction()函数

Synopsis

Generate data into a LUT buffer.

Format

void MgenLutFunction(LutBufId, Func, a, b, c, StartIndex, StartXValue, EndIndex)

MIL_ID LutBufId; LUT buffer identifier
long Func; Function to use for calculations
double a; Function constant a
double b; Function constant b
double c; Function constant c
long StartIndex; First LUT index
double StartXValue; Initial X value
long EndIndex; Last LUT index

Description

This function generates data in the specified LUT buffer area (StartIndex to EndIndex inclusive) according to the function specified by Func and using the LUT location index and the StartXValue as the X value in the equation.

The LutBufId parameter specifies the identifier of the LUT in which to generate values. This parameter must be given a valid LUT buffer identifier. Allocate a LUT buffer, using MbufAlloc1d or MbufAllocColor. If the LUT is a multi-band LUT (allocated with MbufAllocColor), the same data is written to all bands.

The Func parameter specifies the function to use for calculations. This parameter can be set to one of the following:? MgenLutFunction

The a, b, c parameters specify function constants. For M_SIN, M_COS, and M_TAN, X is considered to be in degrees. 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.

The StartIndex and EndIndex specify the first and last LUT index entries for which to generate values. The StartIndex value must be less than or equal to the EndIndex value.

The StartXValue parameter specifies the initial value of X in the function.

See also

MgenLutRamp, MbufPut1d, MbufPutColor, MbufAlloc1d, MbufAllocColor

《MgenLutFunction()函数》上有1条评论

评论已关闭。