Made dlib.point() have writable x and y properties.

This commit is contained in:
Davis King 2018-02-10 12:37:14 -05:00
parent fa39e51864
commit 8fd9c26f6e
1 changed files with 2 additions and 2 deletions

View File

@ -167,8 +167,8 @@ void bind_vector(py::module& m)
.def(py::init<long,long>(), py::arg("x"), py::arg("y"))
.def("__repr__", &point__repr__)
.def("__str__", &point__str__)
.def_property_readonly("x", &point_x, "The x-coordinate of the point.")
.def_property_readonly("y", &point_y, "The y-coordinate of the point.")
.def_property("x", &point_x, [](point& p, long x){p.x()=x;}, "The x-coordinate of the point.")
.def_property("y", &point_y, [](point& p, long y){p.x()=y;}, "The y-coordinate of the point.")
.def(py::pickle(&getstate<type>, &setstate<type>));
}
{