From patchwork Fri May 27 14:44:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 16079 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 5CAFABD161 for ; Fri, 27 May 2022 14:45:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 777B865657; Fri, 27 May 2022 16:45:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1653662716; bh=O1E83xEQOu12v5ZIMjQFl7+ZKcLZq6RJVyYUYyL7Wyo=; 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=eqIyXm8DtW+QJVuYWrdtNZ/TkRFCll5B+LngZ6yai/L/DT4NkxIn3HVnmOJ77pkhF DFWI5zgm44KzVaj9BbRud4QkInYSowKgAJxwOsgIeRz4tuEMZjBlnezPnJIWpdRmVM SX3UsV7yKLbhZv+TqtwlpudPnhabNTjlXFK+LKR4ZDyeaYBCOwUQjipwUKEhEq+xI3 GUSVIIkw1bIdrtLvn14kI5OKPvr4L1swxKnx+pebZQsPQQfF0HKZSE+K12KqciKuzk mWdqq8NDXP66IuoxjQ/fxVvavgG5UzdqrPFMRA03efkPO2WNCQXPoSMPhTvFlN7OYN msAkharm873ag== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A5B91633A3 for ; Fri, 27 May 2022 16:45:08 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="o6lzaJB7"; dkim-atps=neutral Received: from deskari.lan (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 19815EF2; Fri, 27 May 2022 16:45:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1653662708; bh=O1E83xEQOu12v5ZIMjQFl7+ZKcLZq6RJVyYUYyL7Wyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o6lzaJB7AgaGEc7/O6MXE8FKGOPYufZP6ustVbvgm1cxizACoxe24WrI2GURBVU6b oFxN+OUioY0Q55jHVr2JeHTJ6tA3tuOi01C/b83pvt4pC9Gs0ANoGwf2mfVK8UHEwH Nf7ifxQtpSU+NqFjjZv6SGgTiAE68wSS9bwximE0= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Fri, 27 May 2022 17:44:25 +0300 Message-Id: <20220527144447.94891-9-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220527144447.94891-1-tomi.valkeinen@ideasonboard.com> References: <20220527144447.94891-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 08/30] py: MappedFrameBuffer: Add type hints & docs 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: Tomi Valkeinen via libcamera-devel From: Tomi Valkeinen Reply-To: Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a few type hints and (minimal) docs to MappedFrameBuffer. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- src/py/libcamera/utils/MappedFrameBuffer.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/py/libcamera/utils/MappedFrameBuffer.py b/src/py/libcamera/utils/MappedFrameBuffer.py index e7dd16ec..fc2726b6 100644 --- a/src/py/libcamera/utils/MappedFrameBuffer.py +++ b/src/py/libcamera/utils/MappedFrameBuffer.py @@ -1,8 +1,14 @@ # SPDX-License-Identifier: LGPL-2.1-or-later # Copyright (C) 2022, Tomi Valkeinen +import libcamera +from typing import Tuple + class MappedFrameBuffer: - def __init__(self, fb): + """ + Provides memoryviews for the FrameBuffer's planes + """ + def __init__(self, fb: libcamera.FrameBuffer): self.__fb = fb def __enter__(self): @@ -70,5 +76,6 @@ class MappedFrameBuffer: mm.close() @property - def planes(self): + def planes(self) -> Tuple[memoryview, ...]: + """memoryviews for the planes""" return self.__planes