From patchwork Tue May 24 11:45:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 16014 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 BC748C3256 for ; Tue, 24 May 2022 11:46:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3298B65674; Tue, 24 May 2022 13:46:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1653392803; bh=9bWxwlmHas1NFcPFPjm1Dcf+Y5YWWSGzxnClX4EPsDs=; 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=Z+hdzXlJZk2vYUcZirN31TZqHDOvhq3LAS65edi9Yf8RyZuQVXNlzXSuLEUg99EuW llDUjomKU1SyRsBGjzyWzb/5ipfg32ADJheZuY6O0Jh8wO25ulLmIz2/vs/jLCEHNx Q7g06ic3VRVFLJZOwi5ZqQIh/3OowoatXho5+NumHKxKNrA4+HhCBkDy7xlEM+3cIV BbY58W2kp9jdnUUmljNMkblsLRCk9qxAMmwFdu8068lpQzGqzfcMeMF5VjWShNMUXo cA/WrGrO+JJQ8vF6ROgOVTDLwcqCs7spEoScdNPIKeUbiYREJB2FNKK/Sj5s1cK8vc Db0ev2GVvBXYA== 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 2FF4A65667 for ; Tue, 24 May 2022 13:46:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="XmQtH2KR"; 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 97E4F8DC; Tue, 24 May 2022 13:46:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1653392793; bh=9bWxwlmHas1NFcPFPjm1Dcf+Y5YWWSGzxnClX4EPsDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XmQtH2KR9MHRY5b0JoeL2TPtjwQoRZLt7s4wr/m02Y9C2DZ3XrBxSanlFgWAulBXq U9dmF7/Hc0t1J2FQB3bKi1YhSQqyN89/r9hajZRsIpx3Mqddj7Sz7xhN5rlGXdYMrR aNJTn49mqkhRzSKWlbSw7FXf+R3y6EXdX63if6qQ= To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart , Jacopo Mondi Date: Tue, 24 May 2022 14:45:59 +0300 Message-Id: <20220524114610.41848-9-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220524114610.41848-1-tomi.valkeinen@ideasonboard.com> References: <20220524114610.41848-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 08/19] 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