| Customize Help
| Save Settings

MbufGetLine



Function Map
Synopsis
Read the pixels along a specified theoretical line, count the pixels, and store either their values or coordinates in a user-defined array.
Syntax
void MbufGetLine(
MIL_ID ImageBufId, //in
MIL_INT StartX, //in
MIL_INT StartY, //in
MIL_INT EndX, //in
MIL_INT EndY, //in
MIL_INT64 Mode, //in
MIL_INT *NbPixelsPtr, //out
void *UserArrayPtr //out
)
Description

This function reads the series of pixels along a theoretical line (defined by coordinates) from an image and stores either their values or the X/Y coordinates of each value in a user-defined array. The Bresenham algorithm is used to determine the theoretical line. The line can start and end outside of the buffer, but only pixel values/coordinates within the buffer are store in the user-defined array.

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

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
ImageBufId

Specifies the identifier of the source image buffer. This must be a single-band (monochrome) buffer.

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

StartX

Specifies the horizontal pixel offset of the starting position of the line, relative to the top-left pixel of the source buffer.

StartY

Specifies the vertical pixel offset of the starting position of the line, relative to the top-left pixel of the source buffer.

EndX

Specifies the horizontal pixel offset of the finishing position of the line, relative to the top-left pixel of the source buffer.

EndY

Specifies the vertical pixel offset of the finishing position of the line, relative to the top-left pixel of the source buffer.

Mode

Specifies the operation mode.

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

Specifies to read or count the pixels along a specified theoretical line and store their values in a user-defined array.

Click to summarize M_POSITION_X

Specifies to read the pixels along a specified theoretical line and store the X-coordinates of the pixels along that line in a user-defined array of integer values.

Click to summarize M_POSITION_Y

Specifies to read the pixels along a specified theoretical line and store the Y-coordinates of the pixels along that line in a user-defined array of integer values.

NbPixelsPtr

Specifies the address of the variable in which to write the number of pixels found along the theoretical line. You can set this parameter to M_NULL if you don't want this value to be evaluated.

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

UserArrayPtr
Accepts the following address:
  • Data type: array of the same type as the buffer (ImageBufId) [optionally, in C++: a reference to a std::vector of the same type as the buffer]
    Required array size:Call MbufGetLine() with UserArrayPtr set to M_NULL. The array size is stored in the NbPixelsPtr parameter. Note: When retrieving the pixels

  • Data type: array of type MIL_INT [optionally, in C++: a reference to a std::vector<MIL_INT> ]
    Required array size:Call MbufGetLine() with UserArrayPtr set to M_NULL. The array size is stored in the NbPixelsPtr parameter. Note: When retrieving the position.

Specifies the address of the user array in which to store the pixels or the coordinates from the image buffer. Ensure that the user array is large enough to receive the data to be stored. To determine the required size of the array, you can set this parameter to M_NULL and pass a non-null address to NbPixelsPtr, which will store the required size of the array. In this case, nothing is read from the image buffer.

Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
NONE RASTER DEFAULT POSITION X POSITION Y DEFAULT DEFAULT