0.49.0 Regenerate bindings
MODIFY
CHANGES.md
CHANGES.md
+* 0.49.0
+ * Fix conversion of slice arguments, allow nullable slices (fixes [#201](https://github.com/twistedfall/opencv-rust/issues/201))
+
* 0.48.0
* Fix binding-generator build in cross-compilation environment (kudos to tylerhawkes)
* Using `dnn_superres` now requires `contrib` feature enabled, it was incorrectly marked as core module

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.48.0"
+version = "0.49.0"
edition = "2018"
authors = ["Mathieu Poumeyrol <kali@zoy.org>", "Pro <twisted.fall@gmail.com>"]
autoexamples = false # cuda example doesn't compile on just any system
@@ -57,7 +57,7 @@ contrib = []
docs-only = []
[build-dependencies]
-binding-generator = { package = "opencv-binding-generator", version = "0.22.0", path = "binding-generator", optional = true }
+binding-generator = { package = "opencv-binding-generator", version = "0.23.0", path = "binding-generator", optional = true }
cc = { version = "1.0", features = ["parallel"] }
clang = { version = "1.0", features = ["clang_6_0"], optional = true }
dunce = "1.0"

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.48"
+opencv = "0.49"
```
Select OpenCV version if different from default (opencv-4) in Cargo.toml:
```toml
-opencv = {version = "0.48", default-features = false, features = ["opencv-34", "buildtime-bindgen"]}
+opencv = {version = "0.49", default-features = false, features = ["opencv-34", "buildtime-bindgen"]}
```
Or enable usage of `contrib` modules:
```toml
-opencv = {version = "0.48", features = ["contrib"]}
+opencv = {version = "0.49", features = ["contrib"]}
```
Import prelude

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.22.0"
+version = "0.23.0"
license = "MIT"
authors = ["Pro <twisted.fall@gmail.com>"]
edition = "2018"

MODIFY
bindings/rust/opencv_32/hub/core.rs
bindings/rust/opencv_32/hub/core.rs
@@ -9860,8 +9860,8 @@ impl Mat {
///
/// ## C++ default parameters
/// * steps: 0
- pub unsafe fn new_nd_with_data(sizes: &[i32], typ: i32, data: *mut c_void, steps: &size_t) -> Result<core::Mat> {
- { sys::cv_Mat_Mat_int_const_intX_int_voidX_const_size_tX(sizes.len() as _, sizes.as_ptr(), typ, data, steps) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
+ pub unsafe fn new_nd_with_data(sizes: &[i32], typ: i32, data: *mut c_void, steps: Option<&[size_t]>) -> Result<core::Mat> {
+ { sys::cv_Mat_Mat_int_const_intX_int_voidX_const_size_tX(sizes.len() as _, sizes.as_ptr(), typ, data, steps.map_or(::core::ptr::null(), |steps| steps.as_ptr())) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
}
/// download data from GpuMat
@@ -9882,8 +9882,8 @@ impl Mat {
///
/// ## C++ default parameters
/// * steps: 0
- pub unsafe fn new_nd_vec_with_data(sizes: &core::Vector::<i32>, typ: i32, data: *mut c_void, steps: &size_t) -> Result<core::Mat> {
- { sys::cv_Mat_Mat_const_vector_int_R_int_voidX_const_size_tX(sizes.as_raw_VectorOfi32(), typ, data, steps) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
+ pub unsafe fn new_nd_vec_with_data(sizes: &core::Vector::<i32>, typ: i32, data: *mut c_void, steps: Option<&[size_t]>) -> Result<core::Mat> {
+ { sys::cv_Mat_Mat_const_vector_int_R_int_voidX_const_size_tX(sizes.as_raw_VectorOfi32(), typ, data, steps.map_or(::core::ptr::null(), |steps| steps.as_ptr())) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
}
/// download data from GpuMat

MODIFY
bindings/rust/opencv_34/hub/core.rs
bindings/rust/opencv_34/hub/core.rs
@@ -10768,8 +10768,8 @@ impl Mat {
///
/// ## C++ default parameters
/// * steps: 0
- pub unsafe fn new_nd_with_data(sizes: &[i32], typ: i32, data: *mut c_void, steps: &size_t) -> Result<core::Mat> {
- { sys::cv_Mat_Mat_int_const_intX_int_voidX_const_size_tX(sizes.len() as _, sizes.as_ptr(), typ, data, steps) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
+ pub unsafe fn new_nd_with_data(sizes: &[i32], typ: i32, data: *mut c_void, steps: Option<&[size_t]>) -> Result<core::Mat> {
+ { sys::cv_Mat_Mat_int_const_intX_int_voidX_const_size_tX(sizes.len() as _, sizes.as_ptr(), typ, data, steps.map_or(::core::ptr::null(), |steps| steps.as_ptr())) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
}
/// download data from GpuMat
@@ -10790,8 +10790,8 @@ impl Mat {
///
/// ## C++ default parameters
/// * steps: 0
- pub unsafe fn new_nd_vec_with_data(sizes: &core::Vector::<i32>, typ: i32, data: *mut c_void, steps: &size_t) -> Result<core::Mat> {
- { sys::cv_Mat_Mat_const_vector_int_R_int_voidX_const_size_tX(sizes.as_raw_VectorOfi32(), typ, data, steps) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
+ pub unsafe fn new_nd_vec_with_data(sizes: &core::Vector::<i32>, typ: i32, data: *mut c_void, steps: Option<&[size_t]>) -> Result<core::Mat> {
+ { sys::cv_Mat_Mat_const_vector_int_R_int_voidX_const_size_tX(sizes.as_raw_VectorOfi32(), typ, data, steps.map_or(::core::ptr::null(), |steps| steps.as_ptr())) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
}
/// download data from GpuMat

MODIFY
bindings/rust/opencv_4/hub/core.rs
bindings/rust/opencv_4/hub/core.rs
@@ -10410,8 +10410,8 @@ impl Mat {
///
/// ## C++ default parameters
/// * steps: 0
- pub unsafe fn new_nd_with_data(sizes: &[i32], typ: i32, data: *mut c_void, steps: &size_t) -> Result<core::Mat> {
- { sys::cv_Mat_Mat_int_const_intX_int_voidX_const_size_tX(sizes.len() as _, sizes.as_ptr(), typ, data, steps) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
+ pub unsafe fn new_nd_with_data(sizes: &[i32], typ: i32, data: *mut c_void, steps: Option<&[size_t]>) -> Result<core::Mat> {
+ { sys::cv_Mat_Mat_int_const_intX_int_voidX_const_size_tX(sizes.len() as _, sizes.as_ptr(), typ, data, steps.map_or(::core::ptr::null(), |steps| steps.as_ptr())) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
}
/// download data from GpuMat
@@ -10432,8 +10432,8 @@ impl Mat {
///
/// ## C++ default parameters
/// * steps: 0
- pub unsafe fn new_nd_vec_with_data(sizes: &core::Vector::<i32>, typ: i32, data: *mut c_void, steps: &size_t) -> Result<core::Mat> {
- { sys::cv_Mat_Mat_const_vector_int_R_int_voidX_const_size_tX(sizes.as_raw_VectorOfi32(), typ, data, steps) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
+ pub unsafe fn new_nd_vec_with_data(sizes: &core::Vector::<i32>, typ: i32, data: *mut c_void, steps: Option<&[size_t]>) -> Result<core::Mat> {
+ { sys::cv_Mat_Mat_const_vector_int_R_int_voidX_const_size_tX(sizes.as_raw_VectorOfi32(), typ, data, steps.map_or(::core::ptr::null(), |steps| steps.as_ptr())) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
}
/// download data from GpuMat

MODIFY
src/opencv/hub/core.rs
src/opencv/hub/core.rs
@@ -10410,8 +10410,8 @@ impl Mat {
///
/// ## C++ default parameters
/// * steps: 0
- pub unsafe fn new_nd_with_data(sizes: &[i32], typ: i32, data: *mut c_void, steps: &size_t) -> Result<core::Mat> {
- { sys::cv_Mat_Mat_int_const_intX_int_voidX_const_size_tX(sizes.len() as _, sizes.as_ptr(), typ, data, steps) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
+ pub unsafe fn new_nd_with_data(sizes: &[i32], typ: i32, data: *mut c_void, steps: Option<&[size_t]>) -> Result<core::Mat> {
+ { sys::cv_Mat_Mat_int_const_intX_int_voidX_const_size_tX(sizes.len() as _, sizes.as_ptr(), typ, data, steps.map_or(::core::ptr::null(), |steps| steps.as_ptr())) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
}
/// download data from GpuMat
@@ -10432,8 +10432,8 @@ impl Mat {
///
/// ## C++ default parameters
/// * steps: 0
- pub unsafe fn new_nd_vec_with_data(sizes: &core::Vector::<i32>, typ: i32, data: *mut c_void, steps: &size_t) -> Result<core::Mat> {
- { sys::cv_Mat_Mat_const_vector_int_R_int_voidX_const_size_tX(sizes.as_raw_VectorOfi32(), typ, data, steps) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
+ pub unsafe fn new_nd_vec_with_data(sizes: &core::Vector::<i32>, typ: i32, data: *mut c_void, steps: Option<&[size_t]>) -> Result<core::Mat> {
+ { sys::cv_Mat_Mat_const_vector_int_R_int_voidX_const_size_tX(sizes.as_raw_VectorOfi32(), typ, data, steps.map_or(::core::ptr::null(), |steps| steps.as_ptr())) }.into_result().map(|r| { core::Mat::opencv_from_extern(r) } )
}
/// download data from GpuMat

0.49.0 Regenerate bindings