imaqGetLine

NI Vision for LabWindows/CVI Function

imaqGetLine

Usage

void* imaqGetLine(const Image* image, Point start, Point end, int* numPoints);

Purpose

Returns the pixel values along a given line in an image. If the starting or ending point of the line is outside the image, the line clips at the last visible pixel.

Image Types Supported

IMAQ_IMAGE_U8, IMAQ_IMAGE_U16, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64

Parameters

Name

Type

Description

image const Image* The image containing a line whose pixels the function returns.
start Point The coordinate location of the starting point of the line.
end Point The coordinate location of the ending point of the line.
numPoints int* The number of elements in the returned array. Set this parameter to NULL if you do not need this information.

Return Value

Type

Description

void* On success, this function returns the values of the pixels along the given line in the image. The type of array the function returns depends on the image type, as follows:

Image Type Array Type
IMAQ_IMAGE_U8 unsigned char
IMAQ_IMAGE_U16 unsigned short
IMAQ_IMAGE_I16 short
IMAQ_IMAGE_SGL float
IMAQ_IMAGE_RGB RGBValue structures
IMAQ_IMAGE_HSL HSLValue structures
IMAQ_IMAGE_RGB_U64 RGBU64Value structures


On failure, this function returns NULL. To get extended error information, call imaqGetLastError(). When you are finished with the array, dispose of it by calling imaqDispose().