From patchwork Thu Feb 24 11:33:45 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: 15379 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 DF177BF415 for ; Thu, 24 Feb 2022 11:33:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2C0226115A; Thu, 24 Feb 2022 12:33:58 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vqg1dhxi"; dkim-atps=neutral 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 6787D61145 for ; Thu, 24 Feb 2022 12:33:53 +0100 (CET) Received: from tatooine.ideasonboard.com (unknown [IPv6:2a01:e0a:169:7140:ce74:6df2:4b76:b230]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 158C2DD; Thu, 24 Feb 2022 12:33:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1645702433; bh=sMtrrj+EYo9kT3HadhZ0KuBYFvgSed4b65pLGeDwA5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vqg1dhxi6lAUGTvGrQkctnJD9ffNy+Vy6AuBj+XTegRzSBfIM1va2A+haHCwpEuqY LWdJPMs1a/EhtTU7x5QUvIqG8qK1QcAn6ecTc5qCFk4pYcHWjvmFzgTrI0qDcmDOI2 8fjkNTI+Vk4AE0VT7MIukMW+6+vefMzvJU7NQzkg= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Feb 2022 12:33:45 +0100 Message-Id: <20220224113347.80001-4-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220224113347.80001-1-jeanmichel.hautbois@ideasonboard.com> References: <20220224113347.80001-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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: , 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;