MbufGetLine()函数

Synopsis

Read the pixels of a theoretical line between specified coordinates, count them, and store them in a user-defined array.

Format

void MbufGetLine(ImageBufId, StartX, StartY, EndX, EndY, Mode, NumPixelsPtr, UserArrayPtr)

MIL_ID ImageBufId; Image buffer identifier
long StartX; X start position of the line
long StartY; Y start position of the line
long EndX; X end position of the line
long EndY; Y end position of the line
long Mode; Operation mode
long *NumPixelsPtr; Number of pixels
void *UserArrayPtr; Destination user array

Description

This function reads a series of pixels between specified coordinates (theoretical line) of a specified source image and stores the pixels in a user-defined array. The Bresenham algorithm is used to determine the theoretical line.

The ImageBufId parameter specifies the identifier of the source image buffer. This must be a single-band (monochrome) buffer.

The StartX and StartY parameters specify the horizontal and vertical offsets (in pixels) of the starting position of the line, relative to the top-left corner pixel of the source buffer.

The EndX and EndY parameters specify the horizontal and vertical offsets (in pixels) of the finishing position of the line, relative to the top-left corner pixel of the source buffer.

The Mode parameter specifies the operation mode. This parameter must be set to M_DEFAULT.

The NumPixelsPtr parameter specifies the address of the variable in which to store the number of pixels occurring along the theoretical line. If set to M_NULL, no number is calculated.

The UserArrayPtr parameter specifies the address of the user array in which to store the pixels from the image buffer. Ensure that the user array is large enough to accommodate the data to be stored. MbufGetLine assumes that the array is of the same data type as the source buffer. If this parameter is set to M_NULL, the pixels are not actually read but the number of pixels to be read is calculated and stored in the NumPixelsPtr variable.

See also

MbufPutLine

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

评论已关闭。