Loading...
Searching...
No Matches
libcamera::ipa::AwbGrey Class Reference

A Grey world auto white balance algorithm. More...

Inheritance diagram for libcamera::ipa::AwbGrey:
[legend]
Collaboration diagram for libcamera::ipa::AwbGrey:
[legend]

## Public Member Functions

int | init (const YamlObject &tuningData) override
| Initialize the algorithm with the given tuning data.
AwbResult | calculateAwb (const AwbStats &stats, unsigned int lux) override
| Calculate AWB data from the given statistics.
std::optional< RGB< double > > | gainsFromColourTemperature (double colourTemperature) override
| Compute white balance gains from a colour temperature.
Public Member Functions inherited from libcamera::ipa::AwbAlgorithm
const ControlInfoMap::Map & | controls () const
| Get the controls info map for this algorithm.
virtual void | handleControls (const ControlList &controls)
| Handle the controls supplied in a request.

## Additional Inherited Members

Protected Member Functions inherited from libcamera::ipa::AwbAlgorithm
int | parseModeConfigs (const YamlObject &tuningData, const ControlValue &def={})
| Parse the mode configurations from the tuning data.
Protected Attributes inherited from libcamera::ipa::AwbAlgorithm
ControlInfoMap::Map | controls_
| Controls info map for the controls provided by the algorithm.
std::map< controls::AwbModeEnum, AwbAlgorithm::ModeConfig > | modes_
| Map of all configured modes.

## Detailed Description

A Grey world auto white balance algorithm.

## Member Function Documentation

## calculateAwb()

AwbResult libcamera::ipa::AwbGrey::calculateAwb | ( | const AwbStats & | stats,
|  | unsigned int | lux )

override virtual

Calculate AWB data from the given statistics.

Parameters

  [in] | stats | The statistics to use for the calculation
  [in] | lux | The lux value of the scene

The colour temperature is estimated based on the colours::estimateCCT() function. The gains are calculated purely based on the RGB means provided by the stats. The colour temperature is not taken into account when calculating the gains.

The lux parameter is not used in this algorithm.

Returns
  The AWB result

Implements libcamera::ipa::AwbAlgorithm.

## gainsFromColourTemperature()

std::optional< RGB< double > > libcamera::ipa::AwbGrey::gainsFromColourTemperature | ( | double | colourTemperature | ) |

override virtual

Compute white balance gains from a colour temperature.

Parameters

  [in] | colourTemperature | The colour temperature in Kelvin

Compute the white balance gains from a colourTemperature. This function does not take any statistics into account. It simply interpolates the colour gains configured in the colour temperature curve.

Returns
  The colour gains if a colour temperature curve is available, [1, 1, 1] otherwise.

Implements libcamera::ipa::AwbAlgorithm.

## init()

int libcamera::ipa::AwbGrey::init | ( | const YamlObject & | tuningData | ) |

override virtual

Initialize the algorithm with the given tuning data.

Parameters

  [in] | tuningData | The tuning data for the algorithm

Load the colour temperature curve from the tuning data. If there is no tuning data available, continue with a warning. Manual colour temperature will not work in that case.

Returns
  0 on success, a negative error code otherwise

Implements libcamera::ipa::AwbAlgorithm.

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

- src/ipa/libipa/awb_grey.h
- src/ipa/libipa/awb_grey.cpp