py: Re-implement controls geneneration

The Python bindings controls generation was not very good. It only
covered the enums and they were in the main namespace.

This adds the controls somewhat similarly to the C++ side. We will have
e.g.:

libcamera.controls.Brightness
libcamera.controls.AeMeteringModeEnum.CentreWeighted

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Tomi Valkeinen
2022-05-27 17:44:29 +03:00
committed by Laurent Pinchart
parent 6eb1143e27
commit 3c82ae3821
4 changed files with 39 additions and 20 deletions
@@ -0,0 +1,30 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2022, Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
*
* Python bindings - Auto-generated controls
*
* This file is auto-generated. Do not edit.
*/
#include <libcamera/control_ids.h>
#include <pybind11/smart_holder.h>
namespace py = pybind11;
class PyControls
{
};
class PyDraftControls
{
};
void init_py_controls_generated(py::module& m)
{
auto controls = py::class_<PyControls>(m, "controls");
auto draft = py::class_<PyDraftControls>(controls, "draft");
${controls}
}