summaryrefslogtreecommitdiff
path: root/py/pykmstest.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-05-22 23:14:38 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-05-23 09:43:27 +0300
commitfa91e51e4a485ab813032ffcbc7d8cb8c96314d5 (patch)
treedfddc37cefadd8adbdf5e0e165f06d5cfee57801 /py/pykmstest.cpp
parentb939478901b0c627c42964d65a94194ce7944969 (diff)
split py files
Diffstat (limited to 'py/pykmstest.cpp')
-rw-r--r--py/pykmstest.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/py/pykmstest.cpp b/py/pykmstest.cpp
new file mode 100644
index 0000000..781a43a
--- /dev/null
+++ b/py/pykmstest.cpp
@@ -0,0 +1,27 @@
+#include <pybind11/pybind11.h>
+#include <pybind11/stl.h>
+#include <kms++.h>
+#include "kmstest.h"
+
+namespace py = pybind11;
+
+using namespace kms;
+using namespace std;
+
+void init_pykmstest(py::module &m)
+{
+ py::class_<RGB>(m, "RGB")
+ .def(py::init<>())
+ .def(py::init<uint8_t, uint8_t, uint8_t&>())
+ .def(py::init<uint8_t, uint8_t, uint8_t, uint8_t&>())
+ ;
+
+ // 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) {
+ 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) {
+ draw_rect(fb, x, y, w, h, color);
+ } );
+}