0.37.0 Regenerate bindings
MODIFY
Cargo.toml
Cargo.toml
@@ -6,7 +6,7 @@ repository = "https://github.com/twistedfall/opencv-rust"
readme = "README.md"
keywords = ["opencv", "vision"]
license = "MIT"
-version = "0.36.0"
+version = "0.37.0"
edition = "2018"
authors = ["Mathieu Poumeyrol <kali@zoy.org>", "Pro <twisted.fall@gmail.com>"]
@@ -35,7 +35,7 @@ contrib = []
docs-only = []
[build-dependencies]
-binding-generator = {package = "opencv-binding-generator", version = "0.9", path = "binding-generator", optional = true}
+binding-generator = {package = "opencv-binding-generator", version = "0.10", path = "binding-generator", optional = true}
cc = {version = "1.0", features = ["parallel"]}
clang = {version = "0.23", features = ["clang_6_0"], optional = true}
glob_crate = {package = "glob", version = "0.3"}

MODIFY
README.md
README.md
@@ -14,17 +14,17 @@ Make sure the supported OpenCV version (3.2, 3.4 or 4.x) is installed in your sy
Update your Cargo.toml
```toml
-opencv = "0.36"
+opencv = "0.37"
```
Select OpenCV version if different from default (opencv-4) in Cargo.toml:
```toml
-opencv = {version = "0.36", default-features = false, features = ["opencv-34"]}
+opencv = {version = "0.37", default-features = false, features = ["opencv-34"]}
```
Or enable usage of `contrib` modules:
```toml
-opencv = {version = "0.36", features = ["contrib"]}
+opencv = {version = "0.37", features = ["contrib"]}
```
Import prelude
@@ -34,7 +34,7 @@ use opencv::prelude::*;
When building on Windows and macOS you must enable `buildtime-bindgen` feature to avoid link errors:
```toml
-opencv = {version = "0.36", features = ["buildtime-bindgen"]}
+opencv = {version = "0.37", features = ["buildtime-bindgen"]}
```
## Getting OpenCV

MODIFY
binding-generator/Cargo.toml
binding-generator/Cargo.toml
name = "opencv-binding-generator"
description = "Binding generator for opencv crate"
repository = "https://github.com/twistedfall/opencv-rust"
-version = "0.9.0"
+version = "0.10.0"
license = "MIT"
authors = ["Pro <twisted.fall@gmail.com>"]
edition = "2018"

MODIFY
bindings/rust/opencv_32/hub/dnn.rs
bindings/rust/opencv_32/hub/dnn.rs
@@ -54,7 +54,7 @@ pub enum PoolingLayer_Type {
}
/// Each Layer class must provide this function to the factory
-pub type LayerFactory_Constuctor = Option<extern "C" fn(*mut c_void) -> *mut c_void>;
+pub type LayerFactory_Constuctor = Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>;
/// Container for strings and integers.
pub type Net_LayerId = crate::dnn::DictValue;
pub type Shape = crate::dnn::BlobShape;

