IMAQ GetImagePixelPtr VI
Owning Palette: External Library SupportInstalled With: NI Vision Development ModuleObtains 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.
Function specifies the method the VI uses to get pixel pointer information. The following options are available:
|
|||||||
Image is a reference to the source image. |
|||||||
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. |
|||||||
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. |
|||||||
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.
|
|||||||
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.
|
|||||||
Image Border Size is the border size of the image. |
|||||||
Pixel Pointer out is the pointer on the pixels of the image. This pointer is obtained only in the Map Pixel Pointer mode. |
|||||||
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. |
|||||||
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. |
|||||||
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.
|
|||||||
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.
|
Details
Refer to IMAQ GetImagePixelPtr Example for a typical implementation scheme of this VI.