IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
peak_icv_metadata_conversion.hpp
Go to the documentation of this file.
1
11#pragma once
12
14#include <peak_icv_c/types/peak_icv_image.h>
15
16namespace peak
17{
18namespace icv
19{
20namespace detail
21{
22inline peak_icv_capture_information CreateCCaptureInformationFromMetadata(const peak::common::Metadata& metadata)
23{
24
25 peak_icv_capture_information captureInformationC{};
26
28 {
29 captureInformationC.relative_timestamp = metadata.GetValueByKey<peak::common::MetadataKey::DeviceTimestamp>();
30 }
31 if (metadata.HasEntryByName("BinningHorizontal"))
32 {
33 captureInformationC.binning_factor.x = metadata.GetValueByName<decltype(captureInformationC.binning_factor.x)>("BinningHorizontal");
34 }
35 else
36 {
37 captureInformationC.binning_factor.x = 1;
38 }
39 if (metadata.HasEntryByName("BinningVertical"))
40 {
41 captureInformationC.binning_factor.y = metadata.GetValueByName<decltype(captureInformationC.binning_factor.y)>("BinningVertical");
42 }
43 else
44 {
45 captureInformationC.binning_factor.y = 1;
46 }
47
48 return captureInformationC;
49}
50} // namespace detail
51} // namespace icv
52} // namespace peak
Type-safe container for image acquisition metadata.
T GetValueByName(const std::string &key) const
Retrieves and casts the value associated with a string key.
bool HasEntryByName(const std::string &name) const
Checks if a given string key is stored in the metadata.
bool HasEntryByKey() const
Checks if a known key is stored in the metadata.
detail::MetadataKeyTraits< metadataKey >::type GetValueByKey() const
Retrieves the value of a strongly typed metadata key.
@ DeviceTimestamp
Device-provided image acquisition timestamp in nanoseconds.
peak_icv_capture_information CreateCCaptureInformationFromMetadata(const peak::common::Metadata &metadata)