#include <v4lcontrol.h>
Public Member Functions | |
const std::string & | getDevice (void) const |
return file name of the opened device | |
int | getFile (void) const |
return file descriptor for the opened device | |
bool | getReportErrors (void) const |
void | setReportErrors (bool report) |
set error reporting | |
V4LControl (const std::string &name, bool report=true) | |
V4LControl (int fd, bool report=true) | |
HighLevel | |
High level interface to set specific parameters without much hassle. These might fail if the parameter is not supported by the device and do not throw exceptions. Moreover ranges of parameter values are abstracted to lie within the intervall [0,1]. If you want to have more control, use the lower level interface described in Generic . | |
bool | autoexposure () |
void | autoexposure (bool) |
bool | autogain (void) |
void | autogain (bool) |
double | brightness (void) |
void | brightness (double) |
double | contrast (void) |
void | contrast (double) |
int | exposure (void) |
void | exposure (int) |
double | gain (void) |
void | gain (double) |
double | saturation (void) |
void | saturation (double) |
Generic | |
int | defaultValue (unsigned int id) const |
int | defaultValue (const std::string &name) |
int | get (unsigned int id) |
int | get (const std::string &name) |
unsigned int | getId (const std::string &name) const |
std::string | getName (unsigned int id) const |
bool | isSupported (unsigned int id) const |
bool | isSupported (const std::string &name) const |
int | max (unsigned int id) const |
int | max (const std::string &name) |
std::map< unsigned int, std::string > | menuValues (unsigned int id) const |
std::map< unsigned int, std::string > | menuValues (const std::string &name) |
int | min (unsigned int id) const |
int | min (const std::string &name) |
void | set (unsigned int id, int value) |
void | set (const std::string &name, int value) |
int | step (unsigned int id) const |
int | step (const std::string &name) |
std::vector< std::string > | supportedParameterNames (void) const |
std::vector< unsigned int > | supportedParameters (void) const |
int | type (unsigned int id) |
int | type (const std::string &name) |
LowLevel | |
int | getControlStruct (v4l2_control &value) const |
void | getMenuStruct (unsigned int id, std::vector< v4l2_querymenu > &menu) const |
int | getQueryStruct (v4l2_queryctrl &query) const |
int | setControlStruct (v4l2_control &value) |
Protected Member Functions | |
void | queryControls (void) |
Protected Attributes | |
struct v4l2_control | control |
std::map< unsigned int, v4l2_queryctrl > | controlData |
std::map< std::string, unsigned int > | controlNames |
int | device |
std::string | deviceName |
std::map< unsigned int, std::vector< v4l2_querymenu > > | menuData |
bool | reportErrors |
exposes the V4L2 API to set parameters on a capture device. It can be used in parallel to a v4lbuffer object to control and query all parameters supported. Several abstraction levels are supported. On the highest there are individual member functions for various fixed parameters. The next level supports querying and setting/getting values for all parameters supported by the driver. Finally, low-level access using V4L2 structs is supported as well.
Definition at line 64 of file v4lcontrol.h.
CVD::V4LControl::V4LControl | ( | int | fd, | |
bool | report = true | |||
) |
CVD::V4LControl::V4LControl | ( | const std::string & | name, | |
bool | report = true | |||
) |
bool CVD::V4LControl::autoexposure | ( | ) |
void CVD::V4LControl::autoexposure | ( | bool | ) |
bool CVD::V4LControl::autogain | ( | void | ) |
void CVD::V4LControl::autogain | ( | bool | ) |
double CVD::V4LControl::brightness | ( | void | ) |
void CVD::V4LControl::brightness | ( | double | ) |
double CVD::V4LControl::contrast | ( | void | ) |
void CVD::V4LControl::contrast | ( | double | ) |
int CVD::V4LControl::defaultValue | ( | unsigned int | id | ) | const |
int CVD::V4LControl::defaultValue | ( | const std::string & | name | ) | [inline] |
Definition at line 122 of file v4lcontrol.h.
int CVD::V4LControl::exposure | ( | void | ) |
void CVD::V4LControl::exposure | ( | int | ) |
double CVD::V4LControl::gain | ( | void | ) |
void CVD::V4LControl::gain | ( | double | ) |
int CVD::V4LControl::get | ( | unsigned int | id | ) |
int CVD::V4LControl::get | ( | const std::string & | name | ) | [inline] |
Definition at line 113 of file v4lcontrol.h.
int CVD::V4LControl::getControlStruct | ( | v4l2_control & | value | ) | const |
const std::string& CVD::V4LControl::getDevice | ( | void | ) | const [inline] |
return file name of the opened device
Definition at line 161 of file v4lcontrol.h.
int CVD::V4LControl::getFile | ( | void | ) | const [inline] |
return file descriptor for the opened device
Definition at line 158 of file v4lcontrol.h.
unsigned int CVD::V4LControl::getId | ( | const std::string & | name | ) | const |
void CVD::V4LControl::getMenuStruct | ( | unsigned int | id, | |
std::vector< v4l2_querymenu > & | menu | |||
) | const |
std::string CVD::V4LControl::getName | ( | unsigned int | id | ) | const |
int CVD::V4LControl::getQueryStruct | ( | v4l2_queryctrl & | query | ) | const |
bool CVD::V4LControl::getReportErrors | ( | void | ) | const [inline] |
Definition at line 165 of file v4lcontrol.h.
bool CVD::V4LControl::isSupported | ( | unsigned int | id | ) | const [inline] |
Definition at line 135 of file v4lcontrol.h.
bool CVD::V4LControl::isSupported | ( | const std::string & | name | ) | const [inline] |
Definition at line 107 of file v4lcontrol.h.
int CVD::V4LControl::max | ( | unsigned int | id | ) | const |
int CVD::V4LControl::max | ( | const std::string & | name | ) | [inline] |
Definition at line 128 of file v4lcontrol.h.
std::map<unsigned int, std::string> CVD::V4LControl::menuValues | ( | unsigned int | id | ) | const |
std::map<unsigned int, std::string> CVD::V4LControl::menuValues | ( | const std::string & | name | ) | [inline] |
Definition at line 119 of file v4lcontrol.h.
int CVD::V4LControl::min | ( | unsigned int | id | ) | const |
int CVD::V4LControl::min | ( | const std::string & | name | ) | [inline] |
Definition at line 125 of file v4lcontrol.h.
void CVD::V4LControl::queryControls | ( | void | ) | [protected] |
double CVD::V4LControl::saturation | ( | void | ) |
void CVD::V4LControl::saturation | ( | double | ) |
void CVD::V4LControl::set | ( | unsigned int | id, | |
int | value | |||
) |
void CVD::V4LControl::set | ( | const std::string & | name, | |
int | value | |||
) | [inline] |
Definition at line 110 of file v4lcontrol.h.
int CVD::V4LControl::setControlStruct | ( | v4l2_control & | value | ) |
void CVD::V4LControl::setReportErrors | ( | bool | report | ) | [inline] |
set error reporting
Definition at line 164 of file v4lcontrol.h.
int CVD::V4LControl::step | ( | unsigned int | id | ) | const |
int CVD::V4LControl::step | ( | const std::string & | name | ) | [inline] |
Definition at line 131 of file v4lcontrol.h.
std::vector<std::string> CVD::V4LControl::supportedParameterNames | ( | void | ) | const |
std::vector<unsigned int> CVD::V4LControl::supportedParameters | ( | void | ) | const |
int CVD::V4LControl::type | ( | unsigned int | id | ) |
int CVD::V4LControl::type | ( | const std::string & | name | ) | [inline] |
Definition at line 116 of file v4lcontrol.h.
struct v4l2_control CVD::V4LControl::control [protected] |
Definition at line 170 of file v4lcontrol.h.
std::map<unsigned int, v4l2_queryctrl> CVD::V4LControl::controlData [protected] |
Definition at line 176 of file v4lcontrol.h.
std::map<std::string, unsigned int> CVD::V4LControl::controlNames [protected] |
Definition at line 175 of file v4lcontrol.h.
int CVD::V4LControl::device [protected] |
Definition at line 168 of file v4lcontrol.h.
std::string CVD::V4LControl::deviceName [protected] |
Definition at line 169 of file v4lcontrol.h.
std::map<unsigned int, std::vector<v4l2_querymenu> > CVD::V4LControl::menuData [protected] |
Definition at line 177 of file v4lcontrol.h.
bool CVD::V4LControl::reportErrors [protected] |
Definition at line 171 of file v4lcontrol.h.