Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
Loading...
Searching...
No Matches
auterion::CameraControl Class Reference

Classes

struct  Control
 

Public Types

enum class  Mode { Readable , Writable , ReadWrite }
 
enum class  ControlId { Exposure , Gain , AutoExposureMode }
 Well-known controls. More...
 
using Value = std::variant< int64_t, double, std::string >
 

Public Member Functions

 CameraControl (std::unique_ptr< CameraControlImpl > impl)
 
 CameraControl (const CameraControl &other)=delete
 
CameraControl & operator= (const CameraControl &other)=delete
 
 CameraControl (CameraControl &&other)=delete
 
CameraControl & operator= (CameraControl &&other)=delete
 
std::vector< Control > enumerate () const
 Get a list of all supported controls by this camera.
 
std::vector< std::optional< Value > > get (const std::vector< std::string > &control_names) const
 
std::optional< Value > get (const std::string &control_name) const
 
std::optional< Value > get (const ControlId &control) const
 
bool set (const std::vector< std::string > &control_names, const std::vector< Value > &values) const
 Set controls, applied in the given order.
 
bool set (const std::string &control_name, const Value &value) const
 
bool set (const ControlId &control, const Value &value) const
 

Static Public Member Functions

static std::string toString (ControlId control)
 

Asynchronous calls

The calls above spin the SDK executor until the camera replies, so they cannot be used from one of its callbacks (e.g. while SDK::run() spins). These return at once and pass the reply to callback, on the SDK executor. A call while the camera's services are not available (see available()) gets no reply.

using EnumerateCallback = std::function< void(const std::optional< std::vector< Control > > &controls)>
 
using GetCallback = std::function< void(const std::vector< std::optional< Value > > &values)>
 
using SetCallback = std::function< void(const std::vector< bool > &accepted)>
 
bool available () const
 Whether the camera's control services are available.
 
void enumerate (EnumerateCallback callback) const
 callback gets the controls, or nullopt if the reply could not be parsed
 
void get (const std::vector< std::string > &control_names, GetCallback callback) const
 callback gets a value per control, nullopt where a control failed
 
void set (const std::vector< std::string > &control_names, const std::vector< Value > &values, SetCallback callback) const
 

Member Enumeration Documentation

◆ ControlId

Well-known controls.

Enumerator
Exposure 

Absolute exposure time, unit: 100us, 1 stands for 1/10'000 of a second.

AutoExposureMode 

Auto exposure mode, device-specific (typically 0 = manual, 1 = auto)

Member Function Documentation

◆ set() [1/2]

bool auterion::CameraControl::set ( const std::vector< std::string > &  control_names,
const std::vector< Value > &  values 
) const

Set controls, applied in the given order.

Returns
true if the camera accepted every value

◆ set() [2/2]

void auterion::CameraControl::set ( const std::vector< std::string > &  control_names,
const std::vector< Value > &  values,
SetCallback  callback 
) const

callback gets whether the camera accepted each value

Exceptions
InvalidArgumentExceptionif there are not as many values as control names

The documentation for this class was generated from the following file: