mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 23:39:44 +03:00
py: Add bindings for ControlId enum name
Add python bindings for querying enum value names from a ControlId. Example usage: >>> cid libcamera.ControlId(16, AwbMode, ControlType.Integer32) >>> cid.enumerators() {0: 'AwbAuto', 1: 'AwbIncandescent', 2: 'AwbTungsten', 3: 'AwbFluorescent', 4: 'AwbIndoor', 5: 'AwbDaylight', 6: 'AwbCloudy', 7: 'AwbCustom'} >>> cinfo libcamera.ControlInfo([2..5]) >>> cinfo.values [2, 3, 5] >>> [cid.enumerators()[v] for v in cinfo.values] ['AwbTungsten', 'AwbFluorescent', 'AwbDaylight'] Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@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
ab48009a81
commit
505e49b76e
1 changed files with 2 additions and 1 deletions
|
@ -404,7 +404,8 @@ PYBIND11_MODULE(_libcamera, m)
|
||||||
.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.name(), self.type());
|
||||||
});
|
})
|
||||||
|
.def("enumerators", &ControlId::enumerators);
|
||||||
|
|
||||||
pyControlInfo
|
pyControlInfo
|
||||||
.def_property_readonly("min", [](const ControlInfo &self) {
|
.def_property_readonly("min", [](const ControlInfo &self) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue