From 8bb0f472c3c23963fa72396caa818931ee416407 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Thu, 19 Oct 2023 16:01:28 +0200 Subject: libcamera: transform: Add operations with Orientation Add two operations that allows to combine Transform with Orientation. - Transform operator/(const Orientation &o1, const Orientation &o2) allows to easily get back the Transform that needs to be applied to Orientation2 to get Orientation1 - Orientation operator*(const Orientation &o, const Transform &t) allows to apply a Transform to an Orientation and obtain the combination of the two These two operations allow applications to use Transforms to manipulate the Orientation inside the CameraConfiguration, if they wish. Signed-off-by: Jacopo Mondi Reviewed-by: David Plowman Signed-off-by: Laurent Pinchart --- include/libcamera/transform.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/libcamera/transform.h') diff --git a/include/libcamera/transform.h b/include/libcamera/transform.h index 14f1db0e..9eb10e15 100644 --- a/include/libcamera/transform.h +++ b/include/libcamera/transform.h @@ -74,6 +74,9 @@ Transform transformFromRotation(int angle, bool *success = nullptr); Transform transformFromOrientation(const Orientation &orientation); Orientation transformToOrientation(const Transform &transform); +Transform operator/(const Orientation &o1, const Orientation &o2); +Orientation operator*(const Orientation &o, const Transform &t); + const char *transformToString(Transform t); } /* namespace libcamera */ -- cgit v1.2.1