6 #ifndef IFM3D_FG_FRAME_H
7 #define IFM3D_FG_FRAME_H
12 #include <type_traits>
14 #include <ifm3d/device/device.h>
15 #include <ifm3d/fg/buffer.h>
16 #include <ifm3d/fg/frame_grabber_export.h>
41 AMPLITUDE_IMAGE =
static_cast<uint64_t
>(ifm3d::image_chunk::AMPLITUDE_IMAGE),
46 GRAYSCALE_IMAGE =
static_cast<uint64_t
>(ifm3d::image_chunk::GRAYSCALE_IMAGE),
56 REFLECTIVITY =
static_cast<uint64_t
>(ifm3d::image_chunk::REFLECTIVITY),
76 CARTESIAN_ALL =
static_cast<uint64_t
>(ifm3d::image_chunk::CARTESIAN_ALL),
81 UNIT_VECTOR_ALL =
static_cast<uint64_t
>(ifm3d::image_chunk::UNIT_VECTOR_ALL),
91 MONOCHROM_2D =
static_cast<uint64_t
>(ifm3d::image_chunk::MONOCHROM_2D),
96 JPEG_IMAGE =
static_cast<uint64_t
>(ifm3d::image_chunk::JPEG_IMAGE),
101 CONFIDENCE_IMAGE =
static_cast<uint64_t
>(ifm3d::image_chunk::CONFIDENCE_IMAGE),
106 DIAGNOSTIC =
static_cast<uint64_t
>(ifm3d::image_chunk::DIAGNOSTIC),
111 JSON_DIAGNOSTIC =
static_cast<uint64_t
>(ifm3d::image_chunk::JSON_DIAGNOSTIC),
116 EXTRINSIC_CALIB =
static_cast<uint64_t
>(ifm3d::image_chunk::EXTRINSIC_CALIB),
121 INTRINSIC_CALIB =
static_cast<uint64_t
>(ifm3d::image_chunk::INTRINSIC_CALIB),
129 O3R_DISTANCE_IMAGE_INFO [[deprecated]] =
static_cast<uint64_t
>(ifm3d::image_chunk::TOF_INFO),
130 O3R_RGB_IMAGE_INFO [[deprecated]] =
static_cast<uint64_t
>(ifm3d::image_chunk::RGB_INFO),
135 TOF_INFO =
static_cast<uint64_t
>(ifm3d::image_chunk::TOF_INFO),
140 RGB_INFO =
static_cast<uint64_t
>(ifm3d::image_chunk::RGB_INFO),
145 JSON_MODEL =
static_cast<uint64_t
>(ifm3d::image_chunk::JSON_MODEL),
150 ALGO_DEBUG =
static_cast<uint64_t
>(ifm3d::image_chunk::ALGO_DEBUG),
160 O3R_ODS_INFO =
static_cast<uint64_t
>(ifm3d::image_chunk::O3R_ODS_INFO),
165 O3R_RESULT_JSON =
static_cast<uint64_t
>(ifm3d::image_chunk::O3R_RESULT_JSON),
175 O3R_RESULT_IMU =
static_cast<uint64_t
>(ifm3d::image_chunk::O3R_RESULT_IMU),
181 XYZ = std::numeric_limits<std::uint32_t>::max(),
195 O3R_MCC_MOTION_IMAGE,
196 O3R_MCC_STATIC_IMAGE,
200 using TimePointT = std::chrono::time_point<std::chrono::system_clock,
201 std::chrono::nanoseconds>;
203 using BufferList = std::vector<Buffer>;
204 using BufferDataListMap = std::map<ifm3d::buffer_id, BufferList>;
210 class IFM3D_FRAME_GRABBER_EXPORT
Frame
213 using Ptr = std::shared_ptr<Frame>;
215 Frame(
const BufferDataListMap& images,
216 const std::vector<TimePointT> timestamps,
217 uint64_t frame_count);
231 std::vector<TimePointT> TimeStamps();
251 std::optional<size_t> index = std::nullopt);
261 uint32_t FrameCount();
269 std::vector<buffer_id> GetBuffers();
271 decltype(std::declval<std::map<buffer_id, BufferList>>().begin())
273 decltype(std::declval<
const std::map<buffer_id, BufferList>>().begin())
274 begin()
const noexcept;
275 decltype(std::declval<std::map<buffer_id, BufferList>>().end())
277 decltype(std::declval<
const std::map<buffer_id, BufferList>>().end()) end()
282 std::unique_ptr<Impl> pImpl;
287 #endif // IFM3D_FG_FRAME_H