summaryrefslogtreecommitdiff
path: root/src/py
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-05-27 17:44:25 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-05-27 22:02:44 +0300
commit19d870d6d8db28da6670f7c077570980eb9af80d (patch)
tree8605e408bd51d25f2b37ab930be2b4dacc19bfcb /src/py
parent9e4388cca5d9ecd6152c0d5990038b515b5f918c (diff)
py: MappedFrameBuffer: Add type hints & docs
Add a few type hints and (minimal) docs to MappedFrameBuffer. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/py')
-rw-r--r--src/py/libcamera/utils/MappedFrameBuffer.py11
1 files 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 <tomi.valkeinen@ideasonboard.com>
+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