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

Pure virtual base class for AWB algorithms implementations. More...

Inheritance diagram for libcamera::ipa::AwbImplementation:

Classes

struct  Result
 The result of an AWB computation. More...
 

Public Member Functions

virtual ~AwbImplementation ()=default
 Virtual class destructor.
 
virtual int init (const ValueNode &tuningData)=0
 Initialize the algorithm by parsing tuningData.
 
virtual Result calculateAwb (const AwbStats &stats, unsigned int lux, std::array< double, 2 > range)=0
 Calculate AWB data from the given statistics.
 
virtual std::optional< RGB< double > > gainsFromColourTemperature (double colourTemperature)=0
 Compute white balance gains from a colour temperature.
 

Detailed Description

Pure virtual base class for AWB algorithms implementations.

The AwbImplementation class defines the interface for the AWB algorithm implementations.

It is currently implemented by the AwbGrey and AwbBayes classes.

The interface defines an init() function to initialize the algorithm with the content of the tuning file and two functions to compute colour gains according to the algorithm operating mode (auto or manual) in use.

The calculateAwb() function calculates colour gains given a set of statistics provided by the IPA module. It is used when the algorithm operates in auto mode and gains are dynamically computed given a new set of statistics from the AWB engine.

The gainsFromColourTemperature() function instead computes the white balance gains from a colour temperature. This function does not take any statistics into account. It is used to compute the colour gains when the user manually specifies a colour temperature.

Member Function Documentation

◆ calculateAwb()

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

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

Calculate an AwbResult object from the given statistics and lux value. A lux value of 0 means it is unknown or invalid and the algorithm shall ignore it.

Returns
The AWB result

Implemented in libcamera::ipa::AwbBayes, and libcamera::ipa::AwbGrey.

◆ gainsFromColourTemperature()

libcamera::ipa::AwbImplementation::gainsFromColourTemperature ( double  colourTemperature)
pure virtual

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 is used to compute the colour gains when the user manually specifies a colour temperature.

Returns
The colour gains or std::nullopt if the conversion is not possible

Implemented in libcamera::ipa::AwbGrey, and libcamera::ipa::AwbBayes.

◆ init()

libcamera::ipa::AwbImplementation::init ( const ValueNode tuningData)
pure virtual

Initialize the algorithm by parsing tuningData.

Parameters
[in]tuningData

Implemented in libcamera::ipa::AwbBayes, and libcamera::ipa::AwbGrey.


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