| Customize Help
| Save Settings

MgenRamp



Function Map
Synopsis
Generate 2D ramp data into a buffer.
Syntax
void MgenRamp(
MIL_ID BufId, //in
MIL_DOUBLE ScaleX, //in
MIL_DOUBLE ScaleY, //in
MIL_DOUBLE Offset, //in
MIL_INT64 ControlFlag //in
)
Description

This function uses the specified scale factors and offset to generate a 2D ramp (linearly increasing/decreasing data in both X and Y) in the specified buffer. You can specify any MIL buffer, such as an array, image, kernel, LUT, or structuring element buffer.

This function generates the ramp data using the following formula: BufId[x,y] = ScaleX * x + ScaleY * y + Offset.

This function can be useful, for example, to simulate non-uniform lighting in an image (non-uniform lighting is generally approximated by an intensity ramp that is added to the image), or to generate the pixel coordinates of all the pixels of an image.

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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
BufId

Specifies the identifier of the buffer in which to generate values. The buffer must have been previously allocated on the system using MbufAlloc...() with M_ARRAY, M_IMAGE, M_KERNEL, M_LUT, or M_STRUCT_ELEMENT.

If you specify an image buffer, it must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

ScaleX

Specifies the factor by which to scale in X.

ScaleY

Specifies the factor by which to scale in Y.

Offset

Specifies the offset. This corresponds to the value placed in the first location of the buffer.

ControlFlag

Reserved for future expansion and must be set to M_DEFAULT.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.