Skip to content

Commit

Permalink
regen immvision bindings (GlTexture)
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Oct 6, 2024
1 parent b541194 commit dcc980a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions bindings/imgui_bundle/immvision.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -589,17 +589,19 @@ class GlTexture:
def __init__(self) -> None:
"""Create an empty texture"""
pass
# GlTexture(const cv::Mat& image, bool isColorOrderBGR); /* original C++ signature */
# GlTexture(const cv::Mat& image, bool isColorOrderBGR = false); /* original C++ signature */
@overload
def __init__(self, image: Mat, is_color_order_bgr: bool) -> None:
"""Create a texture from an image (cv::Mat in C++, numpy array in Python)"""
def __init__(self, image: Mat, is_color_order_bgr: bool = False) -> None:
"""Create a texture from an image (cv::Mat in C++, numpy array in Python)
isColorOrderBGR: if True, the image is assumed to be in BGR order (OpenCV default)
"""
pass
#
# Methods
#

# void UpdateFromImage(const cv::Mat& image, bool isColorOrderBGR); /* original C++ signature */
def update_from_image(self, image: Mat, is_color_order_bgr: bool) -> None:
# void UpdateFromImage(const cv::Mat& image, bool isColorOrderBGR = false); /* original C++ signature */
def update_from_image(self, image: Mat, is_color_order_bgr: bool = False) -> None:
"""Update the texture from a new image (cv::Mat in C++, numpy array in Python).
(private API)
"""
Expand Down
6 changes: 3 additions & 3 deletions external/immvision/bindings/pybind_immvision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,11 @@ void py_init_module_immvision(py::module& m)
.def(py::init<>(),
"Create an empty texture")
.def(py::init<const cv::Mat &, bool>(),
py::arg("image"), py::arg("is_color_order_bgr"),
"Create a texture from an image (cv::Mat in C++, numpy array in Python)")
py::arg("image"), py::arg("is_color_order_bgr") = false,
" Create a texture from an image (cv::Mat in C++, numpy array in Python)\n isColorOrderBGR: if True, the image is assumed to be in BGR order (OpenCV default)")
.def("update_from_image",
&ImmVision::GlTexture::UpdateFromImage,
py::arg("image"), py::arg("is_color_order_bgr"),
py::arg("image"), py::arg("is_color_order_bgr") = false,
" Update the texture from a new image (cv::Mat in C++, numpy array in Python).\n(private API)")
.def("size_im_vec2",
&ImmVision::GlTexture::SizeImVec2, " Returns the size as ImVec2\n(private API)")
Expand Down

0 comments on commit dcc980a

Please sign in to comment.