From patchwork Thu Jan 23 11:40:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22616 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 62A6ABDE6B for ; Thu, 23 Jan 2025 11:42:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 08EBC68561; Thu, 23 Jan 2025 12:42:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="M2Wj2DeH"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B94261879 for ; Thu, 23 Jan 2025 12:42:14 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:c0a:33cd:b453:5d3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C1674465; Thu, 23 Jan 2025 12:41:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1737632470; bh=jjPgmjkMuR6c/TDSoavRWZ7mTYlA3Yncak0fSBLhhHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M2Wj2DeH8dIzy6JAK108/sOS9MO7f1lrJ1d18nElaZQtVTL08AmF0zqjU9JkGyhGt z/42IDduYIdlxw2TG/WVkNX6Gskhm3o5hE64A1LJgdCGjlHIvm1QAb3A2vhVcGCsZ0 GbgxADtVpgP+yiqGlacUFQ7t1yhduV+OTDpm03k0= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Paul Elder , Daniel Scally Subject: [PATCH v2 01/17] libipa: interpolator: Add accessor to internal data Date: Thu, 23 Jan 2025 12:40:51 +0100 Message-ID: <20250123114204.79321-2-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250123114204.79321-1-stefan.klug@ideasonboard.com> References: <20250123114204.79321-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" The only way to access the internal data of an Interpolator is through the getInterpolated() method. Sometimes it is necessary to to access the internal data directly to iterate over it. Add an accessor for that. While at it, remove a line break from the doxygen documentation for interpolate() so that doxygen is able to correctly match the function. Signed-off-by: Stefan Klug Reviewed-by: Paul Elder Reviewed-by: Daniel Scally --- Changes in v2: - Collected tags --- src/ipa/libipa/interpolator.cpp | 10 ++++++++-- src/ipa/libipa/interpolator.h | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ipa/libipa/interpolator.cpp b/src/ipa/libipa/interpolator.cpp index 73e8d3b7de14..f901a86e4c74 100644 --- a/src/ipa/libipa/interpolator.cpp +++ b/src/ipa/libipa/interpolator.cpp @@ -125,6 +125,13 @@ namespace ipa { * Overwrites the internal map using move semantics. */ +/** + * \fn std::map &Interpolator::data() const + * \brief Access the internal map + * + * \return The internal map + */ + /** * \fn const T& Interpolator::getInterpolated() * \brief Retrieve an interpolated value for the given key @@ -136,8 +143,7 @@ namespace ipa { */ /** - * \fn void Interpolator::interpolate(const T &a, const T &b, T &dest, double - * lambda) + * \fn void Interpolator::interpolate(const T &a, const T &b, T &dest, double lambda) * \brief Interpolate between two instances of T * \param a The first value to interpolate * \param b The second value to interpolate diff --git a/src/ipa/libipa/interpolator.h b/src/ipa/libipa/interpolator.h index fffce21465fe..7880db6976d1 100644 --- a/src/ipa/libipa/interpolator.h +++ b/src/ipa/libipa/interpolator.h @@ -81,6 +81,11 @@ public: lastInterpolatedKey_.reset(); } + const std::map &data() const + { + return data_; + } + const T &getInterpolated(unsigned int key, unsigned int *quantizedKey = nullptr) { ASSERT(data_.size() > 0);