libcamera  v0.0.0
Supporting cameras in Linux since 2019
Enumerations | Variables
libcamera::controls Namespace Reference

Namespace for libcamera controls. More...

Enumerations

enum  {
  AE_ENABLE = 1 , AE_LOCKED = 2 , AE_METERING_MODE = 3 , AE_CONSTRAINT_MODE = 4 ,
  AE_EXPOSURE_MODE = 5 , EXPOSURE_VALUE = 6 , EXPOSURE_TIME = 7 , ANALOGUE_GAIN = 8 ,
  BRIGHTNESS = 9 , CONTRAST = 10 , LUX = 11 , AWB_ENABLE = 12 ,
  AWB_MODE = 13 , COLOUR_GAINS = 14 , COLOUR_TEMPERATURE = 15 , SATURATION = 16 ,
  SENSOR_BLACK_LEVELS = 17 , SHARPNESS = 18
}
 
enum  AeMeteringModeValues {
  MeteringCentreWeighted = 0 , MeteringSpot = 1 , MeteringMatrix = 2 , MeteringCustom = 3 ,
  MeteringModeMax = 3
}
 Supported AeMeteringMode values. More...
 
enum  AeConstraintModeValues {
  ConstraintNormal = 0 , ConstraintHighlight = 1 , ConstraintShadows = 2 , ConstraintCustom = 3 ,
  ConstraintModeMax = 3
}
 Supported AeConstraintMode values. More...
 
enum  AeExposureModeValues {
  ExposureNormal = 0 , ExposureShort = 1 , ExposureLong = 2 , ExposureCustom = 3 ,
  ExposureModeMax = 3
}
 Supported AeExposureMode values. More...
 
enum  AwbModeValues {
  AwbAuto = 0 , AwbIncandescent = 1 , AwbTungsten = 2 , AwbFluorescent = 3 ,
  AwbIndoor = 4 , AwbDaylight = 5 , AwbCloudy = 6 , AwbCustom = 7 ,
  AwbModeMax = 7
}
 Supported AwbMode values. More...
 

Variables

const Control< bool > AeEnable
 Enable or disable the AE. More...
 
const Control< bool > AeLocked
 Report the lock status of a running AE algorithm. More...
 
const Control< int32_t > AeMeteringMode
 Specify a metering mode for the AE algorithm to use. The metering modes determine which parts of the image are used to determine the scene brightness. Metering modes may be platform specific and not all metering modes may be supported.
 
const Control< int32_t > AeConstraintMode
 Specify a constraint mode for the AE algorithm to use. These determine how the measured scene brightness is adjusted to reach the desired target exposure. Constraint modes may be platform specific, and not all constraint modes may be supported.
 
const Control< int32_t > AeExposureMode
 Specify an exposure mode for the AE algorithm to use. These specify how the desired total exposure is divided between the shutter time and the sensor's analogue gain. The exposure modes are platform specific, and not all exposure modes may be supported.
 
const Control< float > ExposureValue
 Specify an Exposure Value (EV) parameter. The EV parameter will only be applied if the AE algorithm is currently enabled. More...
 
const Control< int32_t > ExposureTime
 Exposure time (shutter speed) for the frame applied in the sensor device. This value is specified in micro-seconds. More...
 
const Control< float > AnalogueGain
 Analogue gain value applied in the sensor device. The value of the control specifies the gain multiplier applied to all colour channels. This value cannot be lower than 1.0. More...
 
const Control< float > Brightness
 Specify a fixed brightness parameter. Positive values (up to 1.0) produce brighter images; negative values (up to -1.0) produce darker images and 0.0 leaves pixels unchanged.
 
const Control< float > Contrast
 Specify a fixed contrast parameter. Normal contrast is given by the value 1.0; larger values produce images with more contrast.
 
const Control< float > Lux
 Report an estimate of the current illuminance level in lux. The Lux control can only be returned in metadata.
 
const Control< bool > AwbEnable
 Enable or disable the AWB. More...
 
const Control< int32_t > AwbMode
 Specify the range of illuminants to use for the AWB algorithm. The modes supported are platform specific, and not all modes may be supported.
 
const Control< Span< const float > > ColourGains
 Pair of gain values for the Red and Blue colour channels, in that order. ColourGains can only be applied in a Request when the AWB is disabled. More...
 
