summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb747ea)
raw | patch | inline | side by side (parent: cb747ea)
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 22 Nov 2016 10:52:14 +0000 (12:52 +0200) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Tue, 22 Nov 2016 10:52:14 +0000 (12:52 +0200) |
Add MappedFramebuffer to python bindings and use it for the draw
functions.
Looks like recent pybind11 versions have better multi-inheritance
support, so all this need to be revisited after updating pybind11.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
functions.
Looks like recent pybind11 versions have better multi-inheritance
support, so all this need to be revisited after updating pybind11.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
py/pykmsbase.cpp | patch | blob | history | |
py/pykmsutil.cpp | patch | blob | history |
diff --git a/py/pykmsbase.cpp b/py/pykmsbase.cpp
index 3ce56761752b5e957d9adedb3a639ae1701b332d..9f20fdb66caa3ec9817d5661032f82fa4ba03237 100644 (file)
--- a/py/pykmsbase.cpp
+++ b/py/pykmsbase.cpp
.def_property_readonly("data", &Blob::data)
;
- py::class_<Framebuffer>(m, "Framebuffer", py::base<DrmObject>())
+ py::class_<Framebuffer>(m, "Framebuffer", py::base<DrmObject>())
;
- py::class_<DumbFramebuffer>(m, "DumbFramebuffer", py::base<Framebuffer>())
+ py::class_<MappedFramebuffer>(m, "MappedFramebuffer", py::base<Framebuffer>())
+ ;
+
+ py::class_<DumbFramebuffer>(m, "DumbFramebuffer", py::base<MappedFramebuffer>())
.def(py::init<Card&, uint32_t, uint32_t, const string&>(),
py::keep_alive<1, 2>()) // Keep Card alive until this is destructed
.def(py::init<Card&, uint32_t, uint32_t, PixelFormat>(),
diff --git a/py/pykmsutil.cpp b/py/pykmsutil.cpp
index ab9f5a8d0be8e58cabdc4860f2255509a3971563..b3b7594fad3b35be50bb92dbc9fab85eb04948bc 100644 (file)
--- a/py/pykmsutil.cpp
+++ b/py/pykmsutil.cpp
;
// Use lambdas to handle IMappedFramebuffer
- m.def("draw_test_pattern", [](DumbFramebuffer& fb) { draw_test_pattern(fb); } );
- m.def("draw_color_bar", [](DumbFramebuffer& fb, int old_xpos, int xpos, int width) {
+ m.def("draw_test_pattern", [](MappedFramebuffer& fb) { draw_test_pattern(fb); } );
+ m.def("draw_color_bar", [](MappedFramebuffer& fb, int old_xpos, int xpos, int width) {
draw_color_bar(fb, old_xpos, xpos, width);
} );
- m.def("draw_rect", [](DumbFramebuffer& fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color) {
+ m.def("draw_rect", [](MappedFramebuffer& fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color) {
draw_rect(fb, x, y, w, h, color);
} );
}