From 1cc6d926ac9636fc7a4211bae363511610c83029 Mon Sep 17 00:00:00 2001 From: Daniel Scally Date: Fri, 15 Nov 2024 07:46:25 +0000 Subject: ipa: rkisp1: Use centralised libipa helpers Use the centralised libipa helpers instead of open-coding common functions. Reviewed-by: Jacopo Mondi Signed-off-by: Daniel Scally Reviewed-by: Kieran Bingham Reviewed-by: Milan Zamazal Reviewed-by: Laurent Pinchart --- src/ipa/rkisp1/algorithms/awb.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (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 b3c00bef..5c1d9511 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -16,6 +16,8 @@ #include +#include "libipa/colours.h" + /** * \file awb.h */ @@ -178,22 +180,6 @@ void Awb::prepare(IPAContext &context, const uint32_t frame, } } -uint32_t Awb::estimateCCT(double red, double green, double blue) -{ - /* Convert the RGB values to CIE tristimulus values (XYZ) */ - double X = (-0.14282) * (red) + (1.54924) * (green) + (-0.95641) * (blue); - double Y = (-0.32466) * (red) + (1.57837) * (green) + (-0.73191) * (blue); - double Z = (-0.68202) * (red) + (0.77073) * (green) + (0.56332) * (blue); - - /* Calculate the normalized chromaticity values */ - double x = X / (X + Y + Z); - double y = Y / (X + Y + Z); - - /* Calculate CCT */ - double n = (x - 0.3320) / (0.1858 - y); - return 449 * n * n * n + 3525 * n * n + 6823.3 * n + 5520.33; -} - /** * \copydoc libcamera::ipa::Algorithm::process */ -- cgit v1.2.1