From patchwork Tue Nov 22 11:22:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17831 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 BBA6FBE08B for ; Tue, 22 Nov 2022 11:22:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 87E4F63323; Tue, 22 Nov 2022 12:22:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669116151; bh=nV2KMfIX/aSz7EeOXcUnYblpXLNHbIzztPfK6uf2CyA=; 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=J+OthZMdfLCv/Ra4t+o6K7yO/tY7CI1jAwLECJ8kUoS2ZfVIlFIp63945H2oN0N5I 53wYpQGTCUMxSqkSpNR90skiecm7tgj+QbCILB/gd1DLyA82BHQHyihp5hoNkXObiP FY760gqx8fah+9yvDLIbmaxUaI0RbRHsCKpBBho3ZKAUgaD0VG5/WrCRiJkultn5Tt SWlFYumeWh+zjUJ14imKAU6gcJpQyl23G+gOYOlgpe8nnuikIKIHrJEl1fJ40/r/MI bYM7lapkDm3/vqDCBRWCPhM0h42npwO5Un0DhxDx3jSofO4e0J6vgklYKoJ3iKMIPT KT/Dc+JD3uPiA== Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E5AC163319 for ; Tue, 22 Nov 2022 12:22:28 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Bf9Gm9p8"; dkim-atps=neutral Received: by mail-wm1-x32d.google.com with SMTP id m7-20020a05600c090700b003cf8a105d9eso11035610wmp.5 for ; Tue, 22 Nov 2022 03:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=85uGoaw0AEnYQ+Egl5/eIy+7JdznUeKgQUblC7ayBfM=; b=Bf9Gm9p8FUWIZIF+zGlZVNtER4kOJIpWEE0qfwO8coczc1IpnjZiAfxfr8dCw9OO+f qWHW72qgYz/0bahZhyLnlwIg0iuSmT2EBnBDeFhP6Zk6gJhpA+htJGf1An7ErBSYCMjU Hzdw3E+bsLer4vtwtV0gJVZDbrgECPb2PUNVpitWK1pcKR07eIVl+lQwiou2KvYlQlW+ AEFh+el5vVhNQVGOJdue+fgfzQDNlI++Lw3KdGdTovHM7xejxBqIvj2loGXRi5pzsFMK HKyAjNiJVrrtkAWrjyaMzHVkqOj5tDDjXhDHv8aSgkPykGKLMkWLYm/klt/14+1cmY4N FJIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=85uGoaw0AEnYQ+Egl5/eIy+7JdznUeKgQUblC7ayBfM=; b=mR0pxvBZ10ZaxtaO/9LQSnMBz1ofzNPxExhJrbieagq6GW28laPmFyAB3M/lhN42wR q8JxXzcFgPA2wA1+MJygc+YOtTNaSAs1vDeZWaos5R1zMzWWfxt2+/6bFEd7IQ31cAk0 DHQfePtW26COB9mSQSX7Vm6hzGRXQexja4+du/KSENN1fOz0wumnoHqdF0m2XetE8a5J J6UKjEYkKmp06/VziosjXcDiNEd/rtBAv08N/Mx/8/iC9VvCEqvD97Raax+yehD1p33/ 7CAE7LEVgflbxiLZa2q/Hk0OTsn8NRk5iR0yA42y4PhTPeFlaCYHY9kssKeTfUxFKVxd bTWQ== X-Gm-Message-State: ANoB5pkHq3DTi4Vg6GMQFDwN18XxXqS4R4/QpNl15qnzKYhq/x59WzRL 9hsg6xkfQkeJ4CPjmu/mdGahvqSj31ttWQ== X-Google-Smtp-Source: AA0mqf6umRHLstW42DmbbtClXlQV1RmODsHn0Gw4pvXwPQplNZigQ89EVSg6f9j17nF1G4M9zq3BTA== X-Received: by 2002:a05:600c:3d10:b0:3cf:8a44:e1eb with SMTP id bh16-20020a05600c3d1000b003cf8a44e1ebmr6730969wmb.189.1669116148338; Tue, 22 Nov 2022 03:22:28 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id q125-20020a1c4383000000b003c6cd82596esm21400388wma.43.2022.11.22.03.22.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 03:22:27 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 22 Nov 2022 11:22:21 +0000 Message-Id: <20221122112224.31691-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221122112224.31691-1-naush@raspberrypi.com> References: <20221122112224.31691-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 2/5] ipa: raspberrypi: histogram: Add a constructor for an empty histogram 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a default constructor to the RPiController::Histogram class that creates an empty histogram. Since this is a cumulative histogram, push a value of 0 into the first (and only) bin to signify this. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- src/ipa/raspberrypi/controller/histogram.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ipa/raspberrypi/controller/histogram.h b/src/ipa/raspberrypi/controller/histogram.h index 66a68b087964..6b3e3a9e68e4 100644 --- a/src/ipa/raspberrypi/controller/histogram.h +++ b/src/ipa/raspberrypi/controller/histogram.h @@ -20,6 +20,11 @@ namespace RPiController { class Histogram { public: + Histogram() + { + cumulative_.push_back(0); + } + template Histogram(T *histogram, int num) { assert(num);