[{"id":31691,"web_url":"https://patchwork.libcamera.org/comment/31691/","msgid":"<172854899357.532453.4483097721001957500@ping.linuxembedded.co.uk>","date":"2024-10-10T08:29:53","subject":"Re: [PATCH v3 6/7] ipa: libipa: Add data accessor to Histogram","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2024-10-08 16:29:44)\n> For debugging purposes it is helpful to access the internal data of the\n> histogram.  Add an accessor for that.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n> Changes in v2:\n> - return Span instead of reference to std::vector\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..a926002c8cf0 100644\n> --- a/src/ipa/libipa/histogram.h\n> +++ b/src/ipa/libipa/histogram.h\n> @@ -36,6 +36,7 @@ public:\n>         }\n>  \n>         size_t bins() const { return cumulative_.size() - 1; }\n> +       const Span<const uint64_t> data() const { return cumulative_; }\n>         uint64_t total() const { return cumulative_[cumulative_.size() - 1]; }\n>         uint64_t cumulativeFrequency(double bin) const;\n>         double quantile(double q, uint32_t first = 0, uint32_t last = UINT_MAX) const;\n> -- \n> 2.43.0\n>","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 1E028C32EA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Oct 2024 08:29:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C8E716536C;\n\tThu, 10 Oct 2024 10:29:57 +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 BE9F963536\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Oct 2024 10:29:56 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 518A04D4;\n\tThu, 10 Oct 2024 10:28:18 +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=\"MuCJ1sMs\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1728548898;\n\tbh=ahubFZ2mybSQx82/t2WAzf3KkLy80AI1/z7UU9pUFpY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=MuCJ1sMsw1Q90wahJ8JyrbiXtjh50Hg7auyvh1em0YYD8xnWOgaQ7FisHBpSzVRY7\n\t5rwzvAcSr41KOQUHeW3z/mO0wq4RNw6x5PpVByKfuLa6gEMK4jjk4T5s5uTTjsSBpW\n\t9o3F6QJ6royhjwUKkrLVViSLBtwP2SUhRRBvgnig=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241008153031.429906-7-stefan.klug@ideasonboard.com>","References":"<20241008153031.429906-1-stefan.klug@ideasonboard.com>\n\t<20241008153031.429906-7-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v3 6/7] ipa: libipa: Add data accessor to Histogram","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 10 Oct 2024 09:29:53 +0100","Message-ID":"<172854899357.532453.4483097721001957500@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]