Skip to content

Commit

Permalink
Update changelog & bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
twistedfall committed Nov 10, 2024
1 parent cb26fc1 commit 05fbdcb
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 22 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* 0.93.4
* Various documentation, callback handling and other internal improvements.

* 0.93.3
* Fix issue with using `Option<Ptr>`, now behaves as expected and doesn't segfault.
* Introduce `Mat::get_data_dump()` to get the dump of the Mat data, it's also included in the `Debug` output.
Expand Down
4 changes: 2 additions & 2 deletions docs/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33694,8 +33694,8 @@ pub mod core {
/// serialized.
#[inline]
fn enqueue_host_callback(&mut self, callback: core::Stream_StreamCallback) -> Result<()> {
callback_arg!(callback_trampoline(status: i32, user_data: *mut c_void) -> () => user_data in callbacks => callback(status: i32) -> ());
userdata_arg!(user_data in callbacks => callback);
callback_arg!(callback_trampoline(status: i32, user_data: *mut c_void) -> () => user_data in callback(status: i32) -> ());
userdata_arg!(user_data: *mut c_void => callback);
return_send!(via ocvrs_return);
unsafe { sys::cv_cuda_Stream_enqueueHostCallback_StreamCallback_voidX(self.as_raw_mut_Stream(), callback_trampoline, user_data, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down
8 changes: 4 additions & 4 deletions docs/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2817,8 +2817,8 @@ pub mod face {
/// set the custom face detector
#[inline]
fn set_face_detector(&mut self, f: Option<Box<dyn FnMut(*const c_void, *const c_void) -> bool + Send + Sync + 'static>>) -> Result<bool> {
callback_arg!(f_trampoline(unnamed: *const c_void, unnamed_1: *const c_void, unnamed_2: *mut c_void) -> bool => unnamed_2 in callbacks => f(unnamed: *const c_void, unnamed_1: *const c_void) -> bool);
userdata_arg!(user_data in callbacks => f);
callback_arg!(f_trampoline(unnamed: *const c_void, unnamed_1: *const c_void, unnamed_2: *mut c_void) -> bool => unnamed_2 in f(unnamed: *const c_void, unnamed_1: *const c_void) -> bool);
userdata_arg!(user_data: *mut c_void => f);
return_send!(via ocvrs_return);
unsafe { sys::cv_face_FacemarkKazemi_setFaceDetector_bool__X__const_cv__InputArrayR__const_cv__OutputArrayR__voidX__voidX(self.as_raw_mut_FacemarkKazemi(), f_trampoline, user_data, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down Expand Up @@ -3669,8 +3669,8 @@ pub mod face {
/// * user_data: 0
#[inline]
fn set_face_detector(&mut self, detector: crate::face::FN_FaceDetector) -> Result<bool> {
callback_arg!(detector_trampoline(unnamed: *const c_void, unnamed_1: *const c_void, user_data: *mut c_void) -> bool => user_data in callbacks => detector(unnamed: *const c_void, unnamed_1: *const c_void) -> bool);
userdata_arg!(user_data in callbacks => detector);
callback_arg!(detector_trampoline(unnamed: *const c_void, unnamed_1: *const c_void, user_data: *mut c_void) -> bool => user_data in detector(unnamed: *const c_void, unnamed_1: *const c_void) -> bool);
userdata_arg!(user_data: *mut c_void => detector);
return_send!(via ocvrs_return);
unsafe { sys::cv_face_FacemarkTrain_setFaceDetector_FN_FaceDetector_voidX(self.as_raw_mut_FacemarkTrain(), detector_trampoline, user_data, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down
20 changes: 10 additions & 10 deletions docs/highgui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ pub mod highgui {
#[inline]
pub fn create_button_def(bar_name: &str, on_change: crate::highgui::ButtonCallback) -> Result<i32> {
extern_container_arg!(bar_name);
callback_arg!(on_change_trampoline(state: i32, userdata: *mut c_void) -> () => userdata in callbacks => on_change(state: i32) -> ());
userdata_arg!(userdata in callbacks => on_change);
callback_arg!(on_change_trampoline(state: i32, userdata: *mut c_void) -> () => userdata in on_change(state: i32) -> ());
userdata_arg!(userdata: *mut c_void => on_change);
return_send!(via ocvrs_return);
unsafe { sys::cv_createButton_const_StringR_ButtonCallback_voidX(bar_name.opencv_as_extern(), on_change_trampoline, userdata, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down Expand Up @@ -624,8 +624,8 @@ pub mod highgui {
#[inline]
pub fn create_button(bar_name: &str, on_change: crate::highgui::ButtonCallback, typ: i32, initial_button_state: bool) -> Result<i32> {
extern_container_arg!(bar_name);
callback_arg!(on_change_trampoline(state: i32, userdata: *mut c_void) -> () => userdata in callbacks => on_change(state: i32) -> ());
userdata_arg!(userdata in callbacks => on_change);
callback_arg!(on_change_trampoline(state: i32, userdata: *mut c_void) -> () => userdata in on_change(state: i32) -> ());
userdata_arg!(userdata: *mut c_void => on_change);
return_send!(via ocvrs_return);
unsafe { sys::cv_createButton_const_StringR_ButtonCallback_voidX_int_bool(bar_name.opencv_as_extern(), on_change_trampoline, userdata, typ, initial_button_state, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down Expand Up @@ -666,8 +666,8 @@ pub mod highgui {
pub fn create_trackbar(trackbarname: &str, winname: &str, value: Option<&mut i32>, count: i32, on_change: crate::highgui::TrackbarCallback) -> Result<i32> {
extern_container_arg!(trackbarname);
extern_container_arg!(winname);
callback_arg!(on_change_trampoline(pos: i32, userdata: *mut c_void) -> () => userdata in callbacks => on_change(pos: i32) -> ());
userdata_arg!(userdata in callbacks => on_change);
callback_arg!(on_change_trampoline(pos: i32, userdata: *mut c_void) -> () => userdata in on_change(pos: i32) -> ());
userdata_arg!(userdata: *mut c_void => on_change);
return_send!(via ocvrs_return);
unsafe { sys::cv_createTrackbar_const_StringR_const_StringR_intX_int_TrackbarCallback_voidX(trackbarname.opencv_as_extern(), winname.opencv_as_extern(), value.map_or(::core::ptr::null_mut(), |value| value), count, on_change_trampoline, userdata, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down Expand Up @@ -1447,8 +1447,8 @@ pub mod highgui {
#[inline]
pub fn set_mouse_callback(winname: &str, on_mouse: crate::highgui::MouseCallback) -> Result<()> {
extern_container_arg!(winname);
callback_arg!(on_mouse_trampoline(event: i32, x: i32, y: i32, flags: i32, userdata: *mut c_void) -> () => userdata in callbacks => on_mouse(event: i32, x: i32, y: i32, flags: i32) -> ());
userdata_arg!(userdata in callbacks => on_mouse);
callback_arg!(on_mouse_trampoline(event: i32, x: i32, y: i32, flags: i32, userdata: *mut c_void) -> () => userdata in on_mouse(event: i32, x: i32, y: i32, flags: i32) -> ());
userdata_arg!(userdata: *mut c_void => on_mouse);
return_send!(via ocvrs_return);
unsafe { sys::cv_setMouseCallback_const_StringR_MouseCallback_voidX(winname.opencv_as_extern(), on_mouse_trampoline, userdata, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down Expand Up @@ -1517,8 +1517,8 @@ pub mod highgui {
#[inline]
pub fn set_opengl_draw_callback(winname: &str, on_opengl_draw: crate::highgui::OpenGlDrawCallback) -> Result<()> {
extern_container_arg!(winname);
callback_arg!(on_opengl_draw_trampoline(userdata: *mut c_void) -> () => userdata in callbacks => on_opengl_draw() -> ());
userdata_arg!(userdata in callbacks => on_opengl_draw);
callback_arg!(on_opengl_draw_trampoline(userdata: *mut c_void) -> () => userdata in on_opengl_draw() -> ());
userdata_arg!(userdata: *mut c_void => on_opengl_draw);
return_send!(via ocvrs_return);
unsafe { sys::cv_setOpenGlDrawCallback_const_StringR_OpenGlDrawCallback_voidX(winname.opencv_as_extern(), on_opengl_draw_trampoline, userdata, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down
4 changes: 2 additions & 2 deletions docs/hub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,6 @@ pub mod hub_prelude {

mod ffi_exports {
use crate::mod_prelude_sys::*;
#[no_mangle] unsafe extern "C" fn ocvrs_create_string_0_93_2(s: *const c_char) -> *mut String { crate::templ::ocvrs_create_string(s) }
#[no_mangle] unsafe extern "C" fn ocvrs_create_byte_string_0_93_2(v: *const u8, len: size_t) -> *mut Vec<u8> { crate::templ::ocvrs_create_byte_string(v, len) }
#[no_mangle] unsafe extern "C" fn ocvrs_create_string_0_93_3(s: *const c_char) -> *mut String { crate::templ::ocvrs_create_string(s) }
#[no_mangle] unsafe extern "C" fn ocvrs_create_byte_string_0_93_3(v: *const u8, len: size_t) -> *mut Vec<u8> { crate::templ::ocvrs_create_byte_string(v, len) }
}
8 changes: 4 additions & 4 deletions docs/viz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2423,8 +2423,8 @@ pub mod viz {
/// * cookie: 0
#[inline]
fn register_keyboard_callback(&mut self, callback: crate::viz::Viz3d_KeyboardCallback) -> Result<()> {
callback_arg!(callback_trampoline(unnamed: *const c_void, unnamed_1: *mut c_void) -> () => unnamed_1 in callbacks => callback(unnamed: *const c_void) -> ());
userdata_arg!(cookie in callbacks => callback);
callback_arg!(callback_trampoline(unnamed: *const c_void, unnamed_1: *mut c_void) -> () => unnamed_1 in callback(unnamed: *const c_void) -> ());
userdata_arg!(cookie: *mut c_void => callback);
return_send!(via ocvrs_return);
unsafe { sys::cv_viz_Viz3d_registerKeyboardCallback_KeyboardCallback_voidX(self.as_raw_mut_Viz3d(), callback_trampoline, cookie, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand All @@ -2442,8 +2442,8 @@ pub mod viz {
/// * cookie: 0
#[inline]
fn register_mouse_callback(&mut self, callback: crate::viz::Viz3d_MouseCallback) -> Result<()> {
callback_arg!(callback_trampoline(unnamed: *const c_void, unnamed_1: *mut c_void) -> () => unnamed_1 in callbacks => callback(unnamed: *const c_void) -> ());
userdata_arg!(cookie in callbacks => callback);
callback_arg!(callback_trampoline(unnamed: *const c_void, unnamed_1: *mut c_void) -> () => unnamed_1 in callback(unnamed: *const c_void) -> ());
userdata_arg!(cookie: *mut c_void => callback);
return_send!(via ocvrs_return);
unsafe { sys::cv_viz_Viz3d_registerMouseCallback_MouseCallback_voidX(self.as_raw_mut_Viz3d(), callback_trampoline, cookie, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
Expand Down

0 comments on commit 05fbdcb

Please sign in to comment.