| 240 | // ---------------------------------------------------------------------------------------- |
| 241 | |
| 242 | void bind_gui(py::module& m) |
| 243 | { |
| 244 | { |
| 245 | typedef image_window type; |
| 246 | typedef void (image_window::*set_title_funct)(const std::string&); |
| 247 | typedef void (image_window::*add_overlay_funct)(const std::vector<rectangle>& r, rgb_pixel p); |
| 248 | |
| 249 | const char* docs1 = "Create an image window that displays the given numpy image."; |
| 250 | const char* docs2 = "Create an image window that displays the given numpy image and also has the given title."; |
| 251 | const char* docs3 = "Make the image_window display the given image."; |
| 252 | py::class_<type, std::shared_ptr<type>>(m, "image_window", |
| 253 | "This is a GUI window capable of showing images on the screen.") |
| 254 | .def(py::init()) |
| 255 | .def(py::init(&make_image_window_from_detector)) |
| 256 | .def(py::init(&make_image_window_from_detector_py)) |
| 257 | .def(py::init(&make_image_window_from_detector_and_title)) |
| 258 | .def(py::init(&make_image_window_from_detector_py_and_title)) |
| 259 | .def(py::init(&make_image_window_from_image<uint8_t>)) |
| 260 | .def(py::init(&make_image_window_from_image<uint16_t>)) |
| 261 | .def(py::init(&make_image_window_from_image<uint32_t>)) |
| 262 | .def(py::init(&make_image_window_from_image<uint64_t>)) |
| 263 | .def(py::init(&make_image_window_from_image<int8_t>)) |
| 264 | .def(py::init(&make_image_window_from_image<int16_t>)) |
| 265 | .def(py::init(&make_image_window_from_image<int32_t>)) |
| 266 | .def(py::init(&make_image_window_from_image<int64_t>)) |
| 267 | .def(py::init(&make_image_window_from_image<float>)) |
| 268 | .def(py::init(&make_image_window_from_image<double>)) |
| 269 | .def(py::init(&make_image_window_from_image<rgb_pixel>), docs1) |
| 270 | .def(py::init(&make_image_window_from_image_and_title<uint8_t>)) |
| 271 | .def(py::init(&make_image_window_from_image_and_title<uint16_t>)) |
| 272 | .def(py::init(&make_image_window_from_image_and_title<uint32_t>)) |
| 273 | .def(py::init(&make_image_window_from_image_and_title<uint64_t>)) |
| 274 | .def(py::init(&make_image_window_from_image_and_title<int8_t>)) |
| 275 | .def(py::init(&make_image_window_from_image_and_title<int16_t>)) |
| 276 | .def(py::init(&make_image_window_from_image_and_title<int32_t>)) |
| 277 | .def(py::init(&make_image_window_from_image_and_title<int64_t>)) |
| 278 | .def(py::init(&make_image_window_from_image_and_title<float>)) |
| 279 | .def(py::init(&make_image_window_from_image_and_title<double>)) |
| 280 | .def(py::init(&make_image_window_from_image_and_title<rgb_pixel>), docs2) |
| 281 | .def("set_image", image_window_set_image_simple_detector_py, py::arg("detector"), |
| 282 | "Make the image_window display the given HOG detector's filters.") |
| 283 | .def("set_image", image_window_set_image_fhog_detector, py::arg("detector"), |
| 284 | "Make the image_window display the given HOG detector's filters.") |
| 285 | .def("set_image", image_window_set_image<uint8_t>, py::arg("image")) |
| 286 | .def("set_image", image_window_set_image<uint16_t>, py::arg("image")) |
| 287 | .def("set_image", image_window_set_image<uint32_t>, py::arg("image")) |
| 288 | .def("set_image", image_window_set_image<uint64_t>, py::arg("image")) |
| 289 | .def("set_image", image_window_set_image<int8_t>, py::arg("image")) |
| 290 | .def("set_image", image_window_set_image<int16_t>, py::arg("image")) |
| 291 | .def("set_image", image_window_set_image<int32_t>, py::arg("image")) |
| 292 | .def("set_image", image_window_set_image<int64_t>, py::arg("image")) |
| 293 | .def("set_image", image_window_set_image<float>, py::arg("image")) |
| 294 | .def("set_image", image_window_set_image<double>, py::arg("image")) |
| 295 | .def("set_image", image_window_set_image<rgb_pixel>, py::arg("image"), docs3) |
| 296 | .def("set_title", (set_title_funct)&type::set_title, py::arg("title"), |
| 297 | "Set the title of the window to the given value.") |
| 298 | .def("clear_overlay", &type::clear_overlay, "Remove all overlays from the image_window.") |
| 299 | .def("add_overlay", (add_overlay_funct)&type::add_overlay<rgb_pixel>, py::arg("rectangles"), py::arg("color")=rgb_pixel(255, 0, 0), |
no test coverage detected