diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-19 02:34:13 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-24 16:40:24 +0300 |
commit | 11f5c3ad0561a4e4b1e06f477ab2022c69803ad2 (patch) | |
tree | 15038a08c2da9c7f25c547f8a5376c1af8f50713 /src/ipa/ipu3/algorithms/awb.cpp | |
parent | 32d5f0d2a41a3e973afa4318b37a6db34fe82983 (diff) |
ipa: ipu3: Fill AGC and AWB metadata in algorithms
Fill the frame metadata in the AGC and AWB algorithm's prepare()
function. This removes the need to fill metadata manually in the IPA
module's processStatsBuffer() function.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/ipu3/algorithms/awb.cpp')
-rw-r--r-- | src/ipa/ipu3/algorithms/awb.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp index 6452b6a1..dd7ebc07 100644 --- a/src/ipa/ipu3/algorithms/awb.cpp +++ b/src/ipa/ipu3/algorithms/awb.cpp @@ -11,6 +11,8 @@ #include <libcamera/base/log.h> +#include <libcamera/control_ids.h> + /** * \file awb.h */ @@ -403,6 +405,14 @@ void Awb::process(IPAContext &context, [[maybe_unused]] const uint32_t frame, context.activeState.awb.gains.green = asyncResults_.greenGain; context.activeState.awb.gains.red = asyncResults_.redGain; context.activeState.awb.temperatureK = asyncResults_.temperatureK; + + metadata.set(controls::AwbEnable, true); + metadata.set(controls::ColourGains, { + static_cast<float>(context.activeState.awb.gains.red), + static_cast<float>(context.activeState.awb.gains.blue) + }); + metadata.set(controls::ColourTemperature, + context.activeState.awb.temperatureK); } constexpr uint16_t Awb::threshold(float value) |