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 <jacopo.mondi@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Jacopo Mondi
2023-10-19 16:01:28 +02:00
committed by Laurent Pinchart
parent b54c935dd7
commit 8bb0f472c3
2 changed files with 36 additions and 0 deletions
+3
View File
@@ -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 */