| Customize Help
| Save Settings

MbufGetList



Function Map
Synopsis
Read the values in the source buffer, at the specified positions, and place their values in a user-defined array.
Syntax
void MbufGetList(
MIL_ID SrcBufId, //in
MIL_INT NumPixels, //in
const MIL_DOUBLE *PixXArrayPtr, //in
const MIL_DOUBLE *PixYArrayPtr, //in
MIL_INT64 InterpolationMode, //in
void *UserArrayPtr //out
)
Description

This function reads the values in the source buffer, at the specified positions, and places their values in a user-defined array.

If the source buffer is compressed, MIL decompresses the data before copying it to the user-supplied array.

When executing the operation on a buffer that has multiple bands, the red band is read first; the red values at the specified positions are placed in the first third of the user-defined array. Then, the green band is read; the green values at the specified positions are placed in the second third of the user-defined array (immediately following the red values). Finally, the blue band is read; the blue values at the specified positions are placed in the last third of the user-defined array (immediately following the green values). For example, if you want to read 3 pixels, the function will store the red band of each pixel, then the green band, and finally the blue band (RRR, GGG, BBB not RGB, RGB, RGB).

Note that if the source buffer has multiple bands, its format should match the implicit format of the user array (that is, planar RGB); otherwise an internal conversion has to be done (from the source to a temporary buffer) before executing the operation using the temporary buffer. Likewise, if the source buffer is compressed, an internal decompression has to be done (from the source to a temporary buffer) before executing the operation using the temporary buffer.

Note that when using a C compiler (not a C++ or other compiler), it is suggested to use the type-specific versions of this particular function, rather than the standard function prototype at the top of this page. An exhaustive list of type-specific versions of this function can be found at the bottom of this page.
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
SrcBufId

Specifies the identifier of the source buffer. This buffer can be a single-band (monochrome) or multi-band buffer and is not limited to image buffers.

If the specified buffer is an image buffer with an associated region of interest (ROI), an error will occur.

NumPixels

Specifies the number of values to get.

When using a standard vector (std::vector) overload function in C++, you can pass M_DEFAULT to this parameter and MIL will automatically determine the size based on the number of items in the vector passed to the PixXArrayPtr or PixYArrayPtr parameter.

PixXArrayPtr
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(NumPixels)

Specifies the address of an array containing the X-position corresponding to the pixels to get.

PixYArrayPtr
Accepts the address of one of the following:
  • array of type MIL_DOUBLE [optionally, in C++: a reference to a constant std::vector<MIL_DOUBLE> ] (and a maximum array rank for C# of 1)
    Required array size:(NumPixels)

Specifies the address of an array containing the Y-position corresponding to the pixels to get.

InterpolationMode

Specifies the interpolation mode. The specified mode controls how the function behaves with non-integer positions.

This parameter must be set to one of the values below.

function map For specifying the interpolation mode
Click to summarizeValue Description
Click to summarize M_DEFAULT

Same as M_NEAREST_NEIGHBOR with M_OVERSCAN_ENABLE.

Click to summarize M_BICUBIC +

Specifies bicubic interpolation. The value placed in the user-defined array is determined by taking a weighted average of the 16 values (4x4) that surround the specified position. Note that the sum of the weights used for bicubic interpolation might be greater than one. If this occurs and the result reflects an overflow or underflow, the result is saturated according to the depth and data type of the array.

(summarize)
Click to summarize M_BILINEAR +

Specifies bilinear interpolation. The value placed in the user-defined array is determined by taking a weighted average of the 4 values (2x2) that surround the specified position.

(summarize)
Click to summarize M_NEAREST_NEIGHBOR +

Specifies nearest neighbor interpolation. The value placed in the user-defined array is that of the value of the pixel closest to the specified position.

(summarize)
Combination values for the values listed in For specifying the interpolation mode.

You can add one of the following values to the above-mentioned values to determine how the function behaves with positions that fall outside the source buffer.

function map For overscan
Click to summarizeCombination value Description
Click to summarize M_OVERSCAN_CLEAR

Sets the destination position to 0, if the associated point falls outside the source buffer.

Click to summarize M_OVERSCAN_DISABLE

Leaves the destination position as is, if the associated point falls outside the source buffer.

Click to summarize M_OVERSCAN_ENABLE

Uses the values of the source buffer's ancestor buffer, if the associated point falls outside the source buffer. If the source buffer is not a child buffer or if the point falls outside the ancestor buffer, it leaves the destination point as is.

(summarize)
UserArrayPtr
Accepts the following address:

Specifies the address of a user-defined array in which the values are placed. The data type of this array must match the data type of the source buffer. Its number of entries is determined by the number of values to get and also by the number of bands of the source buffer.

Type-specific versions of the function when using a C compiler
void MbufGetListDouble (MIL_ID SrcBufId, MIL_INT NumPixels, const MIL_DOUBLE *PixXArrayPtr, const MIL_DOUBLE *PixYArrayPtr, MIL_INT64 InterpolationMode, void *UserArrayPtr)
Parameters

SrcBufId

See SrcBufId of the main function for a description.

NumPixels

See NumPixels of the main function for a description.

PixXArrayPtr

See PixXArrayPtr of the main function for a description.

PixYArrayPtr

See PixYArrayPtr of the main function for a description.

InterpolationMode

See InterpolationMode of the main function for a description.

UserArrayPtr

See UserArrayPtr of the main function for a description.

void MbufGetListInt32 (MIL_ID SrcBufId, MIL_INT NumPixels, const MIL_INT32 *PixXArrayPtr, const MIL_INT32 *PixYArrayPtr, MIL_INT64 InterpolationMode, void *UserArrayPtr)
Parameters

SrcBufId

See SrcBufId of the main function for a description.

NumPixels

See NumPixels of the main function for a description.

PixXArrayPtr

See PixXArrayPtr of the main function for a description.

PixYArrayPtr

See PixYArrayPtr of the main function for a description.

InterpolationMode

See InterpolationMode of the main function for a description.

UserArrayPtr

See UserArrayPtr of the main function for a description.

void MbufGetListInt64 (MIL_ID SrcBufId, MIL_INT NumPixels, const MIL_INT64 *PixXArrayPtr, const MIL_INT64 *PixYArrayPtr, MIL_INT64 InterpolationMode, void *UserArrayPtr)
Parameters

SrcBufId

See SrcBufId of the main function for a description.

NumPixels

See NumPixels of the main function for a description.

PixXArrayPtr

See PixXArrayPtr of the main function for a description.

PixYArrayPtr

See PixYArrayPtr of the main function for a description.

InterpolationMode

See InterpolationMode of the main function for a description.

UserArrayPtr

See UserArrayPtr of the main function for a description.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
NONE DEFAULT BICUBIC BILINEAR NEAREST NEIGHBOR OVERSCAN CLEAR OVERSCAN DISABLE OVERSCAN ENABLE