const Control< int32_t > ColourTemperature
 Report the current estimate of the colour temperature, in kelvin, for this frame. The ColourTemperature control can only be returned in metadata.
 
const Control< float > Saturation
 Specify a fixed saturation parameter. Normal saturation is given by the value 1.0; larger values produce more saturated colours; 0.0 produces a greyscale image.
 
const Control< Span< const int32_t > > SensorBlackLevels
 Reports the sensor black levels used for processing a frame, in the order R, Gr, Gb, B. These values are returned as numbers out of a 16-bit pixel range (as if pixels ranged from 0 to 65535). The SensorBlackLevels control can only be returned in metadata.
 
const Control< float > Sharpness
 A value of 0.0 means no sharpening. The minimum value means minimal sharpening, and shall be 0.0 unless the camera can't disable sharpening completely. The default value shall give a "reasonable" level of sharpening, suitable for most use cases. The maximum value may apply extremely high levels of sharpening, higher than anyone could reasonably want. Negative values are not allowed. Note also that sharpening is not applied to raw streams.
 
const ControlIdMap controls
 List of all supported libcamera controls. More...
 

Detailed Description

Namespace for libcamera controls.

Enumeration Type Documentation

◆ AeConstraintModeValues

Supported AeConstraintMode values.

Enumerator
ConstraintNormal 

Default constraint mode. This mode aims to balance the exposure of different parts of the image so as to reach a reasonable average level. However, highlights in the image may appear over-exposed and lowlights may appear under-exposed.

ConstraintHighlight 

Highlight constraint mode. This mode adjusts the exposure levels in order to try and avoid over-exposing the brightest parts (highlights) of an image. Other non-highlight parts of the image may appear under-exposed.

ConstraintShadows 

Shadows constraint mode. This mode adjusts the exposure levels in order to try and avoid under-exposing the dark parts (shadows) of an image. Other normally exposed parts of the image may appear over-exposed.

ConstraintCustom 

Custom constraint mode.

ConstraintModeMax 

Maximum allowed value (place any new values above here).

◆ AeExposureModeValues

Supported AeExposureMode values.

Enumerator
ExposureNormal 

Default exposure mode.

ExposureShort 

Exposure mode allowing only short exposure times.

ExposureLong 

Exposure mode allowing long exposure times.

ExposureCustom 

Custom exposure mode.

ExposureModeMax 

Maximum allowed value (place any new values above here).

◆ AeMeteringModeValues

Supported AeMeteringMode values.

Enumerator
MeteringCentreWeighted 

Centre-weighted metering mode.

MeteringSpot 

Spot metering mode.

MeteringMatrix 

Matrix metering mode.

MeteringCustom 

Custom metering mode.

MeteringModeMax 

Maximum allowed value (place any new values above here).

◆ AwbModeValues

Supported AwbMode values.

Enumerator
AwbAuto 

Search over the whole colour temperature range.

AwbIncandescent 

Incandescent AWB lamp mode.

AwbTungsten 

Tungsten AWB lamp mode.

AwbFluorescent 

Fluorescent AWB lamp mode.

AwbIndoor 

Indoor AWB lighting mode.

AwbDaylight 

Daylight AWB lighting mode.

AwbCloudy 

Cloudy AWB lighting mode.

AwbCustom 

Custom AWB mode.

AwbModeMax 

Maximum allowed value (place any new values above here).

Variable Documentation

◆ AeEnable

libcamera::controls::AeEnable
extern

Enable or disable the AE.

See also
ExposureTime AnalogueGain

◆ AeLocked

libcamera::controls::AeLocked
extern

Report the lock status of a running AE algorithm.

If the AE algorithm is locked the value shall be set to true, if it's converging it shall be set to false. If the AE algorithm is not running the control shall not be present in the metadata control list.

See also
AeEnable

◆ AnalogueGain

libcamera::controls::AnalogueGain
extern

Analogue gain value applied in the sensor device. The value of the control specifies the gain multiplier applied to all colour channels. This value cannot be lower than 1.0.

See also
ExposureTime AeEnable

◆ AwbEnable

libcamera::controls::AwbEnable
extern

Enable or disable the AWB.

