From patchwork Thu Oct 19 14:01:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 19157 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 4362BC32B9 for ; Thu, 19 Oct 2023 14:02:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA7856298F; Thu, 19 Oct 2023 16:02:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1697724120; bh=+BfuYw/ENojz8fu8+mWFKfDwzkpRGph1acjzgncgusI=; 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=tWbcH07oiVxohtKUZNEhks6K2/2Nn64Z7PYCCb5ZFC5QWljmegQa2WN0PFH08bWso zVkXnUOtvfzaZH0EgOFQgErbZ4GSDSm21ENCnWU7UUjBl5NcKJt00sOv3mOGXqc65u dOW8bXFB7I0ft+wU2/zHwieh0inj3al91pLpKOrxPSr8YYW7OUhlGScqcPr5Rg8Cjq nI6kArY4OdwlFUur5/4euJBPl4fZtgWLKBFYy9Ru9awRVJ8ttdAdUpJglGUlt9nHAW 7WZqZVfAWX9ZikKv3LUW6QLWP9FhQlqv6KPKUdfvZYkit0eCz+LI5XMh80AGcep9yL kJiKjt1Pp6FQQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 797E262990 for ; Thu, 19 Oct 2023 16:01:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="pDv5TBP5"; 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 547A6735; Thu, 19 Oct 2023 16:01:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1697724105; bh=+BfuYw/ENojz8fu8+mWFKfDwzkpRGph1acjzgncgusI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pDv5TBP5bc+IIAujaiH4h5A9hIGqHEfepySbgn1E9GbYvKanDz4q/Gn20wQaiKdKY sK03cqzlz9p1/fCN0GVrinDrdoL80bpoqgCvgkTZjmeyj/w6gR96wuEisZc2dm+USy i4qVNlejkmEWvEhSp6zYPWyTp/z0mZpjHPhFDr3A= To: libcamera-devel@lists.libcamera.org Date: Thu, 19 Oct 2023 16:01:30 +0200 Message-ID: <20231019140133.32090-10-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231019140133.32090-1-jacopo.mondi@ideasonboard.com> References: <20231019140133.32090-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 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 | 1 + 2 files changed, 11 insertions(+) diff --git a/src/py/libcamera/py_enums.cpp b/src/py/libcamera/py_enums.cpp index 803c4e7ee362..e25689c674ef 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("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 d2ce372297db..aa35f0a24847 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)