64 std::array<double, 2> range) = 0;
65 virtual std::optional<RGB<double>>
84 const AwbStats &stats,
unsigned int lux,
101 static constexpr ModeConfig AwbGreyMode = { 0.0, 0.0 };
103 int parseModeConfigs(
const ValueNode &tuningData,
106 std::map<controls::AwbModeEnum, AwbAlgorithmBase::ModeConfig> modes_;
107 const ModeConfig *currentMode_ =
nullptr;
108 std::unique_ptr<AwbImplementation> impl_;
120 gainMin_ = std::max(Q::TraitsType::min, 1.0f);
125 Span<const float, 2>{ { 1.0f, 1.0f } });
std::unordered_map< const ControlId *, ControlInfo > Map
The base std::unsorted_map<> container.
Definition controls.h:367
Describe the limits of valid values for a Control.
Definition controls.h:330
Associate a list of ControlId with their values for an object.
Definition controls.h:409
Abstract type representing the value of a control.
Definition controls.h:134
A class representing a tree structure of values.
Definition value_node.h:27
Vector class.
Definition vector.h:35
Base class for AwbAlgorithm for non-templated functions implementation.
Definition awb.h:70
void prepare(awb::ActiveState &state, awb::FrameContext &frameContext)
Set the gains and colour temperature values in frameContext.
Definition awb.cpp:350
float gainMax_
The maximum supported gain value.
Definition awb.h:92
ControlInfoMap::Map controls_
Controls info map for the controls registered by the AWB algorithm.
Definition awb.h:90
void process(awb::ActiveState &state, awb::FrameContext &frameContext, const AwbStats &stats, unsigned int lux, ControlList &metadata)
Process AWB statistics to calculate gains and populate metadata.
Definition awb.cpp:370
int init(const ValueNode &tuningData)
Initialize the algorithm with the given tuning data.
Definition awb.cpp:213
void queueRequest(awb::ActiveState &state, const uint32_t frame, awb::FrameContext &frameContext, const ControlList &controls)
Queue a Request to the AWB algorithm.
Definition awb.cpp:282
int configure(awb::ActiveState &state)
Configure the AWB algorithm.
Definition awb.cpp:250
float gainMin_
The minimum supported gain value.
Definition awb.h:91
The libipa AWB algorithm.
Definition awb.h:114
int init(const ValueNode &tuningData, ControlInfoMap::Map &controls)
Definition awb.h:116
Pure virtual base class for AWB algorithms implementations.
Definition awb.h:54
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 ~AwbImplementation()=default
Virtual class destructor.
virtual std::optional< RGB< double > > gainsFromColourTemperature(double colourTemperature)=0
Compute white balance gains from a colour temperature.
Camera controls identifiers.
Framework to manage controls related to an object.
const Control< Span< const float, 2 > > ColourGains
Pair of gain values for the Red and Blue colour channels, in that order.
Top-level libcamera namespace.
Definition backtrace.h:17
The result of an AWB computation.
Definition awb.h:56
RGB< double > gains
The computed white balance gains.
Definition awb.h:57
unsigned int colourTemperature
The computed colour temperature, in Kelvin.
Definition awb.h:58
An abstraction class wrapping hardware-specific AWB statistics.
Definition awb.h:44
virtual RGB< double > rgbMeans() const =0
Get RGB means of the statistics.
virtual double computeColourError(const RGB< double > &gains) const =0
Virtual class destructor.
virtual bool valid() const =0
Retrieve if the AWB statistics are valid.
Active AWB state shared across frames.
Definition awb.h:31
Context manual
The most recent manually requested AWB state.
Definition awb.h:32
bool autoEnabled
True when automatic AWB is selected.
Definition awb.h:35
Context automatic
The most recent automatically calculated AWB state.
Definition awb.h:33
AWB gains and colour temperature.
Definition awb.h:26
unsigned int colourTemperature
The colour temperature, in Kelvin.
Definition awb.h:28
RGB< double > gains
The white balance gains.
Definition awb.h:27
Per-frame AWB state.
Definition awb.h:38
bool autoEnabled
True when automatic AWB is in use.
Definition awb.h:39
Data structure to manage tree of values.