imgGrabArea

NI IMAQ Function

imgGrabArea

Usage

rval imgGrabArea(SESSION_ID sid, void** bufAddr, uInt32 waitForNext, uInt32 top, uInt32 left, uInt32 height, uInt32 width, uInt32 rowPixels);

Purpose

Performs a transfer from a continuous acquisition. This function operates similarly to imgGrab, but imgGrabArea only acquires a portion of the image. Call this function only after calling imgGrabSetup.

Parameters

Name Type Direction
sid SESSION_ID input
bufAddr void** input/output
waitForNext uInt32 input
top uInt32 input
left uInt32 input
height uInt32 input
width uInt32 input
rowPixels uInt32 input
rval Int32 output

Parameter Discussion

sid: valid SESSION_ID.

bufAddr: pointer to a pointer to an area of memory in which to store the image. If bufAddr points to a NULL pointer, this call allocates a buffer, acquires an image, and returns the buffer address in the location specified by bufAddr. If bufAddr points to a non-NULL pointer, this function acquires into that buffer.

waitForNext: if zero, the function returns the most recently acquired image. If non-zero, the function waits for and returns the next acquired image.

top: top offset of the first pixel to acquire.

left: left offset of the first pixel to acquire.

height: height of the area to acquire.

width: width of the area to acquire.

rowPixels: total number of pixels in each image line. Passing a zero for this parameter causes the function to ignore the parameter and use the IMG_ATTR_ROWPIXELS attribute instead. Use this parameter for byte alignment or if the image buffer contains a border for image processing.

Return Value

This function returns 0 on success. On failure, this function returns an error code. For more information about the error code, call imgShowError.