libcamera: transform: Add functions to convert Orientation

Add two helper functions to the transform.cpp file that allows to
convert to and from an Orientation.

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:26 +02:00 committed by Laurent Pinchart
parent 568569b081
commit 250577878b
2 changed files with 64 additions and 0 deletions

View file

@ -11,6 +11,8 @@
namespace libcamera {
enum class Orientation;
enum class Transform : int {
Identity = 0,
Rot0 = Identity,
@ -69,6 +71,8 @@ constexpr Transform operator~(Transform t)
}
Transform transformFromRotation(int angle, bool *success = nullptr);
Transform transformFromOrientation(const Orientation &orientation);
Orientation transformToOrientation(const Transform &transform);
const char *transformToString(Transform t);