Impact Acquire SDK Java
ImageBuffer Class Reference

Fully describes a captured image. More...

Public Member Functions

synchronized void delete ()
 
int getIBytesPerPixel ()
 The number of bytes per pixel.
 
int getIChannelCount ()
 The number of channels this image consists of.
 
int getIHeight ()
 The height of the image in pixel or lines.
 
int getISize ()
 The size (in bytes) of the whole image.
 
int getIWidth ()
 The width of the image in pixel.
 
ChannelData getPChannels ()
 A pointer to an array of channel specific image data.
 
int getPixelFormat ()
 The pixel format of this image.
 
SWIGTYPE_p_void getVpData ()
 The starting address of the image.
 
 ImageBuffer ()
 
void setIBytesPerPixel (int value)
 The number of bytes per pixel.
 
void setIChannelCount (int value)
 The number of channels this image consists of.
 
void setIHeight (int value)
 The height of the image in pixel or lines.
 
void setISize (int value)
 The size (in bytes) of the whole image.
 
void setIWidth (int value)
 The width of the image in pixel.
 
void setPChannels (ChannelData value)
 A pointer to an array of channel specific image data.
 
void setPixelFormat (int value)
 The pixel format of this image.
 
void setVpData (SWIGTYPE_p_void value)
 The starting address of the image.
 

Protected Member Functions

void finalize ()
 
 ImageBuffer (long cPtr, boolean cMemoryOwn)
 

Static Protected Member Functions

static long swigRelease (ImageBuffer obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

Fully describes a captured image.

This class serves as a describing structure for captured images.

Constructor & Destructor Documentation

◆ ImageBuffer() [1/2]

ImageBuffer ( long cPtr,
boolean cMemoryOwn )
protected

◆ ImageBuffer() [2/2]

Member Function Documentation

◆ delete()

synchronized void delete ( )

◆ finalize()

void finalize ( )
protected

◆ getIBytesPerPixel()

int getIBytesPerPixel ( )

The number of bytes per pixel.

◆ getIChannelCount()

int getIChannelCount ( )

The number of channels this image consists of.

For an RGB image this value e.g. would be 3. This value defines how many mvIMPACT.acquire.ChannelData structures mvIMPACT.acquire.ImageBuffer.pChannels is pointing to once this structure has been allocated and filled with valid data.

◆ getIHeight()

int getIHeight ( )

The height of the image in pixel or lines.

◆ getISize()

int getISize ( )

The size (in bytes) of the whole image.

This value in connection with mvIMPACT.acquire.ImageBuffer.vpData is sufficient to copy the complete image without having any additional information about it.

◆ getIWidth()

int getIWidth ( )

The width of the image in pixel.

◆ getPChannels()

ChannelData getPChannels ( )

A pointer to an array of channel specific image data.

◆ getPixelFormat()

int getPixelFormat ( )

The pixel format of this image.

This might be important, when the image data needs to be processed or stored in a file or maybe even if the image shall be displayed.

◆ getVpData()

SWIGTYPE_p_void getVpData ( )

The starting address of the image.

This address in connection with mvIMPACT.acquire.ImageBuffer.iSize is sufficient to copy the complete image without having any additional information about it.

Attention
Do NOT use this pointer in Java! It references native, unmanaged memory and cannot be copied directly into a piece of managed Java memory. Use mvIMPACT::acquire::ImageBufferDesc::copy() instead (see code below)!
byte[] data = new byte[pRequest.getImageSize().read()];
pRequest.getImageBufferDesc().copy( data );
Note
It's not always necessary to copy the image data! Each mvIMPACT.acquire.ImageBuffer is an integral part of the mvIMPACT.acquire.Request object returned to the user by a call to the corresponding 'waitFor' function offered by the interface. The data in this mvIMPACT.acquire.ImageBuffer remains valid until the user either unlocks the request buffer or closes the mvIMPACT.acquire.Device again.
By unlocking the mvIMPACT.acquire.Request the user informs the driver, that this mvIMPACT.acquire.Request and the mvIMPACT.acquire.ImageBuffer belonging to that mvIMPACT.acquire.Request is not longer needed by the user. The driver then queues this mvIMPACT.acquire.Request for capturing image data into it once again. However once a mvIMPACT.acquire.Request has been returned to the user, its mvIMPACT.acquire.ImageBuffer can't be overwritten by the driver! Therefore the user can work with, modify, store or copy the data safely until he unlocks the mvIMPACT.acquire.Request again.

◆ setIBytesPerPixel()

void setIBytesPerPixel ( int value)

The number of bytes per pixel.

◆ setIChannelCount()

void setIChannelCount ( int value)

The number of channels this image consists of.

For an RGB image this value e.g. would be 3. This value defines how many mvIMPACT.acquire.ChannelData structures mvIMPACT.acquire.ImageBuffer.pChannels is pointing to once this structure has been allocated and filled with valid data.

◆ setIHeight()

void setIHeight ( int value)

The height of the image in pixel or lines.

◆ setISize()

void setISize ( int value)

The size (in bytes) of the whole image.

This value in connection with mvIMPACT.acquire.ImageBuffer.vpData is sufficient to copy the complete image without having any additional information about it.

◆ setIWidth()

void setIWidth ( int value)

The width of the image in pixel.

◆ setPChannels()

void setPChannels ( ChannelData value)

A pointer to an array of channel specific image data.

◆ setPixelFormat()

void setPixelFormat ( int value)

The pixel format of this image.

This might be important, when the image data needs to be processed or stored in a file or maybe even if the image shall be displayed.

◆ setVpData()

void setVpData ( SWIGTYPE_p_void value)

The starting address of the image.

This address in connection with mvIMPACT.acquire.ImageBuffer.iSize is sufficient to copy the complete image without having any additional information about it.

Attention
Do NOT use this pointer in Java! It references native, unmanaged memory and cannot be copied directly into a piece of managed Java memory. Use mvIMPACT::acquire::ImageBufferDesc::copy() instead (see code below)!
byte[] data = new byte[pRequest.getImageSize().read()];
pRequest.getImageBufferDesc().copy( data );
Note
It's not always necessary to copy the image data! Each mvIMPACT.acquire.ImageBuffer is an integral part of the mvIMPACT.acquire.Request object returned to the user by a call to the corresponding 'waitFor' function offered by the interface. The data in this mvIMPACT.acquire.ImageBuffer remains valid until the user either unlocks the request buffer or closes the mvIMPACT.acquire.Device again.
By unlocking the mvIMPACT.acquire.Request the user informs the driver, that this mvIMPACT.acquire.Request and the mvIMPACT.acquire.ImageBuffer belonging to that mvIMPACT.acquire.Request is not longer needed by the user. The driver then queues this mvIMPACT.acquire.Request for capturing image data into it once again. However once a mvIMPACT.acquire.Request has been returned to the user, its mvIMPACT.acquire.ImageBuffer can't be overwritten by the driver! Therefore the user can work with, modify, store or copy the data safely until he unlocks the mvIMPACT.acquire.Request again.

◆ swigRelease()

static long swigRelease ( ImageBuffer obj)
staticprotected

Member Data Documentation

◆ swigCMemOwn

transient boolean swigCMemOwn
protected