IMAQ GetImagePixelPtr VI

LabView NI Vision

IMAQ GetImagePixelPtr VI

Owning Palette: External Library SupportInstalled With: NI Vision Development Module

Obtains a pointer on the pixels of an image. This VI also returns information on the organization of the image pixels in memory. Example of IMAQ GetImagePixelPtr.

Details

IMAQ GetImagePixelPtr

cenum.gif

Function specifies the method the VI uses to get pixel pointer information. The following options are available:

Map Pixel Pointer (0)

Obtains the pointer on a pixel of an image and obtains information related to the organization of the pixels of this image in memory.

Unmap Pixel Pointer (1)

Frees the pointer and related information previously obtained using Map Pixel Pointer.

Get Pixels Infos (2)

Obtains information related to the organization of the pixels of an image in memory without mapping a pointer.

cgenclasstagrefflat.gif

Image is a reference to the source image.

ci32.gif

X Coordinate allows you to select the X coordinate of the pixel in the image on which the pointer is required. This parameter is not used in the Unmap Pixel Pointer mode. The default is 0.

ci32.gif

Y Coordinate allows you to select the Y coordinate of the pixel in the image on which the pointer is required. This parameter is not used in the Unmap Pixel Pointer mode. The default is 0.

cerrcodeclst.gif

error in (no error) describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

cbool.gif

status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.

ci32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

cstr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

cu32.gif

Pixel Pointer in is used only when Function is set to Unmap Pixel Pointer mode. When the VI is executed to obtain a pointer using the Map Pixel Pointer function, some information regarding the pointer that is required to unmap the pixel pointer is recorded.

Note  You need to give this pointer to the VI to retrieve this information when executing the Unmap Pixel Pointer function.
ii32.gif

Image Border Size is the border size of the image.

iu32.gif

Pixel Pointer out is the pointer on the pixels of the image. This pointer is obtained only in the Map Pixel Pointer mode.

ii32.gif

LineWidth(Pixels) returns the total number of pixels in a horizontal line in the image. This is the sum of the xRes of the image, the borders of the image, and the left and right alignments of the image, as shown in the following figure. This number may not match the horizontal size of the image.

ii32.gif

Pixel Size (Bytes) returns the size, in bytes, of each pixel in the image. This value multiplied with the LineWidth gives the number of bytes occupied by a line of the image in memory.

ierrcodeclst.gif

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.

ibool.gif

status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

ii32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

istr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

ii32.gif

Transfer Max Size returns the number of bytes from the pixel pointer to the end of the image. This size represents the maximum size of bytes that can be transferred. For example, for an 8-bit image of size 256 × 256 and border 1, the line width is 288, and the maximum transfer size from pixel (0, 0) is 73,728 bytes. Images are 32-byte aligned.

Note  Pixel (0, 0) is located at the top, left corner of the image.

Details

Refer to IMAQ GetImagePixelPtr Example for a typical implementation scheme of this VI.