MODIFY
bindings/rust/opencv_32/hub/highgui.rs
bindings/rust/opencv_32/hub/highgui.rs
@@ -917,7 +917,7 @@ pub fn set_window_title(winname: &str, title: &str) -> Result<()> {
unsafe { sys::cv_setWindowTitle_const_StringX_const_StringX(winname.as_ptr(), title.as_ptr()) }.into_result()
}
-pub fn start_loop(pt2_func: Option<extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: &mut [&str]) -> Result<i32> {
+pub fn start_loop(pt2_func: Option<unsafe extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: &mut [&str]) -> Result<i32> {
string_array_arg_mut!(argv);
unsafe { sys::cv_startLoop_int__X__int__charXX__int_charXX(pt2_func, argc, argv.as_mut_ptr()) }.into_result()
}

MODIFY
bindings/rust/opencv_32/hub/sys.rs
bindings/rust/opencv_32/hub/sys.rs
@@ -1725,7 +1725,7 @@ mod dnn_sys {
pub fn cv_dnn_Layer_inputNameToIndex_String(instance: *mut c_void, input_name: *mut c_char) -> Result<i32>;
pub fn cv_dnn_Layer_outputNameToIndex_String(instance: *mut c_void, output_name: *mut c_char) -> Result<i32>;
pub fn cv_dnn_Layer_setParamsFrom_const_LayerParamsX(instance: *mut c_void, params: *const c_void) -> Result_void;
- pub fn cv_dnn_LayerFactory_registerLayer_const_StringX_Constuctor(typ: *const c_char, constructor: Option<extern "C" fn(*mut c_void) -> *mut c_void>) -> Result_void;
+ pub fn cv_dnn_LayerFactory_registerLayer_const_StringX_Constuctor(typ: *const c_char, constructor: Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>) -> Result_void;
pub fn cv_dnn_LayerFactory_unregisterLayer_const_StringX(typ: *const c_char) -> Result_void;
pub fn cv_dnn_LayerFactory_createLayerInstance_const_StringX_LayerParamsX(typ: *const c_char, params: *mut c_void) -> Result<*mut c_void>;
pub fn cv_dnn_LayerParams_blobs(instance: *mut c_void) -> Result<*mut c_void>;
@@ -2199,8 +2199,8 @@ mod highgui_sys {
extern "C" {
pub fn cv_addText_const_MatX_const_StringX_Point_const_QtFontX(img: *const c_void, text: *const c_char, org: *const core::Point, font: *const c_void) -> Result_void;
pub fn cv_addText_const_MatX_const_StringX_Point_const_StringX_int_Scalar_int_int_int(img: *const c_void, text: *const c_char, org: *const core::Point, name_font: *const c_char, point_size: i32, color: *const core::Scalar, weight: i32, style: i32, spacing: i32) -> Result_void;
- pub fn cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name: *const c_char, on_change: Option<extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void, typ: i32, initial_button_state: bool) -> Result<i32>;
- pub fn cv_createTrackbar_const_StringX_const_StringX_intX_int_TrackbarCallback_voidX(trackbarname: *const c_char, winname: *const c_char, value: *mut i32, count: i32, on_change: Option<extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result<i32>;
+ pub fn cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name: *const c_char, on_change: Option<unsafe extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void, typ: i32, initial_button_state: bool) -> Result<i32>;
+ pub fn cv_createTrackbar_const_StringX_const_StringX_intX_int_TrackbarCallback_voidX(trackbarname: *const c_char, winname: *const c_char, value: *mut i32, count: i32, on_change: Option<unsafe extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result<i32>;
pub fn cv_destroyAllWindows() -> Result_void;
pub fn cv_destroyWindow_const_StringX(winname: *const c_char) -> Result_void;
pub fn cv_displayOverlay_const_StringX_const_StringX_int(winname: *const c_char, text: *const c_char, delayms: i32) -> Result_void;
@@ -2215,15 +2215,15 @@ mod highgui_sys {
pub fn cv_namedWindow_const_StringX_int(winname: *const c_char, flags: i32) -> Result_void;
pub fn cv_resizeWindow_const_StringX_int_int(winname: *const c_char, width: i32, height: i32) -> Result_void;
pub fn cv_saveWindowParameters_const_StringX(window_name: *const c_char) -> Result_void;
- pub fn cv_setMouseCallback_const_StringX_MouseCallback_voidX(winname: *const c_char, on_mouse: Option<extern "C" fn(i32, i32, i32, i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
+ pub fn cv_setMouseCallback_const_StringX_MouseCallback_voidX(winname: *const c_char, on_mouse: Option<unsafe extern "C" fn(i32, i32, i32, i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
pub fn cv_setOpenGlContext_const_StringX(winname: *const c_char) -> Result_void;
- pub fn cv_setOpenGlDrawCallback_const_StringX_OpenGlDrawCallback_voidX(winname: *const c_char, on_opengl_draw: Option<extern "C" fn(*mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
+ pub fn cv_setOpenGlDrawCallback_const_StringX_OpenGlDrawCallback_voidX(winname: *const c_char, on_opengl_draw: Option<unsafe extern "C" fn(*mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
pub fn cv_setTrackbarMax_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, maxval: i32) -> Result_void;
pub fn cv_setTrackbarMin_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, minval: i32) -> Result_void;
pub fn cv_setTrackbarPos_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, pos: i32) -> Result_void;
pub fn cv_setWindowProperty_const_StringX_int_double(winname: *const c_char, prop_id: i32, prop_value: f64) -> Result_void;
pub fn cv_setWindowTitle_const_StringX_const_StringX(winname: *const c_char, title: *const c_char) -> Result_void;
- pub fn cv_startLoop_int__X__int__charXX__int_charXX(pt2_func: Option<extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: *mut *mut c_char) -> Result<i32>;
+ pub fn cv_startLoop_int__X__int__charXX__int_charXX(pt2_func: Option<unsafe extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: *mut *mut c_char) -> Result<i32>;
pub fn cv_startWindowThread() -> Result<i32>;
pub fn cv_stopLoop() -> Result_void;
pub fn cv_updateWindow_const_StringX(winname: *const c_char) -> Result_void;

MODIFY
bindings/rust/opencv_34/hub/dnn.rs
bindings/rust/opencv_34/hub/dnn.rs
@@ -73,7 +73,7 @@ pub enum Target {
}
/// Each Layer class must provide this function to the factory
-pub type LayerFactory_Constructor = Option<extern "C" fn(*mut c_void) -> *mut c_void>;
+pub type LayerFactory_Constructor = Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>;
pub type MatShape = core::Vector::<i32>;
/// Container for strings and integers.
pub type Net_LayerId = crate::dnn::DictValue;

MODIFY
bindings/rust/opencv_34/hub/highgui.rs
bindings/rust/opencv_34/hub/highgui.rs
@@ -1036,7 +1036,7 @@ pub fn set_window_title(winname: &str, title: &str) -> Result<()> {
unsafe { sys::cv_setWindowTitle_const_StringX_const_StringX(winname.as_ptr(), title.as_ptr()) }.into_result()
}
-pub fn start_loop(pt2_func: Option<extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: &mut [&str]) -> Result<i32> {
+pub fn start_loop(pt2_func: Option<unsafe extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: &mut [&str]) -> Result<i32> {
string_array_arg_mut!(argv);
unsafe { sys::cv_startLoop_int__X__int__charXX__int_charXX(pt2_func, argc, argv.as_mut_ptr()) }.into_result()
}

MODIFY
bindings/rust/opencv_34/hub/sys.rs
bindings/rust/opencv_34/hub/sys.rs
@@ -1939,7 +1939,7 @@ mod dnn_sys {
pub fn cv_dnn_Layer_Layer() -> Result<*mut c_void>;
pub fn cv_dnn_Layer_Layer_const_LayerParamsX(params: *const c_void) -> Result<*mut c_void>;
pub fn cv_dnn_Layer_setParamsFrom_const_LayerParamsX(instance: *mut c_void, params: *const c_void) -> Result_void;
- pub fn cv_dnn_LayerFactory_registerLayer_const_StringX_Constructor(typ: *const c_char, constructor: Option<extern "C" fn(*mut c_void) -> *mut c_void>) -> Result_void;
+ pub fn cv_dnn_LayerFactory_registerLayer_const_StringX_Constructor(typ: *const c_char, constructor: Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>) -> Result_void;
pub fn cv_dnn_LayerFactory_unregisterLayer_const_StringX(typ: *const c_char) -> Result_void;
pub fn cv_dnn_LayerFactory_createLayerInstance_const_StringX_LayerParamsX(typ: *const c_char, params: *mut c_void) -> Result<*mut c_void>;
pub fn cv_dnn_LayerParams_blobs(instance: *mut c_void) -> Result<*mut c_void>;
@@ -2334,7 +2334,7 @@ mod face_sys {
pub fn cv_face_FacemarkLBF_Params_write_const_FileStorageX(instance: *const c_void, unnamed: *mut c_void) -> Result_void;
pub fn cv_face_FacemarkTrain_addTrainingSample_const__InputArrayX_const__InputArrayX(instance: *mut c_void, image: *const c_void, landmarks: *const c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_training_voidX(instance: *mut c_void, parameters: *mut c_void) -> Result_void;
- pub fn cv_face_FacemarkTrain_setFaceDetector_FN_FaceDetector_voidX(instance: *mut c_void, detector: Option<extern "C" fn(*const c_void, *const c_void, *mut c_void) -> bool>, user_data: *mut c_void) -> Result<bool>;
+ pub fn cv_face_FacemarkTrain_setFaceDetector_FN_FaceDetector_voidX(instance: *mut c_void, detector: Option<unsafe extern "C" fn(*const c_void, *const c_void, *mut c_void) -> bool>, user_data: *mut c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_getFaces_const__InputArrayX_const__OutputArrayX(instance: *mut c_void, image: *const c_void, faces: *const c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_getData_voidX(instance: *mut c_void, items: *mut c_void) -> Result<bool>;
pub fn cv_face_FisherFaceRecognizer_create_int_double(num_components: i32, threshold: f64) -> Result<*mut c_void>;
@@ -2703,8 +2703,8 @@ mod highgui_sys {
extern "C" {
pub fn cv_addText_const_MatX_const_StringX_Point_const_QtFontX(img: *const c_void, text: *const c_char, org: *const core::Point, font: *const c_void) -> Result_void;
pub fn cv_addText_const_MatX_const_StringX_Point_const_StringX_int_Scalar_int_int_int(img: *const c_void, text: *const c_char, org: *const core::Point, name_font: *const c_char, point_size: i32, color: *const core::Scalar, weight: i32, style: i32, spacing: i32) -> Result_void;
- pub fn cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name: *const c_char, on_change: Option<extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void, typ: i32, initial_button_state: bool) -> Result<i32>;
- pub fn cv_createTrackbar_const_StringX_const_StringX_intX_int_TrackbarCallback_voidX(trackbarname: *const c_char, winname: *const c_char, value: *mut i32, count: i32, on_change: Option<extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result<i32>;
+ pub fn cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name: *const c_char, on_change: Option<unsafe extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void, typ: i32, initial_button_state: bool) -> Result<i32>;
+ pub fn cv_createTrackbar_const_StringX_const_StringX_intX_int_TrackbarCallback_voidX(trackbarname: *const c_char, winname: *const c_char, value: *mut i32, count: i32, on_change: Option<unsafe extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result<i32>;
pub fn cv_destroyAllWindows() -> Result_void;
pub fn cv_destroyWindow_const_StringX(winname: *const c_char) -> Result_void;
pub fn cv_displayOverlay_const_StringX_const_StringX_int(winname: *const c_char, text: *const c_char, delayms: i32) -> Result_void;
@@ -2724,15 +2724,15 @@ mod highgui_sys {
pub fn cv_selectROI_const_StringX_const__InputArrayX_bool_bool(window_name: *const c_char, img: *const c_void, show_crosshair: bool, from_center: bool) -> Result<core::Rect>;
pub fn cv_selectROI_const__InputArrayX_bool_bool(img: *const c_void, show_crosshair: bool, from_center: bool) -> Result<core::Rect>;
pub fn cv_selectROIs_const_StringX_const__InputArrayX_vector_Rect_X_bool_bool(window_name: *const c_char, img: *const c_void, bounding_boxes: *mut c_void, show_crosshair: bool, from_center: bool) -> Result_void;
- pub fn cv_setMouseCallback_const_StringX_MouseCallback_voidX(winname: *const c_char, on_mouse: Option<extern "C" fn(i32, i32, i32, i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
+ pub fn cv_setMouseCallback_const_StringX_MouseCallback_voidX(winname: *const c_char, on_mouse: Option<unsafe extern "C" fn(i32, i32, i32, i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
pub fn cv_setOpenGlContext_const_StringX(winname: *const c_char) -> Result_void;
- pub fn cv_setOpenGlDrawCallback_const_StringX_OpenGlDrawCallback_voidX(winname: *const c_char, on_opengl_draw: Option<extern "C" fn(*mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
+ pub fn cv_setOpenGlDrawCallback_const_StringX_OpenGlDrawCallback_voidX(winname: *const c_char, on_opengl_draw: Option<unsafe extern "C" fn(*mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
pub fn cv_setTrackbarMax_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, maxval: i32) -> Result_void;
pub fn cv_setTrackbarMin_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, minval: i32) -> Result_void;
pub fn cv_setTrackbarPos_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, pos: i32) -> Result_void;
pub fn cv_setWindowProperty_const_StringX_int_double(winname: *const c_char, prop_id: i32, prop_value: f64) -> Result_void;
pub fn cv_setWindowTitle_const_StringX_const_StringX(winname: *const c_char, title: *const c_char) -> Result_void;
- pub fn cv_startLoop_int__X__int__charXX__int_charXX(pt2_func: Option<extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: *mut *mut c_char) -> Result<i32>;
+ pub fn cv_startLoop_int__X__int__charXX__int_charXX(pt2_func: Option<unsafe extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: *mut *mut c_char) -> Result<i32>;
pub fn cv_startWindowThread() -> Result<i32>;
pub fn cv_stopLoop() -> Result_void;
pub fn cv_updateWindow_const_StringX(winname: *const c_char) -> Result_void;
@@ -4975,8 +4975,8 @@ mod viz_sys {
pub fn cv_viz_Viz3d_addLight_Vec3d_Vec3d_Color_Color_Color_Color(instance: *mut c_void, position: *const core::Vec3d, focal_point: *const core::Vec3d, color: *mut c_void, diffuse_color: *mut c_void, ambient_color: *mut c_void, specular_color: *mut c_void) -> Result_void;
pub fn cv_viz_Viz3d_wasStopped_const(instance: *const c_void) -> Result<bool>;
pub fn cv_viz_Viz3d_close(instance: *mut c_void) -> Result_void;
- pub fn cv_viz_Viz3d_registerKeyboardCallback_KeyboardCallback_voidX(instance: *mut c_void, callback: Option<extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
- pub fn cv_viz_Viz3d_registerMouseCallback_MouseCallback_voidX(instance: *mut c_void, callback: Option<extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
+ pub fn cv_viz_Viz3d_registerKeyboardCallback_KeyboardCallback_voidX(instance: *mut c_void, callback: Option<unsafe extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
+ pub fn cv_viz_Viz3d_registerMouseCallback_MouseCallback_voidX(instance: *mut c_void, callback: Option<unsafe extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
pub fn cv_viz_Viz3d_setRenderingProperty_const_StringX_int_double(instance: *mut c_void, id: *const c_char, property: i32, value: f64) -> Result_void;
pub fn cv_viz_Viz3d_getRenderingProperty_const_StringX_int(instance: *mut c_void, id: *const c_char, property: i32) -> Result<f64>;
pub fn cv_viz_Viz3d_setRepresentation_int(instance: *mut c_void, representation: i32) -> Result_void;

MODIFY
bindings/rust/opencv_4/hub/dnn.rs
bindings/rust/opencv_4/hub/dnn.rs
@@ -84,7 +84,7 @@ pub enum Target {
}
/// Each Layer class must provide this function to the factory
-pub type LayerFactory_Constructor = Option<extern "C" fn(*mut c_void) -> *mut c_void>;
+pub type LayerFactory_Constructor = Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>;
pub type MatShape = core::Vector::<i32>;
/// Container for strings and integers.
pub type Net_LayerId = crate::dnn::DictValue;

MODIFY
bindings/rust/opencv_4/hub/highgui.rs
bindings/rust/opencv_4/hub/highgui.rs
@@ -1036,7 +1036,7 @@ pub fn set_window_title(winname: &str, title: &str) -> Result<()> {
unsafe { sys::cv_setWindowTitle_const_StringX_const_StringX(winname.as_ptr(), title.as_ptr()) }.into_result()
}
-pub fn start_loop(pt2_func: Option<extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: &mut [&str]) -> Result<i32> {
+pub fn start_loop(pt2_func: Option<unsafe extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: &mut [&str]) -> Result<i32> {
string_array_arg_mut!(argv);
unsafe { sys::cv_startLoop_int__X__int__charXX__int_charXX(pt2_func, argc, argv.as_mut_ptr()) }.into_result()
}

MODIFY
bindings/rust/opencv_4/hub/sys.rs
bindings/rust/opencv_4/hub/sys.rs
@@ -1967,7 +1967,7 @@ mod dnn_sys {
pub fn cv_dnn_Layer_Layer() -> Result<*mut c_void>;
pub fn cv_dnn_Layer_Layer_const_LayerParamsX(params: *const c_void) -> Result<*mut c_void>;
pub fn cv_dnn_Layer_setParamsFrom_const_LayerParamsX(instance: *mut c_void, params: *const c_void) -> Result_void;
- pub fn cv_dnn_LayerFactory_registerLayer_const_StringX_Constructor(typ: *const c_char, constructor: Option<extern "C" fn(*mut c_void) -> *mut c_void>) -> Result_void;
+ pub fn cv_dnn_LayerFactory_registerLayer_const_StringX_Constructor(typ: *const c_char, constructor: Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>) -> Result_void;
pub fn cv_dnn_LayerFactory_unregisterLayer_const_StringX(typ: *const c_char) -> Result_void;
pub fn cv_dnn_LayerFactory_createLayerInstance_const_StringX_LayerParamsX(typ: *const c_char, params: *mut c_void) -> Result<*mut c_void>;
pub fn cv_dnn_LayerParams_blobs(instance: *mut c_void) -> Result<*mut c_void>;
@@ -2394,7 +2394,7 @@ mod face_sys {
pub fn cv_face_FacemarkLBF_Params_write_const_FileStorageX(instance: *const c_void, unnamed: *mut c_void) -> Result_void;
pub fn cv_face_FacemarkTrain_addTrainingSample_const__InputArrayX_const__InputArrayX(instance: *mut c_void, image: *const c_void, landmarks: *const c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_training_voidX(instance: *mut c_void, parameters: *mut c_void) -> Result_void;
- pub fn cv_face_FacemarkTrain_setFaceDetector_FN_FaceDetector_voidX(instance: *mut c_void, detector: Option<extern "C" fn(*const c_void, *const c_void, *mut c_void) -> bool>, user_data: *mut c_void) -> Result<bool>;
+ pub fn cv_face_FacemarkTrain_setFaceDetector_FN_FaceDetector_voidX(instance: *mut c_void, detector: Option<unsafe extern "C" fn(*const c_void, *const c_void, *mut c_void) -> bool>, user_data: *mut c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_getFaces_const__InputArrayX_const__OutputArrayX(instance: *mut c_void, image: *const c_void, faces: *const c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_getData_voidX(instance: *mut c_void, items: *mut c_void) -> Result<bool>;
pub fn cv_face_FisherFaceRecognizer_create_int_double(num_components: i32, threshold: f64) -> Result<*mut c_void>;
@@ -2768,8 +2768,8 @@ mod highgui_sys {
extern "C" {
pub fn cv_addText_const_MatX_const_StringX_Point_const_QtFontX(img: *const c_void, text: *const c_char, org: *const core::Point, font: *const c_void) -> Result_void;
pub fn cv_addText_const_MatX_const_StringX_Point_const_StringX_int_Scalar_int_int_int(img: *const c_void, text: *const c_char, org: *const core::Point, name_font: *const c_char, point_size: i32, color: *const core::Scalar, weight: i32, style: i32, spacing: i32) -> Result_void;
- pub fn cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name: *const c_char, on_change: Option<extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void, typ: i32, initial_button_state: bool) -> Result<i32>;
- pub fn cv_createTrackbar_const_StringX_const_StringX_intX_int_TrackbarCallback_voidX(trackbarname: *const c_char, winname: *const c_char, value: *mut i32, count: i32, on_change: Option<extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result<i32>;
+ pub fn cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name: *const c_char, on_change: Option<unsafe extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void, typ: i32, initial_button_state: bool) -> Result<i32>;
+ pub fn cv_createTrackbar_const_StringX_const_StringX_intX_int_TrackbarCallback_voidX(trackbarname: *const c_char, winname: *const c_char, value: *mut i32, count: i32, on_change: Option<unsafe extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result<i32>;
pub fn cv_destroyAllWindows() -> Result_void;
pub fn cv_destroyWindow_const_StringX(winname: *const c_char) -> Result_void;
pub fn cv_displayOverlay_const_StringX_const_StringX_int(winname: *const c_char, text: *const c_char, delayms: i32) -> Result_void;
@@ -2789,15 +2789,15 @@ mod highgui_sys {
pub fn cv_selectROI_const_StringX_const__InputArrayX_bool_bool(window_name: *const c_char, img: *const c_void, show_crosshair: bool, from_center: bool) -> Result<core::Rect>;
pub fn cv_selectROI_const__InputArrayX_bool_bool(img: *const c_void, show_crosshair: bool, from_center: bool) -> Result<core::Rect>;
pub fn cv_selectROIs_const_StringX_const__InputArrayX_vector_Rect_X_bool_bool(window_name: *const c_char, img: *const c_void, bounding_boxes: *mut c_void, show_crosshair: bool, from_center: bool) -> Result_void;
- pub fn cv_setMouseCallback_const_StringX_MouseCallback_voidX(winname: *const c_char, on_mouse: Option<extern "C" fn(i32, i32, i32, i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
+ pub fn cv_setMouseCallback_const_StringX_MouseCallback_voidX(winname: *const c_char, on_mouse: Option<unsafe extern "C" fn(i32, i32, i32, i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
pub fn cv_setOpenGlContext_const_StringX(winname: *const c_char) -> Result_void;
- pub fn cv_setOpenGlDrawCallback_const_StringX_OpenGlDrawCallback_voidX(winname: *const c_char, on_opengl_draw: Option<extern "C" fn(*mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
+ pub fn cv_setOpenGlDrawCallback_const_StringX_OpenGlDrawCallback_voidX(winname: *const c_char, on_opengl_draw: Option<unsafe extern "C" fn(*mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
pub fn cv_setTrackbarMax_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, maxval: i32) -> Result_void;
pub fn cv_setTrackbarMin_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, minval: i32) -> Result_void;
pub fn cv_setTrackbarPos_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, pos: i32) -> Result_void;
pub fn cv_setWindowProperty_const_StringX_int_double(winname: *const c_char, prop_id: i32, prop_value: f64) -> Result_void;
pub fn cv_setWindowTitle_const_StringX_const_StringX(winname: *const c_char, title: *const c_char) -> Result_void;
- pub fn cv_startLoop_int__X__int__charXX__int_charXX(pt2_func: Option<extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: *mut *mut c_char) -> Result<i32>;
+ pub fn cv_startLoop_int__X__int__charXX__int_charXX(pt2_func: Option<unsafe extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: *mut *mut c_char) -> Result<i32>;
pub fn cv_startWindowThread() -> Result<i32>;
pub fn cv_stopLoop() -> Result_void;
pub fn cv_updateWindow_const_StringX(winname: *const c_char) -> Result_void;
@@ -5132,8 +5132,8 @@ mod viz_sys {
pub fn cv_viz_Viz3d_addLight_const_Vec3dX_const_Vec3dX_const_ColorX_const_ColorX_const_ColorX_const_ColorX(instance: *mut c_void, position: *const core::Vec3d, focal_point: *const core::Vec3d, color: *const c_void, diffuse_color: *const c_void, ambient_color: *const c_void, specular_color: *const c_void) -> Result_void;
pub fn cv_viz_Viz3d_wasStopped_const(instance: *const c_void) -> Result<bool>;
pub fn cv_viz_Viz3d_close(instance: *mut c_void) -> Result_void;
- pub fn cv_viz_Viz3d_registerKeyboardCallback_KeyboardCallback_voidX(instance: *mut c_void, callback: Option<extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
- pub fn cv_viz_Viz3d_registerMouseCallback_MouseCallback_voidX(instance: *mut c_void, callback: Option<extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
+ pub fn cv_viz_Viz3d_registerKeyboardCallback_KeyboardCallback_voidX(instance: *mut c_void, callback: Option<unsafe extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
+ pub fn cv_viz_Viz3d_registerMouseCallback_MouseCallback_voidX(instance: *mut c_void, callback: Option<unsafe extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
pub fn cv_viz_Viz3d_setRenderingProperty_const_StringX_int_double(instance: *mut c_void, id: *const c_char, property: i32, value: f64) -> Result_void;
pub fn cv_viz_Viz3d_getRenderingProperty_const_StringX_int(instance: *mut c_void, id: *const c_char, property: i32) -> Result<f64>;
pub fn cv_viz_Viz3d_setRepresentation_int(instance: *mut c_void, representation: i32) -> Result_void;

MODIFY
src/opencv/hub/dnn.rs
src/opencv/hub/dnn.rs
@@ -84,7 +84,7 @@ pub enum Target {
}
/// Each Layer class must provide this function to the factory
-pub type LayerFactory_Constructor = Option<extern "C" fn(*mut c_void) -> *mut c_void>;
+pub type LayerFactory_Constructor = Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>;
pub type MatShape = core::Vector::<i32>;
/// Container for strings and integers.
pub type Net_LayerId = crate::dnn::DictValue;

MODIFY
src/opencv/hub/highgui.rs
src/opencv/hub/highgui.rs
@@ -1036,7 +1036,7 @@ pub fn set_window_title(winname: &str, title: &str) -> Result<()> {
unsafe { sys::cv_setWindowTitle_const_StringX_const_StringX(winname.as_ptr(), title.as_ptr()) }.into_result()
}
-pub fn start_loop(pt2_func: Option<extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: &mut [&str]) -> Result<i32> {
+pub fn start_loop(pt2_func: Option<unsafe extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: &mut [&str]) -> Result<i32> {
string_array_arg_mut!(argv);
unsafe { sys::cv_startLoop_int__X__int__charXX__int_charXX(pt2_func, argc, argv.as_mut_ptr()) }.into_result()
}

MODIFY
src/opencv/hub/sys.rs
src/opencv/hub/sys.rs
@@ -1967,7 +1967,7 @@ mod dnn_sys {
pub fn cv_dnn_Layer_Layer() -> Result<*mut c_void>;
pub fn cv_dnn_Layer_Layer_const_LayerParamsX(params: *const c_void) -> Result<*mut c_void>;
pub fn cv_dnn_Layer_setParamsFrom_const_LayerParamsX(instance: *mut c_void, params: *const c_void) -> Result_void;
- pub fn cv_dnn_LayerFactory_registerLayer_const_StringX_Constructor(typ: *const c_char, constructor: Option<extern "C" fn(*mut c_void) -> *mut c_void>) -> Result_void;
+ pub fn cv_dnn_LayerFactory_registerLayer_const_StringX_Constructor(typ: *const c_char, constructor: Option<unsafe extern "C" fn(*mut c_void) -> *mut c_void>) -> Result_void;
pub fn cv_dnn_LayerFactory_unregisterLayer_const_StringX(typ: *const c_char) -> Result_void;
pub fn cv_dnn_LayerFactory_createLayerInstance_const_StringX_LayerParamsX(typ: *const c_char, params: *mut c_void) -> Result<*mut c_void>;
pub fn cv_dnn_LayerParams_blobs(instance: *mut c_void) -> Result<*mut c_void>;
@@ -2394,7 +2394,7 @@ mod face_sys {
pub fn cv_face_FacemarkLBF_Params_write_const_FileStorageX(instance: *const c_void, unnamed: *mut c_void) -> Result_void;
pub fn cv_face_FacemarkTrain_addTrainingSample_const__InputArrayX_const__InputArrayX(instance: *mut c_void, image: *const c_void, landmarks: *const c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_training_voidX(instance: *mut c_void, parameters: *mut c_void) -> Result_void;
- pub fn cv_face_FacemarkTrain_setFaceDetector_FN_FaceDetector_voidX(instance: *mut c_void, detector: Option<extern "C" fn(*const c_void, *const c_void, *mut c_void) -> bool>, user_data: *mut c_void) -> Result<bool>;
+ pub fn cv_face_FacemarkTrain_setFaceDetector_FN_FaceDetector_voidX(instance: *mut c_void, detector: Option<unsafe extern "C" fn(*const c_void, *const c_void, *mut c_void) -> bool>, user_data: *mut c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_getFaces_const__InputArrayX_const__OutputArrayX(instance: *mut c_void, image: *const c_void, faces: *const c_void) -> Result<bool>;
pub fn cv_face_FacemarkTrain_getData_voidX(instance: *mut c_void, items: *mut c_void) -> Result<bool>;
pub fn cv_face_FisherFaceRecognizer_create_int_double(num_components: i32, threshold: f64) -> Result<*mut c_void>;
@@ -2768,8 +2768,8 @@ mod highgui_sys {
extern "C" {
pub fn cv_addText_const_MatX_const_StringX_Point_const_QtFontX(img: *const c_void, text: *const c_char, org: *const core::Point, font: *const c_void) -> Result_void;
pub fn cv_addText_const_MatX_const_StringX_Point_const_StringX_int_Scalar_int_int_int(img: *const c_void, text: *const c_char, org: *const core::Point, name_font: *const c_char, point_size: i32, color: *const core::Scalar, weight: i32, style: i32, spacing: i32) -> Result_void;
- pub fn cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name: *const c_char, on_change: Option<extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void, typ: i32, initial_button_state: bool) -> Result<i32>;
- pub fn cv_createTrackbar_const_StringX_const_StringX_intX_int_TrackbarCallback_voidX(trackbarname: *const c_char, winname: *const c_char, value: *mut i32, count: i32, on_change: Option<extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result<i32>;
+ pub fn cv_createButton_const_StringX_ButtonCallback_voidX_int_bool(bar_name: *const c_char, on_change: Option<unsafe extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void, typ: i32, initial_button_state: bool) -> Result<i32>;
+ pub fn cv_createTrackbar_const_StringX_const_StringX_intX_int_TrackbarCallback_voidX(trackbarname: *const c_char, winname: *const c_char, value: *mut i32, count: i32, on_change: Option<unsafe extern "C" fn(i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result<i32>;
pub fn cv_destroyAllWindows() -> Result_void;
pub fn cv_destroyWindow_const_StringX(winname: *const c_char) -> Result_void;
pub fn cv_displayOverlay_const_StringX_const_StringX_int(winname: *const c_char, text: *const c_char, delayms: i32) -> Result_void;
@@ -2789,15 +2789,15 @@ mod highgui_sys {
pub fn cv_selectROI_const_StringX_const__InputArrayX_bool_bool(window_name: *const c_char, img: *const c_void, show_crosshair: bool, from_center: bool) -> Result<core::Rect>;
pub fn cv_selectROI_const__InputArrayX_bool_bool(img: *const c_void, show_crosshair: bool, from_center: bool) -> Result<core::Rect>;
pub fn cv_selectROIs_const_StringX_const__InputArrayX_vector_Rect_X_bool_bool(window_name: *const c_char, img: *const c_void, bounding_boxes: *mut c_void, show_crosshair: bool, from_center: bool) -> Result_void;
- pub fn cv_setMouseCallback_const_StringX_MouseCallback_voidX(winname: *const c_char, on_mouse: Option<extern "C" fn(i32, i32, i32, i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
+ pub fn cv_setMouseCallback_const_StringX_MouseCallback_voidX(winname: *const c_char, on_mouse: Option<unsafe extern "C" fn(i32, i32, i32, i32, *mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
pub fn cv_setOpenGlContext_const_StringX(winname: *const c_char) -> Result_void;
- pub fn cv_setOpenGlDrawCallback_const_StringX_OpenGlDrawCallback_voidX(winname: *const c_char, on_opengl_draw: Option<extern "C" fn(*mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
+ pub fn cv_setOpenGlDrawCallback_const_StringX_OpenGlDrawCallback_voidX(winname: *const c_char, on_opengl_draw: Option<unsafe extern "C" fn(*mut c_void) -> ()>, userdata: *mut c_void) -> Result_void;
pub fn cv_setTrackbarMax_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, maxval: i32) -> Result_void;
pub fn cv_setTrackbarMin_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, minval: i32) -> Result_void;
pub fn cv_setTrackbarPos_const_StringX_const_StringX_int(trackbarname: *const c_char, winname: *const c_char, pos: i32) -> Result_void;
pub fn cv_setWindowProperty_const_StringX_int_double(winname: *const c_char, prop_id: i32, prop_value: f64) -> Result_void;
pub fn cv_setWindowTitle_const_StringX_const_StringX(winname: *const c_char, title: *const c_char) -> Result_void;
- pub fn cv_startLoop_int__X__int__charXX__int_charXX(pt2_func: Option<extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: *mut *mut c_char) -> Result<i32>;
+ pub fn cv_startLoop_int__X__int__charXX__int_charXX(pt2_func: Option<unsafe extern "C" fn(i32, *mut *mut c_char) -> i32>, argc: i32, argv: *mut *mut c_char) -> Result<i32>;
pub fn cv_startWindowThread() -> Result<i32>;
pub fn cv_stopLoop() -> Result_void;
pub fn cv_updateWindow_const_StringX(winname: *const c_char) -> Result_void;
@@ -5132,8 +5132,8 @@ mod viz_sys {
pub fn cv_viz_Viz3d_addLight_const_Vec3dX_const_Vec3dX_const_ColorX_const_ColorX_const_ColorX_const_ColorX(instance: *mut c_void, position: *const core::Vec3d, focal_point: *const core::Vec3d, color: *const c_void, diffuse_color: *const c_void, ambient_color: *const c_void, specular_color: *const c_void) -> Result_void;
pub fn cv_viz_Viz3d_wasStopped_const(instance: *const c_void) -> Result<bool>;
pub fn cv_viz_Viz3d_close(instance: *mut c_void) -> Result_void;
- pub fn cv_viz_Viz3d_registerKeyboardCallback_KeyboardCallback_voidX(instance: *mut c_void, callback: Option<extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
- pub fn cv_viz_Viz3d_registerMouseCallback_MouseCallback_voidX(instance: *mut c_void, callback: Option<extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
+ pub fn cv_viz_Viz3d_registerKeyboardCallback_KeyboardCallback_voidX(instance: *mut c_void, callback: Option<unsafe extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
+ pub fn cv_viz_Viz3d_registerMouseCallback_MouseCallback_voidX(instance: *mut c_void, callback: Option<unsafe extern "C" fn(*const c_void, *mut c_void) -> ()>, cookie: *mut c_void) -> Result_void;
pub fn cv_viz_Viz3d_setRenderingProperty_const_StringX_int_double(instance: *mut c_void, id: *const c_char, property: i32, value: f64) -> Result_void;
pub fn cv_viz_Viz3d_getRenderingProperty_const_StringX_int(instance: *mut c_void, id: *const c_char, property: i32) -> Result<f64>;
pub fn cv_viz_Viz3d_setRepresentation_int(instance: *mut c_void, representation: i32) -> Result_void;

0.37.0 Regenerate bindings