781a43aa668e711534ed0d9b2534b17b2e6948a4
1 #include <pybind11/pybind11.h>
2 #include <pybind11/stl.h>
3 #include <kms++.h>
4 #include "kmstest.h"
6 namespace py = pybind11;
8 using namespace kms;
9 using namespace std;
11 void init_pykmstest(py::module &m)
12 {
13 py::class_<RGB>(m, "RGB")
14 .def(py::init<>())
15 .def(py::init<uint8_t, uint8_t, uint8_t&>())
16 .def(py::init<uint8_t, uint8_t, uint8_t, uint8_t&>())
17 ;
19 // Use lambdas to handle IMappedFramebuffer
20 m.def("draw_test_pattern", [](DumbFramebuffer& fb) { draw_test_pattern(fb); } );
21 m.def("draw_color_bar", [](DumbFramebuffer& fb, int old_xpos, int xpos, int width) {
22 draw_color_bar(fb, old_xpos, xpos, width);
23 } );
24 m.def("draw_rect", [](DumbFramebuffer& fb, uint32_t x, uint32_t y, uint32_t w, uint32_t h, RGB color) {
25 draw_rect(fb, x, y, w, h, color);
26 } );
27 }