[{"id":31571,"web_url":"https://patchwork.libcamera.org/comment/31571/","msgid":"<20241003164906.GA7009@pendragon.ideasonboard.com>","date":"2024-10-03T16:49:06","subject":"Re: [PATCH v1 6/8] ipa: libipa: Add data accessor to Histogram","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Stefan,\n\nThank you for the patch.\n\nOn Wed, Oct 02, 2024 at 06:19:24PM +0200, Stefan Klug wrote:\n> For debugging purposes it is helpful to access the internal data of the\n> histogram.  Add an accessor for that.\n\nI wondered if we should return a span instead of a vector to be more\nindependent of the internal representation, but it's an internal API\nanyway, it can easily change.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>  src/ipa/libipa/histogram.cpp | 6 ++++++\n>  src/ipa/libipa/histogram.h   | 1 +\n>  2 files changed, 7 insertions(+)\n> \n> diff --git a/src/ipa/libipa/histogram.cpp b/src/ipa/libipa/histogram.cpp\n> index 5fbfadf5e4e1..10e44b54a0cf 100644\n> --- a/src/ipa/libipa/histogram.cpp\n> +++ b/src/ipa/libipa/histogram.cpp\n> @@ -62,6 +62,12 @@ Histogram::Histogram(Span<const uint32_t> data)\n>   * \\return Number of bins\n>   */\n>  \n> +/**\n> + * \\fn Histogram::data()\n> + * \\brief Retrieve the internal data\n> + * \\return The data\n> + */\n> +\n>  /**\n>   * \\fn Histogram::total()\n>   * \\brief Retrieve the total number of values in the data set\n> diff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h\n> index 6fd641683694..91ce05f17d9f 100644\n> --- a/src/ipa/libipa/histogram.h\n> +++ b/src/ipa/libipa/histogram.h\n> @@ -36,6 +36,7 @@ public:\n>  \t}\n>  \n>  \tsize_t bins() const { return cumulative_.size() - 1; }\n> +\tconst std::vector<uint64_t> &data() const { return cumulative_; }\n>  \tuint64_t total() const { return cumulative_[cumulative_.size() - 1]; }\n>  \tuint64_t cumulativeFrequency(double bin) const;\n>  \tdouble quantile(double q, uint32_t first = 0, uint32_t last = UINT_MAX) const;","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BECE9BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Oct 2024 16:49:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CC2F56351F;\n\tThu,  3 Oct 2024 18:49:11 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D143C62C92\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Oct 2024 18:49:09 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 674DC593;\n\tThu,  3 Oct 2024 18:47:36 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ZRJ2me1C\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727974056;\n\tbh=Li/70GnLFkFo0vfmdh4RA/3ExvYIIBIg9NDIaym3uf8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ZRJ2me1CVrJd650xLRawEAI0h2HeKLTZ4Cv+EBsZQskNNRONs0YW30f+gZyjEJ5m1\n\tXZnzsiCqcpYk37YUogRfbSR32zgza4EdQj/IGzUuEHWzv0dYDGQ7htG0xa3z8Qgomp\n\tDlQPtkKZ6FErQmPwpsh/nG7iDCDLcZR4QrGSQ01Y=","Date":"Thu, 3 Oct 2024 19:49:06 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1 6/8] ipa: libipa: Add data accessor to Histogram","Message-ID":"<20241003164906.GA7009@pendragon.ideasonboard.com>","References":"<20241002161933.247091-1-stefan.klug@ideasonboard.com>\n\t<20241002161933.247091-7-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241002161933.247091-7-stefan.klug@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]