MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / ExportRect

Function ExportRect

python/mod_cvcuda/nvcv/Rect.cpp:30–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace nvcvpy::priv {
29
30void 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

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected