7 #ifndef IFM3D_FG_FRAMEGRABBER_H
8 #define IFM3D_FG_FRAMEGRABBER_H
16 #include <type_traits>
17 #include <ifm3d/device/device.h>
18 #include <ifm3d/device/err.h>
19 #include <ifm3d/fg/buffer.h>
20 #include <ifm3d/fg/organizer.h>
21 #include <ifm3d/fg/frame.h>
22 #include <ifm3d/fg/frame_grabber_export.h>
32 using Ptr = std::shared_ptr<FrameGrabber>;
33 using NewFrameCallback = std::function<void(Frame::Ptr)>;
34 using AsyncErrorCallback = std::function<void(
int,
const std::string&)>;
35 using AsyncNotificationCallback =
36 std::function<void(
const std::string&,
const std::string&)>;
38 std::vector<std::variant<std::uint64_t, int, ifm3d::buffer_id>>;
39 using ErrorCallback = std::function<void(
const ifm3d::Error&)>;
48 std::optional<std::uint16_t> pcic_port = std::nullopt);
77 std::shared_future<void> SWTrigger();
83 void OnNewFrame(NewFrameCallback callback =
nullptr);
106 std::shared_future<void> Start(
107 const BufferList& buffers,
108 const std::optional<json>& pcicFormat = std::nullopt);
115 std::shared_future<void> Stop();
125 std::shared_future<Frame::Ptr> WaitForFrame();
133 void SetOrganizer(std::unique_ptr<Organizer> organizer);
141 void OnAsyncError(AsyncErrorCallback callback =
nullptr);
148 void OnAsyncNotification(AsyncNotificationCallback callback =
nullptr);
154 void OnError(ErrorCallback callback =
nullptr);
162 void SetMasking(
const bool mask);
171 std::unique_ptr<Impl> pImpl;
177 #endif // IFM3D_FG_FRAMEGRABBER_H