[libcamera-devel] [PATCH v5 09/12] py: libcamera: Define and use Orientation
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Oct 18 22:56:12 CEST 2023
Hi Jacopo,
Thank you for the patch.
On Fri, Sep 01, 2023 at 05:02:12PM +0200, Jacopo Mondi via libcamera-devel wrote:
> Define an enumeration type for Orientation and expose the
> CameraConfiguration::orientation property in place of
> CameraConfiguration::transform.
>
> Signed-off-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/py/libcamera/py_enums.cpp | 10 ++++++++++
> src/py/libcamera/py_main.cpp | 2 +-
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/py/libcamera/py_enums.cpp b/src/py/libcamera/py_enums.cpp
> index 803c4e7ee362..3cf381e2eb84 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("Rotate0Flip", Orientation::rotate0Flip)
> + .value("Rotate180", Orientation::rotate180)
> + .value("Rotate180Flip", Orientation::rotate180Flip)
> + .value("Rotate90Flip", Orientation::rotate90Flip)
> + .value("Rotate270", Orientation::rotate270)
> + .value("Rotate270Flip", Orientation::rotate270Flip)
> + .value("Rotate90", Orientation::rotate90);
> }
> diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp
> index 01fb15a9391c..63371dce38b3 100644
> --- a/src/py/libcamera/py_main.cpp
> +++ b/src/py/libcamera/py_main.cpp
> @@ -293,7 +293,7 @@ PYBIND11_MODULE(_libcamera, m)
> py::return_value_policy::reference_internal)
> .def_property_readonly("size", &CameraConfiguration::size)
> .def_property_readonly("empty", &CameraConfiguration::empty)
> - .def_readwrite("transform", &CameraConfiguration::transform);
> + .def_readwrite("orientation", &CameraConfiguration::orientation);
>
> pyCameraConfigurationStatus
> .value("Valid", CameraConfiguration::Valid)
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list