libcamera  v0.4.0
Supporting cameras in Linux since 2019
Public Types | Public Member Functions | List of all members
libcamera::ControlId Class Reference

Control static metadata. More...

Inheritance diagram for libcamera::ControlId:
Inheritance graph
[legend]

Public Types

enum  Direction { In = (1 << 0), Out = (1 << 1) }
 The direction the control is capable of being passed from/to.
 
using DirectionFlags = Flags< Direction >
 A wrapper for ControlId::Direction so that it can be used as flags.
 

Public Member Functions

 ControlId (unsigned int id, const std::string &name, const std::string &vendor, ControlType type, DirectionFlags direction, std::size_t size=0, const std::map< std::string, int32_t > &enumStrMap={})
 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...
 
const std::string & vendor () const
 Retrieve the vendor name. More...
 
ControlType type () const
 Retrieve the control data type. More...
 
DirectionFlags direction () const
 Return the direction that the control can be used in. More...
 
bool isInput () const
 Determine if the control is available to be used as an input control. More...
 
bool isOutput () const
 Determine if the control is available to be used in output metadata. More...
 
bool isArray () const
 Determine if the control is an array control. More...
 
std::size_t size () const
 Retrieve the size of the control if it is an array control. More...
 
const std::map< int32_t, std::string > & enumerators () const
 Retrieve the map of enum values to enum names. More...
 

Detailed Description

Control static metadata.

The ControlId class stores a control ID, name and data type. It provides unique identification of a control, but without support for compile-time type deduction that the derived template Control class supports. See the Control class for more information.

Constructor & Destructor Documentation

◆ ControlId()

libcamera::ControlId::ControlId ( unsigned int  id,
const std::string &  name,
const std::string &  vendor,
ControlType  type,
DirectionFlags  direction,
std::size_t  size = 0,
const std::map< std::string, int32_t > &  enumStrMap = {} 
)

Construct a ControlId instance.

Parameters
[in]idThe control numerical ID
[in]nameThe control name
[in]vendorThe vendor name
[in]typeThe control data type
[in]directionThe direction of the control, if it can be used in Controls or Metadata
[in]sizeThe size of the array control, or 0 if scalar control
[in]enumStrMapThe map from enum names to values (optional)

Member Function Documentation

◆ direction()

DirectionFlags libcamera::ControlId::direction ( ) const
inline

Return the direction that the control can be used in.

This is similar to

See also
isInput() and
isOutput(), but returns the flags direction instead of booleans for each direction.
Returns
The direction flags corresponding to if the control can be used as an input control or as output metadata

◆ enumerators()

const std::map< int32_t, std::string > & libcamera::ControlId::enumerators ( ) const
inline

Retrieve the map of enum values to enum names.

Returns
The map of enum values to enum names

◆ id()

unsigned int libcamera::ControlId::id ( ) const
inline

Retrieve the control numerical ID.

Returns
The control numerical ID

◆ isArray()

bool libcamera::ControlId::isArray ( ) const
inline

Determine if the control is an array control.

Returns
True if the control is an array control, false otherwise

◆ isInput()

bool libcamera::ControlId::isInput ( ) const
inline

Determine if the control is available to be used as an input control.

Controls can be used either as input in controls, or as output in metadata. This function checks if the control is allowed to be used as the former.

Returns
True if the control can be used as an input control, false otherwise

◆ isOutput()

bool libcamera::ControlId::isOutput ( ) const
inline

Determine if the control is available to be used in output metadata.

Controls can be used either as input in controls, or as output in metadata. This function checks if the control is allowed to be used as the latter.

Returns
True if the control can be returned in output metadata, false otherwise

◆ name()

const char * libcamera::ControlId::name ( ) const
inline

Retrieve the control name.

Returns
The control name

◆ size()

std::size_t libcamera::ControlId::size ( ) const
inline

Retrieve the size of the control if it is an array control.

Returns
The size of the array control, size_t::max for dynamic extent, or 0 for non-array

◆ type()

ControlType libcamera::ControlId::type ( ) const
inline

Retrieve the control data type.

Returns
The control data type

◆ vendor()

const std::string & libcamera::ControlId::vendor ( ) const
inline

Retrieve the vendor name.

Returns
The vendor name, as a string

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