| Customize Help
| Save Settings

MbufPutLine



Function Map
Synopsis
Write a specified series of values along a specified theoretical line in an image.
Syntax
void MbufPutLine(
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
const void *UserArrayPtr //in
)
Description

This function reads pixel values from a user-defined array and writes them to the series of pixels, in the specified image, along the theoretical line defined by specified coordinates. The Bresenham algorithm is used to determine the theoretical line. The line can start and end outside of the buffer. The first pixel value in the array will be written to the first valid pixel in the buffer. If the user-array contains more entries than there are valid pixels on the theoretical line in the buffer, the excess entries will be ignored. If the user-array is smaller than the number of valid pixels on the theoretical line, an error will occur.

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 destination image buffer. This must be a single-band (monochrome) buffer.

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

StartX

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

StartY

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

EndX

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

EndY

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

Mode

Specifies the operation mode. Reserved for future expansion. This parameter must be set to M_DEFAULT.

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 MbufPutLine() with UserArrayPtr set to M_NULL. The array size is stored in the NbPixelsPtr parameter. Note: The array size is determined by calling the function twice.

Specifies the address of the user array containing the pixels to write to the image buffer. Ensure that the user array is at least as large as the value returned by NbPixelsPtr. To determine the number of pixel values required, you can set this parameter to M_NULL and pass a non-null address to NbPixelsPtr, which will store the size of the required array. In this case, nothing is written to the image buffer.

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