Commit 1a3f8d5b authored by Davis King's avatar Davis King

Added center() and more overloads of centered_rect() to the Python API.

parent 8516442a
......@@ -271,6 +271,24 @@ ensures \n\
m.def("centered_rects", [](const std::vector<point>& p, unsigned long width, unsigned long height) {
return centered_rects(p, width, height); },
py::arg("pts"), py::arg("width"), py::arg("height"));
m.def("centered_rect", [](const dpoint& p, unsigned long width, unsigned long height) {
return centered_rect(p, width, height); },
py::arg("p"), py::arg("width"), py::arg("height"));
m.def("centered_rect", [](const rectangle& rect, unsigned long width, unsigned long height) {
return centered_rect(rect, width, height); },
py::arg("rect"), py::arg("width"), py::arg("height"));
m.def("centered_rect", [](const drectangle& rect, unsigned long width, unsigned long height) {
return centered_rect(rect, width, height); },
py::arg("rect"), py::arg("width"), py::arg("height"));
m.def("center", [](const rectangle& rect){return center(rect); }, py::arg("rect"),
" returns the center of the given rectangle");
m.def("center", [](const drectangle& rect){return center(rect); }, py::arg("rect"),
" returns the center of the given rectangle");
}
// ----------------------------------------------------------------------------------------
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment