From patchwork Thu Sep 28 09:45:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 19092 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 AD3B4BD808 for ; Thu, 28 Sep 2023 09:45:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 20FFC61DE3; Thu, 28 Sep 2023 11:45:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1695894335; bh=pI4a/mUF7TzAq9tl4K0ADiq+L14vMK8Q/oCJGWpz1is=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=DLZpV8BT4DcwzFa7eqnlWwWuEdCp8K89O4oHQT6F07EyF8exKeWovzMerfJosE5tN BSZwc+2F/XEodrulWcxw47txUmxlNUii3xc6p42tsRCj0AwCCzRx0eOdn6laK3aex9 y/G1Lz+kvcsgXoYJ7IHYPEa2R+XSi5Wt6vjgji6hZMaVkeuPpUCRfT1S4XMbKVsNGz 7wMwChHJvWKTaleDkQfuTEZe//nyrNd/n6OpnmYsIvJlKmDnUZ/QKy9b6V1ovWBueg rRHTuihJmasLRTsC7RctNURI99XNDCB2mGhP4neR/UpRg3AwyxCS+S0o+O2WCPp6J5 wW4smOwG/w4sQ== Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0DEAC61DE1 for ; Thu, 28 Sep 2023 11:45:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="F/x30JsY"; dkim-atps=neutral Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-32483535e51so653813f8f.0 for ; Thu, 28 Sep 2023 02:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1695894332; x=1696499132; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=bqubCjiB3WjRoqiL3XMvMG37Eu/cr39ftG1FkAhf3Y0=; b=F/x30JsYmTj9tPvAHQbdJZS4Bm3xK99UGQBWnOHER+iryPlZt9EqIn94mi0BTOqddJ kPdlntOuOtDxJQcU8R2CYGZcxFFZ1fs+p7H/0/dkq9aKeez0YnRr88uSjg/0BwArUy3z yXfxwIn1ejuaOJrcltoIkZMp3puclgb/2nsxS2XurhsAqalFVNiQU3n+0vuyyGVf8WxT Lt2nBvBn7GxZuLV5DbsuW2mxdSpU8KdoaOht1+amvTpTAoQTQQmZmVUJCQTTOAsIWd/T I813UUNMsC145pnNi1eT08qe1ew5Brdb55nLKzkmuxeCQyKMPo9Auy/9g9zxBawY77E4 aZOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695894332; x=1696499132; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bqubCjiB3WjRoqiL3XMvMG37Eu/cr39ftG1FkAhf3Y0=; b=QnH/bAjdXVqvOqGdRJRb0GLlJa1NEfSItbWYoB+YaBGIefQo8NkFVHX1zmnkwCFIFX nj/RVyieufQnbATpU6uiLQqI/y05fVNSNe0NvbKguzdgdGteBQwzJEqGDeiXNVggYLOo FsvMKkWVqQ87XS3HgbDghonCMeoCkV6/cahz+Y+hL4Zem2Oyfm/oatMCpHCGbQC+xS1v JKatT4QL3+at38vM5MmWbvqL8JMwrkdheU8iRLHPl29LHAk260BpkwYpjpozW7676ila 8HD8DPY0HHPW5mbr3w8iHwZpme6ke/okP3rGy5irl8mR4tzKQXwHBavd+gvHaPnylyuV xnfA== X-Gm-Message-State: AOJu0YwK580mmLwM59sb2A26Q2Z9PNO/cbwnZLVp2yGWgIsT8IuOfZY+ FQPglk1rgu52v/dIsly3YCjGoKG86SRvJ++mNlE= X-Google-Smtp-Source: AGHT+IEY1oyhgBFwFu7LLXi6+qiVSBayvBuXkc72g2N9O+g/Y8Cj+gDmK1wqjXzbFLYiCHOdL4RggA== X-Received: by 2002:adf:ce8b:0:b0:321:66a5:4da4 with SMTP id r11-20020adfce8b000000b0032166a54da4mr753034wrn.2.1695894332205; Thu, 28 Sep 2023 02:45:32 -0700 (PDT) Received: from pi5-davidp.pitowers.org ([2a00:1098:3142:14:183e:6cc8:a436:a27c]) by smtp.gmail.com with ESMTPSA id p17-20020a5d68d1000000b003217cbab88bsm360133wrw.16.2023.09.28.02.45.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 02:45:29 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Sep 2023 10:45:26 +0100 Message-Id: <20230928094526.21999-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] py: Add the SensorConfiguration class 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: David Plowman via libcamera-devel From: David Plowman Reply-To: David Plowman Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" We provide access to the bitDepth and outputSize fields of the new SensorConfiguration class. The class also needs a constructor so that Python applications can make one and put it into the CameraConfiguration. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Reviewed-by: Tomi Valkeinen --- src/py/libcamera/py_main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index 01fb15a9..8df04520 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -112,6 +112,7 @@ PYBIND11_MODULE(_libcamera, m) auto pyCameraManager = py::class_>(m, "CameraManager"); auto pyCamera = py::class_>(m, "Camera"); + auto pySensorConfiguration = py::class_(m, "SensorConfiguration"); auto pyCameraConfiguration = py::class_(m, "CameraConfiguration"); auto pyCameraConfigurationStatus = py::enum_(pyCameraConfiguration, "Status"); auto pyStreamConfiguration = py::class_(m, "StreamConfiguration"); @@ -281,6 +282,11 @@ PYBIND11_MODULE(_libcamera, m) return ret; }); + pySensorConfiguration + .def(py::init<>()) + .def_readwrite("bit_depth", &SensorConfiguration::bitDepth) + .def_readwrite("output_size", &SensorConfiguration::outputSize); + pyCameraConfiguration .def("__iter__", [](CameraConfiguration &self) { return py::make_iterator(self); @@ -293,6 +299,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("sensor_config", &CameraConfiguration::sensorConfig) .def_readwrite("transform", &CameraConfiguration::transform); pyCameraConfigurationStatus