From patchwork Thu Feb 6 14:10:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22744 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8E3EBC32EA for ; Thu, 6 Feb 2025 14:10:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 13C8C685F3; Thu, 6 Feb 2025 15:10:33 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="c1nqBfVH"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F0978685E2 for ; Thu, 6 Feb 2025 15:10:30 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:6b7d:6f52:efbb:46c8]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 722A011DA; Thu, 6 Feb 2025 15:09:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1738850957; bh=70TC5rfQAKHjA1/Nsb/TBHDPn/n+dEWmX4/6XL1jX6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c1nqBfVHem8pO7Hu8Nez4AdFWORjicsRPLz3u3NCcJS7uZ7Sl+IMAtXYJA6RADF3u 4Dj3VDonzapjBQsYdz2VTDMO/NAWNmDOjuGmy+ofC16m8YUHLiM+1B0Lo/e2+NwY34 D7mlfIyYuQsWh8tbZsV4bRo6deE3vQZhe6GLqoXo= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH 3/4] ipa: Use Vector class from libcamera Date: Thu, 6 Feb 2025 15:10:10 +0100 Message-ID: <20250206141018.236272-4-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250206141018.236272-1-stefan.klug@ideasonboard.com> References: <20250206141018.236272-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that there is a Vector class in libcamera, use that one. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Naushir Patuck --- src/ipa/ipu3/algorithms/awb.h | 2 +- src/ipa/libipa/colours.h | 2 +- src/ipa/libipa/pwl.h | 2 +- src/ipa/rkisp1/algorithms/awb.h | 3 ++- src/ipa/rkisp1/ipa_context.h | 2 +- src/ipa/rpi/controller/rpi/agc_channel.cpp | 7 ++++--- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h index 1916990a5364..dbf69c9073a1 100644 --- a/src/ipa/ipu3/algorithms/awb.h +++ b/src/ipa/ipu3/algorithms/awb.h @@ -13,7 +13,7 @@ #include -#include "libipa/vector.h" +#include "libcamera/internal/vector.h" #include "algorithm.h" diff --git a/src/ipa/libipa/colours.h b/src/ipa/libipa/colours.h index fa6a8b575cc7..d39b2ca8b87e 100644 --- a/src/ipa/libipa/colours.h +++ b/src/ipa/libipa/colours.h @@ -9,7 +9,7 @@ #include -#include "vector.h" +#include "libcamera/internal/vector.h" namespace libcamera { diff --git a/src/ipa/libipa/pwl.h b/src/ipa/libipa/pwl.h index d4ec9f4f18fb..8fdc70538b93 100644 --- a/src/ipa/libipa/pwl.h +++ b/src/ipa/libipa/pwl.h @@ -12,7 +12,7 @@ #include #include -#include "vector.h" +#include "libcamera/internal/vector.h" namespace libcamera { diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h index e424804861a6..34ec42cbb164 100644 --- a/src/ipa/rkisp1/algorithms/awb.h +++ b/src/ipa/rkisp1/algorithms/awb.h @@ -9,8 +9,9 @@ #include +#include "libcamera/internal/vector.h" + #include "libipa/interpolator.h" -#include "libipa/vector.h" #include "algorithm.h" diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index 5d5b79fa615e..c765b928a55f 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -22,10 +22,10 @@ #include "libcamera/internal/debug_controls.h" #include "libcamera/internal/matrix.h" +#include "libcamera/internal/vector.h" #include #include -#include namespace libcamera { diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp index e79184b7ac74..a5562760e034 100644 --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp @@ -12,8 +12,9 @@ #include +#include "libcamera/internal/vector.h" + #include "libipa/colours.h" -#include "libipa/vector.h" #include "../awb_status.h" #include "../device_status.h" @@ -700,7 +701,7 @@ static double computeInitialY(StatisticsPtr &stats, AwbStatus const &awb, * Note that the weights are applied by the IPA to the statistics directly, * before they are given to us here. */ - ipa::RGB sum{ 0.0 }; + RGB sum{ 0.0 }; double pixelSum = 0; for (unsigned int i = 0; i < stats->agcRegions.numRegions(); i++) { auto ®ion = stats->agcRegions.get(i); @@ -716,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 *= ipa::RGB{{ awb.gainR, awb.gainR, awb.gainB }}; + sum *= RGB{ { awb.gainR, awb.gainR, awb.gainB } }; double ySum = ipa::rec601LuminanceFromRGB(sum);