libcamera v0.7.2+rpt20260817
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
libcamera::ipa::AwbGrey Class Reference

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

Inheritance diagram for libcamera::ipa::AwbGrey:
Collaboration diagram for libcamera::ipa::AwbGrey:

Public Member Functions

int init (const ValueNode &tuningData) override
 Initialize the algorithm with the given tuning data.
 
AwbImplementation::Result calculateAwb (const AwbStats &stats, unsigned int lux, std::array< double, 2 > range) 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::AwbImplementation
virtual ~AwbImplementation ()=default
 Virtual class destructor.
 

Detailed Description

A Grey world auto white balance algorithm.

Member Function Documentation

◆ calculateAwb()

AwbImplementation::Result libcamera::ipa::AwbGrey::calculateAwb ( const AwbStats stats,
unsigned int  lux,
std::array< double, 2 >  range 
)
overridevirtual

Calculate AWB data from the given statistics.

Parameters
[in]statsThe statistics to use for the calculation
[in]luxThe lux value of the scene
[in]rangeThe colour temperature search limits

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::AwbImplementation.

◆ gainsFromColourTemperature()

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

Compute white balance gains from a colour temperature.

Parameters
[in]colourTemperatureThe 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 curve (if provided in the tuning file) on a new colour temperature.

Returns
The RGB gain values adjusted to colourTemperature or std::nullopt if no gain curve is specified in the tuning data

Implements libcamera::ipa::AwbImplementation.

◆ init()

int libcamera::ipa::AwbGrey::init ( const ValueNode tuningData)
overridevirtual

Initialize the algorithm with the given tuning data.

Parameters
[in]tuningDataThe 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::AwbImplementation.


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