12#include <linux/intel-ipu3.h>
20namespace ipa::ipu3::algorithms {
23static constexpr uint32_t kAwbStatsSizeX = 16;
24static constexpr uint32_t kAwbStatsSizeY = 12;
44 const ipu3_uapi_stats_3a *stats)
override;
49 RGB(
double _R = 0,
double _G = 0,
double _B = 0)
54 RGB &operator+=(RGB
const &other)
56 R += other.R, G += other.G, B += other.B;
69 void calculateWBGains(
const ipu3_uapi_stats_3a *stats);
71 void generateAwbStats(
const ipu3_uapi_stats_3a *stats);
74 uint32_t estimateCCT(
double red,
double green,
double blue);
75 static constexpr uint16_t threshold(
float value);
76 static constexpr uint16_t gainValue(
double gain);
78 std::vector<RGB> zones_;
79 Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];
80 AwbStatus asyncResults_;
83 uint32_t cellsPerZoneX_;
84 uint32_t cellsPerZoneY_;
85 uint32_t cellsPerZoneThreshold_;
The base class for all IPA algorithms.
Definition: algorithm.h:22
A Grey world white balance correction algorithm.
Definition: awb.h:36
int configure(IPAContext &context, const IPAConfigInfo &configInfo) override
Configure the Algorithm given an IPAConfigInfo.
Definition: awb.cpp:199
void process(IPAContext &context, IPAFrameContext *frameContext, const ipu3_uapi_stats_3a *stats) override
Process ISP statistics, and run algorithm operations.
Definition: awb.cpp:390
void prepare(IPAContext &context, ipu3_uapi_params *params) override
Fill the params buffer with ISP processing parameters for a frame.
Definition: awb.cpp:432
Data structures related to geometric objects.
Algorithm common interface.
Top-level libcamera namespace.
Definition: backtrace.h:17
Global IPA context data shared between all algorithms.
Definition: ipa_context.h:92
Context for a frame.
Definition: ipa_context.h:79
RGB statistics for a given zone.
Definition: awb.h:26
unsigned int counted
Number of unsaturated cells used to calculate the sums.
Definition: awb.h:27
uint64_t red
Sum of the average red values of each unsaturated cell in the zone.
Definition: awb.h:29
struct libcamera::ipa::ipu3::algorithms::Accumulator::@2 sum
A structure containing the average red, green and blue sums.
uint64_t blue
Sum of the average blue values of each unsaturated cell in the zone.
Definition: awb.h:31
uint64_t green
Sum of the average green values of each unsaturated cell in the zone.
Definition: awb.h:30