See also
ColourGains

◆ ColourGains

libcamera::controls::ColourGains
extern

Pair of gain values for the Red and Blue colour channels, in that order. ColourGains can only be applied in a Request when the AWB is disabled.

See also
AwbEnable

◆ controls

const ControlIdMap libcamera::controls::controls
extern
Initial value:
{
{ AE_ENABLE, &AeEnable },
{ AE_LOCKED, &AeLocked },
{ AE_METERING_MODE, &AeMeteringMode },
{ AE_CONSTRAINT_MODE, &AeConstraintMode },
{ AE_EXPOSURE_MODE, &AeExposureMode },
{ EXPOSURE_VALUE, &ExposureValue },
{ EXPOSURE_TIME, &ExposureTime },
{ ANALOGUE_GAIN, &AnalogueGain },
{ BRIGHTNESS, &Brightness },
{ CONTRAST, &Contrast },
{ LUX, &Lux },
{ AWB_ENABLE, &AwbEnable },
{ AWB_MODE, &AwbMode },
{ COLOUR_GAINS, &ColourGains },
{ COLOUR_TEMPERATURE, &ColourTemperature },
{ SATURATION, &Saturation },
{ SENSOR_BLACK_LEVELS, &SensorBlackLevels },
{ SHARPNESS, &Sharpness },
}
const Control< float > Brightness
Specify a fixed brightness parameter. Positive values (up to 1.0) produce brighter images; negative v...
const Control< int32_t > AeExposureMode
Specify an exposure mode for the AE algorithm to use. These specify how the desired total exposure is...
const Control< int32_t > AwbMode
Specify the range of illuminants to use for the AWB algorithm. The modes supported are platform speci...
const Control< Span< const int32_t > > SensorBlackLevels
Reports the sensor black levels used for processing a frame, in the order R, Gr, Gb,...
const Control< bool > AwbEnable
Enable or disable the AWB.
const Control< int32_t > ExposureTime
Exposure time (shutter speed) for the frame applied in the sensor device. This value is specified in ...
const Control< bool > AeLocked
Report the lock status of a running AE algorithm.
const Control< float > Contrast
Specify a fixed contrast parameter. Normal contrast is given by the value 1.0; larger values produce ...
const Control< float > ExposureValue
Specify an Exposure Value (EV) parameter. The EV parameter will only be applied if the AE algorithm i...
const Control< bool > AeEnable
Enable or disable the AE.
const Control< int32_t > ColourTemperature
Report the current estimate of the colour temperature, in kelvin, for this frame. The ColourTemperatu...
const Control< float > Saturation
Specify a fixed saturation parameter. Normal saturation is given by the value 1.0; larger values prod...
const Control< float > Lux
Report an estimate of the current illuminance level in lux. The Lux control can only be returned in m...
const Control< int32_t > AeMeteringMode
Specify a metering mode for the AE algorithm to use. The metering modes determine which parts of the ...
const Control< float > AnalogueGain
Analogue gain value applied in the sensor device. The value of the control specifies the gain multipl...
const Control< Span< const float > > ColourGains
Pair of gain values for the Red and Blue colour channels, in that order. ColourGains can only be appl...
const Control< float > Sharpness
A value of 0.0 means no sharpening. The minimum value means minimal sharpening, and shall be 0....
const Control< int32_t > AeConstraintMode
Specify a constraint mode for the AE algorithm to use. These determine how the measured scene brightn...

List of all supported libcamera controls.

Unless otherwise stated, all controls are bi-directional, i.e. they can be set through Request::controls() and returned out through Request::metadata().

◆ ExposureTime

libcamera::controls::ExposureTime
extern

Exposure time (shutter speed) for the frame applied in the sensor device. This value is specified in micro-seconds.

See also
AnalogueGain AeEnable

◆ ExposureValue

libcamera::controls::ExposureValue
extern

Specify an Exposure Value (EV) parameter. The EV parameter will only be applied if the AE algorithm is currently enabled.

By convention EV adjusts the exposure as log2. For example EV = [-2, -1, 0.5, 0, 0.5, 1, 2] results in an exposure adjustment of [1/4x, 1/2x, 1/sqrt(2)x, 1x, sqrt(2)x, 2x, 4x].

See also
AeEnable