|
duvc-ctl 2.0.0
USB Video Class Camera Control Library
|
RAII camera handle for simplified device management. More...
#include <duvc-ctl/core/camera.h>
Public Member Functions | |
| Camera (const Device &device) | |
| Create camera handle for device. | |
| Camera (int device_index) | |
| Create camera handle by device index. | |
| Camera (const std::wstring &device_path) | |
| Create camera handle by device path. | |
| ~Camera () | |
| Destructor - automatically releases device connection. | |
| Camera (const Camera &)=delete | |
| Camera & | operator= (const Camera &)=delete |
| Camera (Camera &&) noexcept | |
| Camera & | operator= (Camera &&) noexcept |
| bool | is_valid () const |
| Check if camera is valid and connected. | |
| const Device & | device () const |
| Get the underlying device information. | |
| Result< PropSetting > | get (CamProp prop) |
| Get camera property value. | |
| Result< void > | set (CamProp prop, const PropSetting &setting) |
| Set camera property value. | |
| Result< PropRange > | get_range (CamProp prop) |
| Get camera property range. | |
| Result< PropSetting > | get (VidProp prop) |
| Get video processing property value. | |
| Result< void > | set (VidProp prop, const PropSetting &setting) |
| Set video processing property value. | |
| Result< PropRange > | get_range (VidProp prop) |
| Get video processing property range. | |
RAII camera handle for simplified device management.
This class provides a high-level interface for camera control, automatically managing device connections and providing a clean API.
Create camera handle for device.
| device | Device to connect to |
Definition at line 12 of file camera.cpp.
|
explicit |
Create camera handle by device index.
| device_index | Index from list_devices() |
Definition at line 14 of file camera.cpp.
References duvc::list_devices().
|
explicit |
Create camera handle by device path.
| device_path | Windows device instance path (case-insensitive) |
Opens a camera using its unique Windows device path. This is the most precise method for multi-camera setups where firmware variations cause duplicate names or VID/PID combinations.
| std::runtime_error | if device not found or invalid |
Definition at line 22 of file camera.cpp.
References duvc::find_device_by_path(), and duvc::Device::is_valid().
|
default |
Destructor - automatically releases device connection.
|
defaultnoexcept |
| Result< PropSetting > duvc::Camera::get | ( | CamProp | prop | ) |
Get camera property value.
| prop | Camera property to query |
Definition at line 48 of file camera.cpp.
References duvc::DeviceNotFound, duvc::Ok(), and duvc::PropertyNotSupported.
Referenced by duvc_get_multiple_camera_properties(), duvc_get_multiple_video_properties(), duvc_set_multiple_camera_properties(), and duvc_set_multiple_video_properties().
| Result< PropSetting > duvc::Camera::get | ( | VidProp | prop | ) |
Get video processing property value.
| prop | Video property to query |
Definition at line 89 of file camera.cpp.
References duvc::DeviceNotFound, duvc::Ok(), and duvc::PropertyNotSupported.
Get camera property range.
| prop | Camera property to query |
Definition at line 75 of file camera.cpp.
References duvc::DeviceNotFound, duvc::Ok(), and duvc::PropertyNotSupported.
Get video processing property range.
| prop | Video property to query |
Definition at line 116 of file camera.cpp.
References duvc::DeviceNotFound, duvc::Ok(), and duvc::PropertyNotSupported.
| bool duvc::Camera::is_valid | ( | ) | const |
Check if camera is valid and connected.
Definition at line 37 of file camera.cpp.
References duvc::is_device_connected(), and is_valid().
Referenced by is_valid().
| Result< void > duvc::Camera::set | ( | CamProp | prop, |
| const PropSetting & | setting ) |
Set camera property value.
| prop | Camera property to set |
| setting | New property setting |
Definition at line 62 of file camera.cpp.
References duvc::DeviceNotFound, duvc::Ok(), and duvc::PropertyNotSupported.
Referenced by duvc_set_multiple_camera_properties(), and duvc_set_multiple_video_properties().
| Result< void > duvc::Camera::set | ( | VidProp | prop, |
| const PropSetting & | setting ) |
Set video processing property value.
| prop | Video property to set |
| setting | New property setting |
Definition at line 103 of file camera.cpp.
References duvc::DeviceNotFound, duvc::Ok(), and duvc::PropertyNotSupported.