Commit c1820284 authored by Davis King's avatar Davis King

Made point and dpoint constructable from each other.

parent f917f5e5
......@@ -181,6 +181,7 @@ void bind_vector(py::module& m)
typedef point type;
py::class_<type>(m, "point", "This object represents a single point of integer coordinates that maps directly to a dlib::point.")
.def(py::init<long,long>(), py::arg("x"), py::arg("y"))
.def(py::init<dpoint>(), py::arg("p"))
.def("__repr__", &point__repr__)
.def("__str__", &point__str__)
.def_property("x", &point_x, [](point& p, long x){p.x()=x;}, "The x-coordinate of the point.")
......@@ -200,6 +201,7 @@ void bind_vector(py::module& m)
typedef dpoint type;
py::class_<type>(m, "dpoint", "This object represents a single point of floating point coordinates that maps directly to a dlib::dpoint.")
.def(py::init<double,double>(), py::arg("x"), py::arg("y"))
.def(py::init<point>(), py::arg("p"))
.def("__repr__", &dpoint__repr__)
.def("__str__", &dpoint__str__)
.def_property("x", &dpoint_x, [](dpoint& p, double x){p.x()=x;}, "The x-coordinate of the dpoint.")
......
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