From patchwork Wed Aug 14 09:41:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 20912 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 0A6A9BDB13 for ; Wed, 14 Aug 2024 09:41:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A0C94633C0; Wed, 14 Aug 2024 11:41:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HqNoJMvB"; 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 C0A6661946 for ; Wed, 14 Aug 2024 11:41:43 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:8a6:aa2:ebee:5ae5]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 246E783D; Wed, 14 Aug 2024 11:40:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1723628446; bh=28iV49HVIUdybCC32NHQSu7GlpNR66Dk9Oedz9JmgOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HqNoJMvBKHDRmu2s16GypBlg6NOvlFEVVIydlkFSUtir9yDzNotYnsxL9x6ImKCiF vi7XI3iudu0TxUk/qE4PTJQM2k3PuD9AdQ+Oj73etWTL0zAWpvBpjWueQU/Eebp+YQ m6/h8aVy9S4LAdKTjxqjv3EOWeApOlbYKHGkxJ8k= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham Subject: [PATCH v2 2/2] utils: tuning: Change Tuner.add() to accept a list of modules Date: Wed, 14 Aug 2024 11:41:31 +0200 Message-ID: <20240814094134.73333-3-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240814094134.73333-1-stefan.klug@ideasonboard.com> References: <20240814094134.73333-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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" Change the first parameter of Tuner.add() to accept either a list of modules or a single module. This allows more compact code and is in sync with Tuner.set_output_order(). Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- utils/tuning/libtuning/libtuning.py | 5 ++++- utils/tuning/rkisp1.py | 10 +--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/utils/tuning/libtuning/libtuning.py b/utils/tuning/libtuning/libtuning.py index e7c63535fefd..bac573235040 100644 --- a/utils/tuning/libtuning/libtuning.py +++ b/utils/tuning/libtuning/libtuning.py @@ -95,7 +95,10 @@ class Tuner(object): self.output = {} def add(self, module): - self.modules.append(module) + if isinstance(module, list): + self.modules.extend(module) + else: + self.modules.append(module) def set_input_parser(self, parser): self.parser = parser diff --git a/utils/tuning/rkisp1.py b/utils/tuning/rkisp1.py index 5d7a69fc4a13..f5c42a61d15e 100755 --- a/utils/tuning/rkisp1.py +++ b/utils/tuning/rkisp1.py @@ -45,15 +45,7 @@ lsc = LSCRkISP1(debug=[lt.Debug.Plot], smoothing_function=lt.smoothing.MedianBlur(3),) tuner = lt.Tuner('RkISP1') -tuner.add(agc) -tuner.add(awb) -tuner.add(blc) -tuner.add(ccm) -tuner.add(color_processing) -tuner.add(filter) -tuner.add(gamma_out) -tuner.add(lsc) - +tuner.add([agc, awb, blc, ccm, color_processing, filter, gamma_out, lsc]) tuner.set_input_parser(YamlParser()) tuner.set_output_formatter(YamlOutput()) tuner.set_output_order([agc, awb, blc, ccm, color_processing,