summaryrefslogtreecommitdiff
path: root/src/py
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-10-19 16:01:30 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-10-23 16:06:07 +0300
commita28f871836e1dc3fc8031589c91f814b844dbe55 (patch)
tree17dc5f4e38748d75a5b0b326899bdda3c63df44f /src/py
parent69b2dc16a09a111d8053c5d8009207cef357bcc5 (diff)
py: libcamera: Define and use Orientation
Define an enumeration type for Orientation and expose the CameraConfiguration::orientation property in place of CameraConfiguration::transform. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/py')
-rw-r--r--src/py/libcamera/py_enums.cpp10
-rw-r--r--src/py/libcamera/py_main.cpp1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/py/libcamera/py_enums.cpp b/src/py/libcamera/py_enums.cpp
index 803c4e7e..e25689c6 100644
--- a/src/py/libcamera/py_enums.cpp
+++ b/src/py/libcamera/py_enums.cpp
@@ -31,4 +31,14 @@ void init_py_enums(py::module &m)
.value("String", ControlType::ControlTypeString)
.value("Rectangle", ControlType::ControlTypeRectangle)
.value("Size", ControlType::ControlTypeSize);
+
+ py::enum_<Orientation>(m, "Orientation")
+ .value("Rotate0", Orientation::Rotate0)
+ .value("Rotate0Mirror", Orientation::Rotate0Mirror)
+ .value("Rotate180", Orientation::Rotate180)
+ .value("Rotate180Mirror", Orientation::Rotate180Mirror)
+ .value("Rotate90Mirror", Orientation::Rotate90Mirror)
+ .value("Rotate270", Orientation::Rotate270)
+ .value("Rotate270Mirror", Orientation::Rotate270Mirror)
+ .value("Rotate90", Orientation::Rotate90);
}
diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
index d2ce3722..aa35f0a2 100644
--- a/src/py/libcamera/py_main.cpp
+++ b/src/py/libcamera/py_main.cpp
@@ -330,6 +330,7 @@ PYBIND11_MODULE(_libcamera, m)
.def_property_readonly("empty", &CameraConfiguration::empty)
.def_readwrite("sensor_config", &CameraConfiguration::sensorConfig)
.def_readwrite("transform", &CameraConfiguration::transform);
+ .def_readwrite("orientation", &CameraConfiguration::orientation);
pyCameraConfigurationStatus
.value("Valid", CameraConfiguration::Valid)