7#ifndef __LIBCAMERA_IPU3_ALGORITHMS_AWB_H__
8#define __LIBCAMERA_IPU3_ALGORITHMS_AWB_H__
12#include <linux/intel-ipu3.h>
20namespace ipa::ipu3::algorithms {
23static constexpr uint32_t kAwbStatsSizeX = 16;
24static constexpr uint32_t kAwbStatsSizeY = 12;
48 RGB(
double _R = 0,
double _G = 0,
double _B = 0)
53 RGB &operator+=(
RGB const &other)
55 R += other.R, G += other.G, B += other.B;
68 void calculateWBGains(
const ipu3_uapi_stats_3a *stats);
70 void generateAwbStats(
const ipu3_uapi_stats_3a *stats);
73 uint32_t estimateCCT(
double red,
double green,
double blue);
74 static constexpr uint16_t threshold(
float value);
76 std::vector<RGB> zones_;
77 Accumulator awbStats_[kAwbStatsSizeX * kAwbStatsSizeY];
78 AwbStatus asyncResults_;
81 uint32_t cellsPerZoneX_;
82 uint32_t cellsPerZoneY_;
83 uint32_t cellsPerZoneThreshold_;
Algorithm common interface.
The base class for all IPU3 algorithms.
Definition: algorithm.h:19
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:196
void prepare(IPAContext &context, ipu3_uapi_params *params) override
Fill the params buffer with ISP processing parameters for a frame.
Definition: awb.cpp:397
void process(IPAContext &context, const ipu3_uapi_stats_3a *stats) override
Process ISP statistics, and run algorithm operations.
Definition: awb.cpp:376
Data structures related to geometric objects.
@ RGB
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:55
Top-level libcamera namespace.
Definition: backtrace.h:17
Global IPA context data shared between all algorithms.
Definition: ipa_context.h:63
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::@3 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