dl::IImage Class Referenceabstract

Interface to an DLAPI Image buffer. More...

#include <dlapi.h>

Public Member Functions

virtual unsigned short * getBufferData () const =0
 Returns a pointer to the raw data buffer of the image. More...
 
virtual unsigned int getBufferLength () const =0
 Returns the length in pixels of the raw data buffer of the image. More...
 
virtual TImageMetadata getMetadata () const =0
 Returns the image metadata structure associated with the image. More...
 

Detailed Description

Interface to an DLAPI Image buffer.

This interface provides the user access to an image buffer, along with all relevant metadata associated with said image. The maximum buffer size supported by interface is platform dependent, and is therefore capped at UINT_MAX 16-bit pixels. The buffer contains the camera's pixel data. The default arrangement of this buffer is a 16-byte x-index by y-index array where the index of the buffer is equal to:

\(i = x + ( y \times w )\)

where \(i\) is the index of buffer, \(x\) is the index of a pixel on the x-axis of the image's subframe, \(y\) is the index of a pixel on the y-axis of the image's subframe, and \(w\) is the width of the image's subframe in pixels. Sensors with non-standard pixel mappings (CMOS sensors), bit-depths, or multiple layers (SCMOS sensors) are not currently supported.

Image buffers are stored in DLAPI memory, and their lifecycle is managed entirely by DLAPI's internals. Images must therefore be copied to the calling application's memory space at the earliest convenience to avoid that image buffer's deletion at the hands of another call to ISensor::startDownload(). This can be achieved quickly using the <cstring> function memmove().

e.g.

{c++}
#include <dlapi.h>
#include <cstring>
void copyImageBuffer(dl::IImagePtr pImg, unsigned short *& pBuffer, size_t & bufferLength)
{
bufferLength = pImg->getBufferLength();
pBuffer = new unsigned short[bufferLength];
memmove(pBuffer, pImg->getBufferData(), sizeof(unsigned short) * bufferLength);
}

Where the user passes in a pointer to an IImage object, retrieved via a call to ISensor::getImage() following a successful image transfer, a reference to a pointer of type unsigned short (which will receive the image buffer), and a reference to a size_t (which will receive the size of the image buffer). The calling function would then take ownership of the new image buffer.

Member Function Documentation

◆ getBufferData()

virtual unsigned short* dl::IImage::getBufferData ( ) const
pure virtual

Returns a pointer to the raw data buffer of the image.

Returns
unsigned short * pointer to the image buffer.

Returns a pointer to the image's data buffer.

◆ getBufferLength()

virtual unsigned int dl::IImage::getBufferLength ( ) const
pure virtual

Returns the length in pixels of the raw data buffer of the image.

Returns
the length of the data buffer in pixels.

Returns the length of the image buffer (width * height) in pixels, not bytes.

◆ getMetadata()

virtual TImageMetadata dl::IImage::getMetadata ( ) const
pure virtual

Returns the image metadata structure associated with the image.

Returns
the image's metadata structure.
See also
TImageMetadata

Returns the image's metadata structure to the user.


The documentation for this class was generated from the following file:
  • C:/NightlyBuild/DL_Imaging/Aluma_Software/dlapi/src/dlapi.h