libcamera v0.1.0+127-8e215127-dirty (2023-12-02T01:06:12+00:00)
Supporting cameras in Linux since 2019
|
Describe a control and its intrinsic properties. More...
Public Types | |
using | type = T |
The Control template type T. | |
Public Member Functions | |
Control (unsigned int id, const char *name) | |
Construct a Control instance. More... | |
![]() | |
ControlId (unsigned int id, const std::string &name, ControlType type) | |
Construct a ControlId instance. More... | |
unsigned int | id () const |
Retrieve the control numerical ID. More... | |
const std::string & | name () const |
Retrieve the control name. More... | |
ControlType | type () const |
Retrieve the control data type. More... | |
Describe a control and its intrinsic properties.
The Control class models a control exposed by an object. Its template type name T refers to the control data type, and allows functions that operate on control values to be defined as template functions using the same type T for the control value. See for instance how the ControlList::get() function returns a value corresponding to the type of the requested control.
While this class is the main means to refer to a control, the control identifying information is stored in the non-template base ControlId class. This allows code that operates on a set of controls of different types to reference those controls through a ControlId instead of a Control. For instance, the list of controls supported by a camera is exposed as ControlId instead of Control.
Controls of any type can be defined through template specialisation, but libcamera only supports the bool, uint8_t, int32_t, int64_t and float types natively (this includes types that are equivalent to the supported types, such as int and long int).
Controls IDs shall be unique. While nothing prevents multiple instances of the Control class to be created with the same ID for the same object, doing so may cause undefined behaviour.
|
inline |
Construct a Control instance.
[in] | id | The control numerical ID |
[in] | name | The control name |
The control data type is automatically deduced from the template type T.