From patchwork Thu Nov 24 10:38:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17863 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 5ED46BDE6B for ; Thu, 24 Nov 2022 10:38:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2059463321; Thu, 24 Nov 2022 11:38:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669286324; 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=3wvZ/tVkFn7rlHhqoOsm5z9iiUXN9u0tNj7Agmyoi3RmyFmvML5lWYVBgVbDjAM7Q ryqtzYMdl7qpNC6apsulQbDKORPRjrtpz2bAIYIRz69B6pAdPagh/+PIqZT2x2Zkge O9WU2X/eUvld4UA/dbQMLHjbf+K3hCIFHhs8dBMPjqukR/6gpPP6z5cRYlHG0LdsxF nN0c0h7h5AWQ4YFmGjKrOwL4uSYjkS+4C1fYUsZicJcgEkQoaWeProjTBq+5i5wSfJ Wse64w1UsNFcZ/LR/gB6tUij6469lCT9IxndRowbO/Vlff1ac5z18SIl1Fe1mA8VWM gD/dHsuF1Ya8Q== Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9366363316 for ; Thu, 24 Nov 2022 11:38:41 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="F0PlEgh7"; dkim-atps=neutral Received: by mail-wr1-x42f.google.com with SMTP id q7so961182wrr.8 for ; Thu, 24 Nov 2022 02:38:41 -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=F0PlEgh7jJBm5RP+QgTLgVIQQr6li6qeh8AX6e843o7xvocib8sOx5ANGxvDVUAZg1 X2k96ubQthWl81TTJQTcN1HQfG4+ayfCU2aVeFvXK679KImjgifBigumNi9dkVs1t8S1 6HRwtg6SIcvnpwmnhbSj7OgN8FkWGhT0qqij4SgKl1Phac0wj9/YdyByxP7Kf2LEX5zP bfRLYWvSieKxgCAPYwU/6deEKV9Qt0iZKmZOf+/jtqqOc3fRhl6zsE49PbL7pxKt1EnW 9iKUmolXKRQPiSmi30IdgDx0AQ8durxrTYPYp9vTJJPGGmU0u1f61FsotJFN40JF6W2N pc3A== 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=ulVWP71CIPhmPEQ7ymBbrXDnDEWKOHK0OUffbje8qa/GlV4I5iu56DmKBhOzftB0oA vEg1dERQyTvom9fUFVC/hpr6pKsabvdZMKe0twExyATk2s4tK6uFROw60IXHxLP0o0zf dSVjRMCOuHVdZDOHYoGJrTHGA5zsEKIfAqFwrQF4WMnikg1QrROw3R7zmFQt+Rvp/kka d1xrmhjhJ3wrirvtQefymHo99h9WQBdQCn30DgleQJDQRgxbClHqz4SeQYW9meXkDrI5 JvpP0UVN3NaHeeU0qndu/6yiEK9a4IVqFBayoZP/HeE1KE7tVMD/lAYL+1hUIx0653Wo rtXA== X-Gm-Message-State: ANoB5pmkyikbGhw7kbFlyL3dfSWF2LwdD8IDJGQC0WVTO/FcxqkcveQK pv0UtQ/xu91jNknzlGxXpliED3KTpEj5yA== X-Google-Smtp-Source: AA0mqf43A1Nlhg4Rt+SPFOQakbKLUgOccGZZb+2XUykGEBWMUU/8d5TF+JEkEIc1Oz6udp80cre/AA== X-Received: by 2002:a5d:620e:0:b0:241:e32f:8371 with SMTP id y14-20020a5d620e000000b00241e32f8371mr7003104wru.156.1669286320979; Thu, 24 Nov 2022 02:38:40 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id s16-20020adff810000000b002368a6deaf8sm995103wrp.57.2022.11.24.02.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 02:38:40 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Thu, 24 Nov 2022 10:38:29 +0000 Message-Id: <20221124103832.6172-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221124103832.6172-1-naush@raspberrypi.com> References: <20221124103832.6172-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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);