Skip to content

Commit b34d701

Browse files
committed
Update DrawTool binding for new drawRGBAImage
1 parent e916e24 commit b34d701

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

bindings/Sofa/src/SofaPython3/Sofa/Core/Binding_VisualParams.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ void moduleAddVisualParams(py::module &m)
9595
dt.def("drawText", [](DrawTool* self, int x, int y, int fontSize, char* text){
9696
self->writeOverlayText(x,y, fontSize, sofa::type::RGBAColor::white(), text);
9797
});
98-
dt.def("drawRGBAImage", [](DrawTool* self, const std::string& id, const sofa::type::Vec3& pos, const int w, const int h, const int mode, const char* data){
99-
self->drawRGBAImage(id, pos, w, h, mode, data);
98+
dt.def("drawRGBAImage", [](DrawTool* self, const std::string& id, const int revision, const sofa::type::Vec3& pos, const double scale, const int w, const int h, const int mode, py::array_t<char, py::array::c_style | py::array::forcecast> data){
99+
char* buffer = static_cast<char*>(data.request().ptr);
100+
self->drawRGBAImage(id, revision, pos, scale, w, h, mode, buffer);
100101
});
101-
dt.def("drawRGBAImage", [](DrawTool* self, const std::string& id, const sofa::type::Vec3& pos, const std::string& filename){
102-
self->drawRGBAImage(id, pos, filename);
102+
dt.def("drawRGBAImage", [](DrawTool* self, const std::string& id, const int revision, const sofa::type::Vec3& pos, const double scale, const std::string& filename){
103+
self->drawRGBAImage(id, revision, pos, scale, filename);
103104
});
104105

105106
}

0 commit comments

Comments
 (0)