duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
duvc.hpp
Go to the documentation of this file.
1#pragma once
2
14// Core functionality
19#include <duvc-ctl/core/types.h>
20
21// Utility functions
25
26// Platform interface (advanced users)
28
29// Vendor extensions
31#ifdef _WIN32
33#endif
34
35namespace duvc {
36
42using ::duvc::is_device_connected;
43using ::duvc::list_devices;
45
63inline bool get(const Device &dev, CamProp prop, PropSetting &out) {
64 Camera cam(dev);
65 if (!cam.is_valid())
66 return false;
67 auto res = cam.get(prop);
68 if (!res.is_ok())
69 return false;
70 out = res.value();
71 return true;
72}
73
81inline bool set(const Device &dev, CamProp prop, const PropSetting &in) {
82 Camera cam(dev);
83 if (!cam.is_valid())
84 return false;
85 return cam.set(prop, in).is_ok();
86}
87
95inline bool get_range(const Device &dev, CamProp prop, PropRange &out) {
96 Camera cam(dev);
97 if (!cam.is_valid())
98 return false;
99 auto res = cam.get_range(prop);
100 if (!res.is_ok())
101 return false;
102 out = res.value();
103 return true;
104}
105
113inline bool get(const Device &dev, VidProp prop, PropSetting &out) {
114 Camera cam(dev);
115 if (!cam.is_valid())
116 return false;
117 auto res = cam.get(prop);
118 if (!res.is_ok())
119 return false;
120 out = res.value();
121 return true;
122}
123
131inline bool set(const Device &dev, VidProp prop, const PropSetting &in) {
132 Camera cam(dev);
133 if (!cam.is_valid())
134 return false;
135 return cam.set(prop, in).is_ok();
136}
137
145inline bool get_range(const Device &dev, VidProp prop, PropRange &out) {
146 Camera cam(dev);
147 if (!cam.is_valid())
148 return false;
149 auto res = cam.get_range(prop);
150 if (!res.is_ok())
151 return false;
152 out = res.value();
153 return true;
154}
156
162using ::duvc::get_device_capabilities;
165
171using ::duvc::to_wstring;
173
174} // namespace duvc
RAII camera handle for simplified device management.
Device capability detection and snapshots using Camera API.
RAII camera handle for simplified device management.
Definition camera.h:23
Result type that can contain either a value or an error.
Definition result.h:75
const T & value() const &
Get the value (assumes success)
Definition result.h:114
bool is_ok() const
Check if result contains a value (success)
Definition result.h:101
Vendor-specific property constants and definitions.
Device enumeration and management functions.
HRESULT decoder and diagnostics utilities.
bool get(const Device &, CamProp, PropSetting &)
Get a camera control property value.
Definition duvc.hpp:63
bool set(const Device &, CamProp, const PropSetting &)
Set a camera control property value.
Definition duvc.hpp:81
bool get_range(const Device &, CamProp, PropRange &)
Get the valid range for a camera control property.
Definition duvc.hpp:95
Abstract platform interface for camera control.
Structured logging interface for duvc-ctl.
Logitech-specific vendor property definitions and helpers.
Definition core.h:13
VidProp
Video processing properties (IAMVideoProcAmp interface)
Definition types.h:50
CamProp
Camera control properties (IAMCameraControl interface)
Definition types.h:18
Result/Error type system for duvc-ctl.
String conversion utilities for enums and types.
Represents a camera device.
Definition types.h:131
Property range and default information.
Definition types.h:92
Property setting with value and control mode.
Definition types.h:74
Core data types and enumerations for duvc-ctl.