From ad5326c926831fe7a943d10fd800de43e596f171 Mon Sep 17 00:00:00 2001 From: David Plowman Date: Thu, 22 May 2025 14:03:18 +0100 Subject: ipa: rpi: controller: rpi: Fix colour gain typo in AGC A simple typo crept in where the red gain had been re-typed rather than using the correct green gain. In particular, this was causing very dark images for sensors that use large red gains, such as the IMX477 outdoors. Fixes: 29892f1c56c6 ("ipa: libipa: colour: Use the RGB class to model RGB values") Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart Reviewed-by: Naushir Patuck Tested-by: Naushir Patuck Reviewed-by: Paul Elder Signed-off-by: Laurent Pinchart --- src/ipa/rpi/controller/rpi/agc_channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp index a5562760..b2999364 100644 --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp @@ -717,7 +717,7 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb, /* Factor in the AWB correction if needed. */ if (stats->agcStatsPos == Statistics::AgcStatsPos::PreWb) - sum *= RGB{ { awb.gainR, awb.gainR, awb.gainB } }; + sum *= RGB{ { awb.gainR, awb.gainG, awb.gainB } }; double ySum = ipa::rec601LuminanceFromRGB(sum); -- cgit v1.2.1