From 6f6e1bf704feec3a9bcfc1f5490ae82fe8d63065 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 applying 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 specify a 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. No functional changes intended. Signed-off-by: Jacopo Mondi Reviewed-by: David Plowman --- src/libcamera/v4l2_subdevice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libcamera/v4l2_subdevice.cpp') diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp index 15e8206a..38ff8b0c 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -216,6 +216,13 @@ const std::map formatInfoMap = { * resulting color space is acceptable. */ +/** + * \var V4L2SubdeviceFormat::transform + * \brief The transform (vertical/horizontal flips) to be applied on the subdev + * + * Default initialized to Identity (no transform). + */ + /** * \brief Assemble and return a string describing the format * \return A string describing the V4L2SubdeviceFormat -- cgit v1.2.1