controls.h File Reference

Framework to manage controls related to an object. More...

`#include <assert.h>`
`#include <stdint.h>`
`#include <string>`
`#include <unordered_map>`
`#include <libcamera/geometry.h>`
`#include <libcamera/span.h>`

Go to the source code of this file.

## Classes

class | libcamera::ControlValue
| Abstract type representing the value of a control. More...
class | libcamera::ControlId
| Control static metadata. More...
class | libcamera::Control< T >
| Describe a control and its intrinsic properties. More...
class | libcamera::ControlInfo
| Describe the limits of valid values for a Control. More...
class | libcamera::ControlInfoMap
| A map of ControlId to ControlInfo. More...
class | libcamera::ControlList
| Associate a list of ControlId with their values for an object. More...

## Typedefs

using | libcamera::ControlIdMap = std::unordered_map< unsigned int, const ControlId * >
| A map of numerical control ID to ControlId. More...

## Enumerations

enum | libcamera::ControlType { libcamera::ControlTypeNone , libcamera::ControlTypeBool , libcamera::ControlTypeByte , libcamera::ControlTypeInteger32 , libcamera::ControlTypeInteger64 , libcamera::ControlTypeFloat , libcamera::ControlTypeString , ControlTypeRectangle , ControlTypeSize }
| Define the data type of a Control. More...

## Detailed Description

Framework to manage controls related to an object.

A control is a mean to govern or influence the operation of an object, and in particular of a camera. Every control is defined by a unique numerical ID, a name string and the data type of the value it stores. The libcamera API defines a set of standard controls in the libcamera::controls namespace, as a set of instances of the Control class.

The main way for applications to interact with controls is through the ControlList stored in the Request class:

Request *req = ...;
ControlList &controls = req->controls();
controls->set(controls::AwbEnable, false);
controls->set(controls::ManualExposure, 1000);
...
int32_t exposure = controls->get(controls::ManualExposure);
libcamera::controls::AwbEnable
const Control< bool > AwbEnable
Enable or disable the AWB.
libcamera::controls::controls
const ControlIdMap controls
List of all supported libcamera controls.
Definition: control_ids.cpp:291

The ControlList::get() and ControlList::set() methods automatically deduce the data type based on the control.

## Typedef Documentation

## ControlIdMap

libcamera::ControlIdMap

A map of numerical control ID to ControlId.

The map is used by ControlList instances to access controls by numerical IDs. A global map of all libcamera controls is provided by controls::controls.

## Enumeration Type Documentation

## ControlType

enum libcamera::ControlType

Define the data type of a Control.

Enumerator
ControlTypeNone | Invalid type, for empty values
ControlTypeBool | The control stores a boolean value
ControlTypeByte | The control stores a byte value as an unsigned 8-bit integer
ControlTypeInteger32 | The control stores a 32-bit integer value
ControlTypeInteger64 | The control stores a 64-bit integer value
ControlTypeFloat | The control stores a 32-bit floating point value
ControlTypeString | The control stores a string value as an array of char