7 #ifndef IFM3D_FG_FRAMEGRABBER_H
8 #define IFM3D_FG_FRAMEGRABBER_H
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/module_frame_grabber.h>
33 using Ptr = std::shared_ptr<FrameGrabber>;
34 using NewFrameCallback = std::function<void(Frame::Ptr)>;
35 using AsyncErrorCallback = std::function<void(
int,
const std::string&)>;
36 using AsyncNotificationCallback =
37 std::function<void(
const std::string&,
const std::string&)>;
39 std::vector<std::variant<std::uint64_t, int, ifm3d::buffer_id>>;
40 using ErrorCallback = std::function<void(
const ifm3d::Error&)>;
49 std::optional<std::uint16_t> pcic_port = std::nullopt);
78 std::shared_future<void> SWTrigger();
84 void OnNewFrame(NewFrameCallback callback =
nullptr);
107 std::shared_future<void> Start(
108 const BufferList& buffers,
109 const std::optional<json>& schema = std::nullopt);
116 std::shared_future<void> Stop();
126 std::shared_future<Frame::Ptr> WaitForFrame();
134 void SetOrganizer(std::unique_ptr<Organizer> organizer);
142 void OnAsyncError(AsyncErrorCallback callback =
nullptr);
149 void OnAsyncNotification(AsyncNotificationCallback callback =
nullptr);
155 void OnError(ErrorCallback callback =
nullptr);
163 void SetMasking(
const bool mask);
172 std::unique_ptr<Impl> pImpl;
178 #endif // IFM3D_FG_FRAMEGRABBER_H