diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/camera.h | 2 | ||||
-rw-r--r-- | include/libcamera/meson.build | 1 | ||||
-rw-r--r-- | include/libcamera/orientation.h | 30 |
3 files changed, 33 insertions, 0 deletions
diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index decf4ec0..a4536c72 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -21,6 +21,7 @@ #include <libcamera/controls.h> #include <libcamera/geometry.h> +#include <libcamera/orientation.h> #include <libcamera/request.h> #include <libcamera/stream.h> #include <libcamera/transform.h> @@ -94,6 +95,7 @@ public: std::optional<SensorConfiguration> sensorConfig; Transform transform; + Orientation orientation; protected: CameraConfiguration(); diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 408b7acf..a24c50d6 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -12,6 +12,7 @@ libcamera_public_headers = files([ 'framebuffer_allocator.h', 'geometry.h', 'logging.h', + 'orientation.h', 'pixel_format.h', 'request.h', 'stream.h', diff --git a/include/libcamera/orientation.h b/include/libcamera/orientation.h new file mode 100644 index 00000000..9a2c2fb2 --- /dev/null +++ b/include/libcamera/orientation.h @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2023, Ideas On Board Oy + * + * orientation.h - Image orientation + */ + +#pragma once + +#include <iostream> + +namespace libcamera { + +enum class Orientation { + /* EXIF tag 274 starts from '1' */ + Rotate0 = 1, + Rotate0Mirror, + Rotate180, + Rotate180Mirror, + Rotate90Mirror, + Rotate270, + Rotate270Mirror, + Rotate90, +}; + +Orientation orientationFromRotation(int angle, bool *success = nullptr); + +std::ostream &operator<<(std::ostream &out, const Orientation &orientation); + +} /* namespace libcamera */ |