From 83e434b2dccbcc3c9653767dce000052e1e52297 Mon Sep 17 00:00:00 2001 From: Sebastian Fricke Date: Tue, 26 Jan 2021 19:48:50 +0100 Subject: libcamera: bayer_format: Add the fromV4L2PixelFormat function Add a static member function to get the corresponding BayerFormat from a given V4L2PixelFormat. The motivation behind this patch is to align the overall structure of the BayerFormat class with other parts of the code base, such as the V4L2PixelFormat class. The downside of this change is a slightly worse time complexity, but the upside is a smaller codebase and lower memory consumption. As the function is probably not used very frequently, I tend to favor the mentioned upsides. Reviewed-by: Laurent Pinchart Signed-off-by: Sebastian Fricke Signed-off-by: Laurent Pinchart --- include/libcamera/internal/bayer_format.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/libcamera/internal') diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h index dc86f6ee..4f338bd7 100644 --- a/include/libcamera/internal/bayer_format.h +++ b/include/libcamera/internal/bayer_format.h @@ -49,6 +49,7 @@ public: std::string toString() const; V4L2PixelFormat toV4L2PixelFormat() const; + static BayerFormat fromV4L2PixelFormat(V4L2PixelFormat v4l2Format); BayerFormat transform(Transform t) const; Order order; -- cgit v1.2.1