OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — legacy C++ API referencev12.0

These are the pre-v12 classes, kept so existing code keeps building. New code should use the modern API — see Migration Guide: v11 to v12.

optris::Frame

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.

Public functions

Frame

OTC_SDK_API Frame() noexcept

Constructor.

Frame

OTC_SDK_API Frame(const Frame &)=default

Copy constructor.

operator=

OTC_SDK_API Frame & operator=(const Frame &)=default

Copy assignment.

Frame

OTC_SDK_API Frame(Frame &&)=default

Move constructor.

operator=

OTC_SDK_API Frame & operator=(Frame &&)=default

Move assignment.

~Frame

OTC_SDK_API ~Frame() noexcept=default

Destructor.

getValue

OTC_SDK_API unsigned short getValue(int index) const noexcept(false)

Returns the frame data value at the given index.

Parameters

Name Description
index of the desired frame data.

Returns: frame data value at the given index.

Exceptions

Name Description
SDKException if the index is out of range.

getValue

OTC_SDK_API unsigned short getValue(int x, int y) const noexcept(false)

Returns the frame data value at the given coordinates.

Parameters

Name Description
x coordinate.
y coordinate.

Returns: frame data value at the given coordinates.

Exceptions

Name Description
SDKException if the coordinates are out of range.

getWidth

OTC_SDK_API int getWidth() const noexcept

Returns the width in pixels of the frame.

Returns: width in pixel of the frame.

getHeight

OTC_SDK_API int getHeight() const noexcept

Returns the height in pixel of the frame.

Returns: height in pixels of the frame.

getSize

OTC_SDK_API int getSize() const noexcept

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

Returns: size in pixels of the frame.

isEmpty

OTC_SDK_API bool isEmpty() const noexcept

Returns whether the frame is empty.

Returns: true if the frame is empty. False otherwise.

clear

OTC_SDK_API void clear()

Clears the frame data.

resize

OTC_SDK_API void resize(int width, int height)

Resizes the frame.

Parameters

Name Description
width of the resized frame in pixels.
height of the resized frame in pixels.

setData

OTC_SDK_API void setData(const unsigned short *source)

Sets the frame data values.

Parameters

Name Description
source to set the frame data values from.

setFromRawData

OTC_SDK_API void setFromRawData(const void *source)

Sets the frame data values from raw data.

Parameters

Name Description
source to set the frame data values from.

copyDataTo

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

Copies the internal data to a one-dimensional array or vector.

Warning: Make sure the destination has at least the size returned by getSize().

Parameters

Name Description
destination to copy the internal data to.
size as element count. The specified size is limited to [0, getSize()].

getData

OTC_SDK_API const unsigned short * getData() const noexcept

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

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

Protected attributes

_values

std::vector< unsigned short > _values

Frame data.