From patchwork Tue Dec 13 11:48:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17997 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 60643BDE6B for ; Tue, 13 Dec 2022 11:48:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0B61663362; Tue, 13 Dec 2022 12:48:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670932133; bh=ma9szNikYEmGctrJ31Ey01v3NafeZYa8iuiY1l8LTwQ=; 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=rcSXn2TzwO1vD9vE9E/6VlSzLAOEYoDNwS1Tt9TwSPG4+wmadMel9lcw7df3Ew/El LVkwyNCX10DEFlw5VoGaRfX03AI+AC8px+eqdwY65BHofsUpGau6lokOJRQ2vZbJSn uB668ZF9EdA31v+yNbVabjPOCOJbY0l+VyF5D8PZs2LGAgY5TCT+jQmKemYKCIpGys JicZP6hHqPeT4gGbJRyfxtBylLktXHDr289FKmy5/o3sUpDtQUIsquA0B2xwNDptIk XISk0IGegnk6L3WVSHpMlTABLbNr4vQ9bSPjcZ1mZrdIQRjEAZT4bgimi5Y8NfcdjZ 3yFSSyjSkeseA== Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 64E7063340 for ; Tue, 13 Dec 2022 12:48:49 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="seXBmToy"; dkim-atps=neutral Received: by mail-wr1-x433.google.com with SMTP id h7so15316231wrs.6 for ; Tue, 13 Dec 2022 03:48:49 -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=Oz62LSxuhaQPLtvLBoBKpt4oVpu0W2M+xPyY7uBTRX0=; b=seXBmToy2BJzXhxPyODicg1DeEJDr4nGeX78SSQVwYM/DnHHgOipXPlQXgh7sji62S Cd6hAqjusDdwAMqk1urvi/AwD6HB+5O6P5DRLeiO2LqvXcLwigCyXUDJK0VXd3PZLGGI 4+6gyrLXZPJljdYYEKHD/HJXmmygHuqgEkPKhQIRd+kKj0Nkxkhk+CjT5rR8daBJBIBW StPO82p/7mrU1USAlFKN5LHmZWq4phZwkplnb5ortABVSJmyJPjpGIVycy/vGRJ+Kt4e +Lvg0squjvacHM3OpBwnfG4PcO+ZmhWkcWakggX35CHdS05ixQwwmhMnVnjc+o+f3Hft 4fCA== 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=Oz62LSxuhaQPLtvLBoBKpt4oVpu0W2M+xPyY7uBTRX0=; b=a5+FnXUwVW50kX6/V4D0Qi+83K011Ps0WcMvvffKS6aFgMgMdqi3O+uJ0KEGlbZ+tF BJezflCa++KZxZpPODrMmvRYg6Vutfk8mgdUJPkKt/6tDppWHi0K3Snym/J7QzqGFjif CPvBalVYy2y7yLReN4/ORJJ/3MaV5UNwh1SU/fPsQ6PwdNM8Cy9ytZx51MBujNCAfCv1 rqm6c05QILqKkbOF5GPV9iHCwYDUGOGwoZ1SJBVjJZFAb7tJqdtLptiRccDwviR81LP7 JB1JFHom5CrXzXLavJoOfJM4sKCfWObWS6bUk00PNEbuGFNkLbtdX7O0R31oZPTjiLUF jbVQ== X-Gm-Message-State: ANoB5pmwaeK5t/hlK80vehctmlEzLm52HUq9YUoWQMara7oVOPFdl4c9 qd+Q0zdq/IqBEMolD7xYD7epOGUNQriuGJqj X-Google-Smtp-Source: AA0mqf702/BAWQyzB7P80fCnQQu70XzTWtFXYd6yJadG5KvtIoSS728OZXFXjajKqx12AtP/u8rfpw== X-Received: by 2002:a5d:6045:0:b0:242:24a7:c7f2 with SMTP id j5-20020a5d6045000000b0024224a7c7f2mr11822147wrt.58.1670932128681; Tue, 13 Dec 2022 03:48:48 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id j8-20020a5d4528000000b0024287d9d4a8sm11574541wra.74.2022.12.13.03.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 03:48:48 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 11:48:33 +0000 Message-Id: <20221213114836.15473-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221213114836.15473-1-naush@raspberrypi.com> References: <20221213114836.15473-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 Reviewed-by: Kieran Bingham --- 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);