[PATCH v1 6/8] ipa: libipa: Add data accessor to Histogram

Stefan Klug stefan.klug at ideasonboard.com
Wed Oct 2 18:19:24 CEST 2024


For debugging purposes it is helpful to access the internal data of the
histogram.  Add an accessor for that.

Signed-off-by: Stefan Klug <stefan.klug at ideasonboard.com>
---
 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<const uint32_t> 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<uint64_t> &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;
-- 
2.43.0



More information about the libcamera-devel mailing list