Thermal Camera SDK 11.3.0
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
Frame.h
Go to the documentation of this file.
1// Copyright (c) 2008-2026 Optris GmbH & Co. KG
2
10
11#pragma once
12
13#include <vector>
14
15#include "otcsdk/Api.h"
16#include "otcsdk/Exceptions.h"
17
18
19namespace optris
20{
21
31class Frame
32{
33public:
35 OTC_SDK_API Frame() noexcept;
36
38 OTC_SDK_API Frame(const Frame&) = default;
40 OTC_SDK_API Frame& operator=(const Frame&) = default;
41
43 OTC_SDK_API Frame(Frame&&) = default;
45 OTC_SDK_API Frame& operator=(Frame&&) = default;
46
48 OTC_SDK_API virtual ~Frame() noexcept = default;
49
50
60 OTC_SDK_API unsigned short getValue(int index) const noexcept(false);
61
72 OTC_SDK_API unsigned short getValue(int x, int y) const noexcept(false);
73
79 OTC_SDK_API int getWidth() const noexcept;
80
86 OTC_SDK_API int getHeight() const noexcept;
87
93 OTC_SDK_API int getSize() const noexcept;
94
100 OTC_SDK_API bool isEmpty() const noexcept;
101
104
111 OTC_SDK_API void resize(int width, int height);
112
118 OTC_SDK_API void setData(const unsigned short* source);
119
125 OTC_SDK_API void setFromRawData(const void* source);
126
135 OTC_SDK_API void copyDataTo(unsigned short* destination, int size) const noexcept;
136
142 OTC_SDK_API const unsigned short* getData() const noexcept;
143
144
145protected:
147 std::vector<unsigned short> _values;
148
149
150private:
152 int _width;
154 int _height;
155};
156
157
158// Inline implementation
159inline int Frame::getWidth() const noexcept
160{
161 return _width;
162}
163
164inline int Frame::getHeight() const noexcept
165{
166 return _height;
167}
168
169inline int Frame::getSize() const noexcept
170{
171 return static_cast<int>(_values.size());
172}
173
174inline bool Frame::isEmpty() const noexcept
175{
176 return _values.empty();
177}
178
179inline const unsigned short* Frame::getData() const noexcept
180{
181 return _values.data();
182}
183
184} // namespace optris
Contains defines controlling the Windows DLL export and import of symbols.
#define OTC_SDK_API
Only needed when working with Windows DLLs.
Definition Api.h:65
Contains the exceptions raised by the SDK.
std::vector< unsigned short > _values
Frame data.
Definition Frame.h:147
OTC_SDK_API const unsigned short * getData() const noexcept
Returns a pointer to the first element of the internal value array.
Definition Frame.h:179
OTC_SDK_API unsigned short getValue(int index) const noexcept(false)
Returns the frame data value at the given index.
OTC_SDK_API void setData(const unsigned short *source)
Sets the frame data values.
OTC_SDK_API void resize(int width, int height)
Resizes the frame.
OTC_SDK_API bool isEmpty() const noexcept
Returns whether the frame is empty.
Definition Frame.h:174
OTC_SDK_API void copyDataTo(unsigned short *destination, int size) const noexcept
Copies the internal data to a one-dimensional array or vector.
OTC_SDK_API int getSize() const noexcept
Returns the overall size in pixels of the frame (width * height).
Definition Frame.h:169
OTC_SDK_API void clear()
Clears the frame data.
OTC_SDK_API int getWidth() const noexcept
Returns the width in pixels of the frame.
Definition Frame.h:159
OTC_SDK_API void setFromRawData(const void *source)
Sets the frame data values from raw data.
OTC_SDK_API Frame() noexcept
Constructor.
OTC_SDK_API int getHeight() const noexcept
Returns the height in pixel of the frame.
Definition Frame.h:164
Main SDK namespace.
Definition AlarmChannel.h:21