| 28 | namespace nvcvpy::priv { |
| 29 | |
| 30 | void ExportRect(py::module &m) |
| 31 | { |
| 32 | using namespace py::literals; |
| 33 | |
| 34 | py::class_<NVCVRectI>(m, "RectI", "RectI") |
| 35 | .def(py::init([]() { return NVCVRectI{}; }), "Default constructor") |
| 36 | .def(py::init( |
| 37 | [](int x, int y, int w, int h) |
| 38 | { |
| 39 | NVCVRectI r; |
| 40 | r.x = x; |
| 41 | r.y = y; |
| 42 | r.width = w; |
| 43 | r.height = h; |
| 44 | return r; |
| 45 | }), |
| 46 | "x"_a, "y"_a, "width"_a, "height"_a, "Constructor with x, y, width, height parameters") |
| 47 | .def_readwrite("x", &NVCVRectI::x, "X coordinate of the rectangle's top-left corner") |
| 48 | .def_readwrite("y", &NVCVRectI::y, "Y coordinate of the rectangle's top-left corner") |
| 49 | .def_readwrite("width", &NVCVRectI::width, "Width of the rectangle") |
| 50 | .def_readwrite("height", &NVCVRectI::height, "Height of the rectangle") |
| 51 | .def("__repr__", &util::ToString<NVCVRectI>, "Returns a string representation of the rectangle"); |
| 52 | } |
| 53 | |
| 54 | } // namespace nvcvpy::priv |