Thermal Camera SDK 10.1.1
SDK for Optris Thermal Cameras
Loading...
Searching...
No Matches
FrameMetadata.h
Go to the documentation of this file.
1// Copyright (c) 2008-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"
19
20
21namespace optris
22{
23// Forward declaration
24struct FrameMetadata2;
25
26
33{
34public:
37
38
49 static FrameMetadata fromRawMetadata(FrameMetadata2* raw,
50 bool initializing,
51 int pifActualDeviceCount,
52 int pifConfigurableDeviceCount);
53
54
60 int getSize() const noexcept;
61
67 void setSize(int size) noexcept;
68
69
77 bool isFrameDataReliable() const noexcept;
78
79
85 unsigned int getCounter() const noexcept;
86
94 unsigned int getCounterHardware() const noexcept;
95
102 void setCounters(unsigned int counter, unsigned int counterHardware) noexcept;
103
104
110 long long getTimestamp() const noexcept;
111
117 long long getTimestampMedia() const noexcept;
118
125 void setTimestamps(long long timestamp, long long timestampMedia) noexcept;
126
127
133 FlagState getFlagState() const noexcept;
134
140 void setFlagState(FlagState flagState) noexcept;
141
142
148 float getTemperatureFlag() const noexcept;
149
155 float getTemperatureBox() const noexcept;
156
162 float getTemperatureChip() const noexcept;
163
171 void setProbeTemperatures(float flag, float box, float chip) noexcept;
172
179
186
193
206
214 RadiationParameterSource ambientTemperatureSource) noexcept;
215
230 OTC_SDK_API float getPifAiValue(int deviceIndex, int pinIndex) const;
231
246 OTC_SDK_API bool getPifDiValue(int deviceIndex, int pinIndex) const;
247
253 int getPifActualDeviceCount() const noexcept;
254
260 int getPifConfigurableDeviceCount() const noexcept;
261
267 int getPifAiCountPerDevice() const noexcept;
268
274 int getPifDiCountPerDevice() const noexcept;
275
284 OTC_SDK_API void setPifCounts(int actualDeviceCount,
285 int configurableDeviceCount,
286 int aiCountPerDevice,
287 int diCountPerDevice) noexcept;
288
298 OTC_SDK_API void setPifAiValue(int deviceIndex, int pinIndex, float value);
299
309 OTC_SDK_API void setPifDiValue(int deviceIndex, int pinIndex, bool value);
310
311
317 OTC_SDK_API FrameMetadata clone() const noexcept;
318
319
320private:
322 unsigned short _size;
323
325 unsigned int _counter;
327 unsigned int _counterHardware;
328
330 long long _timestamp;
332 long long _timestampMedia;
333
335 FlagState _flagState;
336
338 float _temperatureFlag;
340 float _temperatureBox;
342 float _temperatureChip;
343
345 RadiationParameters _radiation;
347 RadiationParameterSource _emissivitySource;
349 RadiationParameterSource _ambientTemperatureSource;
350
352 int _pifActualDeviceCount;
354 int _pifConfigurableDeviceCount;
355
357 int _pifAiCountPerDevice;
359 std::vector<float> _pifAiValues;
360
362 int _pifDiCountPerDevice;
364 std::vector<bool> _pifDiValues;
365};
366
367
368// Inline implementations
369inline int FrameMetadata::getSize() const noexcept
370{
371 return _size;
372}
373
374inline void FrameMetadata::setSize(int size) noexcept
375{
376 _size = size;
377}
378
379inline bool FrameMetadata::isFrameDataReliable() const noexcept
380{
381 return (_flagState != FlagState::Initializing);
382}
383
384inline unsigned int FrameMetadata::getCounter() const noexcept
385{
386 return _counter;
387}
388
389inline unsigned int FrameMetadata::getCounterHardware() const noexcept
390{
391 return _counterHardware;
392}
393
394inline void FrameMetadata::setCounters(unsigned int counter, unsigned int counterHardware) noexcept
395{
396 _counter = counter;
397 _counterHardware = counterHardware;
398}
399
400inline long long FrameMetadata::getTimestamp() const noexcept
401{
402 return _timestamp;
403}
404
405inline long long FrameMetadata::getTimestampMedia() const noexcept
406{
407 return _timestampMedia;
408}
409
410inline void FrameMetadata::setTimestamps(long long timestamp, long long timestampMedia) noexcept
411{
412 _timestamp = timestamp;
413 _timestampMedia = timestampMedia;
414}
415
417{
418 return _flagState;
419}
420
421inline void FrameMetadata::setFlagState(FlagState flagState) noexcept
422{
423 _flagState = flagState;
424}
425
426inline float FrameMetadata::getTemperatureFlag() const noexcept
427{
428 return _temperatureFlag;
429}
430
431inline float FrameMetadata::getTemperatureBox() const noexcept
432{
433 return _temperatureBox;
434}
435
436inline float FrameMetadata::getTemperatureChip() const noexcept
437{
438 return _temperatureChip;
439}
440
441inline void FrameMetadata::setProbeTemperatures(float flag, float box, float chip) noexcept
442{
443 _temperatureFlag = flag;
444 _temperatureBox = box;
445 _temperatureChip = chip;
446}
447
449{
450 return _radiation;
451}
452
454{
455 return _emissivitySource;
456}
457
462
464{
465 return _ambientTemperatureSource;
466}
467
469 RadiationParameterSource ambientTemperatureSource) noexcept
470{
471 _emissivitySource = emissivitySource;
472 _ambientTemperatureSource = ambientTemperatureSource;
473}
474
475inline int FrameMetadata::getPifActualDeviceCount() const noexcept
476{
477 return _pifActualDeviceCount;
478}
479
481{
482 return _pifConfigurableDeviceCount;
483}
484
485inline int FrameMetadata::getPifAiCountPerDevice() const noexcept
486{
487 return _pifAiCountPerDevice;
488}
489
490inline int FrameMetadata::getPifDiCountPerDevice() const noexcept
491{
492 return _pifDiCountPerDevice;
493}
494
495inline FrameMetadata FrameMetadata::clone() const noexcept
496{
497 return FrameMetadata{*this};
498}
499
500} // 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.
Contains a class holding the individual radiation parameters.
OTC_SDK_API void setPifDiValue(int deviceIndex, int pinIndex, bool value)
Sets the value of the specified PIF digital input channel.
void setProbeTemperatures(float flag, float box, float chip) noexcept
Set the flag, box and chip probe temperatures in °C.
Definition FrameMetadata.h:441
float getTemperatureChip() const noexcept
Returns the sensor chip temperature in °C at frame capturing time.
Definition FrameMetadata.h:436
OTC_SDK_API FrameMetadata() noexcept
Constructor.
OTC_SDK_API FrameMetadata clone() const noexcept
Returns a complete copy of this metadata.
Definition FrameMetadata.h:495
RadiationParameters getRadiationParameters() const noexcept
Grants read access to the radiation parameters use to process the thermal frame.
Definition FrameMetadata.h:448
RadiationParameterSource getAmbientTemperatureSource() const noexcept
Returns the source of the ambient temperature value.
Definition FrameMetadata.h:463
unsigned int getCounter() const noexcept
Returns a consecutive number for each received frame.
Definition FrameMetadata.h:384
void setCounters(unsigned int counter, unsigned int counterHardware) noexcept
Sets the frame counters.
Definition FrameMetadata.h:394
RadiationParameterSource getEmissivitySource() const noexcept
Returns the source of the emissivity value.
Definition FrameMetadata.h:453
void setRadiationParameterSources(RadiationParameterSource emissivitySource, RadiationParameterSource ambientTemperatureSource) noexcept
Sets the radiation parameters sources.
Definition FrameMetadata.h:468
OTC_SDK_API float getPifAiValue(int deviceIndex, int pinIndex) const
Returns the analog input value on the given PIF channel.
float getTemperatureBox() const noexcept
Returns the housing temperature in °C at frame capturing time.
Definition FrameMetadata.h:431
void setTimestamps(long long timestamp, long long timestampMedia) noexcept
Sets the timestamps.
Definition FrameMetadata.h:410
int getPifAiCountPerDevice() const noexcept
Returns the count of analog input channels per PIF device.
Definition FrameMetadata.h:485
FlagState getFlagState() const noexcept
Returns the state of the shutter flag at frame capturing time.
Definition FrameMetadata.h:416
int getPifConfigurableDeviceCount() const noexcept
Returns the count of configurable PIF devices.
Definition FrameMetadata.h:480
void setSize(int size) noexcept
Sets the size of the raw metadata structure in bytes.
Definition FrameMetadata.h:374
RadiationParameterSource getTransmissivitySource() const noexcept
Returns the source of the transmissivity value.
Definition FrameMetadata.h:458
OTC_SDK_API void setPifAiValue(int deviceIndex, int pinIndex, float value)
Sets the value of the specified PIF analog input channel.
int getPifDiCountPerDevice() const noexcept
Returns the count of digital input channels per PIF device.
Definition FrameMetadata.h:490
static FrameMetadata fromRawMetadata(FrameMetadata2 *raw, bool initializing, int pifActualDeviceCount, int pifConfigurableDeviceCount)
Creates a frame metadata object from raw metadata.
void setFlagState(FlagState flagState) noexcept
Sets the state of the shutter flag.
Definition FrameMetadata.h:421
long long getTimestampMedia() const noexcept
Returns the media timestamp.
Definition FrameMetadata.h:405
int getPifActualDeviceCount() const noexcept
Returns the count of actually connected PIF devices.
Definition FrameMetadata.h:475
int getSize() const noexcept
Returns the size of the raw metadata structure in bytes.
Definition FrameMetadata.h:369
OTC_SDK_API void setPifCounts(int actualDeviceCount, int configurableDeviceCount, int aiCountPerDevice, int diCountPerDevice) noexcept
Sets the counts of the PIF devices and input channels.
OTC_SDK_API bool getPifDiValue(int deviceIndex, int pinIndex) const
Returns the digital input value on the given PIF channel.
unsigned int getCounterHardware() const noexcept
Returns the frame number received from the device.
Definition FrameMetadata.h:389
float getTemperatureFlag() const noexcept
Returns the shutter flag temperature in °C at frame capturing time.
Definition FrameMetadata.h:426
long long getTimestamp() const noexcept
Returns the frame timestamp in UNITS (10000000 units per second).
Definition FrameMetadata.h:400
bool isFrameDataReliable() const noexcept
Returns whether the data provided in the associated frame is reliable.
Definition FrameMetadata.h:379
Holds the radiation parameters for a frame or a measurement field.
Definition RadiationParameters.h:34
Main SDK namespace.
Definition DeviceInfo.h:24
RadiationParameterSource
Represents the different sources of radiation parameters.
Definition RadiationParameters.h:26
@ Sdk
The radiation parameter are/can be set via the SDK.
Definition RadiationParameters.h:27
FlagState
Represents the different states of the shutter flag.
Definition FlagState.h:33
@ Initializing
Flag state is beeing initialized/calibrated.
Definition FlagState.h:39