summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-01-02 16:42:07 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2017-01-03 10:46:42 +0200
commitc6f964425cdec25e3d0ecd0054d398d3420fdfeb (patch)
tree361e39693e7513ad8c0f3bbde4e352f0321c59ba
parent6cad07d9ff9a7d5aec9d288eac9fd72b881a4ba3 (diff)
py: Expose MappedFramebuffer width and height properties
The property getters are defined as pure virtual functions in the MappedFramebuffer class. Expose the Python properties as part of the bindings for that class to make them available for all classes inheriting from MappedFramebuffer. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--py/pykmsbase.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/pykmsbase.cpp b/py/pykmsbase.cpp
index 9f20fdb..5247158 100644
--- a/py/pykmsbase.cpp
+++ b/py/pykmsbase.cpp
@@ -91,6 +91,8 @@ void init_pykmsbase(py::module &m)
;
py::class_<MappedFramebuffer>(m, "MappedFramebuffer", py::base<Framebuffer>())
+ .def_property_readonly("width", &MappedFramebuffer::width)
+ .def_property_readonly("height", &MappedFramebuffer::height)
;
py::class_<DumbFramebuffer>(m, "DumbFramebuffer", py::base<MappedFramebuffer>())
@@ -98,8 +100,6 @@ void init_pykmsbase(py::module &m)
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
.def(py::init<Card&, uint32_t, uint32_t, PixelFormat>(),
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
- .def_property_readonly("width", &DumbFramebuffer::width)
- .def_property_readonly("height", &DumbFramebuffer::height)
;
py::enum_<PixelFormat>(m, "PixelFormat")