7 #ifndef IFM3D_DESERIALIZE_STRUCT_RGB_INFO_V2_HPP
8 #define IFM3D_DESERIALIZE_STRUCT_RGB_INFO_V2_HPP
10 #include <ifm3d/deserialize/deserialize_utils.hpp>
11 #include <ifm3d/deserialize/struct_rgb_info_v1.hpp>
12 #include <ifm3d/device/device.h>
13 #include <ifm3d/device/err.h>
14 #include <ifm3d/fg/buffer.h>
15 #include <ifm3d/fg/organizer_utils.h>
21 constexpr
auto RGB_INFO_ROLLING_SHUTTER_ROW_OFFSET_NS_INDEX = 0x0134;
29 using Ptr = std::shared_ptr<RGBInfoV2>;
32 IsValid(
const uint8_t* data,
size_t size)
34 auto version = mkval<std::uint32_t>(data + RGB_INFO_VERSION_INDEX);
36 return size >= RGB_INFO_V2_SIZE && version >= 1;
40 Read(
const uint8_t* data,
size_t size)
42 if (!IsValid(data, size))
46 RGBInfoV1::Read(data, size);
47 const uint8_t* start_ptr = data;
49 start_ptr + RGB_INFO_ROLLING_SHUTTER_ROW_OFFSET_NS_INDEX);
58 static constexpr
size_t RGB_INFO_V2_SIZE = 312;
61 Deserialize(
const Buffer& rgb_info_buffer)
65 rgb_info_v2.Read(rgb_info_buffer.
Ptr<uint8_t>(0),
66 rgb_info_buffer.
Size());
The class Buffer represent a STL container to store data from the ifm devices in 2 dimension and supp...
Definition: buffer.h:99
T * Ptr(std::uint32_t row)
returns a pointer to the specified Buffer row.
size_t Size() const
Return the size of the buffer in bytes.
Exception wrapper for library and system errors encountered by the library.
Definition: err.h:126
Definition: struct_rgb_info_v1.hpp:32
Definition: struct_rgb_info_v2.hpp:26
std::uint32_t rolling_shutter_row_offset_ns
Rolling-shutter offset between consecutive row timestamps, given in [nanoseconds].
Definition: struct_rgb_info_v2.hpp:57