py: Add bindings for ControlId vendor information
Add python bindings for quering vendor information from a ControlId. While at it, update __repr__ so that it also prints the vendor. Example usage: >>> cid libcamera.ControlId(20, libcamera.Saturation, ControlType.Float) >>> cid.vendor 'libcamera' Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
b777d8272a
commit
79893cc00f
1 changed files with 3 additions and 2 deletions
|
@ -399,11 +399,12 @@ PYBIND11_MODULE(_libcamera, m)
|
||||||
pyControlId
|
pyControlId
|
||||||
.def_property_readonly("id", &ControlId::id)
|
.def_property_readonly("id", &ControlId::id)
|
||||||
.def_property_readonly("name", &ControlId::name)
|
.def_property_readonly("name", &ControlId::name)
|
||||||
|
.def_property_readonly("vendor", &ControlId::vendor)
|
||||||
.def_property_readonly("type", &ControlId::type)
|
.def_property_readonly("type", &ControlId::type)
|
||||||
.def("__str__", [](const ControlId &self) { return self.name(); })
|
.def("__str__", [](const ControlId &self) { return self.name(); })
|
||||||
.def("__repr__", [](const ControlId &self) {
|
.def("__repr__", [](const ControlId &self) {
|
||||||
return py::str("libcamera.ControlId({}, {}, {})")
|
return py::str("libcamera.ControlId({}, {}.{}, {})")
|
||||||
.format(self.id(), self.name(), self.type());
|
.format(self.id(), self.vendor(), self.name(), self.type());
|
||||||
})
|
})
|
||||||
.def("enumerators", &ControlId::enumerators);
|
.def("enumerators", &ControlId::enumerators);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue