libcamera v0.3.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
libcamera::Control< T > Class Template Reference

Describe a control and its intrinsic properties. More...

Inheritance diagram for libcamera::Control< T >:
[legend]
Collaboration diagram for libcamera::Control< T >:
[legend]

## Public Types
using | type = T
| The Control template type T.

## Public Member Functions
| Control (unsigned int id, const char *name)
| Construct a Control instance.
Public Member Functions inherited from libcamera::ControlId
| ControlId (unsigned int id, const std::string &name, ControlType type)
| Construct a ControlId instance.
unsigned int | id () const
| Retrieve the control numerical ID.
const std::string & | name () const
| Retrieve the control name.
ControlType | type () const
| Retrieve the control data type.

## Detailed Description

template<typename T>
class libcamera::Control< T >

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.

## Constructor & Destructor Documentation

## ◆ Control()

template<typename T >

libcamera::Control< T >::Control | ( | unsigned int | id,
|  | const char * | name )
| inline

Construct a Control instance.

Parameters

  [in] | id | The control numerical ID
  [in] | name | The control name

The control data type is automatically deduced from the template type T.

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

- include/libcamera/controls.h
- src/libcamera/controls.cpp