From patchwork Wed Oct 2 16:19:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 21477 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 D8417BD80A for ; Wed, 2 Oct 2024 16:20:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7C04A6352A; Wed, 2 Oct 2024 18:20:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="AfamQfPx"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2DAE56352A for ; Wed, 2 Oct 2024 18:20:32 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:b246:b33f:c662:8ae1]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F01391BC7; Wed, 2 Oct 2024 18:18:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1727885939; bh=eKtLY3QBGZK4eCYQ44bf5E8qhoHSYhXKt5FgzFB8w7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AfamQfPxA+ENuKL72SD3QotHcCIiAy2JWMJwIn8i4RIFH9giJf152E7DLOCoXrP2y PkkLPTcsXvhls8tGPQzAM7wNiTh6XYzVTc5mbHzvipXWacr42sRcH57U3EMAD+6HX3 7/xLfh8lwmKEc6A7ovcln78mo67p+grsK5tIE6xs= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 6/8] ipa: libipa: Add data accessor to Histogram Date: Wed, 2 Oct 2024 18:19:24 +0200 Message-ID: <20241002161933.247091-7-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241002161933.247091-1-stefan.klug@ideasonboard.com> References: <20241002161933.247091-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" For debugging purposes it is helpful to access the internal data of the histogram. Add an accessor for that. Signed-off-by: Stefan Klug Reviewed-by: Laurent Pinchart --- src/ipa/libipa/histogram.cpp | 6 ++++++ src/ipa/libipa/histogram.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/ipa/libipa/histogram.cpp b/src/ipa/libipa/histogram.cpp index 5fbfadf5e4e1..10e44b54a0cf 100644 --- a/src/ipa/libipa/histogram.cpp +++ b/src/ipa/libipa/histogram.cpp @@ -62,6 +62,12 @@ Histogram::Histogram(Span data) * \return Number of bins */ +/** + * \fn Histogram::data() + * \brief Retrieve the internal data + * \return The data + */ + /** * \fn Histogram::total() * \brief Retrieve the total number of values in the data set diff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h index 6fd641683694..91ce05f17d9f 100644 --- a/src/ipa/libipa/histogram.h +++ b/src/ipa/libipa/histogram.h @@ -36,6 +36,7 @@ public: } size_t bins() const { return cumulative_.size() - 1; } + const std::vector &data() const { return cumulative_; } uint64_t total() const { return cumulative_[cumulative_.size() - 1]; } uint64_t cumulativeFrequency(double bin) const; double quantile(double q, uint32_t first = 0, uint32_t last = UINT_MAX) const;