[libcamera-devel] [PATCH v2 08/19] py: MappedFrameBuffer: Add type hints & docs
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu May 26 17:31:46 CEST 2022
Hi Tomi,
Thank you for the patch.
On Tue, May 24, 2022 at 02:45:59PM +0300, Tomi Valkeinen wrote:
> Add a few type hints and (minimal) docs to MappedFrameBuffer.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> 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 <tomi.valkeinen at 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
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list