Message ID | 20240910204812.2581246-4-paul.elder@ideasonboard.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Quoting Paul Elder (2024-09-10 21:48:12) > Add python bindings for quering enum value names from a ControlId. s/quering/querying/ > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> > > --- > New in v2 > --- > src/py/libcamera/py_main.cpp | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp > index ab33f38a8..f6aff5005 100644 > --- a/src/py/libcamera/py_main.cpp > +++ b/src/py/libcamera/py_main.cpp > @@ -404,7 +404,8 @@ PYBIND11_MODULE(_libcamera, m) > .def("__repr__", [](const ControlId &self) { > return py::str("libcamera.ControlId({}, {}, {})") > .format(self.id(), self.name(), self.type()); > - }); > + }) > + .def("enum_name", &ControlId::enumName); Looks too easy ? ;-) Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > pyControlInfo > .def_property_readonly("min", [](const ControlInfo &self) { > -- > 2.39.2 >
diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index ab33f38a8..f6aff5005 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -404,7 +404,8 @@ PYBIND11_MODULE(_libcamera, m) .def("__repr__", [](const ControlId &self) { return py::str("libcamera.ControlId({}, {}, {})") .format(self.id(), self.name(), self.type()); - }); + }) + .def("enum_name", &ControlId::enumName); pyControlInfo .def_property_readonly("min", [](const ControlInfo &self) {
Add python bindings for quering enum value names from a ControlId. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- New in v2 --- src/py/libcamera/py_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)