From 1c0096d7517afca568e642dac6ffce894a5098fb Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 18 Dec 2020 15:51:39 +0100 Subject: libcamera: bayer_format: Add support for mbus codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing implementation of the BayerFormat class supports converting a V4L2PixelFormat to a BayerFormat and vice-versa. Expand the class by adding support for converting a media bus code to a BayerFormat instance, by providing a conversion table and a dedicated static methods. Do not provide support for converting a BayerFormat to a media bus code as there's no 1-to-1 mapping between the two. Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Signed-off-by: Jacopo Mondi --- include/libcamera/internal/bayer_format.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h index 4280b76b..dc86f6ee 100644 --- a/include/libcamera/internal/bayer_format.h +++ b/include/libcamera/internal/bayer_format.h @@ -43,6 +43,7 @@ public: } explicit BayerFormat(V4L2PixelFormat v4l2Format); + static const BayerFormat &fromMbusCode(unsigned int mbusCode); bool isValid() const { return bitDepth != 0; } std::string toString() const; -- cgit v1.2.1