12 #include <linux/intel-ipu3.h> 16 #include "algorithm.h" 20 namespace ipa::ipu3::algorithms {
23 static constexpr uint32_t kAwbStatsSizeX = 16;
24 static constexpr uint32_t kAwbStatsSizeY = 12;
41 int configure(
IPAContext &context,
const IPAConfigInfo &configInfo)
override;
42 void prepare(
IPAContext &context,
const uint32_t frame,
44 ipu3_uapi_params *params)
override;
45 void process(
IPAContext &context,
const uint32_t frame,
47 const ipu3_uapi_stats_3a *stats,
53 RGB(
double _R = 0,
double _G = 0,
double _B = 0)
58 RGB &operator+=(
RGB const &other)
60 R += other.R, G += other.G, B += other.B;
73 void calculateWBGains(
const ipu3_uapi_stats_3a *stats);
75 void generateAwbStats(
const ipu3_uapi_stats_3a *stats);
78 static constexpr uint16_t threshold(
float value);
79 static constexpr uint16_t gainValue(
double gain);
81 std::vector<RGB> zones_;
82 Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];
83 AwbStatus asyncResults_;
86 uint32_t cellsPerZoneX_;
87 uint32_t cellsPerZoneY_;
88 uint32_t cellsPerZoneThreshold_;
Global IPA context data shared between all algorithms.
Definition: ipa_context.h:86
A Grey world white balance correction algorithm.
Definition: awb.h:35
uint64_t green
Sum of the average green values of each unsaturated cell in the zone.
Definition: awb.h:30
Top-level libcamera namespace.
Definition: backtrace.h:17
Sensor is not Bayer; output has 3 16-bit values for each pixel, instead of just 1 16-bit value per pi...
Definition: property_ids.h:73
uint64_t red
Sum of the average red values of each unsaturated cell in the zone.
Definition: awb.h:29
unsigned int counted
Number of unsaturated cells used to calculate the sums.
Definition: awb.h:27
IPU3-specific FrameContext.
Definition: ipa_context.h:79
RGB statistics for a given zone.
Definition: awb.h:26
struct libcamera::ipa::ipu3::algorithms::Accumulator::@4 sum
A structure containing the average red, green and blue sums.
Associate a list of ControlId with their values for an object.
Definition: controls.h:380
The base class for all IPA algorithms.
Definition: algorithm.h:22
Data structures related to geometric objects.
uint64_t blue
Sum of the average blue values of each unsaturated cell in the zone.
Definition: awb.h:31