Impact Acquire SDK Java
ImageBufferDesc Class Reference

A wrapper class to handle mvIMPACT.acquire.ImageBuffer structures. More...

Public Member Functions

ImageBufferDesc clone ()
 Returns a deep copy of the mvIMPACT.acquire.ImageBuffer object referenced by this descriptor.
 
int copy (byte[] pDst)
 Returns a deep copy of the data buffer of the underlying mvIMPACT.acquire.ImageBuffer object referenced by this descriptor.
 
synchronized void delete ()
 
ImageBuffer getBuffer ()
 Grants access to the underlying mvIMPACT.acquire.ImageBuffer structure managed by this object.
 
 ImageBufferDesc (ImageBufferDesc source)
 Constructs a new mvIMPACT.acquire.ImageBufferDesc from an existing one.
 
 ImageBufferDesc (int channelCount)
 Constructs a new mvIMPACT.acquire.ImageBufferDesc object with channelCount channel specific data elements.
 
 ImageBufferDesc (int pixelFormat, int width, int height)
 Constructs a new mvIMPACT.acquire.ImageBufferDesc object and allocates all memory needed.
 
 ImageBufferDesc (String fileName)
 Constructs a new mvIMPACT.acquire.ImageBufferDesc object from a file and allocates all memory needed.
 
 ImageBufferDesc (String fileName, int fileFormat)
 Constructs a new mvIMPACT.acquire.ImageBufferDesc object from a file and allocates all memory needed.
 
int save (String fileName)
 Stores the complete data of one ImageBuffer structure into a file.
 
int save (String fileName, int format)
 Stores the complete data of one ImageBuffer structure into a file.
 

Protected Member Functions

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

Static Protected Member Functions

