Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
optris::Frame Class Reference

Represents a data frame received from a device. More...

#include <Frame.h>

Inheritance diagram for optris::Frame:
Inheritance graph
Collaboration diagram for optris::Frame:
Collaboration graph

Public Member Functions

OTC_SDK_API Frame () noexcept
 Constructor.
 
OTC_SDK_API Frame (const Frame &)=default
 Copy constructor.
 
OTC_SDK_API Frameoperator= (const Frame &)=default
 Copy assignment.
 
OTC_SDK_API Frame (Frame &&)=default
 Move constructor.
 
OTC_SDK_API Frameoperator= (Frame &&)=default
 Move assignment.
 
virtual OTC_SDK_API ~Frame () noexcept=default
 Destructor.
 
OTC_SDK_API unsigned short getValue (int index) const noexcept(false)
 Returns the frame data value at the given index.
 
OTC_SDK_API unsigned short getValue (int x, int y) const noexcept(false)
 Returns the frame data value at the given coordinates.
 
OTC_SDK_API ConstFrameIterator getConstIterator () const noexcept
 Returns an iterator with read access.
 
OTC_SDK_API int getWidth () const noexcept
 Returns the width in pixels of the frame.
 
OTC_SDK_API int getHeight () const noexcept
 Returns the height in pixel of the frame.
 
OTC_SDK_API int getSize () const noexcept
 Returns the overall size in pixels of the frame (width * height).
 
OTC_SDK_API bool isEmpty () const noexcept
 Returns whether the frame is empty.
 
OTC_SDK_API void clear ()
 Clears the frame data.
 
OTC_SDK_API void resize (int width, int height)
 Resizes the frame.
 
OTC_SDK_API Frame clone () const noexcept
 Returns a complete copy of this frame.
 
OTC_SDK_API void setData (const unsigned short *source)
 Sets the frame data values.
 
OTC_SDK_API void setFromRawData (const void *source)
 Sets the frame data values from raw data.
 
OTC_SDK_API void copyDataTo (unsigned short *destination, int size) const noexcept
 Copies the internal values to the destination array.
 
OTC_SDK_API const unsigned short * getData () const noexcept
 Returns a pointer to the first element of the internal value array.
 

Protected Attributes

std::vector< unsigned short > _values
 Frame data.
 

Friends

class ConstFrameIterator
 

Detailed Description

Represents a data frame received from a device.

The encapsulated data may represent thermal or energy measurements in an internal format. See the specialized child classes like ThermalFrame for more details.

The origin of coordinates is located in the upper left corner with the x-axis pointing right and the y-axis pointing down.

Member Function Documentation

◆ clone()

Frame optris::Frame::clone ( ) const
inlinenoexcept

Returns a complete copy of this frame.

Returns
a complete copy of this frame.

◆ copyDataTo()

OTC_SDK_API void optris::Frame::copyDataTo ( unsigned short * destination,
int size ) const
noexcept

Copies the internal values to the destination array.

Warning
Make sure the destination arrays has at least the size returned by getSize().
Parameters
[out]destinationarray to copy the internal data to.
[in]sizein bytes. The specified size is limited to [0, frame size in bytes].

◆ getConstIterator()

ConstFrameIterator optris::Frame::getConstIterator ( ) const
inlinenoexcept

Returns an iterator with read access.

The iterator traverses the frame in a row major fashion.

Returns
iterator with read access.

◆ getData()

const unsigned short * optris::Frame::getData ( ) const
inlinenoexcept

Returns a pointer to the first element of the internal value array.

Returns
pointer to the first element of the internal value array.

◆ getHeight()

int optris::Frame::getHeight ( ) const
inlinenoexcept

Returns the height in pixel of the frame.

Returns
height in pixels of the frame.

◆ getSize()

int optris::Frame::getSize ( ) const
inlinenoexcept

Returns the overall size in pixels of the frame (width * height).

Returns
size in pixels of the frame.

◆ getValue() [1/2]

OTC_SDK_API unsigned short optris::Frame::getValue ( int index) const

Returns the frame data value at the given index.

Parameters
[in]indexof the desired frame data.
Returns
frame data value at the given index.
Exceptions
SDKExceptionif the index is out of range.

◆ getValue() [2/2]

OTC_SDK_API unsigned short optris::Frame::getValue ( int x,
int y ) const

Returns the frame data value at the given coordinates.

Parameters
[in]xcoordinate.
[in]ycoordinate.
Returns
frame data value at the given coordinates.
Exceptions
SDKExceptionif the coordinates are out of range.

◆ getWidth()

int optris::Frame::getWidth ( ) const
inlinenoexcept

Returns the width in pixels of the frame.

Returns
width in pixel of the frame.

◆ isEmpty()

bool optris::Frame::isEmpty ( ) const
inlinenoexcept

Returns whether the frame is empty.

Returns
true if the frame is empty. False otherwise.

◆ resize()

OTC_SDK_API void optris::Frame::resize ( int width,
int height )

Resizes the frame.

Parameters
[in]widthof the resized frame in pixels.
[in]heightof the resized frame in pixels.

◆ setData()

OTC_SDK_API void optris::Frame::setData ( const unsigned short * source)

Sets the frame data values.

Parameters
[in]sourceto set the frame data values from.

◆ setFromRawData()

OTC_SDK_API void optris::Frame::setFromRawData ( const void * source)

Sets the frame data values from raw data.

Parameters
[in]sourceto set the frame data values from.

The documentation for this class was generated from the following file: