duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
duvc::PropRange Struct Reference

Property range and default information. More...

#include <duvc-ctl/core/types.h>

Collaboration diagram for duvc::PropRange:

Public Member Functions

 PropRange ()=default
 Default constructor.
 
bool is_valid (int value) const
 Check if a value is valid for this range.
 
int clamp (int value) const
 Clamp value to valid range.
 

Public Attributes

int min
 Minimum supported value.
 
int max
 Maximum supported value.
 
int step
 Step size between valid values.
 
int default_val
 Default value.
 
CamMode default_mode
 Default control mode.
 

Detailed Description

Property range and default information.

Definition at line 92 of file types.h.

Constructor & Destructor Documentation

◆ PropRange()

duvc::PropRange::PropRange ( )
default

Default constructor.

Member Function Documentation

◆ clamp()

int duvc::PropRange::clamp ( int value) const
inline

Clamp value to valid range.

Parameters
valueValue to clamp
Returns
Nearest valid value within range

Definition at line 116 of file types.h.

References max, min, and step.

◆ is_valid()

bool duvc::PropRange::is_valid ( int value) const
inline

Check if a value is valid for this range.

Parameters
valueValue to check
Returns
true if value is within range and aligned to step

Definition at line 107 of file types.h.

References max, min, and step.

Member Data Documentation

◆ default_mode

CamMode duvc::PropRange::default_mode

◆ default_val

int duvc::PropRange::default_val

Default value.

Definition at line 96 of file types.h.

Referenced by duvc::DeviceConnection::get_range(), and duvc::DeviceConnection::get_range().

◆ max

int duvc::PropRange::max

Maximum supported value.

Definition at line 94 of file types.h.

Referenced by clamp(), duvc::DeviceConnection::get_range(), duvc::DeviceConnection::get_range(), and is_valid().

◆ min

int duvc::PropRange::min

◆ step

int duvc::PropRange::step

Step size between valid values.

Definition at line 95 of file types.h.

Referenced by clamp(), duvc::DeviceConnection::get_range(), duvc::DeviceConnection::get_range(), and is_valid().


The documentation for this struct was generated from the following files: