From 9361cd1ffa15a14fd808d8e865658d2e88f2ca04 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Thu, 24 Nov 2022 10:33:06 +0100 Subject: libcamera: camera_sensor: Apply flips at setFormat() Augment the CameraSensor::setFormat() function to configure horizontal and vertical flips before appllying the image format on the sensor. Applying flips before format is crucial as they might change the Bayer pattern ordering. To allow users of the CameraSensor class to easily pass the requested Transform add to the V4L2SubdeviceFormat class a 'transform' member, by default initialized to Transform::Identity. Moving the handling of H/V flips to the CameraSensor class allows to remove quite some boilerplate code from the IPU3 and RaspberryPi pipeline handlers. Signed-off-by: Jacopo Mondi --- include/libcamera/internal/v4l2_subdevice.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h index 69862de0..576faf97 100644 --- a/include/libcamera/internal/v4l2_subdevice.h +++ b/include/libcamera/internal/v4l2_subdevice.h @@ -20,6 +20,7 @@ #include #include +#include #include "libcamera/internal/formats.h" #include "libcamera/internal/media_object.h" @@ -44,6 +45,7 @@ struct V4L2SubdeviceFormat { uint32_t mbus_code; Size size; std::optional colorSpace; + Transform transform = Transform::Identity; const std::string toString() const; uint8_t bitsPerPixel() const; -- cgit v1.2.1