From patchwork Thu Jan 9 11:53:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22488 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 072FEC32EA for ; Thu, 9 Jan 2025 11:55:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6613C68503; Thu, 9 Jan 2025 12:55:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="uEfE0ZQU"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 65CFB61891 for ; Thu, 9 Jan 2025 12:55:08 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:93b9:eca8:897d:eae6]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5A6AE5B3; Thu, 9 Jan 2025 12:54:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736423654; bh=DAOhp6TPjYaC2DQfshUa3EWKpVkGcmlGrP5+8xVtt0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uEfE0ZQUVVVsQ/qDlUo3plFMONCWxBwecq3lr7S3kUbnROFn+S3m1XM4sHkG6oTJT coSFQbm/71s0gxK3UQt7PteQNsmLcudY9PkDrbzT5tE8F3Qn6AymJqbXj637GJs4fs DdKb5Wk+KTfZ7m1x6XXUwXuLmhgS2NpO+UzmYyww= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 01/11] libipa: interpolator: Add accessor to internal data Date: Thu, 9 Jan 2025 12:53:52 +0100 Message-ID: <20250109115412.356768-2-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250109115412.356768-1-stefan.klug@ideasonboard.com> References: <20250109115412.356768-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 --- 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);