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 <jacopo.mondi@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <libcamera/color_space.h>
|
||||
#include <libcamera/geometry.h>
|
||||
#include <libcamera/transform.h>
|
||||
|
||||
#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> colorSpace;
|
||||
Transform transform = Transform::Identity;
|
||||
|
||||
const std::string toString() const;
|
||||
uint8_t bitsPerPixel() const;
|
||||
|
||||
Reference in New Issue
Block a user