6#include <QtClassHelperMacros>
45 explicit CameraCapture(
const int index, QObject* parent =
nullptr);
57 this->widget = widget;
65 this->msleep_time = gap_time;
106 cv::VideoCapture* videoCaptureHandle {
nullptr };
107 int current_index { -1 };
112 std::atomic_bool internal_running_state_holder {
false };
113 int msleep_time { 10 };
118 void capture_internal();
The CameraCapture class handles camera video capturing.
Definition CameraCapture.h:20
bool isActivate() const
Check if the camera is active.
Definition CameraCapture.cpp:22
Q_DISABLE_COPY(CameraCapture)
Q_DISABLE_COPY disables copy constructor and assignment operator.
~CameraCapture()
Destructor.
Definition CameraCapture.cpp:15
void errorOccur(CameraCapture::Error e)
Signal emitted when an error occurs.
void cameraClosed(int index)
Signal emitted when camera is closed.
bool close()
Close the camera capture session.
Definition CameraCapture.cpp:63
void bind_display_widget(CameraDisplayWidget *widget)
Bind a display widget for camera output.
Definition CameraCapture.h:56
Error
Error enum lists possible camera error cases.
Definition CameraCapture.h:26
@ CAMERA_UNEXISTED
Camera does not exist.
@ CAMERA_MULTI_OPENED
Camera already opened.
@ CAMERA_UNOPENED
Camera not opened.
@ CAMERA_UNBIND_DISPLAY
Camera not bound to display widget.
void cameraOpened(int index)
Signal emitted when camera is opened.
void set_capture_delay_time(const int gap_time)
Set capture delay time in milliseconds.
Definition CameraCapture.h:64
bool start()
Start the camera capture session.
Definition CameraCapture.cpp:26