libcamera: bayer_format: Add PixelFormat conversion helpers to BayerFormat class

Add BayerFormat::toPixelFormat() and BayerFormat::fromPixelFormat() helper
functions to convert between BayerFormat and PixelFormat types.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[Kieran: Minor checkstyle fix]
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2021-11-01 09:15:06 +00:00 committed by Kieran Bingham
parent 16ab13eaa9
commit 91bd175c8f
2 changed files with 33 additions and 0 deletions

View file

@ -10,6 +10,8 @@
#include <stdint.h>
#include <string>
#include <libcamera/pixel_format.h>
#include "libcamera/internal/v4l2_pixelformat.h"
namespace libcamera {
@ -50,6 +52,8 @@ public:
V4L2PixelFormat toV4L2PixelFormat() const;
static BayerFormat fromV4L2PixelFormat(V4L2PixelFormat v4l2Format);
PixelFormat toPixelFormat() const;
static BayerFormat fromPixelFormat(PixelFormat format);
BayerFormat transform(Transform t) const;
Order order;