A.R.G.U.S 2.1.0
Adaptive Real-Time Guardian for Unsafe Situations
Loading...
Searching...
No Matches
CameraCapture.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <chrono>
9#include <memory>
10#include <opencv2/opencv.hpp>
11#include <string>
12
16struct FrameEvent {
17 cv::Mat image_data;
18 long long timestamp_ms;
19 std::chrono::steady_clock::time_point capture_timestamp;
20};
21
23
28public:
37
46
51 explicit CameraCapture(int camera_index = 0);
52
57 explicit CameraCapture(Options options);
58
63
64 CameraCapture(const CameraCapture&) = delete;
68
74 bool waitForNextFrame(FrameEvent& output_event);
75
80 std::string backendName() const;
81
86 std::string backendImplementation() const;
87
92 BackendPreference backendPreference() const noexcept;
93
99 bool setFocusPosition(float position);
100
105 float getFocusPosition() const;
106
107private:
108 std::unique_ptr<CameraCaptureBackend> backend_;
109 BackendPreference backend_preference_;
110 float current_focus_position_ = -1.0f;
111};
Camera capture facade with pluggable backend implementations.
BackendPreference backendPreference() const noexcept
Return requested backend preference.
BackendPreference
Backend selection policy.
@ Auto
Auto-select backend based on platform/runtime constraints.
@ OpenCvVideoCapture
Force OpenCV VideoCapture backend.
@ Libcamera2OpenCv
Force libcamera2opencv callback backend.
bool setFocusPosition(float position)
Set camera focus position when backend/hardware supports it.
std::string backendName() const
Return active backend name.
CameraCapture & operator=(CameraCapture &&)=delete
float getFocusPosition() const
Get current requested focus position.
bool waitForNextFrame(FrameEvent &output_event)
Wait for the next captured frame.
CameraCapture(const CameraCapture &)=delete
~CameraCapture()
Release camera hardware resources.
CameraCapture & operator=(const CameraCapture &)=delete
std::string backendImplementation() const
Return active backend implementation family.
CameraCapture(CameraCapture &&)=delete
Construction options for camera capture.
float focus_position
Focus request: -1.0 autofocus, 0.0 closest, 1.0 farthest.
int camera_index
Camera index passed to backend.
BackendPreference backend_preference
Requested backend policy.
Single captured frame and its timing metadata.
long long timestamp_ms
Epoch-style timestamp for log compatibility.
cv::Mat image_data
Captured image.
std::chrono::steady_clock::time_point capture_timestamp
Monotonic capture time.