0.56.1 Regenerate bindings
MODIFY
CHANGES.md
CHANGES.md
+* 0.56.1
+ * Structs that have infallible default constructors (e.g. `Mat`) now implement `Default` trait.
+ * Make sure to generate `std::vector<cv::Vec[23][fd]>` bindings for `imgproc::HoughLines` function.
+
* 0.56.0
* Mark most exported functions as `#[inline]` to facilitate inter-crate inlining. Those function calls are just wrappers around
the corresponding FFI function.

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.56.0"
+version = "0.56.1"
edition = "2018"
authors = ["Pro <twisted.fall@gmail.com>", "Mathieu Poumeyrol <kali@zoy.org>"]
autoexamples = false # not all examples compile on just any system
@@ -62,7 +62,7 @@ clang-runtime = ["clang/runtime"]
docs-only = []
[build-dependencies]
-binding-generator = { package = "opencv-binding-generator", version = "0.30.0", path = "binding-generator" }
+binding-generator = { package = "opencv-binding-generator", version = "0.31.0", path = "binding-generator" }
cc = { version = "1.0", features = ["parallel"] }
clang = { version = "1.0", features = ["clang_6_0"] }
dunce = "1.0"

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

MODIFY
src/opencv/hub/core.rs
src/opencv/hub/core.rs
@@ -6937,6 +6937,14 @@ impl AsyncArray {
}
+impl Default for AsyncArray {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
/// Provides result of asynchronous operations
pub trait AsyncPromiseTraitConst {
fn as_raw_AsyncPromise(&self) -> *const c_void;
@@ -7025,6 +7033,14 @@ impl AsyncPromise {
}
+impl Default for AsyncPromise {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
/// Designed for command line parsing
///
/// The sample below demonstrates how to use CommandLineParser:
@@ -11426,6 +11442,14 @@ impl Clone for Mat {
}
}
+impl Default for Mat {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
/// /////////////////////////////// MatConstIterator //////////////////////////////////
pub trait MatConstIteratorTraitConst {
fn as_raw_MatConstIterator(&self) -> *const c_void;
@@ -12156,6 +12180,14 @@ impl MatStep {
}
+impl Default for MatStep {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
/// @cond IGNORED
pub trait Matx_AddOpTraitConst {
fn as_raw_Matx_AddOp(&self) -> *const c_void;
@@ -19752,6 +19784,14 @@ impl Context {
}
+impl Default for Context {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait Context_UserContextTraitConst {
fn as_raw_Context_UserContext(&self) -> *const c_void;
@@ -20243,6 +20283,14 @@ impl Device {
}
+impl Default for Device {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait Image2DTraitConst {
fn as_raw_Image2D(&self) -> *const c_void;
@@ -20326,6 +20374,14 @@ impl Image2D {
}
+impl Default for Image2D {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait KernelTraitConst {
fn as_raw_Kernel(&self) -> *const c_void;
@@ -20522,6 +20578,14 @@ impl Kernel {
}
+impl Default for Kernel {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait KernelArgTraitConst {
fn as_raw_KernelArg(&self) -> *const c_void;
@@ -20701,6 +20765,14 @@ impl KernelArg {
}
+impl Default for KernelArg {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait OpenCLExecutionContextTraitConst {
fn as_raw_OpenCLExecutionContext(&self) -> *const c_void;
@@ -20883,6 +20955,14 @@ impl OpenCLExecutionContext {
}
+impl Default for OpenCLExecutionContext {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
/// @deprecated
pub trait PlatformTraitConst {
fn as_raw_Platform(&self) -> *const c_void;
@@ -20952,6 +21032,14 @@ impl Platform {
}
+impl Default for Platform {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait PlatformInfoTraitConst {
fn as_raw_PlatformInfo(&self) -> *const c_void;
@@ -21051,6 +21139,14 @@ impl PlatformInfo {
}
+impl Default for PlatformInfo {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait ProgramTraitConst {
fn as_raw_Program(&self) -> *const c_void;
@@ -21174,6 +21270,14 @@ impl Program {
}
+impl Default for Program {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait ProgramSourceTraitConst {
fn as_raw_ProgramSource(&self) -> *const c_void;
@@ -21314,6 +21418,14 @@ impl ProgramSource {
}
+impl Default for ProgramSource {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait QueueTraitConst {
fn as_raw_Queue(&self) -> *const c_void;
@@ -21406,6 +21518,14 @@ impl Queue {
}
+impl Default for Queue {
+ #[inline]
+ /// Forwards to infallible Self::default()
+ fn default() -> Self {
+ Self::default()
+ }
+}
+
pub trait TimerTraitConst {
fn as_raw_Timer(&self) -> *const c_void;

MODIFY
src/opencv/hub/types.rs
src/opencv/hub/types.rs
@@ -1547,6 +1547,116 @@ mod core_types {
unsafe impl Send for core::Vector<core::UMat> {}
+ pub type VectorOfVec2d = core::Vector<core::Vec2d>;
+
+ impl VectorOfVec2d {
+ pub fn as_raw_VectorOfVec2d(&self) -> *const c_void { self.as_raw() }
+ pub fn as_raw_mut_VectorOfVec2d(&mut self) -> *mut c_void { self.as_raw_mut() }
+ }
+
+ vector_extern! { core::Vec2d, *const c_void, *mut c_void,
+ cv_VectorOfVec2d_new, cv_VectorOfVec2d_delete,
+ cv_VectorOfVec2d_len, cv_VectorOfVec2d_is_empty,
+ cv_VectorOfVec2d_capacity, cv_VectorOfVec2d_shrink_to_fit,
+ cv_VectorOfVec2d_reserve, cv_VectorOfVec2d_remove,
+ cv_VectorOfVec2d_swap, cv_VectorOfVec2d_clear,
+ cv_VectorOfVec2d_get, cv_VectorOfVec2d_set,
+ cv_VectorOfVec2d_push, cv_VectorOfVec2d_insert,
+ }
+ vector_copy_non_bool! { core::Vec2d, *const c_void, *mut c_void,
+ cv_VectorOfVec2d_data, cv_VectorOfVec2d_data_mut,
+ cv_VectorOfVec2d_clone,
+ }
+
+ unsafe impl Send for core::Vector<core::Vec2d> {}
+
+ impl core::ToInputArray for VectorOfVec2d {
+ #[inline]
+ fn input_array(&self) -> Result<core::_InputArray> {
+ extern "C" { fn cv_VectorOfVec2d_input_array(instance: *const c_void) -> sys::Result<*mut c_void>; }
+ unsafe { cv_VectorOfVec2d_input_array(self.as_raw_VectorOfVec2d()) }
+ .into_result()
+ .map(|ptr| unsafe { core::_InputArray::from_raw(ptr) } )
+ }
+ }
+
+ impl core::ToOutputArray for VectorOfVec2d {
+ #[inline]
+ fn output_array(&mut self) -> Result<core::_OutputArray> {
+ extern "C" { fn cv_VectorOfVec2d_output_array(instance: *mut c_void) -> sys::Result<*mut c_void>; }
+ unsafe { cv_VectorOfVec2d_output_array(self.as_raw_mut_VectorOfVec2d()) }
+ .into_result()
+ .map(|ptr| unsafe { core::_OutputArray::from_raw(ptr) })
+ }
+ }
+
+ impl core::ToInputOutputArray for VectorOfVec2d {
+ #[inline]
+ fn input_output_array(&mut self) -> Result<core::_InputOutputArray> {
+ extern "C" { fn cv_VectorOfVec2d_input_output_array(instance: *mut c_void) -> sys::Result<*mut c_void>; }
+ unsafe { cv_VectorOfVec2d_input_output_array(self.as_raw_mut_VectorOfVec2d()) }
+ .into_result()
+ .map(|ptr| unsafe { core::_InputOutputArray::from_raw(ptr) })
+ }
+ }
+
+ input_output_array_ref_forward! { VectorOfVec2d }
+
+ pub type VectorOfVec2f = core::Vector<core::Vec2f>;
+
+ impl VectorOfVec2f {
+ pub fn as_raw_VectorOfVec2f(&self) -> *const c_void { self.as_raw() }
+ pub fn as_raw_mut_VectorOfVec2f(&mut self) -> *mut c_void { self.as_raw_mut() }
+ }
+
+ vector_extern! { core::Vec2f, *const c_void, *mut c_void,
+ cv_VectorOfVec2f_new, cv_VectorOfVec2f_delete,
+ cv_VectorOfVec2f_len, cv_VectorOfVec2f_is_empty,
+ cv_VectorOfVec2f_capacity, cv_VectorOfVec2f_shrink_to_fit,
+ cv_VectorOfVec2f_reserve, cv_VectorOfVec2f_remove,
+ cv_VectorOfVec2f_swap, cv_VectorOfVec2f_clear,
+ cv_VectorOfVec2f_get, cv_VectorOfVec2f_set,
+ cv_VectorOfVec2f_push, cv_VectorOfVec2f_insert,
+ }
+ vector_copy_non_bool! { core::Vec2f, *const c_void, *mut c_void,
+ cv_VectorOfVec2f_data, cv_VectorOfVec2f_data_mut,
+ cv_VectorOfVec2f_clone,
+ }
+
+ unsafe impl Send for core::Vector<core::Vec2f> {}
+
+ impl core::ToInputArray for VectorOfVec2f {
+ #[inline]
+ fn input_array(&self) -> Result<core::_InputArray> {
+ extern "C" { fn cv_VectorOfVec2f_input_array(instance: *const c_void) -> sys::Result<*mut c_void>; }
+ unsafe { cv_VectorOfVec2f_input_array(self.as_raw_VectorOfVec2f()) }
+ .into_result()
+ .map(|ptr| unsafe { core::_InputArray::from_raw(ptr) } )
+ }
+ }
+
+ impl core::ToOutputArray for VectorOfVec2f {
+ #[inline]
+ fn output_array(&mut self) -> Result<core::_OutputArray> {
+ extern "C" { fn cv_VectorOfVec2f_output_array(instance: *mut c_void) -> sys::Result<*mut c_void>; }
+ unsafe { cv_VectorOfVec2f_output_array(self.as_raw_mut_VectorOfVec2f()) }
+ .into_result()
+ .map(|ptr| unsafe { core::_OutputArray::from_raw(ptr) })
+ }
+ }
+
+ impl core::ToInputOutputArray for VectorOfVec2f {
+ #[inline]
+ fn input_output_array(&mut self) -> Result<core::_InputOutputArray> {
+ extern "C" { fn cv_VectorOfVec2f_input_output_array(instance: *mut c_void) -> sys::Result<*mut c_void>; }
+ unsafe { cv_VectorOfVec2f_input_output_array(self.as_raw_mut_VectorOfVec2f()) }
+ .into_result()
+ .map(|ptr| unsafe { core::_InputOutputArray::from_raw(ptr) })
+ }
+ }
+
+ input_output_array_ref_forward! { VectorOfVec2f }
+
pub type VectorOfVec2i = core::Vector<core::Vec2i>;
impl VectorOfVec2i {

0.56.1 Regenerate bindings