diff --git a/bindings/python/mapnik_grid.cpp b/bindings/python/mapnik_grid.cpp index 0c1b577b5..7a55060fb 100644 --- a/bindings/python/mapnik_grid.cpp +++ b/bindings/python/mapnik_grid.cpp @@ -35,6 +35,11 @@ using namespace boost::python; // help compiler see template definitions static dict (*encode)( mapnik::grid const&, std::string, bool, unsigned int) = mapnik::grid_encode; +bool painted(mapnik::grid const& grid) +{ + return grid.painted(); +} + void export_grid() { class_ >( @@ -44,6 +49,7 @@ void export_grid() ( arg("width"),arg("height"),arg("key")="__id__",arg("resolution")=1 ), "Create a mapnik.Grid object\n" )) + .def("painted",&painted) .def("width",&mapnik::grid::width) .def("height",&mapnik::grid::height) .def("view",&mapnik::grid::get_view) diff --git a/bindings/python/mapnik_image.cpp b/bindings/python/mapnik_image.cpp index 849dd363f..71068b693 100644 --- a/bindings/python/mapnik_image.cpp +++ b/bindings/python/mapnik_image.cpp @@ -118,6 +118,11 @@ void save_to_file3(mapnik::image_32 const& im, std::string const& filename, std: save_to_file(im,filename,type,pal); } +bool painted(mapnik::image_32 const& im) +{ + return im.painted(); +} + boost::shared_ptr open_from_file(std::string const& filename) { @@ -195,6 +200,7 @@ void export_image() .def("width",&image_32::width) .def("height",&image_32::height) .def("view",&image_32::get_view) + .def("painted",&painted) .add_property("background",make_function (&image_32::get_background,return_value_policy()), &image_32::set_background, "The background color of the image.") @@ -204,6 +210,7 @@ void export_image() .def("blend",&blend) .def("composite",&composite) //TODO(haoyu) The method name 'tostring' might be confusing since they actually return bytes in Python 3 + .def("tostring",&tostring1) .def("tostring",&tostring2) .def("tostring",&tostring3)