From patchwork Mon Mar 28 09:24:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 15566 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 9C8CAC3266 for ; Mon, 28 Mar 2022 09:24:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4D9DE65640; Mon, 28 Mar 2022 11:24:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1648459486; bh=2HJTGIzy9CsO2/V/VvT4biuOy1qQF6ZkFGXJMTw/Myw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=HfI8VUbpLIE4MtKfv2UebHTAtKBNikAvcVgcSZAHX/U1h6aYPyjZje+CFRqFYN4/J phnGK/RPMZXvOIEc8Q1M6RpOENdnSCq0Y1fsbm678WrpBsmU06UoNCJ6fP4onJDqFM EWrhW3CnDib5jMsgTKQtIgN0mu8mMSWQJ85LFhx0hQczJEVxAs0s+rISMc7ZVNH+MS I9BnT7MS0a0hzF2p8YlPM6WMXvPdG7ynEbVEEOlixNA7lRdNjO2cB2ngJP4ZJW8+EX q4mFcc6Htvg8oXQY3vjRGtshOLUd65LC8QQpn8Qtn4qiJp+u3fTPxzTSo6EQG86J2n OWPInpPPyE/tg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 78E3A65633 for ; Mon, 28 Mar 2022 11:24:42 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oVPXykPx"; dkim-atps=neutral Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:4f49:c672:4655:7dbb]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DAE28E0A; Mon, 28 Mar 2022 11:24:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1648459482; bh=2HJTGIzy9CsO2/V/VvT4biuOy1qQF6ZkFGXJMTw/Myw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oVPXykPxmCF/NyHheEmci8/VHopV5QijU9n6Qols4ioMhh+RfI8l7KINEhTSAdEs8 olXQe8yXrUW2PG0M2yt1yC8MeGx0MQqBCv4WCZaJ2V3/QpjdxizVrmceM321oZAf3d jAFejCMwpDjYXdCD5JjRd6f3Jhktj4fkIXSJIHnQ= To: libcamera-devel@lists.libcamera.org Date: Mon, 28 Mar 2022 11:24:31 +0200 Message-Id: <20220328092433.69856-4-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220328092433.69856-1-jeanmichel.hautbois@ideasonboard.com> References: <20220328092433.69856-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 3/5] ipa: libipa: Histogram: Constify the constructor span 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: , X-Patchwork-Original-From: Jean-Michel Hautbois via libcamera-devel From: Jean-Michel Hautbois Reply-To: Jean-Michel Hautbois Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The Histogram constructor does not modify the data. Pass it a Span instead of a Span. Signed-off-by: Jean-Michel Hautbois Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/ipa/libipa/histogram.cpp | 2 +- src/ipa/libipa/histogram.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/libipa/histogram.cpp b/src/ipa/libipa/histogram.cpp index 4d94571f..d8ad1c89 100644 --- a/src/ipa/libipa/histogram.cpp +++ b/src/ipa/libipa/histogram.cpp @@ -32,7 +32,7 @@ namespace ipa { * \brief Create a cumulative histogram * \param[in] data A pre-sorted histogram to be passed */ -Histogram::Histogram(Span data) +Histogram::Histogram(Span data) { cumulative_.reserve(data.size()); cumulative_.push_back(0); diff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h index c40a366b..164d4603 100644 --- a/src/ipa/libipa/histogram.h +++ b/src/ipa/libipa/histogram.h @@ -22,7 +22,7 @@ namespace ipa { class Histogram { public: - Histogram(Span data); + Histogram(Span data); size_t bins() const { return cumulative_.size() - 1; } uint64_t total() const { return cumulative_[cumulative_.size() - 1]; } uint64_t cumulativeFrequency(double bin) const;