static long swigRelease (ImageBufferDesc obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

A wrapper class to handle mvIMPACT.acquire.ImageBuffer structures.

This class acts as a simple wrapper to handle mvIMPACT.acquire.ImageBuffer structures. When using this class the user is no longer responsible for the memory management of mvIMPACT.acquire.ImageBuffer structures.

Instances of this class are reference counted. Memory is freed once the last instance to it is destroyed. For details read the corresponding sections in the documentation of the various constructors and function belonging to this class.

Constructor & Destructor Documentation

◆ ImageBufferDesc() [1/6]

ImageBufferDesc ( long cPtr,
boolean cMemoryOwn )
protected

◆ ImageBufferDesc() [2/6]

Constructs a new mvIMPACT.acquire.ImageBufferDesc from an existing one.

The image buffer associated with this descriptor will not be copied! The internal data will be reference counted and changing this new object will also affect the original one. The internal data is freed when the last descriptor referencing the image is destroyed.

Parameters
source[in] The source buffer descriptor.

◆ ImageBufferDesc() [3/6]

ImageBufferDesc ( int channelCount)

Constructs a new mvIMPACT.acquire.ImageBufferDesc object with channelCount channel specific data elements.

This constructor does NOT allocate memory for the actual pixel data but only for the a structure describing an image.

When passing invalid values to this constructor (e.g. a negative value for channelCount) an exception will be thrown.

Parameters
channelCount[in] The number of channel specific data elements to allocate memory for.

◆ ImageBufferDesc() [4/6]

ImageBufferDesc ( int pixelFormat,
int width,
int height )

Constructs a new mvIMPACT.acquire.ImageBufferDesc object and allocates all memory needed.

This constructor will allocate and handle a new and complete ImageBuffer object including memory for the pixel data for the given pixel format.

The size(in bytes) of allocated pixel memory will depend on the pixelFormat as well as on the parameters width and height. mvIMPACT.acquire.ImageBuffer.iSize will return the amount of memory allocated for the buffer.

When passing invalid values to this constructor (e.g. a negative value for height) an exception will be thrown.

Parameters
pixelFormat[in] The desired pixel format for the new mvIMPACT.acquire.ImageBuffer object handled by this descriptor.
width[in] The width of the new mvIMPACT.acquire.ImageBuffer object handled by this descriptor.
height[in] The height of the new mvIMPACT.acquire.ImageBuffer object handled by this descriptor.

◆ ImageBufferDesc() [5/6]

ImageBufferDesc ( String fileName,
int fileFormat )

Constructs a new mvIMPACT.acquire.ImageBufferDesc object from a file and allocates all memory needed.

This constructor will allocate and handle a new and complete ImageBuffer object including memory for the pixel data for the given pixel format. The buffer will be filled with the data from the file referenced by fileName.

Note
Internally The FreeImage library (see 'legal notice' section) is used for this operation. If the library cannot be located in version 3.18.0 or 3.16.0 on the host system calling this constructor will fail and an exception will be thrown.
Since
2.23.0
Parameters
fileName[in] The name of the file to load.
fileFormat[in] The format of the file to load.

◆ ImageBufferDesc() [6/6]

ImageBufferDesc ( String fileName)

Constructs a new mvIMPACT.acquire.ImageBufferDesc object from a file and allocates all memory needed.

This constructor will allocate and handle a new and complete ImageBuffer object including memory for the pixel data for the given pixel format. The buffer will be filled with the data from the file referenced by fileName.

Note
Internally The FreeImage library (see 'legal notice' section) is used for this operation. If the library cannot be located in version 3.18.0 or 3.16.0 on the host system calling this constructor will fail and an exception will be thrown.
Since
2.23.0
Parameters
fileName[in] The name of the file to load.

Member Function Documentation

◆ clone()

ImageBufferDesc clone ( )

Returns a deep copy of the mvIMPACT.acquire.ImageBuffer object referenced by this descriptor.

This function will create a deep copy of the mvIMPACT.acquire.ImageBuffer object referenced by this descriptor. Afterwards modifying one of the images will NOT influence the other one.

Returns
A deep copy of the mvIMPACT.acquire.ImageBuffer object referenced by this descriptor.

◆ copy()

int copy ( byte[] pDst)

Returns a deep copy of the data buffer of the underlying mvIMPACT.acquire.ImageBuffer object referenced by this descriptor.

This function will create a deep copy of the data buffer of the mvIMPACT.acquire.ImageBuffer object referenced by this descriptor. Afterwards modifying one of the buffers will NOT influence the other one.

Since
2.36.0
Returns
The buffer size needed for pDst if dstSize was too small or the size used if the operation was successful.
Parameters
pDstA pointer to the buffer to copy the data into. Can be 0 if just the size needed shall be queried.

◆ delete()

synchronized void delete ( )

◆ finalize()

void finalize ( )
protected

◆ getBuffer()

ImageBuffer getBuffer ( )

Grants access to the underlying mvIMPACT.acquire.ImageBuffer structure managed by this object.

Returns
A pointer to the mvIMPACT.acquire.ImageBuffer object referenced by this descriptor.

◆ save() [1/2]

int save ( String fileName)

Stores the complete data of one ImageBuffer structure into a file.

This function stores the image described by a mvIMPACT.acquire.ImageBuffer structure pointed to by the pBuffer variable into a file.

Note
Internally The FreeImage library (see 'legal notice' section) is used for this operation. If the library cannot be located in version 3.18.0 or 3.16.0 on the host system calling this function will fail.
Since
2.23.0
Returns
Parameters
fileName[in] The full path of the file to create.

◆ save() [2/2]

int save ( String fileName,
int format )

Stores the complete data of one ImageBuffer structure into a file.

This function stores the image described by a mvIMPACT.acquire.ImageBuffer structure pointed to by the pBuffer variable into a file.

Note
Internally The FreeImage library (see 'legal notice' section) is used for this operation. If the library cannot be located in version 3.18.0 or 3.16.0 on the host system calling this function will fail.
Since
2.23.0
Returns
Parameters
fileName[in] The full path of the file to create.
format[in] The format of the file to be created. If this parameter is set to mvIMPACT.acquire.TImageFileFormat.iffAuto make sure to specify a proper file extension.

◆ swigRelease()

static long swigRelease ( ImageBufferDesc obj)
staticprotected

Member Data Documentation

◆ swigCMemOwn

transient boolean swigCMemOwn
protected