libcamera
v0.5.0
Supporting cameras in Linux since 2019
|
A base class for auto white balance algorithms. More...
Classes | |
class | ModeConfig |
Holds the configuration of a single AWB mode. More... | |
Public Member Functions | |
virtual int | init (const YamlObject &tuningData)=0 |
Initialize the algorithm with the given tuning data. More... | |
virtual AwbResult | calculateAwb (const AwbStats &stats, unsigned int lux)=0 |
Calculate AWB data from the given statistics. More... | |
virtual RGB< double > | gainsFromColourTemperature (double colourTemperature)=0 |
Compute white balance gains from a colour temperature. More... | |
const ControlInfoMap::Map & | controls () const |
Get the controls info map for this algorithm. More... | |
virtual void | handleControls ([[maybe_unused]] const ControlList &controls) |
Handle the controls supplied in a request. More... | |
Protected Member Functions | |
int | parseModeConfigs (const YamlObject &tuningData, const ControlValue &def={}) |
Parse the mode configurations from the tuning data. More... | |
Protected Attributes | |
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. More... | |
A base class for auto white balance algorithms.
This class is a base class for auto white balance algorithms. It defines an interface for the algorithms to implement, and is used by the IPAs to interact with the concrete implementation.
|
pure virtual |
Calculate AWB data from the given statistics.
[in] | stats | The statistics to use for the calculation |
[in] | lux | The lux value of the scene |
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.
Implemented in libcamera::ipa::AwbBayes, and libcamera::ipa::AwbGrey.
|
inline |
Get the controls info map for this algorithm.
|
pure virtual |
Compute white balance gains from a colour temperature.
[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 is used to compute the colour gains when the user manually specifies a colour temperature.
Implemented in libcamera::ipa::AwbBayes, and libcamera::ipa::AwbGrey.
|
inlinevirtual |
Handle the controls supplied in a request.
[in] | controls | The controls to handle |
|
pure virtual |
Initialize the algorithm with the given tuning data.
[in] | tuningData | The tuning data to use for the algorithm |
Implemented in libcamera::ipa::AwbBayes, and libcamera::ipa::AwbGrey.
|
protected |
Parse the mode configurations from the tuning data.
[in] | tuningData | the YamlObject representing the tuning data |
[in] | def | The default value for the AwbMode control |
Utility function to parse the tuning data for an AwbMode entry and read all provided modes. It adds controls::AwbMode to AwbAlgorithm::controls_ and populates AwbAlgorithm::modes_. For a list of possible modes see controls::AwbModeEnum.
Each mode entry must contain a "lo" and "hi" key to specify the lower and upper colour temperature of that mode. For example:
If def is supplied but not contained in the the tuningData, -EINVAL is returned.
|
protected |
Map of all configured modes.