Skip to content
Snippets Groups Projects
Commit 0dd39848 authored by Christof Kaufmann's avatar Christof Kaufmann
Browse files

python: Add string representation for images

parent d278642a
No related branches found
No related tags found
No related merge requests found
...@@ -335,6 +335,11 @@ PYBIND11_MODULE(_imagefusion, module) { ...@@ -335,6 +335,11 @@ PYBIND11_MODULE(_imagefusion, module) {
constimage.def(py::init([](py::none /*empty*/) { return new imfu::ConstImage(); })); constimage.def(py::init([](py::none /*empty*/) { return new imfu::ConstImage(); }));
constimage.def(py::init<std::string const&, std::vector<int>, imfu::Rectangle, bool, bool, bool>()); constimage.def(py::init<std::string const&, std::vector<int>, imfu::Rectangle, bool, bool, bool>());
constimage.def("write", py::overload_cast<std::string const& /*filename*/, std::string const& /*drivername*/, std::vector<std::pair<std::string,std::string>> const& /*options*/, imfu::GeoInfo const& /*gi*/>(&imfu::ConstImage::write, py::const_), "Write an Image to a file"); constimage.def("write", py::overload_cast<std::string const& /*filename*/, std::string const& /*drivername*/, std::vector<std::pair<std::string,std::string>> const& /*options*/, imfu::GeoInfo const& /*gi*/>(&imfu::ConstImage::write, py::const_), "Write an Image to a file");
constimage.def("__repr__", [](imfu::ConstImage const& img) {
std::string out;
out << img.cvMat();
return out;
});
py::class_<imfu::Image, imfu::ConstImage> image(module, "Image", py::buffer_protocol()); py::class_<imfu::Image, imfu::ConstImage> image(module, "Image", py::buffer_protocol());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment