#include #include #include #include namespace py = pybind11; using namespace kms; using namespace std; void init_pykmstest(py::module &m) { py::class_(m, "RGB") .def(py::init<>()) .def(py::init()) .def(py::init()) .def_property_readonly("rgb888", &RGB::rgb888) .def_property_readonly("argb8888", &RGB::argb8888) .def_property_readonly("abgr8888", &RGB::abgr8888) .def_property_readonly("rgb565", &RGB::rgb565) ; py::class_(m, "ResourceManager") .def(py::init()) .def("reset", &ResourceManager::reset) .def("reserve_connector", &ResourceManager::reserve_connector, py::arg("name") = string()) .def("reserve_crtc", &ResourceManager::reserve_crtc) .def("reserve_plane", &ResourceManager::reserve_plane, py::arg("crtc"), py::arg("type"), py::arg("format") = PixelFormat::Undefined) .def("reserve_primary_plane", &ResourceManager::reserve_primary_plane, py::arg("crtc"), py::arg("format") = PixelFormat::Undefined) .def("reserve_overlay_plane", &ResourceManager::reserve_overlay_plane, py::arg("crtc"), py::arg("format") = PixelFormat::Undefined) ; // 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); } ); }