From patchwork Fri Feb 3 09:17:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18241 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 0790CC3243 for ; Fri, 3 Feb 2023 09:17:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9178761EF6; Fri, 3 Feb 2023 10:17:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675415862; bh=0DLpjcoVBgrz4VpzM1CoahUQ97CgrbpdDHhpaKpgEIo=; 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=0WXWLu1ZTyJmCPsYtTrRYvLgnnxe/R8vF8xN/3S6X8Or5tFXeEY3hh5HT500m5iXr 2OWmE058R908ytEAsln2mF4j9//N0APOteWKx/QNQLoa5gdISaTzPYWzvnn7Ve8Bet U9lHM/qmOftu0vPHsLnnbMT2I8/h85jmYeyxFvu5TPL5jHj0BcPzPYhEo/IcOtgTBf y4aRhZYm0lAnTRQuLRZIS1jA2Etio1WwoSG9pKCcnakch4p5Fjsbas95WZ1FuevZDw Wt7uznn6ZNnxzuVhInvZ3IMznFbbRU7obt50a9awoB/xPKd0mFbWTU5wW4B5I42inx 4aQsNnZLBsvbA== Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F0DEC61EF4 for ; Fri, 3 Feb 2023 10:17:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="UL8sAqR9"; dkim-atps=neutral Received: by mail-wm1-x335.google.com with SMTP id j32-20020a05600c1c2000b003dc4fd6e61dso5530911wms.5 for ; Fri, 03 Feb 2023 01:17:40 -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=M1N5dqqm7dMXcCpzYGXNUD+d9WKJ+Ysufg73/hJ/cJs=; b=UL8sAqR94giJaFAFKTHFHceEETvplOPHu+QgmikGblD1t5ANphXd/88HhTn711mNzK YxApBqd9mdH3QbdByDnCqazRJ0oSR9kHxyxY68BW7cukjxQ3zkR6uXQ3E0KDIIHW0+y+ nxgi56LymLReP832Oyzj3GpL5bRuTVBBtnoFTxYFxubRrrmsUXyQzSSN8Ay6fD6bzQGq DBFzPuT+pmkEmQKFNELBbF+A0i/GCMeXIKfEbSS8Pbig6yrD3AtCOGZYjCjz9V5QGJag DK7UUrfnESXNbjyk8G0aE8MwS+ygL44hW74LrcTJF7GcYZk1j22sl7v6li6GZtQ+KS3T Yufg== 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=M1N5dqqm7dMXcCpzYGXNUD+d9WKJ+Ysufg73/hJ/cJs=; b=6V9o6MPul3qcDvoy3fIs9t1uLI/lKKO16ttcYi8IoWY8qqqzLm6NckYFOLlCNryHcn 5ZnCxe090b5D23HFlUIKP72PNWWfjQy1p5V1lFxRauTWYWK0HcPWY3T7LuQbDnkxeotF fBkWTQMH+ZF+lKfMEjdQEdifW4QgYnK/6FiAJkWHHiiJZiasuIUMb16aQWv5dc5vHWRT +SK2xw7/mkvMsyDwP2ShE2/V5UcxrFCPBwmTwSGiQ3rzmTCcdTZ2/Zpy4CnmCepPkNku 4hCcDoOJMTbBQgTIkmB06YnR3mr43fHZF4mv/r+b1OXuJyk+sjEc7I+IUATdlVFqTld6 ddDw== X-Gm-Message-State: AO0yUKVR3WhFKqkTv3cd0h7O5aKlJgvZ7IYuk6zLppMC4aYM7l9TmABW aUkHZjgzJIliswj3uzoz6CR1ULduCOrWJLqEjqQETg== X-Google-Smtp-Source: AK7set8kMGpy2oAV7CvbK2EOUukctTpU6yUdIVLhYMm6xVr5Z4YlJZlIaQ38ro42qLf/U6PTMSZL7w== X-Received: by 2002:a05:600c:4f93:b0:3dc:59c3:9020 with SMTP id n19-20020a05600c4f9300b003dc59c39020mr9191331wmq.8.1675415860509; Fri, 03 Feb 2023 01:17:40 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id az24-20020a05600c601800b003dc4baaedd3sm7468864wmb.37.2023.02.03.01.17.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 01:17:40 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Feb 2023 09:17:31 +0000 Message-Id: <20230203091734.22803-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230203091734.22803-1-naush@raspberrypi.com> References: <20230203091734.22803-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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);