Thermal Camera SDK 10.0.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
FrameMetadata.h
Go to the documentation of this file.
1// Copyright (c) 2025 Optris GmbH Co. KG
2
10
11#pragma once
12
13#include <vector>
14
15#include "otcsdk/Api.h"
16#include "otcsdk/Exceptions.h"
18
19
20namespace optris
21{
22// Forward declaration
23struct FrameMetadata2;
24
25
32{
33public:
36
37
46 static FrameMetadata fromRawMetadata(FrameMetadata2* raw, bool initializing);
47
48
54 int getSize() const noexcept;
55
61 void setSize(int size) noexcept;
62
63
71 bool isFrameDataReliable() const noexcept;
72
73
79 unsigned int getCounter() const noexcept;
80
88 unsigned int getCounterHardware() const noexcept;
89
96 void setCounters(unsigned int counter, unsigned int counterHardware) noexcept;
97
98
104 long long getTimestamp() const noexcept;
105
111 long long getTimestampMedia() const noexcept;
112
119 void setTimestamps(long long timestamp, long long timestampMedia) noexcept;
120
121
127 FlagState getFlagState() const noexcept;
128
134 void setFlagState(FlagState flagState) noexcept;
135
136
142 float getTemperatureFlag() const noexcept;
143
149 float getTemperatureBox() const noexcept;
150
156 float getTemperatureChip() const noexcept;
157
165 void setTemperatures(float flag, float box, float chip) noexcept;
166
167
177 OTC_SDK_API bool getPifDigitalInputValue(int channel) const;
178
188 OTC_SDK_API float getPifAnalogInputValue(int channel) const;
189
190
196 int getPifDigitalInputChannelCount() const noexcept;
197
203 int getPifAnalogInputChannelCount() const noexcept;
204
205
212 void setPifInputChannelCounts(int digital, int analog) noexcept;
213
222 OTC_SDK_API void setPifDigitalInputValue(int channel, bool value);
223
232 OTC_SDK_API void setPifAnalogInputValue(int channel, float value);
233
239 OTC_SDK_API FrameMetadata clone() const noexcept;
240
241
242private:
244 unsigned short _size;
245
247 unsigned int _counter;
249 unsigned int _counterHardware;
250
252 long long _timestamp;
254 long long _timestampMedia;
255
257 FlagState _flagState;
258
260 float _temperatureFlag;
262 float _temperatureBox;
264 float _temperatureChip;
265
267 std::vector<bool> _pifDigitalInputValues;
269 std::vector<float> _pifAnalogInputValues;
270};
271
272
273// Inline implementations
274inline int FrameMetadata::getSize() const noexcept
275{
276 return _size;
277}
278
279inline void FrameMetadata::setSize(int size) noexcept
280{
281 _size = size;
282}
283
284inline bool FrameMetadata::isFrameDataReliable() const noexcept
285{
286 return (_flagState != FlagState::Initializing);
287}
288
289inline unsigned int FrameMetadata::getCounter() const noexcept
290{
291 return _counter;
292}
293
294inline unsigned int FrameMetadata::getCounterHardware() const noexcept
295{
296 return _counterHardware;
297}
298
299inline void FrameMetadata::setCounters(unsigned int counter, unsigned int counterHardware) noexcept
300{
301 _counter = counter;
302 _counterHardware = counterHardware;
303}
304
305inline long long FrameMetadata::getTimestamp() const noexcept
306{
307 return _timestamp;
308}
309
310inline long long FrameMetadata::getTimestampMedia() const noexcept
311{
312 return _timestampMedia;
313}
314
315inline void FrameMetadata::setTimestamps(long long timestamp, long long timestampMedia) noexcept
316{
317 _timestamp = timestamp;
318 _timestampMedia = timestampMedia;
319}
320
322{
323 return _flagState;
324}
325
326inline void FrameMetadata::setFlagState(FlagState flagState) noexcept
327{
328 _flagState = flagState;
329}
330
331inline float FrameMetadata::getTemperatureFlag() const noexcept
332{
333 return _temperatureFlag;
334}
335
336inline float FrameMetadata::getTemperatureBox() const noexcept
337{
338 return _temperatureBox;
339}
340
341inline float FrameMetadata::getTemperatureChip() const noexcept
342{
343 return _temperatureChip;
344}
345
346inline void FrameMetadata::setTemperatures(float flag, float box, float chip) noexcept
347{
348 _temperatureFlag = flag;
349 _temperatureBox = box;
350 _temperatureChip = chip;
351}
352
354{
355 return static_cast<int>(_pifDigitalInputValues.size());
356}
357
359{
360 return static_cast<int>(_pifAnalogInputValues.size());
361}
362
363inline void FrameMetadata::setPifInputChannelCounts(int digital, int analog) noexcept
364{
365 _pifDigitalInputValues.resize(digital);
366 _pifAnalogInputValues.resize(analog);
367}
368
369inline FrameMetadata FrameMetadata::clone() const noexcept
370{
371 return FrameMetadata{*this};
372}
373
374} // 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.
Contains an enum representing the different states of the shutter flag.
int getPifAnalogInputChannelCount() const noexcept
Returns the count of analog PIF input channel count.
Definition FrameMetadata.h:358
float getTemperatureChip() const noexcept
Returns the sensor chip temperature in °C at frame capturing time.
Definition FrameMetadata.h:341
OTC_SDK_API FrameMetadata() noexcept
Constructor.
OTC_SDK_API FrameMetadata clone() const noexcept
Returns a complete copy of this metadata.
Definition FrameMetadata.h:369
OTC_SDK_API void setPifDigitalInputValue(int channel, bool value)
Sets the value of the specified PIF digital input channel.
unsigned int getCounter() const noexcept
Returns a consecutive number for each received frame.
Definition FrameMetadata.h:289
void setCounters(unsigned int counter, unsigned int counterHardware) noexcept
Sets the frame counters.
Definition FrameMetadata.h:299
float getTemperatureBox() const noexcept
Returns the housing temperature in °C at frame capturing time.
Definition FrameMetadata.h:336
void setTimestamps(long long timestamp, long long timestampMedia) noexcept
Sets the timestamps.
Definition FrameMetadata.h:315
FlagState getFlagState() const noexcept
Returns the state of the shutter flag at frame capturing time.
Definition FrameMetadata.h:321
static FrameMetadata fromRawMetadata(FrameMetadata2 *raw, bool initializing)
Creates a frame metadata object from raw metadata.
void setSize(int size) noexcept
Sets the size of the raw metadata structure in bytes.
Definition FrameMetadata.h:279
OTC_SDK_API bool getPifDigitalInputValue(int channel) const
Returns the digital input value on the given PIF channel.
void setTemperatures(float flag, float box, float chip) noexcept
Set the flag, box and chip temperatures in °C.
Definition FrameMetadata.h:346
OTC_SDK_API float getPifAnalogInputValue(int channel) const
Returns the analog input value on the given PIF channel.
void setFlagState(FlagState flagState) noexcept
Sets the state of the shutter flag.
Definition FrameMetadata.h:326
long long getTimestampMedia() const noexcept
Returns the media timestamp.
Definition FrameMetadata.h:310
void setPifInputChannelCounts(int digital, int analog) noexcept
Sets the counts of the PIF input channels.
Definition FrameMetadata.h:363
OTC_SDK_API void setPifAnalogInputValue(int channel, float value)
Sets the value of the specified PIF analog input channel.
int getPifDigitalInputChannelCount() const noexcept
Returns the count of digital PIF input channel count.
Definition FrameMetadata.h:353
int getSize() const noexcept
Returns the size of the raw metadata structure in bytes.
Definition FrameMetadata.h:274
unsigned int getCounterHardware() const noexcept
Returns the frame number received from the device.
Definition FrameMetadata.h:294
float getTemperatureFlag() const noexcept
Returns the shutter flag temperature in °C at frame capturing time.
Definition FrameMetadata.h:331
long long getTimestamp() const noexcept
Returns the frame timestamp in UNITS (10000000 units per second).
Definition FrameMetadata.h:305
bool isFrameDataReliable() const noexcept
Returns whether the data provided in the associated frame is reliable.
Definition FrameMetadata.h:284
Main SDK namespace.
Definition DeviceInfo.h:23
FlagState
Represents the different states of the shutter flag.
Definition FlagState.h:33
@ Initializing
Flag state is beeing initialized/calibrated.
Definition FlagState.h:39