From 38ca814e9723562da7b3a63f89662f801ca45614 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Thu, 23 Jul 2020 11:19:38 +0100 Subject: libcamera: formats: add numPlanes helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Determine the number of planes used by a format by counting the number of PixelFormatPlaneInfo entries with a valid entry. Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- include/libcamera/internal/formats.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h index b8e47491..51a8a6b8 100644 --- a/include/libcamera/internal/formats.h +++ b/include/libcamera/internal/formats.h @@ -46,6 +46,8 @@ public: unsigned int frameSize(const Size &size, const std::array &strides) const; + unsigned int numPlanes() const; + /* \todo Add support for non-contiguous memory planes */ const char *name; PixelFormat format; -- cgit v1.2.1