From patchwork Fri Sep 1 15:02:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 18972 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 0AE5CC32B4 for ; Fri, 1 Sep 2023 15:02:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AADE9628F9; Fri, 1 Sep 2023 17:02:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1693580577; bh=N1DjEyiYLvi/RGVTAM7jwnHuU/GWNXYULPoZ5atYN40=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=W9TWlqYiMdkFwmoJbA1W7e09rCVZXaLP8z3ibKMzBHx00km8Sw5VdarB02HLMWmQ+ RLZjx4P1hANfn7fHwe7J98Usy+E3xyFHgW4q191k9IJf4+YYSy6PV2R2LVv6zb/Nrq NT+jv5qxc5bqNcGfVXi9mTvuhbbDkqwRhmROpYgWrfhxPByMCOGYjfebqvqbztXn7X glQxWzSSwoMVxih4q2Z6UZCLJwSToGVQNpey6e+vbyETIJWFEhaIhlUCtR497TvBhT 9eCvLqX17C9Rn4R+fHKNZjVHuPHWQE8elIRIR/WdQYaEY760M1yHzRnwSvY4Q/deyf J91rQ0dVqKcyg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2773A628F3 for ; Fri, 1 Sep 2023 17:02:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="KwaNOReg"; dkim-atps=neutral Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 03A911AE1; Fri, 1 Sep 2023 17:01:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1693580490; bh=N1DjEyiYLvi/RGVTAM7jwnHuU/GWNXYULPoZ5atYN40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KwaNOReg0LD7x7yuvhhy1Wi2SspNTr7d+YYNBafLPhR+iGOBuu2qD2MUDdLd1RK4O 9UuO8ZD/dl6dgTYWkr/vrHWKn/jg5XyCSvLYML5/tydWL5DZVy/9EdO6nyKz10FHMP cS45xYDvvEMZ256MwjYHXMueNfhoPhuQXKf4+iZA= To: libcamera-devel@lists.libcamera.org Date: Fri, 1 Sep 2023 17:02:12 +0200 Message-Id: <20230901150215.11585-10-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230901150215.11585-1-jacopo.mondi@ideasonboard.com> References: <20230901150215.11585-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 09/12] py: libcamera: Define and use Orientation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Cc: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Define an enumeration type for Orientation and expose the CameraConfiguration::orientation property in place of CameraConfiguration::transform. Signed-off-by: Jacopo Mondi Reviewed-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- 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_(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)