From 886e0328c325bd71e3bc430cb8fd3eb9b10a890b Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Thu, 19 Dec 2024 18:57:19 +0100 Subject: ipa: rkisp1: awb: Load white balance gains from tuning file For the implementation of a manual colour temperature setting, it is necessary to read predefined colour gains per colour temperature from the tuning file. Implement this in a backwards compatible way. If no gains are contained in the tuning file, loading just continues as before. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/ipa/rkisp1/algorithms/awb.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/ipa/rkisp1/algorithms/awb.cpp') diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 4bb4f5b8..e23f67a9 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -41,6 +41,24 @@ Awb::Awb() { } +/** + * \copydoc libcamera::ipa::Algorithm::init + */ +int Awb::init([[maybe_unused]] IPAContext &context, const YamlObject &tuningData) +{ + Interpolator> gainCurve; + int ret = gainCurve.readYaml(tuningData["colourGains"], "ct", "gains"); + if (ret < 0) + LOG(RkISP1Awb, Warning) + << "Failed to parse 'colourGains' " + << "parameter from tuning file; " + << "manual colour temperature will not work properly"; + else + colourGainCurve_ = gainCurve; + + return 0; +} + /** * \copydoc libcamera::ipa::Algorithm::configure */ -- cgit v1.2.1