From b19ba6fe351bb1206f2385a6ca806a6a5185c7d9 Mon Sep 17 00:00:00 2001 From: Pro Date: Sun, 14 May 2023 21:53:34 +0200 Subject: [PATCH] Drop usage of dyn Trait in favor of generating regular boxed structs for abstract classes --- CHANGES.md | 6 + binding-generator/src/abstract_ref_wrapper.rs | 16 - binding-generator/src/generator.rs | 7 +- binding-generator/src/lib.rs | 2 - binding-generator/src/settings.rs | 3 + binding-generator/src/type_ref.rs | 9 +- .../rust_native/abstract_ref_wrapper.rs | 33 - .../src/writer/rust_native/class.rs | 346 +- .../src/writer/rust_native/element.rs | 1 - .../src/writer/rust_native/func.rs | 19 +- .../src/writer/rust_native/mod.rs | 1 - .../src/writer/rust_native/renderer.rs | 7 +- .../tpl/abstract_ref_wrapper/rust.tpl.rs | 9 - .../writer/rust_native/tpl/class/trait.tpl.rs | 1 - .../rust_native/tpl/class/trait_dyn.tpl.rs | 5 - .../src/writer/rust_native/type_ref.rs | 23 +- docs/bgsegm.rs | 312 +- docs/bioinspired.rs | 242 +- docs/calib3d.rs | 286 +- docs/ccalib.rs | 10 +- docs/core.rs | 494 +- docs/cudaarithm.rs | 146 +- docs/cudabgsegm.rs | 156 +- docs/cudacodec.rs | 198 +- docs/cudafeatures2d.rs | 248 +- docs/cudafilters.rs | 102 +- docs/cudaimgproc.rs | 406 +- docs/cudaobjdetect.rs | 236 +- docs/cudaoptflow.rs | 592 ++- docs/cudastereo.rs | 420 +- docs/dnn.rs | 188 +- docs/dpm.rs | 40 +- docs/face.rs | 1038 +++- docs/features2d.rs | 904 +++- docs/freetype.rs | 48 +- docs/gapi.rs | 106 +- docs/hdf.rs | 44 +- docs/hfs.rs | 50 +- docs/imgproc.rs | 274 +- docs/mcc.rs | 168 +- docs/ml.rs | 988 +++- docs/objdetect.rs | 252 +- docs/optflow.rs | 370 +- docs/ovis.rs | 40 +- docs/phase_unwrapping.rs | 120 +- docs/photo.rs | 778 ++- docs/plot.rs | 54 +- docs/quality.rs | 98 +- docs/rapid.rs | 214 +- docs/rgbd.rs | 544 +- docs/saliency.rs | 258 +- docs/sfm.rs | 82 +- docs/shape.rs | 632 ++- docs/stereo.rs | 82 +- docs/stitching.rs | 924 ++-- docs/structured_light.rs | 192 +- docs/superres.rs | 390 +- docs/text.rs | 394 +- docs/tracking.rs | 110 +- docs/types.rs | 4408 ++++++++--------- docs/video.rs | 764 ++- docs/videostab.rs | 910 +++- docs/xfeatures2d.rs | 1276 +++-- docs/ximgproc.rs | 1594 +++++- docs/xobjdetect.rs | 42 +- docs/xphoto.rs | 334 +- examples/video_features.rs | 5 +- src/manual/features2d.rs | 6 +- tests/boxed.rs | 10 +- tests/features2d.rs | 7 +- tests/ml.rs | 13 +- 71 files changed, 17072 insertions(+), 6015 deletions(-) delete mode 100644 binding-generator/src/abstract_ref_wrapper.rs delete mode 100644 binding-generator/src/writer/rust_native/abstract_ref_wrapper.rs delete mode 100644 binding-generator/src/writer/rust_native/tpl/abstract_ref_wrapper/rust.tpl.rs delete mode 100644 binding-generator/src/writer/rust_native/tpl/class/trait_dyn.tpl.rs diff --git a/CHANGES.md b/CHANGES.md index 49dce0562..9aaa6f310 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,9 @@ +* 0.82.0 + * Change the handling of abstract C++ classes, they are no longer exposed as `dyn Class` but a struct is generated for + them making them easier to use from Rust. One notable change is calling static methods on those classes no longer + requires UCS. So `::default()` becomes just `ORB::default()`. You might also need to adjust your imports + because while traits are imported as part of the prelude, the structs need to be imported explicitly. + * 0.81.5 * Bring back the `clang-runtime` feature to improve cooperation with other crates. diff --git a/binding-generator/src/abstract_ref_wrapper.rs b/binding-generator/src/abstract_ref_wrapper.rs deleted file mode 100644 index 463cf6093..000000000 --- a/binding-generator/src/abstract_ref_wrapper.rs +++ /dev/null @@ -1,16 +0,0 @@ -use crate::TypeRef; - -#[derive(Debug)] -pub struct AbstractRefWrapper<'tu, 'ge> { - type_ref: TypeRef<'tu, 'ge>, -} - -impl<'tu, 'ge> AbstractRefWrapper<'tu, 'ge> { - pub fn new(type_ref: TypeRef<'tu, 'ge>) -> Self { - Self { type_ref } - } - - pub fn type_ref(&self) -> &TypeRef<'tu, 'ge> { - &self.type_ref - } -} diff --git a/binding-generator/src/generator.rs b/binding-generator/src/generator.rs index 9a128ded5..efd496021 100644 --- a/binding-generator/src/generator.rs +++ b/binding-generator/src/generator.rs @@ -16,14 +16,13 @@ use crate::entity::WalkAction; use crate::type_ref::{CppNameStyle, FishStyle, Kind as TypeRefKind}; use crate::writer::rust_native::element::RustElement; use crate::{ - get_definition_text, line_reader, opencv_module_from_path, settings, AbstractRefWrapper, Class, ClassSimplicity, - CompiledInterpolation, Const, Element, EntityExt, EntityWalker, EntityWalkerVisitor, Enum, Func, FunctionTypeHint, - GeneratorEnv, SmartPtr, StrExt, Tuple, Typedef, Vector, + get_definition_text, line_reader, opencv_module_from_path, settings, Class, ClassSimplicity, CompiledInterpolation, Const, + Element, EntityExt, EntityWalker, EntityWalkerVisitor, Enum, Func, FunctionTypeHint, GeneratorEnv, SmartPtr, StrExt, Tuple, + Typedef, Vector, }; #[derive(Debug)] pub enum GeneratedType<'tu, 'ge> { - AbstractRefWrapper(AbstractRefWrapper<'tu, 'ge>), Vector(Vector<'tu, 'ge>), SmartPtr(SmartPtr<'tu, 'ge>), Tuple(Tuple<'tu, 'ge>), diff --git a/binding-generator/src/lib.rs b/binding-generator/src/lib.rs index 9fb44ad28..3ee24ed6f 100644 --- a/binding-generator/src/lib.rs +++ b/binding-generator/src/lib.rs @@ -23,7 +23,6 @@ use clang::Entity; use dunce::canonicalize; use once_cell::sync::Lazy; -pub use abstract_ref_wrapper::AbstractRefWrapper; pub use class::Class; pub use constant::Const; pub use element::{is_opencv_path, opencv_module_from_path, DefaultElement, Element, EntityElement}; @@ -48,7 +47,6 @@ pub use typedef::Typedef; use vector::Vector; pub use walker::{EntityWalker, EntityWalkerVisitor}; -mod abstract_ref_wrapper; mod class; pub mod comment; mod constant; diff --git a/binding-generator/src/settings.rs b/binding-generator/src/settings.rs index 1a2e2e761..93a936054 100644 --- a/binding-generator/src/settings.rs +++ b/binding-generator/src/settings.rs @@ -1063,6 +1063,9 @@ pub static NO_SKIP_NAMESPACE_IN_LOCALNAME: Lazy hashmap! { "cuda" => "CUDA", }, + "cudaobjdetect" => hashmap! { + "cuda" => "CUDA", + }, "cudaoptflow" => hashmap! { "cuda" => "CUDA", }, diff --git a/binding-generator/src/type_ref.rs b/binding-generator/src/type_ref.rs index 9c708a5c7..660c100e7 100644 --- a/binding-generator/src/type_ref.rs +++ b/binding-generator/src/type_ref.rs @@ -10,8 +10,7 @@ use crate::entity::WalkAction; use crate::renderer::{CppExternReturnRenderer, CppRenderer}; use crate::{ settings::{self, ArgOverride}, - AbstractRefWrapper, Class, Element, EntityExt, Enum, Function, GeneratedType, GeneratorEnv, SmartPtr, StringExt, Tuple, - Typedef, Vector, + Class, Element, EntityExt, Enum, Function, GeneratedType, GeneratorEnv, SmartPtr, StringExt, Tuple, Typedef, Vector, }; pub trait TypeRefRenderer<'a> { @@ -798,11 +797,7 @@ impl<'tu, 'ge> TypeRef<'tu, 'ge> { } Kind::Typedef(typedef) => typedef.generated_types(), _ => { - let mut out = vec![]; - if self.as_abstract_class_ptr().is_some() { - out.push(GeneratedType::AbstractRefWrapper(AbstractRefWrapper::new(self.clone()))) - } - out + vec![] } } } diff --git a/binding-generator/src/writer/rust_native/abstract_ref_wrapper.rs b/binding-generator/src/writer/rust_native/abstract_ref_wrapper.rs deleted file mode 100644 index 7d70418b6..000000000 --- a/binding-generator/src/writer/rust_native/abstract_ref_wrapper.rs +++ /dev/null @@ -1,33 +0,0 @@ -use maplit::hashmap; -use once_cell::sync::Lazy; - -use crate::type_ref::{Constness, NameStyle}; -use crate::{AbstractRefWrapper, CompiledInterpolation, StrExt}; - -use super::class::ClassExt; -use super::type_ref::TypeRefExt; -use super::RustNativeGeneratedElement; - -impl RustNativeGeneratedElement for AbstractRefWrapper<'_, '_> { - fn element_order(&self) -> u8 { - 10 - } - - fn element_safe_id(&self) -> String { - let type_ref = self.type_ref(); - format!("{}-{}", type_ref.rust_module(), type_ref.rust_safe_id(true)) - } - - fn gen_rust(&self, _opencv_version: &str) -> String { - static RUST: Lazy = - Lazy::new(|| include_str!("tpl/abstract_ref_wrapper/rust.tpl.rs").compile_interpolation()); - - let type_ref = self.type_ref().source(); - let cls = type_ref.as_class().expect("Can only make an abstract ref to a class"); - RUST.interpolate(&hashmap! { - "rust_full" => cls.rust_trait_name(NameStyle::ref_(), Constness::Mut), - "rust_const_full" => cls.rust_trait_name(NameStyle::ref_(), Constness::Const), - "rust_local" => type_ref.rust_name(NameStyle::decl()), - }) - } -} diff --git a/binding-generator/src/writer/rust_native/class.rs b/binding-generator/src/writer/rust_native/class.rs index 37996d3e9..2755cc512 100644 --- a/binding-generator/src/writer/rust_native/class.rs +++ b/binding-generator/src/writer/rust_native/class.rs @@ -48,12 +48,8 @@ fn gen_rust_class(c: &Class, opencv_version: &str) -> String { static TRAIT_TPL: Lazy = Lazy::new(|| include_str!("tpl/class/trait.tpl.rs").compile_interpolation()); - static TRAIT_DYN_TPL: Lazy = - Lazy::new(|| include_str!("tpl/class/trait_dyn.tpl.rs").compile_interpolation()); - let type_ref = c.type_ref(); let is_trait = c.is_trait(); - let is_abstract = c.is_abstract(); let class_kind = c.kind(); let doc_comment = c.rendered_doc_comment(opencv_version); @@ -103,44 +99,10 @@ fn gen_rust_class(c: &Class, opencv_version: &str) -> String { &mut trait_methods_pool, opencv_version, ); - let dyn_impl = if is_abstract { - let consts = consts.iter().map(|c| c.gen_rust(opencv_version)).join(""); - - let mut methods_pool = NamePool::with_capacity(method_count); - let inherent_methods = rust_generate_funcs( - const_methods - .iter() - .chain(mut_methods.iter()) - .filter(|m| m.kind().as_static_method().is_some()), - &mut methods_pool, - opencv_version, - ); - if !inherent_methods.is_empty() || !consts.is_empty() { - TRAIT_DYN_TPL.interpolate(&hashmap! { - "rust_local" => c.rust_trait_name(NameStyle::decl(), Constness::Mut), - "consts" => consts.into(), - "inherent_methods" => inherent_methods.into(), - }) - } else { - String::new() - } - } else { - String::new() - }; - let (const_trait_comment, mut_trait_comment) = if is_abstract { - let rust_trait_local_mut = c.rust_trait_name(NameStyle::ref_(), Constness::Mut); - ( - Cow::Owned(format!("/// Constant methods for [{rust_trait_local_mut}]")), - Cow::Borrowed(doc_comment.as_str()), - ) - } else { - let rust_local = type_ref.rust_name(NameStyle::ref_()); - ( - format!("/// Constant methods for [{rust_local}]").into(), - format!("/// Mutable methods for [{rust_local}]").into(), - ) - }; + let rust_local = type_ref.rust_name(NameStyle::ref_()); + let const_trait_comment = format!("/// Constant methods for [{rust_local}]").into(); + let mut_trait_comment = format!("/// Mutable methods for [{rust_local}]").into(); out = TRAIT_TPL.interpolate(&hashmap! { "const_trait_comment" => const_trait_comment, @@ -155,177 +117,174 @@ fn gen_rust_class(c: &Class, opencv_version: &str) -> String { "trait_bases_mut" => trait_bases_mut.into(), "trait_const_methods" => trait_const_methods.into(), "trait_mut_methods" => trait_mut_methods.into(), - "dyn_impl" => dyn_impl.into(), }); } - if !is_abstract { - let rust_local = c.rust_name(NameStyle::decl()); - let mut impls = if c.has_explicit_clone() { - IMPL_EXPLICIT_CLONE_TPL.interpolate(&hashmap! { - "rust_local" => rust_local.as_ref(), - }) - } else if c.has_implicit_clone() { - IMPL_IMPLICIT_CLONE_TPL.interpolate(&hashmap! { - "rust_local" => rust_local.as_ref(), - }) - } else { - "".to_string() - }; + let rust_local = c.rust_name(NameStyle::decl()); + let mut impls = if c.has_explicit_clone() { + IMPL_EXPLICIT_CLONE_TPL.interpolate(&hashmap! { + "rust_local" => rust_local.as_ref(), + }) + } else if c.has_implicit_clone() { + IMPL_IMPLICIT_CLONE_TPL.interpolate(&hashmap! { + "rust_local" => rust_local.as_ref(), + }) + } else { + "".to_string() + }; - let mut bases = c.all_bases().into_iter() + let mut bases = c.all_bases().into_iter() .filter(|b| !b.is_excluded() && !b.is_simple()) // todo, allow extension of simple classes for e.g. Elliptic_KeyPoint .collect::>(); - bases.sort_unstable_by(|a, b| { - a.cpp_name(CppNameStyle::Declaration) - .cmp(&b.cpp_name(CppNameStyle::Declaration)) - }); - if !class_kind.is_simple() { - if c.is_polymorphic() { - let mut descendants = c - .descendants() - .filter(|d| !d.is_excluded() && !d.is_simple() && !d.is_abstract()) - .collect::>(); - descendants.sort_unstable_by(|a, b| { - a.cpp_name(CppNameStyle::Declaration) - .cmp(&b.cpp_name(CppNameStyle::Declaration)) + bases.sort_unstable_by(|a, b| { + a.cpp_name(CppNameStyle::Declaration) + .cmp(&b.cpp_name(CppNameStyle::Declaration)) + }); + if !class_kind.is_simple() { + if c.is_polymorphic() { + let mut descendants = c + .descendants() + .filter(|d| !d.is_excluded() && !d.is_simple() && !d.is_abstract()) + .collect::>(); + descendants.sort_unstable_by(|a, b| { + a.cpp_name(CppNameStyle::Declaration) + .cmp(&b.cpp_name(CppNameStyle::Declaration)) + }); + for d in descendants { + let desc_local = d.rust_name(NameStyle::decl()); + let desc_full = d.rust_name(NameStyle::ref_()); + impls += &DESCENDANT_CAST_TPL.interpolate(&hashmap! { + "rust_local" => rust_local.as_ref(), + "descendant_rust_local" => desc_local.as_ref(), + "descendant_rust_full" => desc_full.as_ref(), }); - for d in descendants { - let desc_local = d.rust_name(NameStyle::decl()); - let desc_full = d.rust_name(NameStyle::ref_()); - impls += &DESCENDANT_CAST_TPL.interpolate(&hashmap! { - "rust_local" => rust_local.as_ref(), - "descendant_rust_local" => desc_local.as_ref(), - "descendant_rust_full" => desc_full.as_ref(), - }); - } } - for b in &bases { - if !b.is_abstract() { - let base_local = b.rust_name(NameStyle::decl()); - let base_full = b.rust_name(NameStyle::ref_()); - impls += &BASE_CAST_TPL.interpolate(&hashmap! { - "rust_local" => rust_local.as_ref(), - "base_rust_local" => base_local.as_ref(), - "base_rust_full" => base_full.as_ref(), - }); - } + } + for b in &bases { + if !b.is_abstract() { + let base_local = b.rust_name(NameStyle::decl()); + let base_full = b.rust_name(NameStyle::ref_()); + impls += &BASE_CAST_TPL.interpolate(&hashmap! { + "rust_local" => rust_local.as_ref(), + "base_rust_local" => base_local.as_ref(), + "base_rust_full" => base_full.as_ref(), + }); } } + } - if is_trait { - bases.push(c.clone()); - } - let bases = bases - .into_iter() - .map(|base| { - let base_type_ref = base.type_ref(); - let tpl = if class_kind.is_simple() { - &SIMPLE_BASE_TPL - } else { - &BASE_TPL - }; - tpl.interpolate(&hashmap! { - "base_rust_full" => base.rust_trait_name(NameStyle::ref_(), Constness::Mut), - "base_const_rust_full" => base.rust_trait_name(NameStyle::ref_(), Constness::Const), - "rust_local" => type_ref.rust_name(NameStyle::decl()), - "base_rust_local" => base_type_ref.rust_name(NameStyle::decl()), - "base_rust_extern_const" => base_type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Const)), - "base_rust_extern_mut" => base_type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Mut)), - }) + if is_trait { + bases.push(c.clone()); + } + let bases = bases + .into_iter() + .map(|base| { + let base_type_ref = base.type_ref(); + let tpl = if class_kind.is_simple() { + &SIMPLE_BASE_TPL + } else { + &BASE_TPL + }; + tpl.interpolate(&hashmap! { + "base_rust_full" => base.rust_trait_name(NameStyle::ref_(), Constness::Mut), + "base_const_rust_full" => base.rust_trait_name(NameStyle::ref_(), Constness::Const), + "rust_local" => type_ref.rust_name(NameStyle::decl()), + "base_rust_local" => base_type_ref.rust_name(NameStyle::decl()), + "base_rust_extern_const" => base_type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Const)), + "base_rust_extern_mut" => base_type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Mut)), }) - .collect::>(); + }) + .collect::>(); - let fields = if class_kind.is_simple() { - fields - .into_iter() - .map(|f| { - let type_ref = f.type_ref(); - let mut typ = type_ref.rust_name(NameStyle::ref_()); - // hack for converting the references to array types in struct definitions - if type_ref.as_fixed_array().is_some() { - if let Some(new_typ) = typ.strip_prefix("&mut ") { - typ = new_typ.to_string().into() - } + let fields = if class_kind.is_simple() { + fields + .into_iter() + .map(|f| { + let type_ref = f.type_ref(); + let mut typ = type_ref.rust_name(NameStyle::ref_()); + // hack for converting the references to array types in struct definitions + if type_ref.as_fixed_array().is_some() { + if let Some(new_typ) = typ.strip_prefix("&mut ") { + typ = new_typ.to_string().into() } - SIMPLE_FIELD_TPL.interpolate(&hashmap! { - "doc_comment" => Cow::Owned(f.rendered_doc_comment(opencv_version)), - "visibility" => "pub ".into(), - "name" => f.rust_leafname(FishStyle::No), - "type" => typ, - }) + } + SIMPLE_FIELD_TPL.interpolate(&hashmap! { + "doc_comment" => Cow::Owned(f.rendered_doc_comment(opencv_version)), + "visibility" => "pub ".into(), + "name" => f.rust_leafname(FishStyle::No), + "type" => typ, }) - .collect() - } else { - vec![] - }; + }) + .collect() + } else { + vec![] + }; - let mut inherent_methods = String::with_capacity(512 * (const_methods.len() + mut_methods.len())); - let mut inherent_methods_pool = NamePool::with_capacity(method_count); + let mut inherent_methods = String::with_capacity(512 * (const_methods.len() + mut_methods.len())); + let mut inherent_methods_pool = NamePool::with_capacity(method_count); - let mut needs_default_impl = false; - if let Some(def_cons) = mut_methods.iter().find(|m| m.is_default_constructor() && !m.is_excluded()) { - if def_cons.is_infallible() { - needs_default_impl = true; - } - } - let needs_default_ctor = needs_default_ctor(class_kind, c, const_methods.iter().chain(mut_methods.iter())); - if needs_default_ctor { - inherent_methods.push_str(&DEFAULT_CTOR.interpolate(&hashmap! { - "rust_local" => rust_local.as_ref(), - })); - inherent_methods_pool.add_name("default"); + let mut needs_default_impl = false; + if let Some(def_cons) = mut_methods.iter().find(|m| m.is_default_constructor() && !m.is_excluded()) { + if def_cons.is_infallible() { needs_default_impl = true; } + } + let needs_default_ctor = needs_default_ctor(class_kind, c, const_methods.iter().chain(mut_methods.iter())); + if needs_default_ctor { + inherent_methods.push_str(&DEFAULT_CTOR.interpolate(&hashmap! { + "rust_local" => rust_local.as_ref(), + })); + inherent_methods_pool.add_name("default"); + needs_default_impl = true; + } - if needs_default_impl { - impls += &IMPL_DEFAULT_TPL.interpolate(&hashmap! { - "rust_local" => rust_local.as_ref(), - }); - } - - inherent_methods.push_str(&if is_trait { - rust_generate_funcs( - const_methods.iter().chain(mut_methods.iter()).filter(|m| { - let kind = m.kind(); - kind.as_static_method().is_some() || kind.as_constructor().is_some() - }), - &mut inherent_methods_pool, - opencv_version, - ) - } else { - rust_generate_funcs( - const_methods.iter().chain(mut_methods.iter()), - &mut inherent_methods_pool, - opencv_version, - ) + if needs_default_impl { + impls += &IMPL_DEFAULT_TPL.interpolate(&hashmap! { + "rust_local" => rust_local.as_ref(), }); + } - let tpl = if class_kind.is_simple() { - &SIMPLE_TPL - } else { - &BOXED_TPL - }; + inherent_methods.push_str(&if is_trait { + rust_generate_funcs( + const_methods.iter().chain(mut_methods.iter()).filter(|m| { + let kind = m.kind(); + kind.as_static_method().is_some() || kind.as_constructor().is_some() + }), + &mut inherent_methods_pool, + opencv_version, + ) + } else { + rust_generate_funcs( + const_methods.iter().chain(mut_methods.iter()), + &mut inherent_methods_pool, + opencv_version, + ) + }); - let consts = consts.iter().map(|c| c.gen_rust(opencv_version)).join(""); + let tpl = if class_kind.is_simple() { + &SIMPLE_TPL + } else { + &BOXED_TPL + }; - out += &tpl.interpolate(&hashmap! { - "doc_comment" => Cow::Owned(doc_comment), - "debug" => get_debug(c).into(), - "rust_local" => rust_local.clone(), - "rust_full" => c.rust_name(NameStyle::ref_()), - "rust_extern_const" => type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Const)), - "rust_extern_mut" => type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Mut)), - "fields" => fields.join("").into(), - "bases" => bases.join("").into(), - "impl" => IMPL_TPL.interpolate(&hashmap! { - "rust_local" => rust_local, - "consts" => consts.into(), - "inherent_methods" => inherent_methods.into(), - }).into(), - "impls" => impls.into(), - }); - } + let consts = consts.iter().map(|c| c.gen_rust(opencv_version)).join(""); + + out += &tpl.interpolate(&hashmap! { + "doc_comment" => Cow::Owned(doc_comment), + "debug" => get_debug(c).into(), + "rust_local" => rust_local.clone(), + "rust_full" => c.rust_name(NameStyle::ref_()), + "rust_extern_const" => type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Const)), + "rust_extern_mut" => type_ref.rust_extern(ExternDir::ToCpp(ConstnessOverride::Mut)), + "fields" => fields.join("").into(), + "bases" => bases.join("").into(), + "impl" => IMPL_TPL.interpolate(&hashmap! { + "rust_local" => rust_local, + "consts" => consts.into(), + "inherent_methods" => inherent_methods.into(), + }).into(), + "impls" => impls.into(), + }); out } @@ -590,11 +549,12 @@ pub trait ClassExt { impl ClassExt for Class<'_, '_> { fn rust_trait_name(&self, style: NameStyle, constness: Constness) -> Cow { let mut out = self.rust_name(style); - if self.is_trait() && !self.is_abstract() { - out.to_mut().push_str("Trait"); - } - if constness.is_const() { - out.to_mut().push_str("Const"); + if self.is_trait() { + if constness.is_const() { + out.to_mut().push_str("TraitConst"); + } else { + out.to_mut().push_str("Trait"); + } } out } diff --git a/binding-generator/src/writer/rust_native/element.rs b/binding-generator/src/writer/rust_native/element.rs index 10f7be26a..eea4aef53 100644 --- a/binding-generator/src/writer/rust_native/element.rs +++ b/binding-generator/src/writer/rust_native/element.rs @@ -145,7 +145,6 @@ pub trait RustElement: Element { impl<'ne, 'tu: 'ne, 'ge: 'ne> AsRef for GeneratedType<'tu, 'ge> { fn as_ref(&self) -> &(dyn RustNativeGeneratedElement + 'ne) { match self { - GeneratedType::AbstractRefWrapper(r) => r, GeneratedType::Vector(vec) => vec, GeneratedType::SmartPtr(ptr) => ptr, GeneratedType::Tuple(tuple) => tuple, diff --git a/binding-generator/src/writer/rust_native/func.rs b/binding-generator/src/writer/rust_native/func.rs index 35c427960..a360556fd 100644 --- a/binding-generator/src/writer/rust_native/func.rs +++ b/binding-generator/src/writer/rust_native/func.rs @@ -5,7 +5,7 @@ use maplit::hashmap; use once_cell::sync::Lazy; use regex::Regex; -use crate::func::{Kind, OperatorKind}; +use crate::func::OperatorKind; use crate::type_ref::{ConstnessOverride, CppNameStyle, ExternDir, FishStyle, NameStyle}; use crate::writer::rust_native::func_desc::FuncDescReturn; use crate::{ @@ -88,12 +88,11 @@ fn gen_rust_with_name(f: &Func, name: &str, opencv_version: &str) -> String { }; let identifier = f.identifier(); let is_safe = !f.is_unsafe(); - let is_static_func = matches!(f.kind(), Kind::StaticMethod(..) | Kind::Function); let return_type = f.return_type(); let return_type_func_decl = if is_infallible { - return_type.rust_return(FishStyle::No, is_static_func) + return_type.rust_return(FishStyle::No) } else { - format!("Result<{}>", return_type.rust_return(FishStyle::No, is_static_func)).into() + format!("Result<{}>", return_type.rust_return(FishStyle::No)).into() }; let return_type_func_decl = if return_type_func_decl == "()" { Cow::Borrowed("") @@ -122,7 +121,7 @@ fn gen_rust_with_name(f: &Func, name: &str, opencv_version: &str) -> String { if !is_infallible { ret_convert.push("let ret = ret.into_result()?;".into()) } - let ret_map = rust_return_map(&return_type, "ret", is_safe, is_static_func, is_infallible); + let ret_map = rust_return_map(&return_type, "ret", is_safe, is_infallible); if !ret_map.is_empty() { ret_convert.push(format!("let ret = {ret_map};").into()); } @@ -166,13 +165,7 @@ fn gen_rust_with_name(f: &Func, name: &str, opencv_version: &str) -> String { }) } -fn rust_return_map( - return_type: &TypeRef, - ret_name: &str, - is_safe_context: bool, - is_static_func: bool, - is_infallible: bool, -) -> Cow<'static, str> { +fn rust_return_map(return_type: &TypeRef, ret_name: &str, is_safe_context: bool, is_infallible: bool) -> Cow<'static, str> { let unsafety_call = if is_safe_context { "unsafe " } else { @@ -182,7 +175,7 @@ fn rust_return_map( format!( "{unsafety_call}{{ {typ}::opencv_from_extern({ret_name}) }}", unsafety_call = unsafety_call, - typ = return_type.rust_return(FishStyle::Turbo, is_static_func), + typ = return_type.rust_return(FishStyle::Turbo), ret_name = ret_name, ) .into() diff --git a/binding-generator/src/writer/rust_native/mod.rs b/binding-generator/src/writer/rust_native/mod.rs index caccfebde..4edac9eb0 100644 --- a/binding-generator/src/writer/rust_native/mod.rs +++ b/binding-generator/src/writer/rust_native/mod.rs @@ -20,7 +20,6 @@ use crate::{ GeneratedType, GeneratorVisitor, IteratorExt, StrExt, Typedef, }; -mod abstract_ref_wrapper; mod class; mod comment; mod constant; diff --git a/binding-generator/src/writer/rust_native/renderer.rs b/binding-generator/src/writer/rust_native/renderer.rs index b97c94ecb..7368483bd 100644 --- a/binding-generator/src/writer/rust_native/renderer.rs +++ b/binding-generator/src/writer/rust_native/renderer.rs @@ -138,10 +138,9 @@ impl TypeRefRenderer<'_> for RustRenderer { Kind::Class(cls) => { let fish_style = self.name_style.turbo_fish_style(); format!( - "{dyn}{name}{generic}", - dyn=if self.name_style.is_reference() && cls.is_abstract() { "dyn " } else { "" }, - name=cls.rust_name(self.name_style), - generic=render_rust_tpl_decl(self, type_ref, fish_style), + "{name}{generic}", + name = cls.rust_name(self.name_style), + generic = render_rust_tpl_decl(self, type_ref, fish_style), ) .into() } diff --git a/binding-generator/src/writer/rust_native/tpl/abstract_ref_wrapper/rust.tpl.rs b/binding-generator/src/writer/rust_native/tpl/abstract_ref_wrapper/rust.tpl.rs deleted file mode 100644 index 530b4a22d..000000000 --- a/binding-generator/src/writer/rust_native/tpl/abstract_ref_wrapper/rust.tpl.rs +++ /dev/null @@ -1,9 +0,0 @@ -impl {{rust_const_full}} for types::AbstractRefMut<'static, dyn {{rust_full}}> { - #[inline] fn as_raw_{{rust_local}}(&self) -> extern_send!(Self) { self.as_raw() } -} - -impl {{rust_full}} for types::AbstractRefMut<'static, dyn {{rust_full}}> { - #[inline] fn as_raw_mut_{{rust_local}}(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } -} - - diff --git a/binding-generator/src/writer/rust_native/tpl/class/trait.tpl.rs b/binding-generator/src/writer/rust_native/tpl/class/trait.tpl.rs index 96168401a..7823be43b 100644 --- a/binding-generator/src/writer/rust_native/tpl/class/trait.tpl.rs +++ b/binding-generator/src/writer/rust_native/tpl/class/trait.tpl.rs @@ -13,5 +13,4 @@ pub trait {{rust_trait_local}}{{trait_bases_mut}} { {{trait_mut_methods}} } -{{dyn_impl}} diff --git a/binding-generator/src/writer/rust_native/tpl/class/trait_dyn.tpl.rs b/binding-generator/src/writer/rust_native/tpl/class/trait_dyn.tpl.rs deleted file mode 100644 index ad6acf9be..000000000 --- a/binding-generator/src/writer/rust_native/tpl/class/trait_dyn.tpl.rs +++ /dev/null @@ -1,5 +0,0 @@ -impl dyn {{rust_local}} + '_ { - {{consts}} - {{inherent_methods}} -} - diff --git a/binding-generator/src/writer/rust_native/type_ref.rs b/binding-generator/src/writer/rust_native/type_ref.rs index 83cc08aab..c88aefc6b 100644 --- a/binding-generator/src/writer/rust_native/type_ref.rs +++ b/binding-generator/src/writer/rust_native/type_ref.rs @@ -35,7 +35,7 @@ pub trait TypeRefExt { fn rust_arg_forward(&self, name: &str) -> String; fn rust_arg_post_call(&self, name: &str, _is_function_infallible: bool) -> String; fn rust_extern(&self, dir: ExternDir) -> Cow; - fn rust_return(&self, turbo_fish_style: FishStyle, is_static_func: bool) -> Cow; + fn rust_return(&self, turbo_fish_style: FishStyle) -> Cow; fn rust_extern_return_fallible(&self) -> Cow; fn rust_lifetime_count(&self) -> usize; @@ -419,25 +419,8 @@ impl<'tu, 'ge> TypeRefExt for TypeRef<'tu, 'ge> { } } - fn rust_return(&self, turbo_fish_style: FishStyle, is_static_func: bool) -> Cow { - if self.as_abstract_class_ptr().is_some() { - format!( - "types::AbstractRef{mut_suf}{fish}<{lt}{typ}>", - mut_suf = if self.constness().is_const() { - "" - } else { - "Mut" - }, - fish = turbo_fish_style.rust_qual(), - lt = if is_static_func { - "'static, " - } else { - "" - }, - typ = self.source().rust_name(NameStyle::Reference(turbo_fish_style)), - ) - .into() - } else if self.is_extern_by_ptr() { + fn rust_return(&self, turbo_fish_style: FishStyle) -> Cow { + if self.is_extern_by_ptr() { self .source() .rust_name(NameStyle::Reference(turbo_fish_style)) diff --git a/docs/bgsegm.rs b/docs/bgsegm.rs index d12c635d2..830a91dd6 100644 --- a/docs/bgsegm.rs +++ b/docs/bgsegm.rs @@ -2,7 +2,7 @@ pub mod bgsegm { //! # Improved Background-Foreground Segmentation Methods use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::BackgroundSubtractorMOGConst, super::BackgroundSubtractorMOG, super::BackgroundSubtractorGMGConst, super::BackgroundSubtractorGMG, super::BackgroundSubtractorCNTConst, super::BackgroundSubtractorCNT, super::BackgroundSubtractorGSOCConst, super::BackgroundSubtractorGSOC, super::BackgroundSubtractorLSBPConst, super::BackgroundSubtractorLSBP, super::BackgroundSubtractorLSBPDescTraitConst, super::BackgroundSubtractorLSBPDescTrait, super::SyntheticSequenceGeneratorTraitConst, super::SyntheticSequenceGeneratorTrait }; + pub use { super::BackgroundSubtractorMOGTraitConst, super::BackgroundSubtractorMOGTrait, super::BackgroundSubtractorGMGTraitConst, super::BackgroundSubtractorGMGTrait, super::BackgroundSubtractorCNTTraitConst, super::BackgroundSubtractorCNTTrait, super::BackgroundSubtractorGSOCTraitConst, super::BackgroundSubtractorGSOCTrait, super::BackgroundSubtractorLSBPTraitConst, super::BackgroundSubtractorLSBPTrait, super::BackgroundSubtractorLSBPDescTraitConst, super::BackgroundSubtractorLSBPDescTrait, super::SyntheticSequenceGeneratorTraitConst, super::SyntheticSequenceGeneratorTrait }; } pub const LSBP_CAMERA_MOTION_COMPENSATION_LK: i32 = 1; @@ -30,12 +30,12 @@ pub mod bgsegm { /// * max_pixel_stability: 15*60 /// * is_parallel: true #[inline] - pub fn create_background_subtractor_cnt(min_pixel_stability: i32, use_history: bool, max_pixel_stability: i32, is_parallel: bool) -> Result> { + pub fn create_background_subtractor_cnt(min_pixel_stability: i32, use_history: bool, max_pixel_stability: i32, is_parallel: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bgsegm_createBackgroundSubtractorCNT_int_bool_int_bool(min_pixel_stability, use_history, max_pixel_stability, is_parallel, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -49,12 +49,12 @@ pub mod bgsegm { /// * initialization_frames: 120 /// * decision_threshold: 0.8 #[inline] - pub fn create_background_subtractor_gmg(initialization_frames: i32, decision_threshold: f64) -> Result> { + pub fn create_background_subtractor_gmg(initialization_frames: i32, decision_threshold: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bgsegm_createBackgroundSubtractorGMG_int_double(initialization_frames, decision_threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -88,12 +88,12 @@ pub mod bgsegm { /// * noise_removal_threshold_fac_bg: 0.0004f /// * noise_removal_threshold_fac_fg: 0.0008f #[inline] - pub fn create_background_subtractor_gsoc(mc: i32, n_samples: i32, replace_rate: f32, propagation_rate: f32, hits_threshold: i32, alpha: f32, beta: f32, blinking_supression_decay: f32, blinking_supression_multiplier: f32, noise_removal_threshold_fac_bg: f32, noise_removal_threshold_fac_fg: f32) -> Result> { + pub fn create_background_subtractor_gsoc(mc: i32, n_samples: i32, replace_rate: f32, propagation_rate: f32, hits_threshold: i32, alpha: f32, beta: f32, blinking_supression_decay: f32, blinking_supression_multiplier: f32, noise_removal_threshold_fac_bg: f32, noise_removal_threshold_fac_fg: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bgsegm_createBackgroundSubtractorGSOC_int_int_float_float_int_float_float_float_float_float_float(mc, n_samples, replace_rate, propagation_rate, hits_threshold, alpha, beta, blinking_supression_decay, blinking_supression_multiplier, noise_removal_threshold_fac_bg, noise_removal_threshold_fac_fg, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -131,12 +131,12 @@ pub mod bgsegm { /// * lsb_pthreshold: 8 /// * min_count: 2 #[inline] - pub fn create_background_subtractor_lsbp(mc: i32, n_samples: i32, lsbp_radius: i32, tlower: f32, tupper: f32, tinc: f32, tdec: f32, rscale: f32, rincdec: f32, noise_removal_threshold_fac_bg: f32, noise_removal_threshold_fac_fg: f32, lsb_pthreshold: i32, min_count: i32) -> Result> { + pub fn create_background_subtractor_lsbp(mc: i32, n_samples: i32, lsbp_radius: i32, tlower: f32, tupper: f32, tinc: f32, tdec: f32, rscale: f32, rincdec: f32, noise_removal_threshold_fac_bg: f32, noise_removal_threshold_fac_fg: f32, lsb_pthreshold: i32, min_count: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bgsegm_createBackgroundSubtractorLSBP_int_int_int_float_float_float_float_float_float_float_float_int_int(mc, n_samples, lsbp_radius, tlower, tupper, tinc, tdec, rscale, rincdec, noise_removal_threshold_fac_bg, noise_removal_threshold_fac_fg, lsb_pthreshold, min_count, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -155,12 +155,12 @@ pub mod bgsegm { /// * background_ratio: 0.7 /// * noise_sigma: 0 #[inline] - pub fn create_background_subtractor_mog(history: i32, nmixtures: i32, background_ratio: f64, noise_sigma: f64) -> Result> { + pub fn create_background_subtractor_mog(history: i32, nmixtures: i32, background_ratio: f64, noise_sigma: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bgsegm_createBackgroundSubtractorMOG_int_int_double_double(history, nmixtures, background_ratio, noise_sigma, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -192,7 +192,7 @@ pub mod bgsegm { } /// Constant methods for [crate::bgsegm::BackgroundSubtractorCNT] - pub trait BackgroundSubtractorCNTConst: crate::video::BackgroundSubtractorConst { + pub trait BackgroundSubtractorCNTTraitConst: crate::video::BackgroundSubtractorTraitConst { fn as_raw_BackgroundSubtractorCNT(&self) -> *const c_void; #[inline] @@ -247,13 +247,8 @@ pub mod bgsegm { } - /// Background subtraction based on counting. - /// - /// About as fast as MOG2 on a high end system. - /// More than twice faster than MOG2 on cheap hardware (benchmarked on Raspberry Pi3). - /// - /// %Algorithm by Sagi Zeevi ( ) - pub trait BackgroundSubtractorCNT: crate::bgsegm::BackgroundSubtractorCNTConst + crate::video::BackgroundSubtractor { + /// Mutable methods for [crate::bgsegm::BackgroundSubtractorCNT] + pub trait BackgroundSubtractorCNTTrait: crate::bgsegm::BackgroundSubtractorCNTTraitConst + crate::video::BackgroundSubtractorTrait { fn as_raw_mut_BackgroundSubtractorCNT(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -311,8 +306,59 @@ pub mod bgsegm { } + /// Background subtraction based on counting. + /// + /// About as fast as MOG2 on a high end system. + /// More than twice faster than MOG2 on cheap hardware (benchmarked on Raspberry Pi3). + /// + /// %Algorithm by Sagi Zeevi ( ) + pub struct BackgroundSubtractorCNT { + ptr: *mut c_void + } + + opencv_type_boxed! { BackgroundSubtractorCNT } + + impl Drop for BackgroundSubtractorCNT { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackgroundSubtractorCNT_delete(instance: *mut c_void); } + unsafe { cv_BackgroundSubtractorCNT_delete(self.as_raw_mut_BackgroundSubtractorCNT()) }; + } + } + + unsafe impl Send for BackgroundSubtractorCNT {} + + impl core::AlgorithmTraitConst for BackgroundSubtractorCNT { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BackgroundSubtractorCNT { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for BackgroundSubtractorCNT { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for BackgroundSubtractorCNT { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::bgsegm::BackgroundSubtractorCNTTraitConst for BackgroundSubtractorCNT { + #[inline] fn as_raw_BackgroundSubtractorCNT(&self) -> *const c_void { self.as_raw() } + } + + impl crate::bgsegm::BackgroundSubtractorCNTTrait for BackgroundSubtractorCNT { + #[inline] fn as_raw_mut_BackgroundSubtractorCNT(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackgroundSubtractorCNT { + } + + boxed_cast_base! { BackgroundSubtractorCNT, core::Algorithm, cv_BackgroundSubtractorCNT_to_Algorithm } + /// Constant methods for [crate::bgsegm::BackgroundSubtractorGMG] - pub trait BackgroundSubtractorGMGConst: crate::video::BackgroundSubtractorConst { + pub trait BackgroundSubtractorGMGTraitConst: crate::video::BackgroundSubtractorTraitConst { fn as_raw_BackgroundSubtractorGMG(&self) -> *const c_void; /// Returns total number of distinct colors to maintain in histogram. @@ -424,14 +470,8 @@ pub mod bgsegm { } - /// Background Subtractor module based on the algorithm given in [Gold2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Gold2012) . - /// - /// Takes a series of images and returns a sequence of mask (8UC1) - /// images of the same size, where 255 indicates Foreground and 0 represents Background. - /// This class implements an algorithm described in "Visual Tracking of Human Visitors under - /// Variable-Lighting Conditions for a Responsive Audio Art Installation," A. Godbehere, - /// A. Matsukawa, K. Goldberg, American Control Conference, Montreal, June 2012. - pub trait BackgroundSubtractorGMG: crate::bgsegm::BackgroundSubtractorGMGConst + crate::video::BackgroundSubtractor { + /// Mutable methods for [crate::bgsegm::BackgroundSubtractorGMG] + pub trait BackgroundSubtractorGMGTrait: crate::bgsegm::BackgroundSubtractorGMGTraitConst + crate::video::BackgroundSubtractorTrait { fn as_raw_mut_BackgroundSubtractorGMG(&mut self) -> *mut c_void; /// Sets total number of distinct colors to maintain in histogram. @@ -536,8 +576,60 @@ pub mod bgsegm { } + /// Background Subtractor module based on the algorithm given in [Gold2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Gold2012) . + /// + /// Takes a series of images and returns a sequence of mask (8UC1) + /// images of the same size, where 255 indicates Foreground and 0 represents Background. + /// This class implements an algorithm described in "Visual Tracking of Human Visitors under + /// Variable-Lighting Conditions for a Responsive Audio Art Installation," A. Godbehere, + /// A. Matsukawa, K. Goldberg, American Control Conference, Montreal, June 2012. + pub struct BackgroundSubtractorGMG { + ptr: *mut c_void + } + + opencv_type_boxed! { BackgroundSubtractorGMG } + + impl Drop for BackgroundSubtractorGMG { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackgroundSubtractorGMG_delete(instance: *mut c_void); } + unsafe { cv_BackgroundSubtractorGMG_delete(self.as_raw_mut_BackgroundSubtractorGMG()) }; + } + } + + unsafe impl Send for BackgroundSubtractorGMG {} + + impl core::AlgorithmTraitConst for BackgroundSubtractorGMG { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BackgroundSubtractorGMG { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for BackgroundSubtractorGMG { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for BackgroundSubtractorGMG { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::bgsegm::BackgroundSubtractorGMGTraitConst for BackgroundSubtractorGMG { + #[inline] fn as_raw_BackgroundSubtractorGMG(&self) -> *const c_void { self.as_raw() } + } + + impl crate::bgsegm::BackgroundSubtractorGMGTrait for BackgroundSubtractorGMG { + #[inline] fn as_raw_mut_BackgroundSubtractorGMG(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackgroundSubtractorGMG { + } + + boxed_cast_base! { BackgroundSubtractorGMG, core::Algorithm, cv_BackgroundSubtractorGMG_to_Algorithm } + /// Constant methods for [crate::bgsegm::BackgroundSubtractorGSOC] - pub trait BackgroundSubtractorGSOCConst: crate::video::BackgroundSubtractorConst { + pub trait BackgroundSubtractorGSOCTraitConst: crate::video::BackgroundSubtractorTraitConst { fn as_raw_BackgroundSubtractorGSOC(&self) -> *const c_void; #[inline] @@ -552,10 +644,8 @@ pub mod bgsegm { } - /// Implementation of the different yet better algorithm which is called GSOC, as it was implemented during GSOC and was not originated from any paper. - /// - /// This algorithm demonstrates better performance on CDNET 2014 dataset compared to other algorithms in OpenCV. - pub trait BackgroundSubtractorGSOC: crate::bgsegm::BackgroundSubtractorGSOCConst + crate::video::BackgroundSubtractor { + /// Mutable methods for [crate::bgsegm::BackgroundSubtractorGSOC] + pub trait BackgroundSubtractorGSOCTrait: crate::bgsegm::BackgroundSubtractorGSOCTraitConst + crate::video::BackgroundSubtractorTrait { fn as_raw_mut_BackgroundSubtractorGSOC(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -573,8 +663,56 @@ pub mod bgsegm { } + /// Implementation of the different yet better algorithm which is called GSOC, as it was implemented during GSOC and was not originated from any paper. + /// + /// This algorithm demonstrates better performance on CDNET 2014 dataset compared to other algorithms in OpenCV. + pub struct BackgroundSubtractorGSOC { + ptr: *mut c_void + } + + opencv_type_boxed! { BackgroundSubtractorGSOC } + + impl Drop for BackgroundSubtractorGSOC { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackgroundSubtractorGSOC_delete(instance: *mut c_void); } + unsafe { cv_BackgroundSubtractorGSOC_delete(self.as_raw_mut_BackgroundSubtractorGSOC()) }; + } + } + + unsafe impl Send for BackgroundSubtractorGSOC {} + + impl core::AlgorithmTraitConst for BackgroundSubtractorGSOC { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BackgroundSubtractorGSOC { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for BackgroundSubtractorGSOC { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for BackgroundSubtractorGSOC { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::bgsegm::BackgroundSubtractorGSOCTraitConst for BackgroundSubtractorGSOC { + #[inline] fn as_raw_BackgroundSubtractorGSOC(&self) -> *const c_void { self.as_raw() } + } + + impl crate::bgsegm::BackgroundSubtractorGSOCTrait for BackgroundSubtractorGSOC { + #[inline] fn as_raw_mut_BackgroundSubtractorGSOC(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackgroundSubtractorGSOC { + } + + boxed_cast_base! { BackgroundSubtractorGSOC, core::Algorithm, cv_BackgroundSubtractorGSOC_to_Algorithm } + /// Constant methods for [crate::bgsegm::BackgroundSubtractorLSBP] - pub trait BackgroundSubtractorLSBPConst: crate::video::BackgroundSubtractorConst { + pub trait BackgroundSubtractorLSBPTraitConst: crate::video::BackgroundSubtractorTraitConst { fn as_raw_BackgroundSubtractorLSBP(&self) -> *const c_void; #[inline] @@ -589,8 +727,8 @@ pub mod bgsegm { } - /// Background Subtraction using Local SVD Binary Pattern. More details about the algorithm can be found at [LGuo2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LGuo2016) - pub trait BackgroundSubtractorLSBP: crate::bgsegm::BackgroundSubtractorLSBPConst + crate::video::BackgroundSubtractor { + /// Mutable methods for [crate::bgsegm::BackgroundSubtractorLSBP] + pub trait BackgroundSubtractorLSBPTrait: crate::bgsegm::BackgroundSubtractorLSBPTraitConst + crate::video::BackgroundSubtractorTrait { fn as_raw_mut_BackgroundSubtractorLSBP(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -608,6 +746,52 @@ pub mod bgsegm { } + /// Background Subtraction using Local SVD Binary Pattern. More details about the algorithm can be found at [LGuo2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LGuo2016) + pub struct BackgroundSubtractorLSBP { + ptr: *mut c_void + } + + opencv_type_boxed! { BackgroundSubtractorLSBP } + + impl Drop for BackgroundSubtractorLSBP { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackgroundSubtractorLSBP_delete(instance: *mut c_void); } + unsafe { cv_BackgroundSubtractorLSBP_delete(self.as_raw_mut_BackgroundSubtractorLSBP()) }; + } + } + + unsafe impl Send for BackgroundSubtractorLSBP {} + + impl core::AlgorithmTraitConst for BackgroundSubtractorLSBP { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BackgroundSubtractorLSBP { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for BackgroundSubtractorLSBP { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for BackgroundSubtractorLSBP { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::bgsegm::BackgroundSubtractorLSBPTraitConst for BackgroundSubtractorLSBP { + #[inline] fn as_raw_BackgroundSubtractorLSBP(&self) -> *const c_void { self.as_raw() } + } + + impl crate::bgsegm::BackgroundSubtractorLSBPTrait for BackgroundSubtractorLSBP { + #[inline] fn as_raw_mut_BackgroundSubtractorLSBP(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackgroundSubtractorLSBP { + } + + boxed_cast_base! { BackgroundSubtractorLSBP, core::Algorithm, cv_BackgroundSubtractorLSBP_to_Algorithm } + /// Constant methods for [crate::bgsegm::BackgroundSubtractorLSBPDesc] pub trait BackgroundSubtractorLSBPDescTraitConst { fn as_raw_BackgroundSubtractorLSBPDesc(&self) -> *const c_void; @@ -679,7 +863,7 @@ pub mod bgsegm { } /// Constant methods for [crate::bgsegm::BackgroundSubtractorMOG] - pub trait BackgroundSubtractorMOGConst: crate::video::BackgroundSubtractorConst { + pub trait BackgroundSubtractorMOGTraitConst: crate::video::BackgroundSubtractorTraitConst { fn as_raw_BackgroundSubtractorMOG(&self) -> *const c_void; #[inline] @@ -720,10 +904,8 @@ pub mod bgsegm { } - /// Gaussian Mixture-based Background/Foreground Segmentation Algorithm. - /// - /// The class implements the algorithm described in [KB2001](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KB2001) . - pub trait BackgroundSubtractorMOG: crate::bgsegm::BackgroundSubtractorMOGConst + crate::video::BackgroundSubtractor { + /// Mutable methods for [crate::bgsegm::BackgroundSubtractorMOG] + pub trait BackgroundSubtractorMOGTrait: crate::bgsegm::BackgroundSubtractorMOGTraitConst + crate::video::BackgroundSubtractorTrait { fn as_raw_mut_BackgroundSubtractorMOG(&mut self) -> *mut c_void; #[inline] @@ -764,6 +946,54 @@ pub mod bgsegm { } + /// Gaussian Mixture-based Background/Foreground Segmentation Algorithm. + /// + /// The class implements the algorithm described in [KB2001](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KB2001) . + pub struct BackgroundSubtractorMOG { + ptr: *mut c_void + } + + opencv_type_boxed! { BackgroundSubtractorMOG } + + impl Drop for BackgroundSubtractorMOG { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackgroundSubtractorMOG_delete(instance: *mut c_void); } + unsafe { cv_BackgroundSubtractorMOG_delete(self.as_raw_mut_BackgroundSubtractorMOG()) }; + } + } + + unsafe impl Send for BackgroundSubtractorMOG {} + + impl core::AlgorithmTraitConst for BackgroundSubtractorMOG { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BackgroundSubtractorMOG { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for BackgroundSubtractorMOG { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for BackgroundSubtractorMOG { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::bgsegm::BackgroundSubtractorMOGTraitConst for BackgroundSubtractorMOG { + #[inline] fn as_raw_BackgroundSubtractorMOG(&self) -> *const c_void { self.as_raw() } + } + + impl crate::bgsegm::BackgroundSubtractorMOGTrait for BackgroundSubtractorMOG { + #[inline] fn as_raw_mut_BackgroundSubtractorMOG(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackgroundSubtractorMOG { + } + + boxed_cast_base! { BackgroundSubtractorMOG, core::Algorithm, cv_BackgroundSubtractorMOG_to_Algorithm } + /// Constant methods for [crate::bgsegm::SyntheticSequenceGenerator] pub trait SyntheticSequenceGeneratorTraitConst: core::AlgorithmTraitConst { fn as_raw_SyntheticSequenceGenerator(&self) -> *const c_void; diff --git a/docs/bioinspired.rs b/docs/bioinspired.rs index 183da039a..d822ac303 100644 --- a/docs/bioinspired.rs +++ b/docs/bioinspired.rs @@ -7,7 +7,7 @@ pub mod bioinspired { //! [bioinspired_retina] use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::RetinaParametersTraitConst, super::RetinaParametersTrait, super::RetinaConst, super::Retina, super::RetinaFastToneMappingConst, super::RetinaFastToneMapping, super::TransientAreasSegmentationModuleConst, super::TransientAreasSegmentationModule }; + pub use { super::RetinaParametersTraitConst, super::RetinaParametersTrait, super::RetinaTraitConst, super::RetinaTrait, super::RetinaFastToneMappingTraitConst, super::RetinaFastToneMappingTrait, super::TransientAreasSegmentationModuleTraitConst, super::TransientAreasSegmentationModuleTrait }; } /// standard bayer sampling @@ -17,7 +17,7 @@ pub mod bioinspired { /// each pixel position is either R, G or B in a random choice pub const RETINA_COLOR_RANDOM: i32 = 0; /// Constant methods for [crate::bioinspired::Retina] - pub trait RetinaConst: core::AlgorithmTraitConst { + pub trait RetinaTraitConst: core::AlgorithmTraitConst { fn as_raw_Retina(&self) -> *const c_void; /// Write xml/yml formated parameters information @@ -81,29 +81,8 @@ pub mod bioinspired { } - /// class which allows the Gipsa/Listic Labs model to be used with OpenCV. - /// - /// This retina model allows spatio-temporal image processing (applied on still images, video sequences). - /// As a summary, these are the retina model properties: - /// - It applies a spectral whithening (mid-frequency details enhancement) - /// - high frequency spatio-temporal noise reduction - /// - low frequency luminance to be reduced (luminance range compression) - /// - local logarithmic luminance compression allows details to be enhanced in low light conditions - /// - /// USE : this model can be used basically for spatio-temporal video effects but also for : - /// _using the getParvo method output matrix : texture analysiswith enhanced signal to noise ratio and enhanced details robust against input images luminance ranges - /// _using the getMagno method output matrix : motion analysis also with the previously cited properties - /// - /// for more information, reer to the following papers : - /// Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: - /// Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891. - /// - /// The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author : - /// take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper: - /// B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007 - /// take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions. - /// more informations in the above cited Jeanny Heraults's book. - pub trait Retina: core::AlgorithmTrait + crate::bioinspired::RetinaConst { + /// Mutable methods for [crate::bioinspired::Retina] + pub trait RetinaTrait: core::AlgorithmTrait + crate::bioinspired::RetinaTraitConst { fn as_raw_mut_Retina(&mut self) -> *mut c_void; /// Retreive retina input buffer size @@ -505,7 +484,61 @@ pub mod bioinspired { } - impl dyn Retina + '_ { + /// class which allows the Gipsa/Listic Labs model to be used with OpenCV. + /// + /// This retina model allows spatio-temporal image processing (applied on still images, video sequences). + /// As a summary, these are the retina model properties: + /// - It applies a spectral whithening (mid-frequency details enhancement) + /// - high frequency spatio-temporal noise reduction + /// - low frequency luminance to be reduced (luminance range compression) + /// - local logarithmic luminance compression allows details to be enhanced in low light conditions + /// + /// USE : this model can be used basically for spatio-temporal video effects but also for : + /// _using the getParvo method output matrix : texture analysiswith enhanced signal to noise ratio and enhanced details robust against input images luminance ranges + /// _using the getMagno method output matrix : motion analysis also with the previously cited properties + /// + /// for more information, reer to the following papers : + /// Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: + /// Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891. + /// + /// The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author : + /// take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper: + /// B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007 + /// take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions. + /// more informations in the above cited Jeanny Heraults's book. + pub struct Retina { + ptr: *mut c_void + } + + opencv_type_boxed! { Retina } + + impl Drop for Retina { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Retina_delete(instance: *mut c_void); } + unsafe { cv_Retina_delete(self.as_raw_mut_Retina()) }; + } + } + + unsafe impl Send for Retina {} + + impl core::AlgorithmTraitConst for Retina { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Retina { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::bioinspired::RetinaTraitConst for Retina { + #[inline] fn as_raw_Retina(&self) -> *const c_void { self.as_raw() } + } + + impl crate::bioinspired::RetinaTrait for Retina { + #[inline] fn as_raw_mut_Retina(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Retina { /// Constructors from standardized interfaces : retreive a smart pointer to a Retina instance /// /// ## Parameters @@ -525,12 +558,12 @@ pub mod bioinspired { /// /// ## Overloaded parameters #[inline] - pub fn create(input_size: core::Size) -> Result> { + pub fn create(input_size: core::Size) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bioinspired_Retina_create_Size(input_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -557,37 +590,27 @@ pub mod bioinspired { /// * reduction_factor: 1.0f /// * sampling_strength: 10.0f #[inline] - pub fn create_ext(input_size: core::Size, color_mode: bool, color_sampling_method: i32, use_retina_log_sampling: bool, reduction_factor: f32, sampling_strength: f32) -> Result> { + pub fn create_ext(input_size: core::Size, color_mode: bool, color_sampling_method: i32, use_retina_log_sampling: bool, reduction_factor: f32, sampling_strength: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bioinspired_Retina_create_Size_const_bool_int_const_bool_const_float_const_float(input_size.opencv_as_extern(), color_mode, color_sampling_method, use_retina_log_sampling, reduction_factor, sampling_strength, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { Retina, core::Algorithm, cv_Retina_to_Algorithm } + /// Constant methods for [crate::bioinspired::RetinaFastToneMapping] - pub trait RetinaFastToneMappingConst: core::AlgorithmTraitConst { + pub trait RetinaFastToneMappingTraitConst: core::AlgorithmTraitConst { fn as_raw_RetinaFastToneMapping(&self) -> *const c_void; } - /// a wrapper class which allows the tone mapping algorithm of Meylan&al(2007) to be used with OpenCV. - /// - /// This algorithm is already implemented in thre Retina class (retina::applyFastToneMapping) but used it does not require all the retina model to be allocated. This allows a light memory use for low memory devices (smartphones, etc. - /// As a summary, these are the model properties: - /// - 2 stages of local luminance adaptation with a different local neighborhood for each. - /// - first stage models the retina photorecetors local luminance adaptation - /// - second stage models th ganglion cells local information adaptation - /// - compared to the initial publication, this class uses spatio-temporal low pass filters instead of spatial only filters. - /// this can help noise robustness and temporal stability for video sequence use cases. - /// - /// for more information, read to the following papers : - /// Meylan L., Alleysson D., and Susstrunk S., A Model of Retinal Local Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of America, A, Vol. 24, N 9, September, 1st, 2007, pp. 2807-2816Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: - /// regarding spatio-temporal filter and the bigger retina model : - /// Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891. - pub trait RetinaFastToneMapping: core::AlgorithmTrait + crate::bioinspired::RetinaFastToneMappingConst { + /// Mutable methods for [crate::bioinspired::RetinaFastToneMapping] + pub trait RetinaFastToneMappingTrait: core::AlgorithmTrait + crate::bioinspired::RetinaFastToneMappingTraitConst { fn as_raw_mut_RetinaFastToneMapping(&mut self) -> *mut c_void; /// applies a luminance correction (initially High Dynamic Range (HDR) tone mapping) @@ -640,18 +663,67 @@ pub mod bioinspired { } - impl dyn RetinaFastToneMapping + '_ { + /// a wrapper class which allows the tone mapping algorithm of Meylan&al(2007) to be used with OpenCV. + /// + /// This algorithm is already implemented in thre Retina class (retina::applyFastToneMapping) but used it does not require all the retina model to be allocated. This allows a light memory use for low memory devices (smartphones, etc. + /// As a summary, these are the model properties: + /// - 2 stages of local luminance adaptation with a different local neighborhood for each. + /// - first stage models the retina photorecetors local luminance adaptation + /// - second stage models th ganglion cells local information adaptation + /// - compared to the initial publication, this class uses spatio-temporal low pass filters instead of spatial only filters. + /// this can help noise robustness and temporal stability for video sequence use cases. + /// + /// for more information, read to the following papers : + /// Meylan L., Alleysson D., and Susstrunk S., A Model of Retinal Local Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of America, A, Vol. 24, N 9, September, 1st, 2007, pp. 2807-2816Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: + /// regarding spatio-temporal filter and the bigger retina model : + /// Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891. + pub struct RetinaFastToneMapping { + ptr: *mut c_void + } + + opencv_type_boxed! { RetinaFastToneMapping } + + impl Drop for RetinaFastToneMapping { #[inline] - pub fn create(input_size: core::Size) -> Result> { + fn drop(&mut self) { + extern "C" { fn cv_RetinaFastToneMapping_delete(instance: *mut c_void); } + unsafe { cv_RetinaFastToneMapping_delete(self.as_raw_mut_RetinaFastToneMapping()) }; + } + } + + unsafe impl Send for RetinaFastToneMapping {} + + impl core::AlgorithmTraitConst for RetinaFastToneMapping { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for RetinaFastToneMapping { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::bioinspired::RetinaFastToneMappingTraitConst for RetinaFastToneMapping { + #[inline] fn as_raw_RetinaFastToneMapping(&self) -> *const c_void { self.as_raw() } + } + + impl crate::bioinspired::RetinaFastToneMappingTrait for RetinaFastToneMapping { + #[inline] fn as_raw_mut_RetinaFastToneMapping(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl RetinaFastToneMapping { + #[inline] + pub fn create(input_size: core::Size) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bioinspired_RetinaFastToneMapping_create_Size(input_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { RetinaFastToneMapping, core::Algorithm, cv_RetinaFastToneMapping_to_Algorithm } + /// Constant methods for [crate::bioinspired::RetinaParameters] pub trait RetinaParametersTraitConst { fn as_raw_RetinaParameters(&self) -> *const c_void; @@ -890,7 +962,7 @@ pub mod bioinspired { } /// Constant methods for [crate::bioinspired::TransientAreasSegmentationModule] - pub trait TransientAreasSegmentationModuleConst: core::AlgorithmTraitConst { + pub trait TransientAreasSegmentationModuleTraitConst: core::AlgorithmTraitConst { fn as_raw_TransientAreasSegmentationModule(&self) -> *const c_void; /// write xml/yml formated parameters information @@ -920,19 +992,8 @@ pub mod bioinspired { } - /// class which provides a transient/moving areas segmentation module - /// - /// perform a locally adapted segmentation by using the retina magno input data Based on Alexandre - /// BENOIT thesis: "Le système visuel humain au secours de la vision par ordinateur" - /// - /// 3 spatio temporal filters are used: - /// - a first one which filters the noise and local variations of the input motion energy - /// - a second (more powerfull low pass spatial filter) which gives the neighborhood motion energy the - /// segmentation consists in the comparison of these both outputs, if the local motion energy is higher - /// to the neighborhood otion energy, then the area is considered as moving and is segmented - /// - a stronger third low pass filter helps decision by providing a smooth information about the - /// "motion context" in a wider area - pub trait TransientAreasSegmentationModule: core::AlgorithmTrait + crate::bioinspired::TransientAreasSegmentationModuleConst { + /// Mutable methods for [crate::bioinspired::TransientAreasSegmentationModule] + pub trait TransientAreasSegmentationModuleTrait: core::AlgorithmTrait + crate::bioinspired::TransientAreasSegmentationModuleTraitConst { fn as_raw_mut_TransientAreasSegmentationModule(&mut self) -> *mut c_void; /// return the sze of the manage input and output images @@ -1064,18 +1125,65 @@ pub mod bioinspired { } - impl dyn TransientAreasSegmentationModule + '_ { + /// class which provides a transient/moving areas segmentation module + /// + /// perform a locally adapted segmentation by using the retina magno input data Based on Alexandre + /// BENOIT thesis: "Le système visuel humain au secours de la vision par ordinateur" + /// + /// 3 spatio temporal filters are used: + /// - a first one which filters the noise and local variations of the input motion energy + /// - a second (more powerfull low pass spatial filter) which gives the neighborhood motion energy the + /// segmentation consists in the comparison of these both outputs, if the local motion energy is higher + /// to the neighborhood otion energy, then the area is considered as moving and is segmented + /// - a stronger third low pass filter helps decision by providing a smooth information about the + /// "motion context" in a wider area + pub struct TransientAreasSegmentationModule { + ptr: *mut c_void + } + + opencv_type_boxed! { TransientAreasSegmentationModule } + + impl Drop for TransientAreasSegmentationModule { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TransientAreasSegmentationModule_delete(instance: *mut c_void); } + unsafe { cv_TransientAreasSegmentationModule_delete(self.as_raw_mut_TransientAreasSegmentationModule()) }; + } + } + + unsafe impl Send for TransientAreasSegmentationModule {} + + impl core::AlgorithmTraitConst for TransientAreasSegmentationModule { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for TransientAreasSegmentationModule { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::bioinspired::TransientAreasSegmentationModuleTraitConst for TransientAreasSegmentationModule { + #[inline] fn as_raw_TransientAreasSegmentationModule(&self) -> *const c_void { self.as_raw() } + } + + impl crate::bioinspired::TransientAreasSegmentationModuleTrait for TransientAreasSegmentationModule { + #[inline] fn as_raw_mut_TransientAreasSegmentationModule(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TransientAreasSegmentationModule { /// allocator /// ## Parameters /// * inputSize: : size of the images input to segment (output will be the same size) #[inline] - pub fn create(input_size: core::Size) -> Result> { + pub fn create(input_size: core::Size) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_bioinspired_TransientAreasSegmentationModule_create_Size(input_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { TransientAreasSegmentationModule, core::Algorithm, cv_TransientAreasSegmentationModule_to_Algorithm } +} diff --git a/docs/calib3d.rs b/docs/calib3d.rs index e68959ad1..c42728202 100644 --- a/docs/calib3d.rs +++ b/docs/calib3d.rs @@ -245,7 +245,7 @@ pub mod calib3d { //! # C API use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::LMSolver_CallbackConst, super::LMSolver_Callback, super::LMSolverConst, super::LMSolver, super::StereoMatcherConst, super::StereoMatcher, super::StereoBMConst, super::StereoBM, super::StereoSGBMConst, super::StereoSGBM }; + pub use { super::LMSolver_CallbackTraitConst, super::LMSolver_CallbackTrait, super::LMSolverTraitConst, super::LMSolverTrait, super::StereoMatcherTraitConst, super::StereoMatcherTrait, super::StereoBMTraitConst, super::StereoBMTrait, super::StereoSGBMTraitConst, super::StereoSGBMTrait }; } pub const CALIB_CB_ACCURACY: i32 = 32; @@ -5527,7 +5527,7 @@ pub mod calib3d { } /// Constant methods for [crate::calib3d::LMSolver] - pub trait LMSolverConst: core::AlgorithmTraitConst { + pub trait LMSolverTraitConst: core::AlgorithmTraitConst { fn as_raw_LMSolver(&self) -> *const c_void; /// Runs Levenberg-Marquardt algorithm using the passed vector of parameters as the start point. @@ -5563,12 +5563,8 @@ pub mod calib3d { } - /// Levenberg-Marquardt solver. Starting with the specified vector of parameters it - /// optimizes the target vector criteria "err" - /// (finds local minima of each target vector component absolute value). - /// - /// When needed, it calls user-provided callback. - pub trait LMSolver: core::AlgorithmTrait + crate::calib3d::LMSolverConst { + /// Mutable methods for [crate::calib3d::LMSolver] + pub trait LMSolverTrait: core::AlgorithmTrait + crate::calib3d::LMSolverTraitConst { fn as_raw_mut_LMSolver(&mut self) -> *mut c_void; /// Sets the maximum number of iterations @@ -5585,7 +5581,44 @@ pub mod calib3d { } - impl dyn LMSolver + '_ { + /// Levenberg-Marquardt solver. Starting with the specified vector of parameters it + /// optimizes the target vector criteria "err" + /// (finds local minima of each target vector component absolute value). + /// + /// When needed, it calls user-provided callback. + pub struct LMSolver { + ptr: *mut c_void + } + + opencv_type_boxed! { LMSolver } + + impl Drop for LMSolver { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LMSolver_delete(instance: *mut c_void); } + unsafe { cv_LMSolver_delete(self.as_raw_mut_LMSolver()) }; + } + } + + unsafe impl Send for LMSolver {} + + impl core::AlgorithmTraitConst for LMSolver { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LMSolver { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::LMSolverTraitConst for LMSolver { + #[inline] fn as_raw_LMSolver(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::LMSolverTrait for LMSolver { + #[inline] fn as_raw_mut_LMSolver(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LMSolver { /// Creates Levenberg-Marquard solver /// /// ## Parameters @@ -5593,28 +5626,31 @@ pub mod calib3d { /// * maxIters: maximum number of iterations that can be further /// modified using setMaxIters() method. #[inline] - pub fn create(cb: &core::Ptr, max_iters: i32) -> Result> { + pub fn create(cb: &core::Ptr, max_iters: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_LMSolver_create_const_PtrLCallbackGR_int(cb.as_raw_PtrOfLMSolver_Callback(), max_iters, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_ext(cb: &core::Ptr, max_iters: i32, eps: f64) -> Result> { + pub fn create_ext(cb: &core::Ptr, max_iters: i32, eps: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_LMSolver_create_const_PtrLCallbackGR_int_double(cb.as_raw_PtrOfLMSolver_Callback(), max_iters, eps, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { LMSolver, core::Algorithm, cv_LMSolver_to_Algorithm } + /// Constant methods for [crate::calib3d::LMSolver_Callback] - pub trait LMSolver_CallbackConst { + pub trait LMSolver_CallbackTraitConst { fn as_raw_LMSolver_Callback(&self) -> *const c_void; /// computes error and Jacobian for the specified vector of parameters @@ -5642,13 +5678,41 @@ pub mod calib3d { } - pub trait LMSolver_Callback: crate::calib3d::LMSolver_CallbackConst { + /// Mutable methods for [crate::calib3d::LMSolver_Callback] + pub trait LMSolver_CallbackTrait: crate::calib3d::LMSolver_CallbackTraitConst { fn as_raw_mut_LMSolver_Callback(&mut self) -> *mut c_void; } + pub struct LMSolver_Callback { + ptr: *mut c_void + } + + opencv_type_boxed! { LMSolver_Callback } + + impl Drop for LMSolver_Callback { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LMSolver_Callback_delete(instance: *mut c_void); } + unsafe { cv_LMSolver_Callback_delete(self.as_raw_mut_LMSolver_Callback()) }; + } + } + + unsafe impl Send for LMSolver_Callback {} + + impl crate::calib3d::LMSolver_CallbackTraitConst for LMSolver_Callback { + #[inline] fn as_raw_LMSolver_Callback(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::LMSolver_CallbackTrait for LMSolver_Callback { + #[inline] fn as_raw_mut_LMSolver_Callback(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LMSolver_Callback { + } + /// Constant methods for [crate::calib3d::StereoBM] - pub trait StereoBMConst: crate::calib3d::StereoMatcherConst { + pub trait StereoBMTraitConst: crate::calib3d::StereoMatcherTraitConst { fn as_raw_StereoBM(&self) -> *const c_void; #[inline] @@ -5725,9 +5789,8 @@ pub mod calib3d { } - /// Class for computing stereo correspondence using the block matching algorithm, introduced and - /// contributed to OpenCV by K. Konolige. - pub trait StereoBM: crate::calib3d::StereoBMConst + crate::calib3d::StereoMatcher { + /// Mutable methods for [crate::calib3d::StereoBM] + pub trait StereoBMTrait: crate::calib3d::StereoBMTraitConst + crate::calib3d::StereoMatcherTrait { fn as_raw_mut_StereoBM(&mut self) -> *mut c_void; #[inline] @@ -5804,7 +5867,49 @@ pub mod calib3d { } - impl dyn StereoBM + '_ { + /// Class for computing stereo correspondence using the block matching algorithm, introduced and + /// contributed to OpenCV by K. Konolige. + pub struct StereoBM { + ptr: *mut c_void + } + + opencv_type_boxed! { StereoBM } + + impl Drop for StereoBM { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_StereoBM_delete(instance: *mut c_void); } + unsafe { cv_StereoBM_delete(self.as_raw_mut_StereoBM()) }; + } + } + + unsafe impl Send for StereoBM {} + + impl core::AlgorithmTraitConst for StereoBM { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for StereoBM { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoMatcherTraitConst for StereoBM { + #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoMatcherTrait for StereoBM { + #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoBMTraitConst for StereoBM { + #[inline] fn as_raw_StereoBM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoBMTrait for StereoBM { + #[inline] fn as_raw_mut_StereoBM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StereoBM { /// Creates StereoBM object /// /// ## Parameters @@ -5823,18 +5928,21 @@ pub mod calib3d { /// * num_disparities: 0 /// * block_size: 21 #[inline] - pub fn create(num_disparities: i32, block_size: i32) -> Result> { + pub fn create(num_disparities: i32, block_size: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_StereoBM_create_int_int(num_disparities, block_size, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { StereoBM, core::Algorithm, cv_StereoBM_to_Algorithm } + /// Constant methods for [crate::calib3d::StereoMatcher] - pub trait StereoMatcherConst: core::AlgorithmTraitConst { + pub trait StereoMatcherTraitConst: core::AlgorithmTraitConst { fn as_raw_StereoMatcher(&self) -> *const c_void; #[inline] @@ -5893,8 +6001,8 @@ pub mod calib3d { } - /// The base class for stereo correspondence algorithms. - pub trait StereoMatcher: core::AlgorithmTrait + crate::calib3d::StereoMatcherConst { + /// Mutable methods for [crate::calib3d::StereoMatcher] + pub trait StereoMatcherTrait: core::AlgorithmTrait + crate::calib3d::StereoMatcherTraitConst { fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void; /// Computes disparity map for the specified stereo pair @@ -5973,8 +6081,46 @@ pub mod calib3d { } + /// The base class for stereo correspondence algorithms. + pub struct StereoMatcher { + ptr: *mut c_void + } + + opencv_type_boxed! { StereoMatcher } + + impl Drop for StereoMatcher { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_StereoMatcher_delete(instance: *mut c_void); } + unsafe { cv_StereoMatcher_delete(self.as_raw_mut_StereoMatcher()) }; + } + } + + unsafe impl Send for StereoMatcher {} + + impl core::AlgorithmTraitConst for StereoMatcher { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for StereoMatcher { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoMatcherTraitConst for StereoMatcher { + #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoMatcherTrait for StereoMatcher { + #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StereoMatcher { + } + + boxed_cast_base! { StereoMatcher, core::Algorithm, cv_StereoMatcher_to_Algorithm } + /// Constant methods for [crate::calib3d::StereoSGBM] - pub trait StereoSGBMConst: crate::calib3d::StereoMatcherConst { + pub trait StereoSGBMTraitConst: crate::calib3d::StereoMatcherTraitConst { fn as_raw_StereoSGBM(&self) -> *const c_void; #[inline] @@ -6024,25 +6170,8 @@ pub mod calib3d { } - /// The class implements the modified H. Hirschmuller algorithm [HH08](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_HH08) that differs from the original - /// one as follows: - /// - /// * By default, the algorithm is single-pass, which means that you consider only 5 directions - /// instead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the full variant of the - /// algorithm but beware that it may consume a lot of memory. - /// * The algorithm matches blocks, not individual pixels. Though, setting blockSize=1 reduces the - /// blocks to single pixels. - /// * Mutual information cost function is not implemented. Instead, a simpler Birchfield-Tomasi - /// sub-pixel metric from [BT98](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_BT98) is used. Though, the color images are supported as well. - /// * Some pre- and post- processing steps from K. Konolige algorithm StereoBM are included, for - /// example: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering (uniqueness - /// check, quadratic interpolation and speckle filtering). - /// - /// - /// Note: - /// * (Python) An example illustrating the use of the StereoSGBM matching algorithm can be found - /// at opencv_source_code/samples/python/stereo_match.py - pub trait StereoSGBM: crate::calib3d::StereoMatcher + crate::calib3d::StereoSGBMConst { + /// Mutable methods for [crate::calib3d::StereoSGBM] + pub trait StereoSGBMTrait: crate::calib3d::StereoMatcherTrait + crate::calib3d::StereoSGBMTraitConst { fn as_raw_mut_StereoSGBM(&mut self) -> *mut c_void; #[inline] @@ -6092,7 +6221,65 @@ pub mod calib3d { } - impl dyn StereoSGBM + '_ { + /// The class implements the modified H. Hirschmuller algorithm [HH08](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_HH08) that differs from the original + /// one as follows: + /// + /// * By default, the algorithm is single-pass, which means that you consider only 5 directions + /// instead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the full variant of the + /// algorithm but beware that it may consume a lot of memory. + /// * The algorithm matches blocks, not individual pixels. Though, setting blockSize=1 reduces the + /// blocks to single pixels. + /// * Mutual information cost function is not implemented. Instead, a simpler Birchfield-Tomasi + /// sub-pixel metric from [BT98](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_BT98) is used. Though, the color images are supported as well. + /// * Some pre- and post- processing steps from K. Konolige algorithm StereoBM are included, for + /// example: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering (uniqueness + /// check, quadratic interpolation and speckle filtering). + /// + /// + /// Note: + /// * (Python) An example illustrating the use of the StereoSGBM matching algorithm can be found + /// at opencv_source_code/samples/python/stereo_match.py + pub struct StereoSGBM { + ptr: *mut c_void + } + + opencv_type_boxed! { StereoSGBM } + + impl Drop for StereoSGBM { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_StereoSGBM_delete(instance: *mut c_void); } + unsafe { cv_StereoSGBM_delete(self.as_raw_mut_StereoSGBM()) }; + } + } + + unsafe impl Send for StereoSGBM {} + + impl core::AlgorithmTraitConst for StereoSGBM { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for StereoSGBM { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoMatcherTraitConst for StereoSGBM { + #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoMatcherTrait for StereoSGBM { + #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoSGBMTraitConst for StereoSGBM { + #[inline] fn as_raw_StereoSGBM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoSGBMTrait for StereoSGBM { + #[inline] fn as_raw_mut_StereoSGBM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StereoSGBM { /// Creates StereoSGBM object /// /// ## Parameters @@ -6144,16 +6331,19 @@ pub mod calib3d { /// * speckle_range: 0 /// * mode: StereoSGBM::MODE_SGBM #[inline] - pub fn create(min_disparity: i32, num_disparities: i32, block_size: i32, p1: i32, p2: i32, disp12_max_diff: i32, pre_filter_cap: i32, uniqueness_ratio: i32, speckle_window_size: i32, speckle_range: i32, mode: i32) -> Result> { + pub fn create(min_disparity: i32, num_disparities: i32, block_size: i32, p1: i32, p2: i32, disp12_max_diff: i32, pre_filter_cap: i32, uniqueness_ratio: i32, speckle_window_size: i32, speckle_range: i32, mode: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_StereoSGBM_create_int_int_int_int_int_int_int_int_int_int_int(min_disparity, num_disparities, block_size, p1, p2, disp12_max_diff, pre_filter_cap, uniqueness_ratio, speckle_window_size, speckle_range, mode, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { StereoSGBM, core::Algorithm, cv_StereoSGBM_to_Algorithm } + #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq)] pub struct UsacParams { diff --git a/docs/ccalib.rs b/docs/ccalib.rs index f82c3234e..6734fce21 100644 --- a/docs/ccalib.rs +++ b/docs/ccalib.rs @@ -447,7 +447,7 @@ pub mod ccalib { } #[inline] - fn set_descriptor_matcher(&mut self, mut matcher: core::Ptr) -> Result { + fn set_descriptor_matcher(&mut self, mut matcher: core::Ptr) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_ccalib_CustomPattern_setDescriptorMatcher_PtrLDescriptorMatcherG(self.as_raw_mut_CustomPattern(), matcher.as_raw_mut_PtrOfDescriptorMatcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -476,12 +476,12 @@ pub mod ccalib { } #[inline] - fn get_descriptor_matcher(&mut self) -> Result> { + fn get_descriptor_matcher(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ccalib_CustomPattern_getDescriptorMatcher(self.as_raw_mut_CustomPattern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -754,7 +754,7 @@ pub mod ccalib { /// * descriptor: AKAZE::create(AKAZE::DESCRIPTOR_MLDB,0,3,0.006f) /// * matcher: DescriptorMatcher::create("BruteForce-L1") #[inline] - pub fn new(camera_type: i32, n_cameras: i32, file_name: &str, pattern_width: f32, pattern_height: f32, verbose: i32, show_extration: i32, n_mini_matches: i32, flags: i32, criteria: core::TermCriteria, mut detector: core::Ptr, mut descriptor: core::Ptr, mut matcher: core::Ptr) -> Result { + pub fn new(camera_type: i32, n_cameras: i32, file_name: &str, pattern_width: f32, pattern_height: f32, verbose: i32, show_extration: i32, n_mini_matches: i32, flags: i32, criteria: core::TermCriteria, mut detector: core::Ptr, mut descriptor: core::Ptr, mut matcher: core::Ptr) -> Result { extern_container_arg!(file_name); return_send!(via ocvrs_return); unsafe { sys::cv_multicalib_MultiCameraCalibration_MultiCameraCalibration_int_int_const_stringR_float_float_int_int_int_int_TermCriteria_PtrLFeature2DG_PtrLFeature2DG_PtrLDescriptorMatcherG(camera_type, n_cameras, file_name.opencv_as_extern(), pattern_width, pattern_height, verbose, show_extration, n_mini_matches, flags, criteria.opencv_as_extern(), detector.as_raw_mut_PtrOfFeature2D(), descriptor.as_raw_mut_PtrOfFeature2D(), matcher.as_raw_mut_PtrOfDescriptorMatcher(), ocvrs_return.as_mut_ptr()) }; @@ -1060,7 +1060,7 @@ pub mod ccalib { /// * descriptor: AKAZE::create(AKAZE::DESCRIPTOR_MLDB,0,3,0.005f) /// * matcher: DescriptorMatcher::create("BruteForce-L1") #[inline] - pub fn new(pattern_width: f32, pattern_height: f32, nmini_match: i32, depth: i32, verbose: i32, show_extraction: i32, mut detector: core::Ptr, mut descriptor: core::Ptr, mut matcher: core::Ptr) -> Result { + pub fn new(pattern_width: f32, pattern_height: f32, nmini_match: i32, depth: i32, verbose: i32, show_extraction: i32, mut detector: core::Ptr, mut descriptor: core::Ptr, mut matcher: core::Ptr) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_randpattern_RandomPatternCornerFinder_RandomPatternCornerFinder_float_float_int_int_int_int_PtrLFeature2DG_PtrLFeature2DG_PtrLDescriptorMatcherG(pattern_width, pattern_height, nmini_match, depth, verbose, show_extraction, detector.as_raw_mut_PtrOfFeature2D(), descriptor.as_raw_mut_PtrOfFeature2D(), matcher.as_raw_mut_PtrOfDescriptorMatcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); diff --git a/docs/core.rs b/docs/core.rs index aec5ba117..f60dfe170 100644 --- a/docs/core.rs +++ b/docs/core.rs @@ -31,7 +31,7 @@ pub mod core { //! # Parallel backends API use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::HammingTraitConst, super::HammingTrait, super::Detail_CheckContextTraitConst, super::Detail_CheckContextTrait, super::Matx_AddOpTraitConst, super::Matx_AddOpTrait, super::Matx_SubOpTraitConst, super::Matx_SubOpTrait, super::Matx_ScaleOpTraitConst, super::Matx_ScaleOpTrait, super::Matx_MulOpTraitConst, super::Matx_MulOpTrait, super::Matx_DivOpTraitConst, super::Matx_DivOpTrait, super::Matx_MatMulOpTraitConst, super::Matx_MatMulOpTrait, super::Matx_TOpTraitConst, super::Matx_TOpTrait, super::RotatedRectTraitConst, super::RotatedRectTrait, super::RangeTraitConst, super::RangeTrait, super::KeyPointTraitConst, super::KeyPointTrait, super::_InputArrayTraitConst, super::_InputArrayTrait, super::_OutputArrayTraitConst, super::_OutputArrayTrait, super::_InputOutputArrayTraitConst, super::_InputOutputArrayTrait, super::UMatDataTraitConst, super::UMatDataTrait, super::MatSizeTraitConst, super::MatSizeTrait, super::MatStepTraitConst, super::MatStepTrait, super::MatTraitConst, super::MatTrait, super::UMatTraitConst, super::UMatTrait, super::SparseMat_HdrTraitConst, super::SparseMat_HdrTrait, super::SparseMat_NodeTraitConst, super::SparseMat_NodeTrait, super::SparseMatTraitConst, super::SparseMatTrait, super::MatConstIteratorTraitConst, super::MatConstIteratorTrait, super::SparseMatConstIteratorTraitConst, super::SparseMatConstIteratorTrait, super::SparseMatIteratorTraitConst, super::SparseMatIteratorTrait, super::MatOpConst, super::MatOp, super::MatExprTraitConst, super::MatExprTrait, super::FileStorageTraitConst, super::FileStorageTrait, super::FileNodeTraitConst, super::FileNodeTrait, super::FileNodeIteratorTraitConst, super::FileNodeIteratorTrait, super::WriteStructContextTraitConst, super::WriteStructContextTrait, super::ExceptionTraitConst, super::ExceptionTrait, super::PCATraitConst, super::PCATrait, super::LDATraitConst, super::LDATrait, super::SVDTraitConst, super::SVDTrait, super::RNGTraitConst, super::RNGTrait, super::RNG_MT19937TraitConst, super::RNG_MT19937Trait, super::FormattedConst, super::Formatted, super::FormatterConst, super::Formatter, super::AlgorithmTraitConst, super::AlgorithmTrait, super::TickMeterTraitConst, super::TickMeterTrait, super::ParallelLoopBodyConst, super::ParallelLoopBody, super::CommandLineParserTraitConst, super::CommandLineParserTrait, super::TLSDataContainerConst, super::TLSDataContainer, super::NodeDataTraitConst, super::NodeDataTrait, super::MinProblemSolver_FunctionConst, super::MinProblemSolver_Function, super::MinProblemSolverConst, super::MinProblemSolver, super::DownhillSolverConst, super::DownhillSolver, super::ConjGradSolverConst, super::ConjGradSolver, super::DeviceTraitConst, super::DeviceTrait, super::Context_UserContextTraitConst, super::Context_UserContextTrait, super::ContextTraitConst, super::ContextTrait, super::PlatformTraitConst, super::PlatformTrait, super::QueueTraitConst, super::QueueTrait, super::KernelArgTraitConst, super::KernelArgTrait, super::KernelTraitConst, super::KernelTrait, super::ProgramTraitConst, super::ProgramTrait, super::ProgramSourceTraitConst, super::ProgramSourceTrait, super::PlatformInfoTraitConst, super::PlatformInfoTrait, super::Image2DTraitConst, super::Image2DTrait, super::TimerTraitConst, super::TimerTrait, super::OpenCLExecutionContextTraitConst, super::OpenCLExecutionContextTrait, super::GpuMat_AllocatorConst, super::GpuMat_Allocator, super::GpuMatTraitConst, super::GpuMatTrait, super::GpuDataTraitConst, super::GpuDataTrait, super::GpuMatNDTraitConst, super::GpuMatNDTrait, super::BufferPoolTraitConst, super::BufferPoolTrait, super::HostMemTraitConst, super::HostMemTrait, super::StreamTraitConst, super::StreamTrait, super::EventTraitConst, super::EventTrait, super::TargetArchsTraitConst, super::TargetArchsTrait, super::DeviceInfoTraitConst, super::DeviceInfoTrait, super::BufferTraitConst, super::BufferTrait, super::Texture2DTraitConst, super::Texture2DTrait, super::ArraysTraitConst, super::ArraysTrait, super::AsyncArrayTraitConst, super::AsyncArrayTrait, super::AsyncPromiseTraitConst, super::AsyncPromiseTrait, super::LogTagTraitConst, super::LogTagTrait, super::OriginalClassNameTraitConst, super::OriginalClassNameTrait }; + pub use { super::HammingTraitConst, super::HammingTrait, super::Detail_CheckContextTraitConst, super::Detail_CheckContextTrait, super::Matx_AddOpTraitConst, super::Matx_AddOpTrait, super::Matx_SubOpTraitConst, super::Matx_SubOpTrait, super::Matx_ScaleOpTraitConst, super::Matx_ScaleOpTrait, super::Matx_MulOpTraitConst, super::Matx_MulOpTrait, super::Matx_DivOpTraitConst, super::Matx_DivOpTrait, super::Matx_MatMulOpTraitConst, super::Matx_MatMulOpTrait, super::Matx_TOpTraitConst, super::Matx_TOpTrait, super::RotatedRectTraitConst, super::RotatedRectTrait, super::RangeTraitConst, super::RangeTrait, super::KeyPointTraitConst, super::KeyPointTrait, super::_InputArrayTraitConst, super::_InputArrayTrait, super::_OutputArrayTraitConst, super::_OutputArrayTrait, super::_InputOutputArrayTraitConst, super::_InputOutputArrayTrait, super::UMatDataTraitConst, super::UMatDataTrait, super::MatSizeTraitConst, super::MatSizeTrait, super::MatStepTraitConst, super::MatStepTrait, super::MatTraitConst, super::MatTrait, super::UMatTraitConst, super::UMatTrait, super::SparseMat_HdrTraitConst, super::SparseMat_HdrTrait, super::SparseMat_NodeTraitConst, super::SparseMat_NodeTrait, super::SparseMatTraitConst, super::SparseMatTrait, super::MatConstIteratorTraitConst, super::MatConstIteratorTrait, super::SparseMatConstIteratorTraitConst, super::SparseMatConstIteratorTrait, super::SparseMatIteratorTraitConst, super::SparseMatIteratorTrait, super::MatOpTraitConst, super::MatOpTrait, super::MatExprTraitConst, super::MatExprTrait, super::FileStorageTraitConst, super::FileStorageTrait, super::FileNodeTraitConst, super::FileNodeTrait, super::FileNodeIteratorTraitConst, super::FileNodeIteratorTrait, super::WriteStructContextTraitConst, super::WriteStructContextTrait, super::ExceptionTraitConst, super::ExceptionTrait, super::PCATraitConst, super::PCATrait, super::LDATraitConst, super::LDATrait, super::SVDTraitConst, super::SVDTrait, super::RNGTraitConst, super::RNGTrait, super::RNG_MT19937TraitConst, super::RNG_MT19937Trait, super::FormattedTraitConst, super::FormattedTrait, super::FormatterTraitConst, super::FormatterTrait, super::AlgorithmTraitConst, super::AlgorithmTrait, super::TickMeterTraitConst, super::TickMeterTrait, super::ParallelLoopBodyTraitConst, super::ParallelLoopBodyTrait, super::CommandLineParserTraitConst, super::CommandLineParserTrait, super::TLSDataContainerTraitConst, super::TLSDataContainerTrait, super::NodeDataTraitConst, super::NodeDataTrait, super::MinProblemSolver_FunctionTraitConst, super::MinProblemSolver_FunctionTrait, super::MinProblemSolverTraitConst, super::MinProblemSolverTrait, super::DownhillSolverTraitConst, super::DownhillSolverTrait, super::ConjGradSolverTraitConst, super::ConjGradSolverTrait, super::DeviceTraitConst, super::DeviceTrait, super::Context_UserContextTraitConst, super::Context_UserContextTrait, super::ContextTraitConst, super::ContextTrait, super::PlatformTraitConst, super::PlatformTrait, super::QueueTraitConst, super::QueueTrait, super::KernelArgTraitConst, super::KernelArgTrait, super::KernelTraitConst, super::KernelTrait, super::ProgramTraitConst, super::ProgramTrait, super::ProgramSourceTraitConst, super::ProgramSourceTrait, super::PlatformInfoTraitConst, super::PlatformInfoTrait, super::Image2DTraitConst, super::Image2DTrait, super::TimerTraitConst, super::TimerTrait, super::OpenCLExecutionContextTraitConst, super::OpenCLExecutionContextTrait, super::GpuMat_AllocatorTraitConst, super::GpuMat_AllocatorTrait, super::GpuMatTraitConst, super::GpuMatTrait, super::GpuDataTraitConst, super::GpuDataTrait, super::GpuMatNDTraitConst, super::GpuMatNDTrait, super::BufferPoolTraitConst, super::BufferPoolTrait, super::HostMemTraitConst, super::HostMemTrait, super::StreamTraitConst, super::StreamTrait, super::EventTraitConst, super::EventTrait, super::TargetArchsTraitConst, super::TargetArchsTrait, super::DeviceInfoTraitConst, super::DeviceInfoTrait, super::BufferTraitConst, super::BufferTrait, super::Texture2DTraitConst, super::Texture2DTrait, super::ArraysTraitConst, super::ArraysTrait, super::AsyncArrayTraitConst, super::AsyncArrayTrait, super::AsyncPromiseTraitConst, super::AsyncPromiseTrait, super::LogTagTraitConst, super::LogTagTrait, super::OriginalClassNameTraitConst, super::OriginalClassNameTrait }; } pub const ACCESS_FAST: i32 = 67108864; @@ -6699,7 +6699,7 @@ pub mod core { /// ## C++ default parameters /// * nstripes: -1. #[inline] - pub fn parallel_for_(range: &core::Range, body: &dyn core::ParallelLoopBody, nstripes: f64) -> Result<()> { + pub fn parallel_for_(range: &core::Range, body: &core::ParallelLoopBody, nstripes: f64) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_parallel_for__const_RangeR_const_ParallelLoopBodyR_double(range.as_raw_Range(), body.as_raw_ParallelLoopBody(), nstripes, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -9391,11 +9391,17 @@ pub mod core { } /// Constant methods for [core::ConjGradSolver] - pub trait ConjGradSolverConst: core::MinProblemSolverConst { + pub trait ConjGradSolverTraitConst: core::MinProblemSolverTraitConst { fn as_raw_ConjGradSolver(&self) -> *const c_void; } + /// Mutable methods for [core::ConjGradSolver] + pub trait ConjGradSolverTrait: core::ConjGradSolverTraitConst + core::MinProblemSolverTrait { + fn as_raw_mut_ConjGradSolver(&mut self) -> *mut c_void; + + } + /// This class is used to perform the non-linear non-constrained minimization of a function /// with known gradient, /// @@ -9431,12 +9437,47 @@ pub mod core { /// termcrit.type == TermCriteria::MAX_ITER) && termcrit.maxCount > 0 /// ``` /// - pub trait ConjGradSolver: core::ConjGradSolverConst + core::MinProblemSolver { - fn as_raw_mut_ConjGradSolver(&mut self) -> *mut c_void; + pub struct ConjGradSolver { + ptr: *mut c_void + } + + opencv_type_boxed! { ConjGradSolver } + + impl Drop for ConjGradSolver { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ConjGradSolver_delete(instance: *mut c_void); } + unsafe { cv_ConjGradSolver_delete(self.as_raw_mut_ConjGradSolver()) }; + } + } + + unsafe impl Send for ConjGradSolver {} + + impl core::AlgorithmTraitConst for ConjGradSolver { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ConjGradSolver { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl core::MinProblemSolverTraitConst for ConjGradSolver { + #[inline] fn as_raw_MinProblemSolver(&self) -> *const c_void { self.as_raw() } + } + + impl core::MinProblemSolverTrait for ConjGradSolver { + #[inline] fn as_raw_mut_MinProblemSolver(&mut self) -> *mut c_void { self.as_raw_mut() } + } + impl core::ConjGradSolverTraitConst for ConjGradSolver { + #[inline] fn as_raw_ConjGradSolver(&self) -> *const c_void { self.as_raw() } } - impl dyn ConjGradSolver + '_ { + impl core::ConjGradSolverTrait for ConjGradSolver { + #[inline] fn as_raw_mut_ConjGradSolver(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ConjGradSolver { /// This function returns the reference to the ready-to-use ConjGradSolver object. /// /// All the parameters are optional, so this procedure can be called even without parameters at @@ -9455,16 +9496,19 @@ pub mod core { /// * f: Ptr() /// * termcrit: TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5000,0.000001) #[inline] - pub fn create(f: &core::Ptr, termcrit: core::TermCriteria) -> Result> { + pub fn create(f: &core::Ptr, termcrit: core::TermCriteria) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ConjGradSolver_create_const_PtrLFunctionGR_TermCriteria(f.as_raw_PtrOfMinProblemSolver_Function(), termcrit.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { ConjGradSolver, core::Algorithm, cv_ConjGradSolver_to_Algorithm } + /// Class for matching keypoint descriptors /// /// query descriptor index, train descriptor index, train image index, and distance between @@ -9524,7 +9568,7 @@ pub mod core { } /// Constant methods for [core::DownhillSolver] - pub trait DownhillSolverConst: core::MinProblemSolverConst { + pub trait DownhillSolverTraitConst: core::MinProblemSolverTraitConst { fn as_raw_DownhillSolver(&self) -> *const c_void; /// Returns the initial step that will be used in downhill simplex algorithm. @@ -9546,6 +9590,36 @@ pub mod core { } + /// Mutable methods for [core::DownhillSolver] + pub trait DownhillSolverTrait: core::DownhillSolverTraitConst + core::MinProblemSolverTrait { + fn as_raw_mut_DownhillSolver(&mut self) -> *mut c_void; + + /// Sets the initial step that will be used in downhill simplex algorithm. + /// + /// Step, together with initial point (given in DownhillSolver::minimize) are two `n`-dimensional + /// vectors that are used to determine the shape of initial simplex. Roughly said, initial point + /// determines the position of a simplex (it will become simplex's centroid), while step determines the + /// spread (size in each dimension) of a simplex. To be more precise, if ![inline formula](https://latex.codecogs.com/png.latex?s%2Cx%5F0%5Cin%5Cmathbb%7BR%7D%5En) are + /// the initial step and initial point respectively, the vertices of a simplex will be: + /// ![inline formula](https://latex.codecogs.com/png.latex?v%5F0%3A%3Dx%5F0%2D%5Cfrac%7B1%7D%7B2%7D%20s) and ![inline formula](https://latex.codecogs.com/png.latex?v%5Fi%3A%3Dx%5F0%2Bs%5Fi) for ![inline formula](https://latex.codecogs.com/png.latex?i%3D1%2C2%2C%5Cdots%2Cn) where ![inline formula](https://latex.codecogs.com/png.latex?s%5Fi) denotes + /// projections of the initial step of *n*-th coordinate (the result of projection is treated to be + /// vector given by ![inline formula](https://latex.codecogs.com/png.latex?s%5Fi%3A%3De%5Fi%5Ccdot%5Cleft%3Ce%5Fi%5Ccdot%20s%5Cright%3E), where ![inline formula](https://latex.codecogs.com/png.latex?e%5Fi) form canonical basis) + /// + /// ## Parameters + /// * step: Initial step that will be used in algorithm. Roughly said, it determines the spread + /// (size in each dimension) of an initial simplex. + #[inline] + fn set_init_step(&mut self, step: &dyn core::ToInputArray) -> Result<()> { + extern_container_arg!(step); + return_send!(via ocvrs_return); + unsafe { sys::cv_DownhillSolver_setInitStep_const__InputArrayR(self.as_raw_mut_DownhillSolver(), step.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// This class is used to perform the non-linear non-constrained minimization of a function, /// /// defined on an `n`-dimensional Euclidean space, using the **Nelder-Mead method**, also known as @@ -9578,36 +9652,47 @@ pub mod core { /// termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && termcrit.epsilon > 0 && termcrit.maxCount > 0 /// ``` /// - pub trait DownhillSolver: core::DownhillSolverConst + core::MinProblemSolver { - fn as_raw_mut_DownhillSolver(&mut self) -> *mut c_void; + pub struct DownhillSolver { + ptr: *mut c_void + } - /// Sets the initial step that will be used in downhill simplex algorithm. - /// - /// Step, together with initial point (given in DownhillSolver::minimize) are two `n`-dimensional - /// vectors that are used to determine the shape of initial simplex. Roughly said, initial point - /// determines the position of a simplex (it will become simplex's centroid), while step determines the - /// spread (size in each dimension) of a simplex. To be more precise, if ![inline formula](https://latex.codecogs.com/png.latex?s%2Cx%5F0%5Cin%5Cmathbb%7BR%7D%5En) are - /// the initial step and initial point respectively, the vertices of a simplex will be: - /// ![inline formula](https://latex.codecogs.com/png.latex?v%5F0%3A%3Dx%5F0%2D%5Cfrac%7B1%7D%7B2%7D%20s) and ![inline formula](https://latex.codecogs.com/png.latex?v%5Fi%3A%3Dx%5F0%2Bs%5Fi) for ![inline formula](https://latex.codecogs.com/png.latex?i%3D1%2C2%2C%5Cdots%2Cn) where ![inline formula](https://latex.codecogs.com/png.latex?s%5Fi) denotes - /// projections of the initial step of *n*-th coordinate (the result of projection is treated to be - /// vector given by ![inline formula](https://latex.codecogs.com/png.latex?s%5Fi%3A%3De%5Fi%5Ccdot%5Cleft%3Ce%5Fi%5Ccdot%20s%5Cright%3E), where ![inline formula](https://latex.codecogs.com/png.latex?e%5Fi) form canonical basis) - /// - /// ## Parameters - /// * step: Initial step that will be used in algorithm. Roughly said, it determines the spread - /// (size in each dimension) of an initial simplex. + opencv_type_boxed! { DownhillSolver } + + impl Drop for DownhillSolver { #[inline] - fn set_init_step(&mut self, step: &dyn core::ToInputArray) -> Result<()> { - extern_container_arg!(step); - return_send!(via ocvrs_return); - unsafe { sys::cv_DownhillSolver_setInitStep_const__InputArrayR(self.as_raw_mut_DownhillSolver(), step.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_DownhillSolver_delete(instance: *mut c_void); } + unsafe { cv_DownhillSolver_delete(self.as_raw_mut_DownhillSolver()) }; } - } - impl dyn DownhillSolver + '_ { + unsafe impl Send for DownhillSolver {} + + impl core::AlgorithmTraitConst for DownhillSolver { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DownhillSolver { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl core::MinProblemSolverTraitConst for DownhillSolver { + #[inline] fn as_raw_MinProblemSolver(&self) -> *const c_void { self.as_raw() } + } + + impl core::MinProblemSolverTrait for DownhillSolver { + #[inline] fn as_raw_mut_MinProblemSolver(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl core::DownhillSolverTraitConst for DownhillSolver { + #[inline] fn as_raw_DownhillSolver(&self) -> *const c_void { self.as_raw() } + } + + impl core::DownhillSolverTrait for DownhillSolver { + #[inline] fn as_raw_mut_DownhillSolver(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DownhillSolver { /// This function returns the reference to the ready-to-use DownhillSolver object. /// /// All the parameters are optional, so this procedure can be called even without parameters at @@ -9630,17 +9715,20 @@ pub mod core { /// * init_step: Mat_(1,1,0.0) /// * termcrit: TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5000,0.000001) #[inline] - pub fn create(f: &core::Ptr, init_step: &dyn core::ToInputArray, termcrit: core::TermCriteria) -> Result> { + pub fn create(f: &core::Ptr, init_step: &dyn core::ToInputArray, termcrit: core::TermCriteria) -> Result> { extern_container_arg!(init_step); return_send!(via ocvrs_return); unsafe { sys::cv_DownhillSolver_create_const_PtrLFunctionGR_const__InputArrayR_TermCriteria(f.as_raw_PtrOfMinProblemSolver_Function(), init_step.as_raw__InputArray(), termcrit.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { DownhillSolver, core::Algorithm, cv_DownhillSolver_to_Algorithm } + /// Constant methods for [core::Exception] pub trait ExceptionTraitConst { fn as_raw_Exception(&self) -> *const c_void; @@ -10926,13 +11014,13 @@ pub mod core { } /// Constant methods for [core::Formatted] - pub trait FormattedConst { + pub trait FormattedTraitConst { fn as_raw_Formatted(&self) -> *const c_void; } - /// @todo document - pub trait Formatted: core::FormattedConst { + /// Mutable methods for [core::Formatted] + pub trait FormattedTrait: core::FormattedTraitConst { fn as_raw_mut_Formatted(&mut self) -> *mut c_void; #[inline] @@ -10956,24 +11044,52 @@ pub mod core { } + /// @todo document + pub struct Formatted { + ptr: *mut c_void + } + + opencv_type_boxed! { Formatted } + + impl Drop for Formatted { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Formatted_delete(instance: *mut c_void); } + unsafe { cv_Formatted_delete(self.as_raw_mut_Formatted()) }; + } + } + + unsafe impl Send for Formatted {} + + impl core::FormattedTraitConst for Formatted { + #[inline] fn as_raw_Formatted(&self) -> *const c_void { self.as_raw() } + } + + impl core::FormattedTrait for Formatted { + #[inline] fn as_raw_mut_Formatted(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Formatted { + } + /// Constant methods for [core::Formatter] - pub trait FormatterConst { + pub trait FormatterTraitConst { fn as_raw_Formatter(&self) -> *const c_void; #[inline] - fn format(&self, mtx: &core::Mat) -> Result> { + fn format(&self, mtx: &core::Mat) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Formatter_format_const_const_MatR(self.as_raw_Formatter(), mtx.as_raw_Mat(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } - /// @todo document - pub trait Formatter: core::FormatterConst { + /// Mutable methods for [core::Formatter] + pub trait FormatterTrait: core::FormatterTraitConst { fn as_raw_mut_Formatter(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -11022,20 +11138,46 @@ pub mod core { } - impl dyn Formatter + '_ { + /// @todo document + pub struct Formatter { + ptr: *mut c_void + } + + opencv_type_boxed! { Formatter } + + impl Drop for Formatter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Formatter_delete(instance: *mut c_void); } + unsafe { cv_Formatter_delete(self.as_raw_mut_Formatter()) }; + } + } + + unsafe impl Send for Formatter {} + + impl core::FormatterTraitConst for Formatter { + #[inline] fn as_raw_Formatter(&self) -> *const c_void { self.as_raw() } + } + + impl core::FormatterTrait for Formatter { + #[inline] fn as_raw_mut_Formatter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Formatter { /// ## C++ default parameters /// * fmt: FMT_DEFAULT #[inline] - pub fn get(fmt: core::Formatter_FormatType) -> Result> { + pub fn get(fmt: core::Formatter_FormatType) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Formatter_get_FormatType(fmt, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [core::Hamming] pub trait HammingTraitConst { fn as_raw_Hamming(&self) -> *const c_void; @@ -15076,7 +15218,7 @@ pub mod core { /// * _beta: 1 /// * _s: Scalar() #[inline] - pub fn new(_op: &dyn core::MatOp, _flags: i32, _a: &core::Mat, _b: &core::Mat, _c: &core::Mat, _alpha: f64, _beta: f64, _s: core::Scalar) -> Result { + pub fn new(_op: &core::MatOp, _flags: i32, _a: &core::Mat, _b: &core::Mat, _c: &core::Mat, _alpha: f64, _beta: f64, _s: core::Scalar) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_MatExpr_MatExpr_const_MatOpX_int_const_MatR_const_MatR_const_MatR_double_double_const_ScalarR(_op.as_raw_MatOp(), _flags, _a.as_raw_Mat(), _b.as_raw_Mat(), _c.as_raw_Mat(), _alpha, _beta, &_s, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -15088,7 +15230,7 @@ pub mod core { } /// Constant methods for [core::MatOp] - pub trait MatOpConst { + pub trait MatOpTraitConst { fn as_raw_MatOp(&self) -> *const c_void; #[inline] @@ -15324,12 +15466,40 @@ pub mod core { } - /// ////////////////////////////// Matrix Expressions ///////////////////////////////// - pub trait MatOp: core::MatOpConst { + /// Mutable methods for [core::MatOp] + pub trait MatOpTrait: core::MatOpTraitConst { fn as_raw_mut_MatOp(&mut self) -> *mut c_void; } + /// ////////////////////////////// Matrix Expressions ///////////////////////////////// + pub struct MatOp { + ptr: *mut c_void + } + + opencv_type_boxed! { MatOp } + + impl Drop for MatOp { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MatOp_delete(instance: *mut c_void); } + unsafe { cv_MatOp_delete(self.as_raw_mut_MatOp()) }; + } + } + + unsafe impl Send for MatOp {} + + impl core::MatOpTraitConst for MatOp { + #[inline] fn as_raw_MatOp(&self) -> *const c_void { self.as_raw() } + } + + impl core::MatOpTrait for MatOp { + #[inline] fn as_raw_mut_MatOp(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MatOp { + } + /// Constant methods for [core::MatSize] pub trait MatSizeTraitConst { fn as_raw_MatSize(&self) -> *const c_void; @@ -15957,7 +16127,7 @@ pub mod core { } /// Constant methods for [core::MinProblemSolver] - pub trait MinProblemSolverConst: core::AlgorithmTraitConst { + pub trait MinProblemSolverTraitConst: core::AlgorithmTraitConst { fn as_raw_MinProblemSolver(&self) -> *const c_void; /// Getter for the optimized function. @@ -15969,12 +16139,12 @@ pub mod core { /// Smart-pointer to an object that implements Function interface - it represents the /// function that is being optimized. It can be empty, if no function was given so far. #[inline] - fn get_function(&self) -> Result> { + fn get_function(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_MinProblemSolver_getFunction_const(self.as_raw_MinProblemSolver(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -15993,8 +16163,8 @@ pub mod core { } - /// Basic interface for all solvers - pub trait MinProblemSolver: core::AlgorithmTrait + core::MinProblemSolverConst { + /// Mutable methods for [core::MinProblemSolver] + pub trait MinProblemSolverTrait: core::AlgorithmTrait + core::MinProblemSolverTraitConst { fn as_raw_mut_MinProblemSolver(&mut self) -> *mut c_void; /// Setter for the optimized function. @@ -16004,7 +16174,7 @@ pub mod core { /// ## Parameters /// * f: The new function to optimize. #[inline] - fn set_function(&mut self, f: &core::Ptr) -> Result<()> { + fn set_function(&mut self, f: &core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_MinProblemSolver_setFunction_const_PtrLFunctionGR(self.as_raw_mut_MinProblemSolver(), f.as_raw_PtrOfMinProblemSolver_Function(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -16057,8 +16227,46 @@ pub mod core { } + /// Basic interface for all solvers + pub struct MinProblemSolver { + ptr: *mut c_void + } + + opencv_type_boxed! { MinProblemSolver } + + impl Drop for MinProblemSolver { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MinProblemSolver_delete(instance: *mut c_void); } + unsafe { cv_MinProblemSolver_delete(self.as_raw_mut_MinProblemSolver()) }; + } + } + + unsafe impl Send for MinProblemSolver {} + + impl core::AlgorithmTraitConst for MinProblemSolver { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MinProblemSolver { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl core::MinProblemSolverTraitConst for MinProblemSolver { + #[inline] fn as_raw_MinProblemSolver(&self) -> *const c_void { self.as_raw() } + } + + impl core::MinProblemSolverTrait for MinProblemSolver { + #[inline] fn as_raw_mut_MinProblemSolver(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MinProblemSolver { + } + + boxed_cast_base! { MinProblemSolver, core::Algorithm, cv_MinProblemSolver_to_Algorithm } + /// Constant methods for [core::MinProblemSolver_Function] - pub trait MinProblemSolver_FunctionConst { + pub trait MinProblemSolver_FunctionTraitConst { fn as_raw_MinProblemSolver_Function(&self) -> *const c_void; #[inline] @@ -16090,8 +16298,8 @@ pub mod core { } - /// Represents function being optimized - pub trait MinProblemSolver_Function: core::MinProblemSolver_FunctionConst { + /// Mutable methods for [core::MinProblemSolver_Function] + pub trait MinProblemSolver_FunctionTrait: core::MinProblemSolver_FunctionTraitConst { fn as_raw_mut_MinProblemSolver_Function(&mut self) -> *mut c_void; #[inline] @@ -16105,6 +16313,34 @@ pub mod core { } + /// Represents function being optimized + pub struct MinProblemSolver_Function { + ptr: *mut c_void + } + + opencv_type_boxed! { MinProblemSolver_Function } + + impl Drop for MinProblemSolver_Function { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MinProblemSolver_Function_delete(instance: *mut c_void); } + unsafe { cv_MinProblemSolver_Function_delete(self.as_raw_mut_MinProblemSolver_Function()) }; + } + } + + unsafe impl Send for MinProblemSolver_Function {} + + impl core::MinProblemSolver_FunctionTraitConst for MinProblemSolver_Function { + #[inline] fn as_raw_MinProblemSolver_Function(&self) -> *const c_void { self.as_raw() } + } + + impl core::MinProblemSolver_FunctionTrait for MinProblemSolver_Function { + #[inline] fn as_raw_mut_MinProblemSolver_Function(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MinProblemSolver_Function { + } + /// struct returned by cv::moments /// /// The spatial moments ![inline formula](https://latex.codecogs.com/png.latex?%5Ctexttt%7BMoments%3A%3Am%7D%5F%7Bji%7D) are computed as: @@ -16658,7 +16894,7 @@ pub mod core { } /// Constant methods for [core::ParallelLoopBody] - pub trait ParallelLoopBodyConst { + pub trait ParallelLoopBodyTraitConst { fn as_raw_ParallelLoopBody(&self) -> *const c_void; #[inline] @@ -16672,12 +16908,40 @@ pub mod core { } + /// Mutable methods for [core::ParallelLoopBody] + pub trait ParallelLoopBodyTrait: core::ParallelLoopBodyTraitConst { + fn as_raw_mut_ParallelLoopBody(&mut self) -> *mut c_void; + + } + /// Base class for parallel data processors /// /// @ingroup core_parallel - pub trait ParallelLoopBody: core::ParallelLoopBodyConst { - fn as_raw_mut_ParallelLoopBody(&mut self) -> *mut c_void; + pub struct ParallelLoopBody { + ptr: *mut c_void + } + + opencv_type_boxed! { ParallelLoopBody } + + impl Drop for ParallelLoopBody { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ParallelLoopBody_delete(instance: *mut c_void); } + unsafe { cv_ParallelLoopBody_delete(self.as_raw_mut_ParallelLoopBody()) }; + } + } + + unsafe impl Send for ParallelLoopBody {} + + impl core::ParallelLoopBodyTraitConst for ParallelLoopBody { + #[inline] fn as_raw_ParallelLoopBody(&self) -> *const c_void { self.as_raw() } + } + impl core::ParallelLoopBodyTrait for ParallelLoopBody { + #[inline] fn as_raw_mut_ParallelLoopBody(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ParallelLoopBody { } /// Constant methods for [core::RNG] @@ -19046,17 +19310,13 @@ pub mod core { boxed_cast_base! { SparseMatIterator, core::SparseMatConstIterator, cv_SparseMatIterator_to_SparseMatConstIterator } /// Constant methods for [core::TLSDataContainer] - pub trait TLSDataContainerConst { + pub trait TLSDataContainerTraitConst { fn as_raw_TLSDataContainer(&self) -> *const c_void; } - /// TLS container base implementation - /// - /// Don't use directly. - /// ## See also - /// TLSData, TLSDataAccumulator templates - pub trait TLSDataContainer: core::TLSDataContainerConst { + /// Mutable methods for [core::TLSDataContainer] + pub trait TLSDataContainerTrait: core::TLSDataContainerTraitConst { fn as_raw_mut_TLSDataContainer(&mut self) -> *mut c_void; #[inline] @@ -19070,6 +19330,38 @@ pub mod core { } + /// TLS container base implementation + /// + /// Don't use directly. + /// ## See also + /// TLSData, TLSDataAccumulator templates + pub struct TLSDataContainer { + ptr: *mut c_void + } + + opencv_type_boxed! { TLSDataContainer } + + impl Drop for TLSDataContainer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TLSDataContainer_delete(instance: *mut c_void); } + unsafe { cv_TLSDataContainer_delete(self.as_raw_mut_TLSDataContainer()) }; + } + } + + unsafe impl Send for TLSDataContainer {} + + impl core::TLSDataContainerTraitConst for TLSDataContainer { + #[inline] fn as_raw_TLSDataContainer(&self) -> *const c_void { self.as_raw() } + } + + impl core::TLSDataContainerTrait for TLSDataContainer { + #[inline] fn as_raw_mut_TLSDataContainer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TLSDataContainer { + } + /// The class defining termination criteria for iterative algorithms. /// /// You can initialize it by default constructor and then override any parameters, or the structure may @@ -21933,12 +22225,12 @@ pub mod core { /// Returns the allocator associated with the stream. #[inline] - fn get_allocator(&self) -> Result> { + fn get_allocator(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_BufferPool_getAllocator_const(self.as_raw_BufferPool(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -23459,15 +23751,15 @@ pub mod core { /// allocator #[inline] - fn allocator(&mut self) -> types::AbstractRefMut { + fn allocator(&mut self) -> core::GpuMat_Allocator { let ret = unsafe { sys::cv_cuda_GpuMat_getPropAllocator(self.as_raw_mut_GpuMat()) }; - let ret = unsafe { types::AbstractRefMut::::opencv_from_extern(ret) }; + let ret = unsafe { core::GpuMat_Allocator::opencv_from_extern(ret) }; ret } /// allocator #[inline] - unsafe fn set_allocator(&mut self, val: &mut dyn core::GpuMat_Allocator) { + unsafe fn set_allocator(&mut self, val: &mut core::GpuMat_Allocator) { let ret = { sys::cv_cuda_GpuMat_setPropAllocator_AllocatorX(self.as_raw_mut_GpuMat(), val.as_raw_mut_GpuMat_Allocator()) }; ret } @@ -23683,17 +23975,17 @@ pub mod core { impl GpuMat { /// default allocator #[inline] - pub fn default_allocator() -> Result> { + pub fn default_allocator() -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_GpuMat_defaultAllocator(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { types::AbstractRefMut::<'static, dyn core::GpuMat_Allocator>::opencv_from_extern(ret) }; + let ret = unsafe { core::GpuMat_Allocator::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub unsafe fn set_default_allocator(allocator: &mut dyn core::GpuMat_Allocator) -> Result<()> { + pub unsafe fn set_default_allocator(allocator: &mut core::GpuMat_Allocator) -> Result<()> { return_send!(via ocvrs_return); { sys::cv_cuda_GpuMat_setDefaultAllocator_AllocatorX(allocator.as_raw_mut_GpuMat_Allocator(), ocvrs_return.as_mut_ptr()) }; return_receive!(ocvrs_return => ret); @@ -23706,7 +23998,7 @@ pub mod core { /// ## C++ default parameters /// * allocator: GpuMat::defaultAllocator() #[inline] - pub unsafe fn new(allocator: &mut dyn core::GpuMat_Allocator) -> Result { + pub unsafe fn new(allocator: &mut core::GpuMat_Allocator) -> Result { return_send!(via ocvrs_return); { sys::cv_cuda_GpuMat_GpuMat_AllocatorX(allocator.as_raw_mut_GpuMat_Allocator(), ocvrs_return.as_mut_ptr()) }; return_receive!(ocvrs_return => ret); @@ -23720,7 +24012,7 @@ pub mod core { /// ## C++ default parameters /// * allocator: GpuMat::defaultAllocator() #[inline] - pub unsafe fn new_rows_cols(rows: i32, cols: i32, typ: i32, allocator: &mut dyn core::GpuMat_Allocator) -> Result { + pub unsafe fn new_rows_cols(rows: i32, cols: i32, typ: i32, allocator: &mut core::GpuMat_Allocator) -> Result { return_send!(via ocvrs_return); { sys::cv_cuda_GpuMat_GpuMat_int_int_int_AllocatorX(rows, cols, typ, allocator.as_raw_mut_GpuMat_Allocator(), ocvrs_return.as_mut_ptr()) }; return_receive!(ocvrs_return => ret); @@ -23732,7 +24024,7 @@ pub mod core { /// ## C++ default parameters /// * allocator: GpuMat::defaultAllocator() #[inline] - pub unsafe fn new_size(size: core::Size, typ: i32, allocator: &mut dyn core::GpuMat_Allocator) -> Result { + pub unsafe fn new_size(size: core::Size, typ: i32, allocator: &mut core::GpuMat_Allocator) -> Result { return_send!(via ocvrs_return); { sys::cv_cuda_GpuMat_GpuMat_Size_int_AllocatorX(size.opencv_as_extern(), typ, allocator.as_raw_mut_GpuMat_Allocator(), ocvrs_return.as_mut_ptr()) }; return_receive!(ocvrs_return => ret); @@ -23746,7 +24038,7 @@ pub mod core { /// ## C++ default parameters /// * allocator: GpuMat::defaultAllocator() #[inline] - pub unsafe fn new_rows_cols_with_default(rows: i32, cols: i32, typ: i32, s: core::Scalar, allocator: &mut dyn core::GpuMat_Allocator) -> Result { + pub unsafe fn new_rows_cols_with_default(rows: i32, cols: i32, typ: i32, s: core::Scalar, allocator: &mut core::GpuMat_Allocator) -> Result { return_send!(via ocvrs_return); { sys::cv_cuda_GpuMat_GpuMat_int_int_int_Scalar_AllocatorX(rows, cols, typ, s.opencv_as_extern(), allocator.as_raw_mut_GpuMat_Allocator(), ocvrs_return.as_mut_ptr()) }; return_receive!(ocvrs_return => ret); @@ -23758,7 +24050,7 @@ pub mod core { /// ## C++ default parameters /// * allocator: GpuMat::defaultAllocator() #[inline] - pub unsafe fn new_size_with_default(size: core::Size, typ: i32, s: core::Scalar, allocator: &mut dyn core::GpuMat_Allocator) -> Result { + pub unsafe fn new_size_with_default(size: core::Size, typ: i32, s: core::Scalar, allocator: &mut core::GpuMat_Allocator) -> Result { return_send!(via ocvrs_return); { sys::cv_cuda_GpuMat_GpuMat_Size_int_Scalar_AllocatorX(size.opencv_as_extern(), typ, s.opencv_as_extern(), allocator.as_raw_mut_GpuMat_Allocator(), ocvrs_return.as_mut_ptr()) }; return_receive!(ocvrs_return => ret); @@ -23830,7 +24122,7 @@ pub mod core { /// ## C++ default parameters /// * allocator: GpuMat::defaultAllocator() #[inline] - pub unsafe fn from_hostmem(arr: &dyn core::ToInputArray, allocator: &mut dyn core::GpuMat_Allocator) -> Result { + pub unsafe fn from_hostmem(arr: &dyn core::ToInputArray, allocator: &mut core::GpuMat_Allocator) -> Result { extern_container_arg!(arr); return_send!(via ocvrs_return); { sys::cv_cuda_GpuMat_GpuMat_const__InputArrayR_AllocatorX(arr.as_raw__InputArray(), allocator.as_raw_mut_GpuMat_Allocator(), ocvrs_return.as_mut_ptr()) }; @@ -23851,12 +24143,13 @@ pub mod core { } /// Constant methods for [core::GpuMat_Allocator] - pub trait GpuMat_AllocatorConst { + pub trait GpuMat_AllocatorTraitConst { fn as_raw_GpuMat_Allocator(&self) -> *const c_void; } - pub trait GpuMat_Allocator: core::GpuMat_AllocatorConst { + /// Mutable methods for [core::GpuMat_Allocator] + pub trait GpuMat_AllocatorTrait: core::GpuMat_AllocatorTraitConst { fn as_raw_mut_GpuMat_Allocator(&mut self) -> *mut c_void; #[inline] @@ -23879,6 +24172,33 @@ pub mod core { } + pub struct GpuMat_Allocator { + ptr: *mut c_void + } + + opencv_type_boxed! { GpuMat_Allocator } + + impl Drop for GpuMat_Allocator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GpuMat_Allocator_delete(instance: *mut c_void); } + unsafe { cv_GpuMat_Allocator_delete(self.as_raw_mut_GpuMat_Allocator()) }; + } + } + + unsafe impl Send for GpuMat_Allocator {} + + impl core::GpuMat_AllocatorTraitConst for GpuMat_Allocator { + #[inline] fn as_raw_GpuMat_Allocator(&self) -> *const c_void { self.as_raw() } + } + + impl core::GpuMat_AllocatorTrait for GpuMat_Allocator { + #[inline] fn as_raw_mut_GpuMat_Allocator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GpuMat_Allocator { + } + /// Constant methods for [core::GpuMatND] pub trait GpuMatNDTraitConst { fn as_raw_GpuMatND(&self) -> *const c_void; @@ -24892,7 +25212,7 @@ pub mod core { /// creates a new asynchronous stream with custom allocator #[inline] - pub fn new(allocator: &core::Ptr) -> Result { + pub fn new(allocator: &core::Ptr) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_Stream_Stream_const_PtrLAllocatorGR(allocator.as_raw_PtrOfGpuMat_Allocator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); diff --git a/docs/cudaarithm.rs b/docs/cudaarithm.rs index 569412091..8643181c1 100644 --- a/docs/cudaarithm.rs +++ b/docs/cudaarithm.rs @@ -6,7 +6,7 @@ pub mod cudaarithm { //! # Arithm Operations on Matrices use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::LookUpTableConst, super::LookUpTable, super::DFTConst, super::DFT, super::ConvolutionConst, super::Convolution }; + pub use { super::LookUpTableTraitConst, super::LookUpTableTrait, super::DFTTraitConst, super::DFTTrait, super::ConvolutionTraitConst, super::ConvolutionTrait }; } /// Returns the sum of absolute values for matrix elements. @@ -470,12 +470,12 @@ pub mod cudaarithm { /// ## C++ default parameters /// * user_block_size: Size() #[inline] - pub fn create_convolution(user_block_size: core::Size) -> Result> { + pub fn create_convolution(user_block_size: core::Size) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createConvolution_Size(user_block_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -493,12 +493,12 @@ pub mod cudaarithm { /// * **DFT_REAL_OUTPUT** specifies the output as real. The source matrix is the result of /// real-complex transform, so the destination matrix must be real. #[inline] - pub fn create_dft(dft_size: core::Size, flags: i32) -> Result> { + pub fn create_dft(dft_size: core::Size, flags: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createDFT_Size_int(dft_size.opencv_as_extern(), flags, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -507,13 +507,13 @@ pub mod cudaarithm { /// ## Parameters /// * lut: Look-up table of 256 elements. It is a continuous CV_8U matrix. #[inline] - pub fn create_look_up_table(lut: &dyn core::ToInputArray) -> Result> { + pub fn create_look_up_table(lut: &dyn core::ToInputArray) -> Result> { extern_container_arg!(lut); return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createLookUpTable_const__InputArrayR(lut.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1766,13 +1766,13 @@ pub mod cudaarithm { } /// Constant methods for [crate::cudaarithm::Convolution] - pub trait ConvolutionConst: core::AlgorithmTraitConst { + pub trait ConvolutionTraitConst: core::AlgorithmTraitConst { fn as_raw_Convolution(&self) -> *const c_void; } - /// Base class for convolution (or cross-correlation) operator. : - pub trait Convolution: core::AlgorithmTrait + crate::cudaarithm::ConvolutionConst { + /// Mutable methods for [crate::cudaarithm::Convolution] + pub trait ConvolutionTrait: core::AlgorithmTrait + crate::cudaarithm::ConvolutionTraitConst { fn as_raw_mut_Convolution(&mut self) -> *mut c_void; /// Computes a convolution (or cross-correlation) of two images. @@ -1803,14 +1803,52 @@ pub mod cudaarithm { } + /// Base class for convolution (or cross-correlation) operator. : + pub struct Convolution { + ptr: *mut c_void + } + + opencv_type_boxed! { Convolution } + + impl Drop for Convolution { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Convolution_delete(instance: *mut c_void); } + unsafe { cv_Convolution_delete(self.as_raw_mut_Convolution()) }; + } + } + + unsafe impl Send for Convolution {} + + impl core::AlgorithmTraitConst for Convolution { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Convolution { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaarithm::ConvolutionTraitConst for Convolution { + #[inline] fn as_raw_Convolution(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaarithm::ConvolutionTrait for Convolution { + #[inline] fn as_raw_mut_Convolution(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Convolution { + } + + boxed_cast_base! { Convolution, core::Algorithm, cv_Convolution_to_Algorithm } + /// Constant methods for [crate::cudaarithm::DFT] - pub trait DFTConst: core::AlgorithmTraitConst { + pub trait DFTTraitConst: core::AlgorithmTraitConst { fn as_raw_DFT(&self) -> *const c_void; } - /// Base class for DFT operator as a cv::Algorithm. : - pub trait DFT: core::AlgorithmTrait + crate::cudaarithm::DFTConst { + /// Mutable methods for [crate::cudaarithm::DFT] + pub trait DFTTrait: core::AlgorithmTrait + crate::cudaarithm::DFTTraitConst { fn as_raw_mut_DFT(&mut self) -> *mut c_void; /// Computes an FFT of a given image. @@ -1835,14 +1873,52 @@ pub mod cudaarithm { } + /// Base class for DFT operator as a cv::Algorithm. : + pub struct DFT { + ptr: *mut c_void + } + + opencv_type_boxed! { DFT } + + impl Drop for DFT { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DFT_delete(instance: *mut c_void); } + unsafe { cv_DFT_delete(self.as_raw_mut_DFT()) }; + } + } + + unsafe impl Send for DFT {} + + impl core::AlgorithmTraitConst for DFT { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DFT { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaarithm::DFTTraitConst for DFT { + #[inline] fn as_raw_DFT(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaarithm::DFTTrait for DFT { + #[inline] fn as_raw_mut_DFT(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DFT { + } + + boxed_cast_base! { DFT, core::Algorithm, cv_DFT_to_Algorithm } + /// Constant methods for [crate::cudaarithm::LookUpTable] - pub trait LookUpTableConst: core::AlgorithmTraitConst { + pub trait LookUpTableTraitConst: core::AlgorithmTraitConst { fn as_raw_LookUpTable(&self) -> *const c_void; } - /// Base class for transform using lookup table. - pub trait LookUpTable: core::AlgorithmTrait + crate::cudaarithm::LookUpTableConst { + /// Mutable methods for [crate::cudaarithm::LookUpTable] + pub trait LookUpTableTrait: core::AlgorithmTrait + crate::cudaarithm::LookUpTableTraitConst { fn as_raw_mut_LookUpTable(&mut self) -> *mut c_void; /// Transforms the source matrix into the destination matrix using the given look-up table: @@ -1867,4 +1943,42 @@ pub mod cudaarithm { } } + + /// Base class for transform using lookup table. + pub struct LookUpTable { + ptr: *mut c_void + } + + opencv_type_boxed! { LookUpTable } + + impl Drop for LookUpTable { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LookUpTable_delete(instance: *mut c_void); } + unsafe { cv_LookUpTable_delete(self.as_raw_mut_LookUpTable()) }; + } + } + + unsafe impl Send for LookUpTable {} + + impl core::AlgorithmTraitConst for LookUpTable { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LookUpTable { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaarithm::LookUpTableTraitConst for LookUpTable { + #[inline] fn as_raw_LookUpTable(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaarithm::LookUpTableTrait for LookUpTable { + #[inline] fn as_raw_mut_LookUpTable(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LookUpTable { + } + + boxed_cast_base! { LookUpTable, core::Algorithm, cv_LookUpTable_to_Algorithm } } diff --git a/docs/cudabgsegm.rs b/docs/cudabgsegm.rs index 52bf7d849..74f254e26 100644 --- a/docs/cudabgsegm.rs +++ b/docs/cudabgsegm.rs @@ -2,7 +2,7 @@ pub mod cudabgsegm { //! # Background Segmentation use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::CUDA_BackgroundSubtractorMOGConst, super::CUDA_BackgroundSubtractorMOG, super::CUDA_BackgroundSubtractorMOG2Const, super::CUDA_BackgroundSubtractorMOG2 }; + pub use { super::CUDA_BackgroundSubtractorMOGTraitConst, super::CUDA_BackgroundSubtractorMOGTrait, super::CUDA_BackgroundSubtractorMOG2TraitConst, super::CUDA_BackgroundSubtractorMOG2Trait }; } /// Creates MOG2 Background Subtractor @@ -20,12 +20,12 @@ pub mod cudabgsegm { /// * var_threshold: 16 /// * detect_shadows: true #[inline] - pub fn create_background_subtractor_mog2(history: i32, var_threshold: f64, detect_shadows: bool) -> Result> { + pub fn create_background_subtractor_mog2(history: i32, var_threshold: f64, detect_shadows: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createBackgroundSubtractorMOG2_int_double_bool(history, var_threshold, detect_shadows, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -44,17 +44,17 @@ pub mod cudabgsegm { /// * background_ratio: 0.7 /// * noise_sigma: 0 #[inline] - pub fn create_background_subtractor_mog(history: i32, nmixtures: i32, background_ratio: f64, noise_sigma: f64) -> Result> { + pub fn create_background_subtractor_mog(history: i32, nmixtures: i32, background_ratio: f64, noise_sigma: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createBackgroundSubtractorMOG_int_int_double_double(history, nmixtures, background_ratio, noise_sigma, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Constant methods for [crate::cudabgsegm::CUDA_BackgroundSubtractorMOG] - pub trait CUDA_BackgroundSubtractorMOGConst: crate::video::BackgroundSubtractorConst { + pub trait CUDA_BackgroundSubtractorMOGTraitConst: crate::video::BackgroundSubtractorTraitConst { fn as_raw_CUDA_BackgroundSubtractorMOG(&self) -> *const c_void; #[inline] @@ -105,19 +105,8 @@ pub mod cudabgsegm { } - /// Gaussian Mixture-based Background/Foreground Segmentation Algorithm. - /// - /// The class discriminates between foreground and background pixels by building and maintaining a model - /// of the background. Any pixel which does not fit this model is then deemed to be foreground. The - /// class implements algorithm described in [MOG2001](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_MOG2001) . - /// ## See also - /// BackgroundSubtractorMOG - /// - /// - /// Note: - /// * An example on gaussian mixture based background/foreground segmantation can be found at - /// opencv_source_code/samples/gpu/bgfg_segm.cpp - pub trait CUDA_BackgroundSubtractorMOG: crate::cudabgsegm::CUDA_BackgroundSubtractorMOGConst + crate::video::BackgroundSubtractor { + /// Mutable methods for [crate::cudabgsegm::CUDA_BackgroundSubtractorMOG] + pub trait CUDA_BackgroundSubtractorMOGTrait: crate::cudabgsegm::CUDA_BackgroundSubtractorMOGTraitConst + crate::video::BackgroundSubtractorTrait { fn as_raw_mut_CUDA_BackgroundSubtractorMOG(&mut self) -> *mut c_void; #[inline] @@ -178,8 +167,65 @@ pub mod cudabgsegm { } + /// Gaussian Mixture-based Background/Foreground Segmentation Algorithm. + /// + /// The class discriminates between foreground and background pixels by building and maintaining a model + /// of the background. Any pixel which does not fit this model is then deemed to be foreground. The + /// class implements algorithm described in [MOG2001](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_MOG2001) . + /// ## See also + /// BackgroundSubtractorMOG + /// + /// + /// Note: + /// * An example on gaussian mixture based background/foreground segmantation can be found at + /// opencv_source_code/samples/gpu/bgfg_segm.cpp + pub struct CUDA_BackgroundSubtractorMOG { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_BackgroundSubtractorMOG } + + impl Drop for CUDA_BackgroundSubtractorMOG { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_BackgroundSubtractorMOG_delete(instance: *mut c_void); } + unsafe { cv_CUDA_BackgroundSubtractorMOG_delete(self.as_raw_mut_CUDA_BackgroundSubtractorMOG()) }; + } + } + + unsafe impl Send for CUDA_BackgroundSubtractorMOG {} + + impl core::AlgorithmTraitConst for CUDA_BackgroundSubtractorMOG { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_BackgroundSubtractorMOG { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for CUDA_BackgroundSubtractorMOG { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for CUDA_BackgroundSubtractorMOG { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOGTraitConst for CUDA_BackgroundSubtractorMOG { + #[inline] fn as_raw_CUDA_BackgroundSubtractorMOG(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOGTrait for CUDA_BackgroundSubtractorMOG { + #[inline] fn as_raw_mut_CUDA_BackgroundSubtractorMOG(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_BackgroundSubtractorMOG { + } + + boxed_cast_base! { CUDA_BackgroundSubtractorMOG, core::Algorithm, cv_CUDA_BackgroundSubtractorMOG_to_Algorithm } + /// Constant methods for [crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2] - pub trait CUDA_BackgroundSubtractorMOG2Const: crate::video::BackgroundSubtractorMOG2Const { + pub trait CUDA_BackgroundSubtractorMOG2TraitConst: crate::video::BackgroundSubtractorMOG2TraitConst { fn as_raw_CUDA_BackgroundSubtractorMOG2(&self) -> *const c_void; #[inline] @@ -194,14 +240,8 @@ pub mod cudabgsegm { } - /// Gaussian Mixture-based Background/Foreground Segmentation Algorithm. - /// - /// The class discriminates between foreground and background pixels by building and maintaining a model - /// of the background. Any pixel which does not fit this model is then deemed to be foreground. The - /// class implements algorithm described in [Zivkovic2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zivkovic2004) . - /// ## See also - /// BackgroundSubtractorMOG2 - pub trait CUDA_BackgroundSubtractorMOG2: crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2Const + crate::video::BackgroundSubtractorMOG2 { + /// Mutable methods for [crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2] + pub trait CUDA_BackgroundSubtractorMOG2Trait: crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2TraitConst + crate::video::BackgroundSubtractorMOG2Trait { fn as_raw_mut_CUDA_BackgroundSubtractorMOG2(&mut self) -> *mut c_void; #[inline] @@ -225,4 +265,64 @@ pub mod cudabgsegm { } } + + /// Gaussian Mixture-based Background/Foreground Segmentation Algorithm. + /// + /// The class discriminates between foreground and background pixels by building and maintaining a model + /// of the background. Any pixel which does not fit this model is then deemed to be foreground. The + /// class implements algorithm described in [Zivkovic2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zivkovic2004) . + /// ## See also + /// BackgroundSubtractorMOG2 + pub struct CUDA_BackgroundSubtractorMOG2 { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_BackgroundSubtractorMOG2 } + + impl Drop for CUDA_BackgroundSubtractorMOG2 { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_BackgroundSubtractorMOG2_delete(instance: *mut c_void); } + unsafe { cv_CUDA_BackgroundSubtractorMOG2_delete(self.as_raw_mut_CUDA_BackgroundSubtractorMOG2()) }; + } + } + + unsafe impl Send for CUDA_BackgroundSubtractorMOG2 {} + + impl core::AlgorithmTraitConst for CUDA_BackgroundSubtractorMOG2 { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_BackgroundSubtractorMOG2 { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for CUDA_BackgroundSubtractorMOG2 { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for CUDA_BackgroundSubtractorMOG2 { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorMOG2TraitConst for CUDA_BackgroundSubtractorMOG2 { + #[inline] fn as_raw_BackgroundSubtractorMOG2(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorMOG2Trait for CUDA_BackgroundSubtractorMOG2 { + #[inline] fn as_raw_mut_BackgroundSubtractorMOG2(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2TraitConst for CUDA_BackgroundSubtractorMOG2 { + #[inline] fn as_raw_CUDA_BackgroundSubtractorMOG2(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2Trait for CUDA_BackgroundSubtractorMOG2 { + #[inline] fn as_raw_mut_CUDA_BackgroundSubtractorMOG2(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_BackgroundSubtractorMOG2 { + } + + boxed_cast_base! { CUDA_BackgroundSubtractorMOG2, core::Algorithm, cv_CUDA_BackgroundSubtractorMOG2_to_Algorithm } } diff --git a/docs/cudacodec.rs b/docs/cudacodec.rs index 99c88bef0..12cc96dee 100644 --- a/docs/cudacodec.rs +++ b/docs/cudacodec.rs @@ -2,7 +2,7 @@ pub mod cudacodec { //! # Video Encoding/Decoding use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::EncoderCallbackConst, super::EncoderCallback, super::VideoWriterConst, super::VideoWriter, super::VideoReaderConst, super::VideoReader, super::RawVideoSourceConst, super::RawVideoSource }; + pub use { super::EncoderCallbackTraitConst, super::EncoderCallbackTrait, super::VideoWriterTraitConst, super::VideoWriterTrait, super::VideoReaderTraitConst, super::VideoReaderTrait, super::RawVideoSourceTraitConst, super::RawVideoSourceTrait }; } pub const AV1: i32 = 11; @@ -338,12 +338,12 @@ pub mod cudacodec { /// ## C++ default parameters /// * params: VideoReaderInitParams() #[inline] - pub fn create_video_reader_1(source: &core::Ptr, params: crate::cudacodec::VideoReaderInitParams) -> Result> { + pub fn create_video_reader_1(source: &core::Ptr, params: crate::cudacodec::VideoReaderInitParams) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cudacodec_createVideoReader_const_PtrLRawVideoSourceGR_const_VideoReaderInitParams(source.as_raw_PtrOfRawVideoSource(), params.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -363,13 +363,13 @@ pub mod cudacodec { /// * source_params: {} /// * params: VideoReaderInitParams() #[inline] - pub fn create_video_reader(filename: &str, source_params: &core::Vector, params: crate::cudacodec::VideoReaderInitParams) -> Result> { + pub fn create_video_reader(filename: &str, source_params: &core::Vector, params: crate::cudacodec::VideoReaderInitParams) -> Result> { extern_container_arg!(filename); return_send!(via ocvrs_return); unsafe { sys::cv_cudacodec_createVideoReader_const_StringR_const_vectorLintGR_const_VideoReaderInitParams(filename.opencv_as_extern(), source_params.as_raw_VectorOfi32(), params.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -391,13 +391,13 @@ pub mod cudacodec { /// * encoder_callback: 0 /// * stream: Stream::Null() #[inline] - pub fn create_video_writer(file_name: &str, frame_size: core::Size, codec: crate::cudacodec::Codec, fps: f64, color_format: crate::cudacodec::ColorFormat, mut encoder_callback: core::Ptr, stream: &core::Stream) -> Result> { + pub fn create_video_writer(file_name: &str, frame_size: core::Size, codec: crate::cudacodec::Codec, fps: f64, color_format: crate::cudacodec::ColorFormat, mut encoder_callback: core::Ptr, stream: &core::Stream) -> Result> { extern_container_arg!(file_name); return_send!(via ocvrs_return); unsafe { sys::cv_cudacodec_createVideoWriter_const_StringR_const_Size_const_Codec_const_double_const_ColorFormat_PtrLEncoderCallbackG_const_StreamR(file_name.opencv_as_extern(), frame_size.opencv_as_extern(), codec, fps, color_format, encoder_callback.as_raw_mut_PtrOfEncoderCallback(), stream.as_raw_Stream(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -417,13 +417,13 @@ pub mod cudacodec { /// * encoder_callback: 0 /// * stream: Stream::Null() #[inline] - pub fn create_video_writer_1(file_name: &str, frame_size: core::Size, codec: crate::cudacodec::Codec, fps: f64, color_format: crate::cudacodec::ColorFormat, params: crate::cudacodec::EncoderParams, mut encoder_callback: core::Ptr, stream: &core::Stream) -> Result> { + pub fn create_video_writer_1(file_name: &str, frame_size: core::Size, codec: crate::cudacodec::Codec, fps: f64, color_format: crate::cudacodec::ColorFormat, params: crate::cudacodec::EncoderParams, mut encoder_callback: core::Ptr, stream: &core::Stream) -> Result> { extern_container_arg!(file_name); return_send!(via ocvrs_return); unsafe { sys::cv_cudacodec_createVideoWriter_const_StringR_const_Size_const_Codec_const_double_const_ColorFormat_const_EncoderParamsR_PtrLEncoderCallbackG_const_StreamR(file_name.opencv_as_extern(), frame_size.opencv_as_extern(), codec, fps, color_format, ¶ms, encoder_callback.as_raw_mut_PtrOfEncoderCallback(), stream.as_raw_Stream(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -454,15 +454,13 @@ pub mod cudacodec { } /// Constant methods for [crate::cudacodec::EncoderCallback] - pub trait EncoderCallbackConst { + pub trait EncoderCallbackTraitConst { fn as_raw_EncoderCallback(&self) -> *const c_void; } - /// Interface for encoder callbacks. - /// - /// User can implement own multiplexing by implementing this interface. - pub trait EncoderCallback: crate::cudacodec::EncoderCallbackConst { + /// Mutable methods for [crate::cudacodec::EncoderCallback] + pub trait EncoderCallbackTrait: crate::cudacodec::EncoderCallbackTraitConst { fn as_raw_mut_EncoderCallback(&mut self) -> *mut c_void; /// Callback function to signal that the encoded bitstream for one or more frames is ready. @@ -490,6 +488,36 @@ pub mod cudacodec { } + /// Interface for encoder callbacks. + /// + /// User can implement own multiplexing by implementing this interface. + pub struct EncoderCallback { + ptr: *mut c_void + } + + opencv_type_boxed! { EncoderCallback } + + impl Drop for EncoderCallback { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_EncoderCallback_delete(instance: *mut c_void); } + unsafe { cv_EncoderCallback_delete(self.as_raw_mut_EncoderCallback()) }; + } + } + + unsafe impl Send for EncoderCallback {} + + impl crate::cudacodec::EncoderCallbackTraitConst for EncoderCallback { + #[inline] fn as_raw_EncoderCallback(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudacodec::EncoderCallbackTrait for EncoderCallback { + #[inline] fn as_raw_mut_EncoderCallback(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl EncoderCallback { + } + /// Different parameters for CUDA video encoder. #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq)] @@ -571,7 +599,7 @@ pub mod cudacodec { } /// Constant methods for [crate::cudacodec::RawVideoSource] - pub trait RawVideoSourceConst { + pub trait RawVideoSourceTraitConst { fn as_raw_RawVideoSource(&self) -> *const c_void; /// Returns true if the last packet contained a key frame. @@ -627,10 +655,8 @@ pub mod cudacodec { } - /// Interface for video demultiplexing. : - /// - /// User can implement own demultiplexing by implementing this interface. - pub trait RawVideoSource: crate::cudacodec::RawVideoSourceConst { + /// Mutable methods for [crate::cudacodec::RawVideoSource] + pub trait RawVideoSourceTrait: crate::cudacodec::RawVideoSourceTraitConst { fn as_raw_mut_RawVideoSource(&mut self) -> *mut c_void; /// Returns next packet with RAW video frame. @@ -659,8 +685,38 @@ pub mod cudacodec { } + /// Interface for video demultiplexing. : + /// + /// User can implement own demultiplexing by implementing this interface. + pub struct RawVideoSource { + ptr: *mut c_void + } + + opencv_type_boxed! { RawVideoSource } + + impl Drop for RawVideoSource { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_RawVideoSource_delete(instance: *mut c_void); } + unsafe { cv_RawVideoSource_delete(self.as_raw_mut_RawVideoSource()) }; + } + } + + unsafe impl Send for RawVideoSource {} + + impl crate::cudacodec::RawVideoSourceTraitConst for RawVideoSource { + #[inline] fn as_raw_RawVideoSource(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudacodec::RawVideoSourceTrait for RawVideoSource { + #[inline] fn as_raw_mut_RawVideoSource(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl RawVideoSource { + } + /// Constant methods for [crate::cudacodec::VideoReader] - pub trait VideoReaderConst { + pub trait VideoReaderTraitConst { fn as_raw_VideoReader(&self) -> *const c_void; /// Returns information about video file format. @@ -788,17 +844,8 @@ pub mod cudacodec { } - /// Video reader interface. - /// - /// Available when built with WITH_NVCUVID=ON while Nvidia's Video Codec SDK is installed. - /// - /// Decoding support is dependent on the GPU, refer to the Nvidia Video Codec SDK Video Encode and Decode GPU Support Matrix for details. - /// - /// - /// Note: - /// * An example on how to use the videoReader class can be found at - /// opencv_source_code/samples/gpu/video_reader.cpp - pub trait VideoReader: crate::cudacodec::VideoReaderConst { + /// Mutable methods for [crate::cudacodec::VideoReader] + pub trait VideoReaderTrait: crate::cudacodec::VideoReaderTraitConst { fn as_raw_mut_VideoReader(&mut self) -> *mut c_void; /// Grabs, decodes and returns the next video frame. @@ -890,6 +937,43 @@ pub mod cudacodec { } + /// Video reader interface. + /// + /// Available when built with WITH_NVCUVID=ON while Nvidia's Video Codec SDK is installed. + /// + /// Decoding support is dependent on the GPU, refer to the Nvidia Video Codec SDK Video Encode and Decode GPU Support Matrix for details. + /// + /// + /// Note: + /// * An example on how to use the videoReader class can be found at + /// opencv_source_code/samples/gpu/video_reader.cpp + pub struct VideoReader { + ptr: *mut c_void + } + + opencv_type_boxed! { VideoReader } + + impl Drop for VideoReader { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_VideoReader_delete(instance: *mut c_void); } + unsafe { cv_VideoReader_delete(self.as_raw_mut_VideoReader()) }; + } + } + + unsafe impl Send for VideoReader {} + + impl crate::cudacodec::VideoReaderTraitConst for VideoReader { + #[inline] fn as_raw_VideoReader(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudacodec::VideoReaderTrait for VideoReader { + #[inline] fn as_raw_mut_VideoReader(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl VideoReader { + } + /// VideoReader initialization parameters /// ## Parameters /// * udpSource: Remove validation which can cause VideoReader() to throw exceptions when reading from a UDP source. @@ -932,7 +1016,7 @@ pub mod cudacodec { } /// Constant methods for [crate::cudacodec::VideoWriter] - pub trait VideoWriterConst { + pub trait VideoWriterTraitConst { fn as_raw_VideoWriter(&self) -> *const c_void; /// Retrieve the encoding parameters. @@ -947,17 +1031,8 @@ pub mod cudacodec { } - /// Video writer interface. - /// - /// Available when built with WITH_NVCUVENC=ON while Nvidia's Video Codec SDK is installed. - /// - /// Encoding support is dependent on the GPU, refer to the Nvidia Video Codec SDK Video Encode and Decode GPU Support Matrix for details. - /// - /// - /// Note: - /// * An example on how to use the videoWriter class can be found at - /// opencv_source_code/samples/gpu/video_writer.cpp - pub trait VideoWriter: crate::cudacodec::VideoWriterConst { + /// Mutable methods for [crate::cudacodec::VideoWriter] + pub trait VideoWriterTrait: crate::cudacodec::VideoWriterTraitConst { fn as_raw_mut_VideoWriter(&mut self) -> *mut c_void; /// Writes the next video frame. @@ -988,4 +1063,41 @@ pub mod cudacodec { } } + + /// Video writer interface. + /// + /// Available when built with WITH_NVCUVENC=ON while Nvidia's Video Codec SDK is installed. + /// + /// Encoding support is dependent on the GPU, refer to the Nvidia Video Codec SDK Video Encode and Decode GPU Support Matrix for details. + /// + /// + /// Note: + /// * An example on how to use the videoWriter class can be found at + /// opencv_source_code/samples/gpu/video_writer.cpp + pub struct VideoWriter { + ptr: *mut c_void + } + + opencv_type_boxed! { VideoWriter } + + impl Drop for VideoWriter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_VideoWriter_delete(instance: *mut c_void); } + unsafe { cv_VideoWriter_delete(self.as_raw_mut_VideoWriter()) }; + } + } + + unsafe impl Send for VideoWriter {} + + impl crate::cudacodec::VideoWriterTraitConst for VideoWriter { + #[inline] fn as_raw_VideoWriter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudacodec::VideoWriterTrait for VideoWriter { + #[inline] fn as_raw_mut_VideoWriter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl VideoWriter { + } } diff --git a/docs/cudafeatures2d.rs b/docs/cudafeatures2d.rs index 1bb3e7e0d..bde5dbab0 100644 --- a/docs/cudafeatures2d.rs +++ b/docs/cudafeatures2d.rs @@ -2,11 +2,11 @@ pub mod cudafeatures2d { //! # Feature Detection and Description use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::CUDA_DescriptorMatcherConst, super::CUDA_DescriptorMatcher, super::CUDA_Feature2DAsyncConst, super::CUDA_Feature2DAsync, super::CUDA_FastFeatureDetectorConst, super::CUDA_FastFeatureDetector, super::CUDA_ORBConst, super::CUDA_ORB }; + pub use { super::CUDA_DescriptorMatcherTraitConst, super::CUDA_DescriptorMatcherTrait, super::CUDA_Feature2DAsyncTraitConst, super::CUDA_Feature2DAsyncTrait, super::CUDA_FastFeatureDetectorTraitConst, super::CUDA_FastFeatureDetectorTrait, super::CUDA_ORBTraitConst, super::CUDA_ORBTrait }; } /// Constant methods for [crate::cudafeatures2d::CUDA_DescriptorMatcher] - pub trait CUDA_DescriptorMatcherConst: core::AlgorithmTraitConst { + pub trait CUDA_DescriptorMatcherTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_DescriptorMatcher(&self) -> *const c_void; /// Returns true if the descriptor matcher supports masking permissible matches. @@ -42,11 +42,8 @@ pub mod cudafeatures2d { } - /// Abstract base class for matching keypoint descriptors. - /// - /// It has two groups of match methods: for matching descriptors of an image with another image or with - /// an image set. - pub trait CUDA_DescriptorMatcher: core::AlgorithmTrait + crate::cudafeatures2d::CUDA_DescriptorMatcherConst { + /// Mutable methods for [crate::cudafeatures2d::CUDA_DescriptorMatcher] + pub trait CUDA_DescriptorMatcherTrait: core::AlgorithmTrait + crate::cudafeatures2d::CUDA_DescriptorMatcherTraitConst { fn as_raw_mut_CUDA_DescriptorMatcher(&mut self) -> *mut c_void; /// Adds descriptors to train a descriptor collection. @@ -562,7 +559,43 @@ pub mod cudafeatures2d { } - impl dyn CUDA_DescriptorMatcher + '_ { + /// Abstract base class for matching keypoint descriptors. + /// + /// It has two groups of match methods: for matching descriptors of an image with another image or with + /// an image set. + pub struct CUDA_DescriptorMatcher { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_DescriptorMatcher } + + impl Drop for CUDA_DescriptorMatcher { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_DescriptorMatcher_delete(instance: *mut c_void); } + unsafe { cv_CUDA_DescriptorMatcher_delete(self.as_raw_mut_CUDA_DescriptorMatcher()) }; + } + } + + unsafe impl Send for CUDA_DescriptorMatcher {} + + impl core::AlgorithmTraitConst for CUDA_DescriptorMatcher { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_DescriptorMatcher { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudafeatures2d::CUDA_DescriptorMatcherTraitConst for CUDA_DescriptorMatcher { + #[inline] fn as_raw_CUDA_DescriptorMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudafeatures2d::CUDA_DescriptorMatcherTrait for CUDA_DescriptorMatcher { + #[inline] fn as_raw_mut_CUDA_DescriptorMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_DescriptorMatcher { /// Brute-force descriptor matcher. /// /// For each descriptor in the first set, this matcher finds the closest descriptor in the second set @@ -577,18 +610,21 @@ pub mod cudafeatures2d { /// ## C++ default parameters /// * norm_type: cv::NORM_L2 #[inline] - pub fn create_bf_matcher(norm_type: i32) -> Result> { + pub fn create_bf_matcher(norm_type: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_DescriptorMatcher_createBFMatcher_int(norm_type, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { CUDA_DescriptorMatcher, core::Algorithm, cv_CUDA_DescriptorMatcher_to_Algorithm } + /// Constant methods for [crate::cudafeatures2d::CUDA_FastFeatureDetector] - pub trait CUDA_FastFeatureDetectorConst: crate::cudafeatures2d::CUDA_Feature2DAsyncConst { + pub trait CUDA_FastFeatureDetectorTraitConst: crate::cudafeatures2d::CUDA_Feature2DAsyncTraitConst { fn as_raw_CUDA_FastFeatureDetector(&self) -> *const c_void; #[inline] @@ -602,8 +638,8 @@ pub mod cudafeatures2d { } - /// Wrapping class for feature detection using the FAST method. - pub trait CUDA_FastFeatureDetector: crate::cudafeatures2d::CUDA_FastFeatureDetectorConst + crate::cudafeatures2d::CUDA_Feature2DAsync { + /// Mutable methods for [crate::cudafeatures2d::CUDA_FastFeatureDetector] + pub trait CUDA_FastFeatureDetectorTrait: crate::cudafeatures2d::CUDA_FastFeatureDetectorTraitConst + crate::cudafeatures2d::CUDA_Feature2DAsyncTrait { fn as_raw_mut_CUDA_FastFeatureDetector(&mut self) -> *mut c_void; #[inline] @@ -626,7 +662,56 @@ pub mod cudafeatures2d { } - impl dyn CUDA_FastFeatureDetector + '_ { + /// Wrapping class for feature detection using the FAST method. + pub struct CUDA_FastFeatureDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_FastFeatureDetector } + + impl Drop for CUDA_FastFeatureDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_FastFeatureDetector_delete(instance: *mut c_void); } + unsafe { cv_CUDA_FastFeatureDetector_delete(self.as_raw_mut_CUDA_FastFeatureDetector()) }; + } + } + + unsafe impl Send for CUDA_FastFeatureDetector {} + + impl core::AlgorithmTraitConst for CUDA_FastFeatureDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_FastFeatureDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for CUDA_FastFeatureDetector { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for CUDA_FastFeatureDetector { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTraitConst for CUDA_FastFeatureDetector { + #[inline] fn as_raw_CUDA_Feature2DAsync(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTrait for CUDA_FastFeatureDetector { + #[inline] fn as_raw_mut_CUDA_Feature2DAsync(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudafeatures2d::CUDA_FastFeatureDetectorTraitConst for CUDA_FastFeatureDetector { + #[inline] fn as_raw_CUDA_FastFeatureDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudafeatures2d::CUDA_FastFeatureDetectorTrait for CUDA_FastFeatureDetector { + #[inline] fn as_raw_mut_CUDA_FastFeatureDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_FastFeatureDetector { pub const LOCATION_ROW: i32 = 0; pub const RESPONSE_ROW: i32 = 1; pub const ROWS_COUNT: i32 = 2; @@ -637,24 +722,29 @@ pub mod cudafeatures2d { /// * typ: cv::FastFeatureDetector::TYPE_9_16 /// * max_npoints: 5000 #[inline] - pub fn create(threshold: i32, nonmax_suppression: bool, typ: i32, max_npoints: i32) -> Result> { + pub fn create(threshold: i32, nonmax_suppression: bool, typ: i32, max_npoints: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_FastFeatureDetector_create_int_bool_int_int(threshold, nonmax_suppression, typ, max_npoints, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { CUDA_FastFeatureDetector, core::Algorithm, cv_CUDA_FastFeatureDetector_to_Algorithm } + + boxed_cast_base! { CUDA_FastFeatureDetector, crate::features2d::Feature2D, cv_CUDA_FastFeatureDetector_to_Feature2D } + /// Constant methods for [crate::cudafeatures2d::CUDA_Feature2DAsync] - pub trait CUDA_Feature2DAsyncConst: crate::features2d::Feature2DTraitConst { + pub trait CUDA_Feature2DAsyncTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_CUDA_Feature2DAsync(&self) -> *const c_void; } - /// Abstract base class for CUDA asynchronous 2D image feature detectors and descriptor extractors. - pub trait CUDA_Feature2DAsync: crate::cudafeatures2d::CUDA_Feature2DAsyncConst + crate::features2d::Feature2DTrait { + /// Mutable methods for [crate::cudafeatures2d::CUDA_Feature2DAsync] + pub trait CUDA_Feature2DAsyncTrait: crate::cudafeatures2d::CUDA_Feature2DAsyncTraitConst + crate::features2d::Feature2DTrait { fn as_raw_mut_CUDA_Feature2DAsync(&mut self) -> *mut c_void; /// Detects keypoints in an image. @@ -734,8 +824,56 @@ pub mod cudafeatures2d { } + /// Abstract base class for CUDA asynchronous 2D image feature detectors and descriptor extractors. + pub struct CUDA_Feature2DAsync { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_Feature2DAsync } + + impl Drop for CUDA_Feature2DAsync { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_Feature2DAsync_delete(instance: *mut c_void); } + unsafe { cv_CUDA_Feature2DAsync_delete(self.as_raw_mut_CUDA_Feature2DAsync()) }; + } + } + + unsafe impl Send for CUDA_Feature2DAsync {} + + impl core::AlgorithmTraitConst for CUDA_Feature2DAsync { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_Feature2DAsync { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for CUDA_Feature2DAsync { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for CUDA_Feature2DAsync { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTraitConst for CUDA_Feature2DAsync { + #[inline] fn as_raw_CUDA_Feature2DAsync(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTrait for CUDA_Feature2DAsync { + #[inline] fn as_raw_mut_CUDA_Feature2DAsync(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_Feature2DAsync { + } + + boxed_cast_base! { CUDA_Feature2DAsync, core::Algorithm, cv_CUDA_Feature2DAsync_to_Algorithm } + + boxed_cast_base! { CUDA_Feature2DAsync, crate::features2d::Feature2D, cv_CUDA_Feature2DAsync_to_Feature2D } + /// Constant methods for [crate::cudafeatures2d::CUDA_ORB] - pub trait CUDA_ORBConst: crate::cudafeatures2d::CUDA_Feature2DAsyncConst { + pub trait CUDA_ORBTraitConst: crate::cudafeatures2d::CUDA_Feature2DAsyncTraitConst { fn as_raw_CUDA_ORB(&self) -> *const c_void; #[inline] @@ -830,10 +968,8 @@ pub mod cudafeatures2d { } - /// Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor - /// ## See also - /// cv::ORB - pub trait CUDA_ORB: crate::cudafeatures2d::CUDA_Feature2DAsync + crate::cudafeatures2d::CUDA_ORBConst { + /// Mutable methods for [crate::cudafeatures2d::CUDA_ORB] + pub trait CUDA_ORBTrait: crate::cudafeatures2d::CUDA_Feature2DAsyncTrait + crate::cudafeatures2d::CUDA_ORBTraitConst { fn as_raw_mut_CUDA_ORB(&mut self) -> *mut c_void; #[inline] @@ -929,7 +1065,58 @@ pub mod cudafeatures2d { } - impl dyn CUDA_ORB + '_ { + /// Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor + /// ## See also + /// cv::ORB + pub struct CUDA_ORB { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_ORB } + + impl Drop for CUDA_ORB { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_ORB_delete(instance: *mut c_void); } + unsafe { cv_CUDA_ORB_delete(self.as_raw_mut_CUDA_ORB()) }; + } + } + + unsafe impl Send for CUDA_ORB {} + + impl core::AlgorithmTraitConst for CUDA_ORB { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_ORB { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for CUDA_ORB { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for CUDA_ORB { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTraitConst for CUDA_ORB { + #[inline] fn as_raw_CUDA_Feature2DAsync(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTrait for CUDA_ORB { + #[inline] fn as_raw_mut_CUDA_Feature2DAsync(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudafeatures2d::CUDA_ORBTraitConst for CUDA_ORB { + #[inline] fn as_raw_CUDA_ORB(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudafeatures2d::CUDA_ORBTrait for CUDA_ORB { + #[inline] fn as_raw_mut_CUDA_ORB(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_ORB { pub const X_ROW: i32 = 0; pub const Y_ROW: i32 = 1; pub const RESPONSE_ROW: i32 = 2; @@ -949,13 +1136,18 @@ pub mod cudafeatures2d { /// * fast_threshold: 20 /// * blur_for_descriptor: false #[inline] - pub fn create(nfeatures: i32, scale_factor: f32, nlevels: i32, edge_threshold: i32, first_level: i32, wta_k: i32, score_type: i32, patch_size: i32, fast_threshold: i32, blur_for_descriptor: bool) -> Result> { + pub fn create(nfeatures: i32, scale_factor: f32, nlevels: i32, edge_threshold: i32, first_level: i32, wta_k: i32, score_type: i32, patch_size: i32, fast_threshold: i32, blur_for_descriptor: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_ORB_create_int_float_int_int_int_int_int_int_int_bool(nfeatures, scale_factor, nlevels, edge_threshold, first_level, wta_k, score_type, patch_size, fast_threshold, blur_for_descriptor, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { CUDA_ORB, core::Algorithm, cv_CUDA_ORB_to_Algorithm } + + boxed_cast_base! { CUDA_ORB, crate::features2d::Feature2D, cv_CUDA_ORB_to_Feature2D } +} diff --git a/docs/cudafilters.rs b/docs/cudafilters.rs index dd1d2444e..f2ea2e547 100644 --- a/docs/cudafilters.rs +++ b/docs/cudafilters.rs @@ -10,7 +10,7 @@ pub mod cudafilters { //! opencv_source_code/samples/gpu/morphology.cpp use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::FilterConst, super::Filter }; + pub use { super::FilterTraitConst, super::FilterTrait }; } /// Creates a normalized 2D box filter. @@ -31,12 +31,12 @@ pub mod cudafilters { /// * border_mode: BORDER_DEFAULT /// * border_val: Scalar::all(0) #[inline] - pub fn create_box_filter(src_type: i32, dst_type: i32, ksize: core::Size, anchor: core::Point, border_mode: i32, border_val: core::Scalar) -> Result> { + pub fn create_box_filter(src_type: i32, dst_type: i32, ksize: core::Size, anchor: core::Point, border_mode: i32, border_val: core::Scalar) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createBoxFilter_int_int_Size_Point_int_Scalar(src_type, dst_type, ksize.opencv_as_extern(), anchor.opencv_as_extern(), border_mode, border_val.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -54,12 +54,12 @@ pub mod cudafilters { /// * border_mode: BORDER_DEFAULT /// * border_val: Scalar::all(0) #[inline] - pub fn create_box_max_filter(src_type: i32, ksize: core::Size, anchor: core::Point, border_mode: i32, border_val: core::Scalar) -> Result> { + pub fn create_box_max_filter(src_type: i32, ksize: core::Size, anchor: core::Point, border_mode: i32, border_val: core::Scalar) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createBoxMaxFilter_int_Size_Point_int_Scalar(src_type, ksize.opencv_as_extern(), anchor.opencv_as_extern(), border_mode, border_val.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -77,12 +77,12 @@ pub mod cudafilters { /// * border_mode: BORDER_DEFAULT /// * border_val: Scalar::all(0) #[inline] - pub fn create_box_min_filter(src_type: i32, ksize: core::Size, anchor: core::Point, border_mode: i32, border_val: core::Scalar) -> Result> { + pub fn create_box_min_filter(src_type: i32, ksize: core::Size, anchor: core::Point, border_mode: i32, border_val: core::Scalar) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createBoxMinFilter_int_Size_Point_int_Scalar(src_type, ksize.opencv_as_extern(), anchor.opencv_as_extern(), border_mode, border_val.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -101,12 +101,12 @@ pub mod cudafilters { /// * border_mode: BORDER_DEFAULT /// * border_val: Scalar::all(0) #[inline] - pub fn create_column_sum_filter(src_type: i32, dst_type: i32, ksize: i32, anchor: i32, border_mode: i32, border_val: core::Scalar) -> Result> { + pub fn create_column_sum_filter(src_type: i32, dst_type: i32, ksize: i32, anchor: i32, border_mode: i32, border_val: core::Scalar) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createColumnSumFilter_int_int_int_int_int_Scalar(src_type, dst_type, ksize, anchor, border_mode, border_val.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -132,12 +132,12 @@ pub mod cudafilters { /// * row_border_mode: BORDER_DEFAULT /// * column_border_mode: -1 #[inline] - pub fn create_deriv_filter(src_type: i32, dst_type: i32, dx: i32, dy: i32, ksize: i32, normalize: bool, scale: f64, row_border_mode: i32, column_border_mode: i32) -> Result> { + pub fn create_deriv_filter(src_type: i32, dst_type: i32, dx: i32, dy: i32, ksize: i32, normalize: bool, scale: f64, row_border_mode: i32, column_border_mode: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createDerivFilter_int_int_int_int_int_bool_double_int_int(src_type, dst_type, dx, dy, ksize, normalize, scale, row_border_mode, column_border_mode, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -161,12 +161,12 @@ pub mod cudafilters { /// * row_border_mode: BORDER_DEFAULT /// * column_border_mode: -1 #[inline] - pub fn create_gaussian_filter(src_type: i32, dst_type: i32, ksize: core::Size, sigma1: f64, sigma2: f64, row_border_mode: i32, column_border_mode: i32) -> Result> { + pub fn create_gaussian_filter(src_type: i32, dst_type: i32, ksize: core::Size, sigma1: f64, sigma2: f64, row_border_mode: i32, column_border_mode: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createGaussianFilter_int_int_Size_double_double_int_int(src_type, dst_type, ksize.opencv_as_extern(), sigma1, sigma2, row_border_mode, column_border_mode, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -190,12 +190,12 @@ pub mod cudafilters { /// * border_mode: BORDER_DEFAULT /// * border_val: Scalar::all(0) #[inline] - pub fn create_laplacian_filter(src_type: i32, dst_type: i32, ksize: i32, scale: f64, border_mode: i32, border_val: core::Scalar) -> Result> { + pub fn create_laplacian_filter(src_type: i32, dst_type: i32, ksize: i32, scale: f64, border_mode: i32, border_val: core::Scalar) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createLaplacianFilter_int_int_int_double_int_Scalar(src_type, dst_type, ksize, scale, border_mode, border_val.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -217,13 +217,13 @@ pub mod cudafilters { /// * border_mode: BORDER_DEFAULT /// * border_val: Scalar::all(0) #[inline] - pub fn create_linear_filter(src_type: i32, dst_type: i32, kernel: &dyn core::ToInputArray, anchor: core::Point, border_mode: i32, border_val: core::Scalar) -> Result> { + pub fn create_linear_filter(src_type: i32, dst_type: i32, kernel: &dyn core::ToInputArray, anchor: core::Point, border_mode: i32, border_val: core::Scalar) -> Result> { extern_container_arg!(kernel); return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createLinearFilter_int_int_const__InputArrayR_Point_int_Scalar(src_type, dst_type, kernel.as_raw__InputArray(), anchor.opencv_as_extern(), border_mode, border_val.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -243,12 +243,12 @@ pub mod cudafilters { /// ## C++ default parameters /// * partition: 128 #[inline] - pub fn create_median_filter(src_type: i32, window_size: i32, partition: i32) -> Result> { + pub fn create_median_filter(src_type: i32, window_size: i32, partition: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createMedianFilter_int_int_int(src_type, window_size, partition, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -275,13 +275,13 @@ pub mod cudafilters { /// * anchor: Point(-1,-1) /// * iterations: 1 #[inline] - pub fn create_morphology_filter(op: i32, src_type: i32, kernel: &dyn core::ToInputArray, anchor: core::Point, iterations: i32) -> Result> { + pub fn create_morphology_filter(op: i32, src_type: i32, kernel: &dyn core::ToInputArray, anchor: core::Point, iterations: i32) -> Result> { extern_container_arg!(kernel); return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createMorphologyFilter_int_int_const__InputArrayR_Point_int(op, src_type, kernel.as_raw__InputArray(), anchor.opencv_as_extern(), iterations, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -300,12 +300,12 @@ pub mod cudafilters { /// * border_mode: BORDER_DEFAULT /// * border_val: Scalar::all(0) #[inline] - pub fn create_row_sum_filter(src_type: i32, dst_type: i32, ksize: i32, anchor: i32, border_mode: i32, border_val: core::Scalar) -> Result> { + pub fn create_row_sum_filter(src_type: i32, dst_type: i32, ksize: i32, anchor: i32, border_mode: i32, border_val: core::Scalar) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createRowSumFilter_int_int_int_int_int_Scalar(src_type, dst_type, ksize, anchor, border_mode, border_val.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -329,12 +329,12 @@ pub mod cudafilters { /// * row_border_mode: BORDER_DEFAULT /// * column_border_mode: -1 #[inline] - pub fn create_scharr_filter(src_type: i32, dst_type: i32, dx: i32, dy: i32, scale: f64, row_border_mode: i32, column_border_mode: i32) -> Result> { + pub fn create_scharr_filter(src_type: i32, dst_type: i32, dx: i32, dy: i32, scale: f64, row_border_mode: i32, column_border_mode: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createScharrFilter_int_int_int_int_double_int_int(src_type, dst_type, dx, dy, scale, row_border_mode, column_border_mode, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -358,14 +358,14 @@ pub mod cudafilters { /// * row_border_mode: BORDER_DEFAULT /// * column_border_mode: -1 #[inline] - pub fn create_separable_linear_filter(src_type: i32, dst_type: i32, row_kernel: &dyn core::ToInputArray, column_kernel: &dyn core::ToInputArray, anchor: core::Point, row_border_mode: i32, column_border_mode: i32) -> Result> { + pub fn create_separable_linear_filter(src_type: i32, dst_type: i32, row_kernel: &dyn core::ToInputArray, column_kernel: &dyn core::ToInputArray, anchor: core::Point, row_border_mode: i32, column_border_mode: i32) -> Result> { extern_container_arg!(row_kernel); extern_container_arg!(column_kernel); return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createSeparableLinearFilter_int_int_const__InputArrayR_const__InputArrayR_Point_int_int(src_type, dst_type, row_kernel.as_raw__InputArray(), column_kernel.as_raw__InputArray(), anchor.opencv_as_extern(), row_border_mode, column_border_mode, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -391,23 +391,23 @@ pub mod cudafilters { /// * row_border_mode: BORDER_DEFAULT /// * column_border_mode: -1 #[inline] - pub fn create_sobel_filter(src_type: i32, dst_type: i32, dx: i32, dy: i32, ksize: i32, scale: f64, row_border_mode: i32, column_border_mode: i32) -> Result> { + pub fn create_sobel_filter(src_type: i32, dst_type: i32, dx: i32, dy: i32, ksize: i32, scale: f64, row_border_mode: i32, column_border_mode: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createSobelFilter_int_int_int_int_int_double_int_int(src_type, dst_type, dx, dy, ksize, scale, row_border_mode, column_border_mode, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Constant methods for [crate::cudafilters::Filter] - pub trait FilterConst: core::AlgorithmTraitConst { + pub trait FilterTraitConst: core::AlgorithmTraitConst { fn as_raw_Filter(&self) -> *const c_void; } - /// Common interface for all CUDA filters : - pub trait Filter: core::AlgorithmTrait + crate::cudafilters::FilterConst { + /// Mutable methods for [crate::cudafilters::Filter] + pub trait FilterTrait: core::AlgorithmTrait + crate::cudafilters::FilterTraitConst { fn as_raw_mut_Filter(&mut self) -> *mut c_void; /// Applies the specified filter to the image. @@ -431,4 +431,42 @@ pub mod cudafilters { } } + + /// Common interface for all CUDA filters : + pub struct Filter { + ptr: *mut c_void + } + + opencv_type_boxed! { Filter } + + impl Drop for Filter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Filter_delete(instance: *mut c_void); } + unsafe { cv_Filter_delete(self.as_raw_mut_Filter()) }; + } + } + + unsafe impl Send for Filter {} + + impl core::AlgorithmTraitConst for Filter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Filter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudafilters::FilterTraitConst for Filter { + #[inline] fn as_raw_Filter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudafilters::FilterTrait for Filter { + #[inline] fn as_raw_mut_Filter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Filter { + } + + boxed_cast_base! { Filter, core::Algorithm, cv_Filter_to_Algorithm } } diff --git a/docs/cudaimgproc.rs b/docs/cudaimgproc.rs index 987ed35bc..0d108205f 100644 --- a/docs/cudaimgproc.rs +++ b/docs/cudaimgproc.rs @@ -6,7 +6,7 @@ pub mod cudaimgproc { //! # Feature Detection use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::CUDA_CLAHEConst, super::CUDA_CLAHE, super::CUDA_CannyEdgeDetectorConst, super::CUDA_CannyEdgeDetector, super::CUDA_HoughLinesDetectorConst, super::CUDA_HoughLinesDetector, super::CUDA_HoughSegmentDetectorConst, super::CUDA_HoughSegmentDetector, super::CUDA_HoughCirclesDetectorConst, super::CUDA_HoughCirclesDetector, super::CUDA_CornernessCriteriaConst, super::CUDA_CornernessCriteria, super::CUDA_CornersDetectorConst, super::CUDA_CornersDetector, super::CUDA_TemplateMatchingConst, super::CUDA_TemplateMatching }; + pub use { super::CUDA_CLAHETraitConst, super::CUDA_CLAHETrait, super::CUDA_CannyEdgeDetectorTraitConst, super::CUDA_CannyEdgeDetectorTrait, super::CUDA_HoughLinesDetectorTraitConst, super::CUDA_HoughLinesDetectorTrait, super::CUDA_HoughSegmentDetectorTraitConst, super::CUDA_HoughSegmentDetectorTrait, super::CUDA_HoughCirclesDetectorTraitConst, super::CUDA_HoughCirclesDetectorTrait, super::CUDA_CornernessCriteriaTraitConst, super::CUDA_CornernessCriteriaTrait, super::CUDA_CornersDetectorTraitConst, super::CUDA_CornersDetectorTrait, super::CUDA_TemplateMatchingTraitConst, super::CUDA_TemplateMatchingTrait }; } pub const CUDA_ALPHA_ATOP: i32 = 3; @@ -344,12 +344,12 @@ pub mod cudaimgproc { /// * clip_limit: 40.0 /// * tile_grid_size: Size(8,8) #[inline] - pub fn create_clahe(clip_limit: f64, tile_grid_size: core::Size) -> Result> { + pub fn create_clahe(clip_limit: f64, tile_grid_size: core::Size) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createCLAHE_double_Size(clip_limit, tile_grid_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -368,34 +368,34 @@ pub mod cudaimgproc { /// * apperture_size: 3 /// * l2gradient: false #[inline] - pub fn create_canny_edge_detector(low_thresh: f64, high_thresh: f64, apperture_size: i32, l2gradient: bool) -> Result> { + pub fn create_canny_edge_detector(low_thresh: f64, high_thresh: f64, apperture_size: i32, l2gradient: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createCannyEdgeDetector_double_double_int_bool(low_thresh, high_thresh, apperture_size, l2gradient, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates implementation for generalized hough transform from [Ballard1981](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Ballard1981) . #[inline] - pub fn create_generalized_hough_ballard() -> Result> { + pub fn create_generalized_hough_ballard() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createGeneralizedHoughBallard(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates implementation for generalized hough transform from [Guil1999](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Guil1999) . #[inline] - pub fn create_generalized_hough_guil() -> Result> { + pub fn create_generalized_hough_guil() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createGeneralizedHoughGuil(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -426,12 +426,12 @@ pub mod cudaimgproc { /// * use_harris_detector: false /// * harris_k: 0.04 #[inline] - pub fn create_good_features_to_track_detector(src_type: i32, max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, use_harris_detector: bool, harris_k: f64) -> Result> { + pub fn create_good_features_to_track_detector(src_type: i32, max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, use_harris_detector: bool, harris_k: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createGoodFeaturesToTrackDetector_int_int_double_double_int_bool_double(src_type, max_corners, quality_level, min_distance, block_size, use_harris_detector, harris_k, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -450,12 +450,12 @@ pub mod cudaimgproc { /// ## C++ default parameters /// * border_type: BORDER_REFLECT101 #[inline] - pub fn create_harris_corner(src_type: i32, block_size: i32, ksize: i32, k: f64, border_type: i32) -> Result> { + pub fn create_harris_corner(src_type: i32, block_size: i32, ksize: i32, k: f64, border_type: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createHarrisCorner_int_int_int_double_int(src_type, block_size, ksize, k, border_type, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -479,12 +479,12 @@ pub mod cudaimgproc { /// ## C++ default parameters /// * max_circles: 4096 #[inline] - pub fn create_hough_circles_detector(dp: f32, min_dist: f32, canny_threshold: i32, votes_threshold: i32, min_radius: i32, max_radius: i32, max_circles: i32) -> Result> { + pub fn create_hough_circles_detector(dp: f32, min_dist: f32, canny_threshold: i32, votes_threshold: i32, min_radius: i32, max_radius: i32, max_circles: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createHoughCirclesDetector_float_float_int_int_int_int_int(dp, min_dist, canny_threshold, votes_threshold, min_radius, max_radius, max_circles, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -502,12 +502,12 @@ pub mod cudaimgproc { /// * do_sort: false /// * max_lines: 4096 #[inline] - pub fn create_hough_lines_detector(rho: f32, theta: f32, threshold: i32, do_sort: bool, max_lines: i32) -> Result> { + pub fn create_hough_lines_detector(rho: f32, theta: f32, threshold: i32, do_sort: bool, max_lines: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createHoughLinesDetector_float_float_int_bool_int(rho, theta, threshold, do_sort, max_lines, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -523,12 +523,12 @@ pub mod cudaimgproc { /// ## C++ default parameters /// * max_lines: 4096 #[inline] - pub fn create_hough_segment_detector(rho: f32, theta: f32, min_line_length: i32, max_line_gap: i32, max_lines: i32) -> Result> { + pub fn create_hough_segment_detector(rho: f32, theta: f32, min_line_length: i32, max_line_gap: i32, max_lines: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createHoughSegmentDetector_float_float_int_int_int(rho, theta, min_line_length, max_line_gap, max_lines, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -547,12 +547,12 @@ pub mod cudaimgproc { /// ## C++ default parameters /// * border_type: BORDER_REFLECT101 #[inline] - pub fn create_min_eigen_val_corner(src_type: i32, block_size: i32, ksize: i32, border_type: i32) -> Result> { + pub fn create_min_eigen_val_corner(src_type: i32, block_size: i32, ksize: i32, border_type: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createMinEigenValCorner_int_int_int_int(src_type, block_size, ksize, border_type, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -586,12 +586,12 @@ pub mod cudaimgproc { /// ## C++ default parameters /// * user_block_size: Size() #[inline] - pub fn create_template_matching(src_type: i32, method: i32, user_block_size: core::Size) -> Result> { + pub fn create_template_matching(src_type: i32, method: i32, user_block_size: core::Size) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createTemplateMatching_int_int_Size(src_type, method, user_block_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -884,13 +884,13 @@ pub mod cudaimgproc { } /// Constant methods for [crate::cudaimgproc::CUDA_CLAHE] - pub trait CUDA_CLAHEConst: crate::imgproc::CLAHEConst { + pub trait CUDA_CLAHETraitConst: crate::imgproc::CLAHETraitConst { fn as_raw_CUDA_CLAHE(&self) -> *const c_void; } - /// Base class for Contrast Limited Adaptive Histogram Equalization. : - pub trait CUDA_CLAHE: crate::cudaimgproc::CUDA_CLAHEConst + crate::imgproc::CLAHE { + /// Mutable methods for [crate::cudaimgproc::CUDA_CLAHE] + pub trait CUDA_CLAHETrait: crate::cudaimgproc::CUDA_CLAHETraitConst + crate::imgproc::CLAHETrait { fn as_raw_mut_CUDA_CLAHE(&mut self) -> *mut c_void; /// Equalizes the histogram of a grayscale image using Contrast Limited Adaptive Histogram Equalization. @@ -912,8 +912,54 @@ pub mod cudaimgproc { } + /// Base class for Contrast Limited Adaptive Histogram Equalization. : + pub struct CUDA_CLAHE { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_CLAHE } + + impl Drop for CUDA_CLAHE { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_CLAHE_delete(instance: *mut c_void); } + unsafe { cv_CUDA_CLAHE_delete(self.as_raw_mut_CUDA_CLAHE()) }; + } + } + + unsafe impl Send for CUDA_CLAHE {} + + impl core::AlgorithmTraitConst for CUDA_CLAHE { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_CLAHE { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::imgproc::CLAHETraitConst for CUDA_CLAHE { + #[inline] fn as_raw_CLAHE(&self) -> *const c_void { self.as_raw() } + } + + impl crate::imgproc::CLAHETrait for CUDA_CLAHE { + #[inline] fn as_raw_mut_CLAHE(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaimgproc::CUDA_CLAHETraitConst for CUDA_CLAHE { + #[inline] fn as_raw_CUDA_CLAHE(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaimgproc::CUDA_CLAHETrait for CUDA_CLAHE { + #[inline] fn as_raw_mut_CUDA_CLAHE(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_CLAHE { + } + + boxed_cast_base! { CUDA_CLAHE, core::Algorithm, cv_CUDA_CLAHE_to_Algorithm } + /// Constant methods for [crate::cudaimgproc::CUDA_CannyEdgeDetector] - pub trait CUDA_CannyEdgeDetectorConst: core::AlgorithmTraitConst { + pub trait CUDA_CannyEdgeDetectorTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_CannyEdgeDetector(&self) -> *const c_void; #[inline] @@ -954,8 +1000,8 @@ pub mod cudaimgproc { } - /// Base class for Canny Edge Detector. : - pub trait CUDA_CannyEdgeDetector: core::AlgorithmTrait + crate::cudaimgproc::CUDA_CannyEdgeDetectorConst { + /// Mutable methods for [crate::cudaimgproc::CUDA_CannyEdgeDetector] + pub trait CUDA_CannyEdgeDetectorTrait: core::AlgorithmTrait + crate::cudaimgproc::CUDA_CannyEdgeDetectorTraitConst { fn as_raw_mut_CUDA_CannyEdgeDetector(&mut self) -> *mut c_void; /// Finds edges in an image using the [Canny86](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Canny86) algorithm. @@ -1044,14 +1090,52 @@ pub mod cudaimgproc { } + /// Base class for Canny Edge Detector. : + pub struct CUDA_CannyEdgeDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_CannyEdgeDetector } + + impl Drop for CUDA_CannyEdgeDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_CannyEdgeDetector_delete(instance: *mut c_void); } + unsafe { cv_CUDA_CannyEdgeDetector_delete(self.as_raw_mut_CUDA_CannyEdgeDetector()) }; + } + } + + unsafe impl Send for CUDA_CannyEdgeDetector {} + + impl core::AlgorithmTraitConst for CUDA_CannyEdgeDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_CannyEdgeDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaimgproc::CUDA_CannyEdgeDetectorTraitConst for CUDA_CannyEdgeDetector { + #[inline] fn as_raw_CUDA_CannyEdgeDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaimgproc::CUDA_CannyEdgeDetectorTrait for CUDA_CannyEdgeDetector { + #[inline] fn as_raw_mut_CUDA_CannyEdgeDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_CannyEdgeDetector { + } + + boxed_cast_base! { CUDA_CannyEdgeDetector, core::Algorithm, cv_CUDA_CannyEdgeDetector_to_Algorithm } + /// Constant methods for [crate::cudaimgproc::CUDA_CornernessCriteria] - pub trait CUDA_CornernessCriteriaConst: core::AlgorithmTraitConst { + pub trait CUDA_CornernessCriteriaTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_CornernessCriteria(&self) -> *const c_void; } - /// Base class for Cornerness Criteria computation. : - pub trait CUDA_CornernessCriteria: core::AlgorithmTrait + crate::cudaimgproc::CUDA_CornernessCriteriaConst { + /// Mutable methods for [crate::cudaimgproc::CUDA_CornernessCriteria] + pub trait CUDA_CornernessCriteriaTrait: core::AlgorithmTrait + crate::cudaimgproc::CUDA_CornernessCriteriaTraitConst { fn as_raw_mut_CUDA_CornernessCriteria(&mut self) -> *mut c_void; /// Computes the cornerness criteria at each image pixel. @@ -1077,14 +1161,52 @@ pub mod cudaimgproc { } + /// Base class for Cornerness Criteria computation. : + pub struct CUDA_CornernessCriteria { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_CornernessCriteria } + + impl Drop for CUDA_CornernessCriteria { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_CornernessCriteria_delete(instance: *mut c_void); } + unsafe { cv_CUDA_CornernessCriteria_delete(self.as_raw_mut_CUDA_CornernessCriteria()) }; + } + } + + unsafe impl Send for CUDA_CornernessCriteria {} + + impl core::AlgorithmTraitConst for CUDA_CornernessCriteria { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_CornernessCriteria { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaimgproc::CUDA_CornernessCriteriaTraitConst for CUDA_CornernessCriteria { + #[inline] fn as_raw_CUDA_CornernessCriteria(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaimgproc::CUDA_CornernessCriteriaTrait for CUDA_CornernessCriteria { + #[inline] fn as_raw_mut_CUDA_CornernessCriteria(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_CornernessCriteria { + } + + boxed_cast_base! { CUDA_CornernessCriteria, core::Algorithm, cv_CUDA_CornernessCriteria_to_Algorithm } + /// Constant methods for [crate::cudaimgproc::CUDA_CornersDetector] - pub trait CUDA_CornersDetectorConst: core::AlgorithmTraitConst { + pub trait CUDA_CornersDetectorTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_CornersDetector(&self) -> *const c_void; } - /// Base class for Corners Detector. : - pub trait CUDA_CornersDetector: core::AlgorithmTrait + crate::cudaimgproc::CUDA_CornersDetectorConst { + /// Mutable methods for [crate::cudaimgproc::CUDA_CornersDetector] + pub trait CUDA_CornersDetectorTrait: core::AlgorithmTrait + crate::cudaimgproc::CUDA_CornersDetectorTraitConst { fn as_raw_mut_CUDA_CornersDetector(&mut self) -> *mut c_void; /// Determines strong corners on an image. @@ -1114,8 +1236,46 @@ pub mod cudaimgproc { } + /// Base class for Corners Detector. : + pub struct CUDA_CornersDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_CornersDetector } + + impl Drop for CUDA_CornersDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_CornersDetector_delete(instance: *mut c_void); } + unsafe { cv_CUDA_CornersDetector_delete(self.as_raw_mut_CUDA_CornersDetector()) }; + } + } + + unsafe impl Send for CUDA_CornersDetector {} + + impl core::AlgorithmTraitConst for CUDA_CornersDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_CornersDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaimgproc::CUDA_CornersDetectorTraitConst for CUDA_CornersDetector { + #[inline] fn as_raw_CUDA_CornersDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaimgproc::CUDA_CornersDetectorTrait for CUDA_CornersDetector { + #[inline] fn as_raw_mut_CUDA_CornersDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_CornersDetector { + } + + boxed_cast_base! { CUDA_CornersDetector, core::Algorithm, cv_CUDA_CornersDetector_to_Algorithm } + /// Constant methods for [crate::cudaimgproc::CUDA_HoughCirclesDetector] - pub trait CUDA_HoughCirclesDetectorConst: core::AlgorithmTraitConst { + pub trait CUDA_HoughCirclesDetectorTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_HoughCirclesDetector(&self) -> *const c_void; #[inline] @@ -1183,8 +1343,8 @@ pub mod cudaimgproc { } - /// Base class for circles detector algorithm. : - pub trait CUDA_HoughCirclesDetector: core::AlgorithmTrait + crate::cudaimgproc::CUDA_HoughCirclesDetectorConst { + /// Mutable methods for [crate::cudaimgproc::CUDA_HoughCirclesDetector] + pub trait CUDA_HoughCirclesDetectorTrait: core::AlgorithmTrait + crate::cudaimgproc::CUDA_HoughCirclesDetectorTraitConst { fn as_raw_mut_CUDA_HoughCirclesDetector(&mut self) -> *mut c_void; /// Finds circles in a grayscale image using the Hough transform. @@ -1275,8 +1435,46 @@ pub mod cudaimgproc { } + /// Base class for circles detector algorithm. : + pub struct CUDA_HoughCirclesDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_HoughCirclesDetector } + + impl Drop for CUDA_HoughCirclesDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_HoughCirclesDetector_delete(instance: *mut c_void); } + unsafe { cv_CUDA_HoughCirclesDetector_delete(self.as_raw_mut_CUDA_HoughCirclesDetector()) }; + } + } + + unsafe impl Send for CUDA_HoughCirclesDetector {} + + impl core::AlgorithmTraitConst for CUDA_HoughCirclesDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_HoughCirclesDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaimgproc::CUDA_HoughCirclesDetectorTraitConst for CUDA_HoughCirclesDetector { + #[inline] fn as_raw_CUDA_HoughCirclesDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaimgproc::CUDA_HoughCirclesDetectorTrait for CUDA_HoughCirclesDetector { + #[inline] fn as_raw_mut_CUDA_HoughCirclesDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_HoughCirclesDetector { + } + + boxed_cast_base! { CUDA_HoughCirclesDetector, core::Algorithm, cv_CUDA_HoughCirclesDetector_to_Algorithm } + /// Constant methods for [crate::cudaimgproc::CUDA_HoughLinesDetector] - pub trait CUDA_HoughLinesDetectorConst: core::AlgorithmTraitConst { + pub trait CUDA_HoughLinesDetectorTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_HoughLinesDetector(&self) -> *const c_void; #[inline] @@ -1326,8 +1524,8 @@ pub mod cudaimgproc { } - /// Base class for lines detector algorithm. : - pub trait CUDA_HoughLinesDetector: core::AlgorithmTrait + crate::cudaimgproc::CUDA_HoughLinesDetectorConst { + /// Mutable methods for [crate::cudaimgproc::CUDA_HoughLinesDetector] + pub trait CUDA_HoughLinesDetectorTrait: core::AlgorithmTrait + crate::cudaimgproc::CUDA_HoughLinesDetectorTraitConst { fn as_raw_mut_CUDA_HoughLinesDetector(&mut self) -> *mut c_void; /// Finds lines in a binary image using the classical Hough transform. @@ -1425,8 +1623,46 @@ pub mod cudaimgproc { } + /// Base class for lines detector algorithm. : + pub struct CUDA_HoughLinesDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_HoughLinesDetector } + + impl Drop for CUDA_HoughLinesDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_HoughLinesDetector_delete(instance: *mut c_void); } + unsafe { cv_CUDA_HoughLinesDetector_delete(self.as_raw_mut_CUDA_HoughLinesDetector()) }; + } + } + + unsafe impl Send for CUDA_HoughLinesDetector {} + + impl core::AlgorithmTraitConst for CUDA_HoughLinesDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_HoughLinesDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaimgproc::CUDA_HoughLinesDetectorTraitConst for CUDA_HoughLinesDetector { + #[inline] fn as_raw_CUDA_HoughLinesDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaimgproc::CUDA_HoughLinesDetectorTrait for CUDA_HoughLinesDetector { + #[inline] fn as_raw_mut_CUDA_HoughLinesDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_HoughLinesDetector { + } + + boxed_cast_base! { CUDA_HoughLinesDetector, core::Algorithm, cv_CUDA_HoughLinesDetector_to_Algorithm } + /// Constant methods for [crate::cudaimgproc::CUDA_HoughSegmentDetector] - pub trait CUDA_HoughSegmentDetectorConst: core::AlgorithmTraitConst { + pub trait CUDA_HoughSegmentDetectorTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_HoughSegmentDetector(&self) -> *const c_void; #[inline] @@ -1476,8 +1712,8 @@ pub mod cudaimgproc { } - /// Base class for line segments detector algorithm. : - pub trait CUDA_HoughSegmentDetector: core::AlgorithmTrait + crate::cudaimgproc::CUDA_HoughSegmentDetectorConst { + /// Mutable methods for [crate::cudaimgproc::CUDA_HoughSegmentDetector] + pub trait CUDA_HoughSegmentDetectorTrait: core::AlgorithmTrait + crate::cudaimgproc::CUDA_HoughSegmentDetectorTraitConst { fn as_raw_mut_CUDA_HoughSegmentDetector(&mut self) -> *mut c_void; /// Finds line segments in a binary image using the probabilistic Hough transform. @@ -1551,14 +1787,52 @@ pub mod cudaimgproc { } + /// Base class for line segments detector algorithm. : + pub struct CUDA_HoughSegmentDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_HoughSegmentDetector } + + impl Drop for CUDA_HoughSegmentDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_HoughSegmentDetector_delete(instance: *mut c_void); } + unsafe { cv_CUDA_HoughSegmentDetector_delete(self.as_raw_mut_CUDA_HoughSegmentDetector()) }; + } + } + + unsafe impl Send for CUDA_HoughSegmentDetector {} + + impl core::AlgorithmTraitConst for CUDA_HoughSegmentDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_HoughSegmentDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaimgproc::CUDA_HoughSegmentDetectorTraitConst for CUDA_HoughSegmentDetector { + #[inline] fn as_raw_CUDA_HoughSegmentDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaimgproc::CUDA_HoughSegmentDetectorTrait for CUDA_HoughSegmentDetector { + #[inline] fn as_raw_mut_CUDA_HoughSegmentDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_HoughSegmentDetector { + } + + boxed_cast_base! { CUDA_HoughSegmentDetector, core::Algorithm, cv_CUDA_HoughSegmentDetector_to_Algorithm } + /// Constant methods for [crate::cudaimgproc::CUDA_TemplateMatching] - pub trait CUDA_TemplateMatchingConst: core::AlgorithmTraitConst { + pub trait CUDA_TemplateMatchingTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_TemplateMatching(&self) -> *const c_void; } - /// Base class for Template Matching. : - pub trait CUDA_TemplateMatching: core::AlgorithmTrait + crate::cudaimgproc::CUDA_TemplateMatchingConst { + /// Mutable methods for [crate::cudaimgproc::CUDA_TemplateMatching] + pub trait CUDA_TemplateMatchingTrait: core::AlgorithmTrait + crate::cudaimgproc::CUDA_TemplateMatchingTraitConst { fn as_raw_mut_CUDA_TemplateMatching(&mut self) -> *mut c_void; /// Computes a proximity map for a raster template and an image where the template is searched for. @@ -1585,4 +1859,42 @@ pub mod cudaimgproc { } } + + /// Base class for Template Matching. : + pub struct CUDA_TemplateMatching { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_TemplateMatching } + + impl Drop for CUDA_TemplateMatching { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_TemplateMatching_delete(instance: *mut c_void); } + unsafe { cv_CUDA_TemplateMatching_delete(self.as_raw_mut_CUDA_TemplateMatching()) }; + } + } + + unsafe impl Send for CUDA_TemplateMatching {} + + impl core::AlgorithmTraitConst for CUDA_TemplateMatching { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_TemplateMatching { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaimgproc::CUDA_TemplateMatchingTraitConst for CUDA_TemplateMatching { + #[inline] fn as_raw_CUDA_TemplateMatching(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaimgproc::CUDA_TemplateMatchingTrait for CUDA_TemplateMatching { + #[inline] fn as_raw_mut_CUDA_TemplateMatching(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_TemplateMatching { + } + + boxed_cast_base! { CUDA_TemplateMatching, core::Algorithm, cv_CUDA_TemplateMatching_to_Algorithm } } diff --git a/docs/cudaobjdetect.rs b/docs/cudaobjdetect.rs index 4bce36930..4ec2e3c77 100644 --- a/docs/cudaobjdetect.rs +++ b/docs/cudaobjdetect.rs @@ -2,17 +2,17 @@ pub mod cudaobjdetect { //! # Object Detection use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::HOGConst, super::HOG, super::CascadeClassifierConst, super::CascadeClassifier }; + pub use { super::CUDA_HOGTraitConst, super::CUDA_HOGTrait, super::CUDA_CascadeClassifierTraitConst, super::CUDA_CascadeClassifierTrait }; } - /// Constant methods for [crate::cudaobjdetect::CascadeClassifier] - pub trait CascadeClassifierConst: core::AlgorithmTraitConst { - fn as_raw_CascadeClassifier(&self) -> *const c_void; + /// Constant methods for [crate::cudaobjdetect::CUDA_CascadeClassifier] + pub trait CUDA_CascadeClassifierTraitConst: core::AlgorithmTraitConst { + fn as_raw_CUDA_CascadeClassifier(&self) -> *const c_void; #[inline] fn get_max_object_size(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_getMaxObjectSize_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_getMaxObjectSize_const(self.as_raw_CUDA_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -21,7 +21,7 @@ pub mod cudaobjdetect { #[inline] fn get_min_object_size(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_getMinObjectSize_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_getMinObjectSize_const(self.as_raw_CUDA_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -30,7 +30,7 @@ pub mod cudaobjdetect { #[inline] fn get_scale_factor(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_getScaleFactor_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_getScaleFactor_const(self.as_raw_CUDA_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -39,7 +39,7 @@ pub mod cudaobjdetect { #[inline] fn get_min_neighbors(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_getMinNeighbors_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_getMinNeighbors_const(self.as_raw_CUDA_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -48,7 +48,7 @@ pub mod cudaobjdetect { #[inline] fn get_max_num_objects(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_getMaxNumObjects_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_getMaxNumObjects_const(self.as_raw_CUDA_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -57,7 +57,7 @@ pub mod cudaobjdetect { #[inline] fn get_classifier_size(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_getClassifierSize_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_getClassifierSize_const(self.as_raw_CUDA_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -65,23 +65,16 @@ pub mod cudaobjdetect { } - /// Cascade classifier class used for object detection. Supports HAAR and LBP cascades. : - /// - /// - /// Note: - /// * A cascade classifier example can be found at - /// opencv_source_code/samples/gpu/cascadeclassifier.cpp - /// * A Nvidea API specific cascade classifier example can be found at - /// opencv_source_code/samples/gpu/cascadeclassifier_nvidia_api.cpp - pub trait CascadeClassifier: core::AlgorithmTrait + crate::cudaobjdetect::CascadeClassifierConst { - fn as_raw_mut_CascadeClassifier(&mut self) -> *mut c_void; + /// Mutable methods for [crate::cudaobjdetect::CUDA_CascadeClassifier] + pub trait CUDA_CascadeClassifierTrait: core::AlgorithmTrait + crate::cudaobjdetect::CUDA_CascadeClassifierTraitConst { + fn as_raw_mut_CUDA_CascadeClassifier(&mut self) -> *mut c_void; /// Maximum possible object size. Objects larger than that are ignored. Used for /// second signature and supported only for LBP cascades. #[inline] fn set_max_object_size(&mut self, max_object_size: core::Size) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_setMaxObjectSize_Size(self.as_raw_mut_CascadeClassifier(), max_object_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_setMaxObjectSize_Size(self.as_raw_mut_CUDA_CascadeClassifier(), max_object_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -91,7 +84,7 @@ pub mod cudaobjdetect { #[inline] fn set_min_object_size(&mut self, min_size: core::Size) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_setMinObjectSize_Size(self.as_raw_mut_CascadeClassifier(), min_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_setMinObjectSize_Size(self.as_raw_mut_CUDA_CascadeClassifier(), min_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -101,7 +94,7 @@ pub mod cudaobjdetect { #[inline] fn set_scale_factor(&mut self, scale_factor: f64) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_setScaleFactor_double(self.as_raw_mut_CascadeClassifier(), scale_factor, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_setScaleFactor_double(self.as_raw_mut_CUDA_CascadeClassifier(), scale_factor, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -112,7 +105,7 @@ pub mod cudaobjdetect { #[inline] fn set_min_neighbors(&mut self, min_neighbors: i32) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_setMinNeighbors_int(self.as_raw_mut_CascadeClassifier(), min_neighbors, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_setMinNeighbors_int(self.as_raw_mut_CUDA_CascadeClassifier(), min_neighbors, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -121,7 +114,7 @@ pub mod cudaobjdetect { #[inline] fn set_find_largest_object(&mut self, find_largest_object: bool) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_setFindLargestObject_bool(self.as_raw_mut_CascadeClassifier(), find_largest_object, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_setFindLargestObject_bool(self.as_raw_mut_CUDA_CascadeClassifier(), find_largest_object, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -130,7 +123,7 @@ pub mod cudaobjdetect { #[inline] fn get_find_largest_object(&mut self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_getFindLargestObject(self.as_raw_mut_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_getFindLargestObject(self.as_raw_mut_CUDA_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -139,7 +132,7 @@ pub mod cudaobjdetect { #[inline] fn set_max_num_objects(&mut self, max_num_objects: i32) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_setMaxNumObjects_int(self.as_raw_mut_CascadeClassifier(), max_num_objects, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_setMaxNumObjects_int(self.as_raw_mut_CUDA_CascadeClassifier(), max_num_objects, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -181,7 +174,7 @@ pub mod cudaobjdetect { extern_container_arg!(image); extern_container_arg!(objects); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_detectMultiScale_const__InputArrayR_const__OutputArrayR_StreamR(self.as_raw_mut_CascadeClassifier(), image.as_raw__InputArray(), objects.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_detectMultiScale_const__InputArrayR_const__OutputArrayR_StreamR(self.as_raw_mut_CUDA_CascadeClassifier(), image.as_raw__InputArray(), objects.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -196,7 +189,7 @@ pub mod cudaobjdetect { fn convert(&mut self, gpu_objects: &mut dyn core::ToOutputArray, objects: &mut core::Vector) -> Result<()> { extern_container_arg!(gpu_objects); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_CascadeClassifier_convert_const__OutputArrayR_vectorLRectGR(self.as_raw_mut_CascadeClassifier(), gpu_objects.as_raw__OutputArray(), objects.as_raw_mut_VectorOfRect(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_CascadeClassifier_convert_const__OutputArrayR_vectorLRectGR(self.as_raw_mut_CUDA_CascadeClassifier(), gpu_objects.as_raw__OutputArray(), objects.as_raw_mut_VectorOfRect(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -204,7 +197,47 @@ pub mod cudaobjdetect { } - impl dyn CascadeClassifier + '_ { + /// Cascade classifier class used for object detection. Supports HAAR and LBP cascades. : + /// + /// + /// Note: + /// * A cascade classifier example can be found at + /// opencv_source_code/samples/gpu/cascadeclassifier.cpp + /// * A Nvidea API specific cascade classifier example can be found at + /// opencv_source_code/samples/gpu/cascadeclassifier_nvidia_api.cpp + pub struct CUDA_CascadeClassifier { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_CascadeClassifier } + + impl Drop for CUDA_CascadeClassifier { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_CascadeClassifier_delete(instance: *mut c_void); } + unsafe { cv_CUDA_CascadeClassifier_delete(self.as_raw_mut_CUDA_CascadeClassifier()) }; + } + } + + unsafe impl Send for CUDA_CascadeClassifier {} + + impl core::AlgorithmTraitConst for CUDA_CascadeClassifier { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_CascadeClassifier { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaobjdetect::CUDA_CascadeClassifierTraitConst for CUDA_CascadeClassifier { + #[inline] fn as_raw_CUDA_CascadeClassifier(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaobjdetect::CUDA_CascadeClassifierTrait for CUDA_CascadeClassifier { + #[inline] fn as_raw_mut_CUDA_CascadeClassifier(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_CascadeClassifier { /// Loads the classifier from a file. Cascade type is detected automatically by constructor parameter. /// /// ## Parameters @@ -212,13 +245,13 @@ pub mod cudaobjdetect { /// (trained by the haar training application) and NVIDIA's nvbin are supported for HAAR and only new /// type of OpenCV XML cascade supported for LBP. The working haar models can be found at opencv_folder/data/haarcascades_cuda/ #[inline] - pub fn create(filename: &str) -> Result> { + pub fn create(filename: &str) -> Result> { extern_container_arg!(filename); return_send!(via ocvrs_return); unsafe { sys::cv_cuda_CascadeClassifier_create_const_StringR(filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -231,24 +264,27 @@ pub mod cudaobjdetect { /// /// ## Overloaded parameters #[inline] - pub fn create_1(file: &core::FileStorage) -> Result> { + pub fn create_1(file: &core::FileStorage) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_CascadeClassifier_create_const_FileStorageR(file.as_raw_FileStorage(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } - /// Constant methods for [crate::cudaobjdetect::HOG] - pub trait HOGConst: core::AlgorithmTraitConst { - fn as_raw_HOG(&self) -> *const c_void; + + boxed_cast_base! { CUDA_CascadeClassifier, core::Algorithm, cv_CUDA_CascadeClassifier_to_Algorithm } + + /// Constant methods for [crate::cudaobjdetect::CUDA_HOG] + pub trait CUDA_HOGTraitConst: core::AlgorithmTraitConst { + fn as_raw_CUDA_HOG(&self) -> *const c_void; #[inline] fn get_win_sigma(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getWinSigma_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getWinSigma_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -257,7 +293,7 @@ pub mod cudaobjdetect { #[inline] fn get_l2_hys_threshold(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getL2HysThreshold_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getL2HysThreshold_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -266,7 +302,7 @@ pub mod cudaobjdetect { #[inline] fn get_gamma_correction(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getGammaCorrection_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getGammaCorrection_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -275,7 +311,7 @@ pub mod cudaobjdetect { #[inline] fn get_num_levels(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getNumLevels_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getNumLevels_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -284,7 +320,7 @@ pub mod cudaobjdetect { #[inline] fn get_hit_threshold(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getHitThreshold_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getHitThreshold_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -293,7 +329,7 @@ pub mod cudaobjdetect { #[inline] fn get_win_stride(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getWinStride_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getWinStride_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -302,7 +338,7 @@ pub mod cudaobjdetect { #[inline] fn get_scale_factor(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getScaleFactor_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getScaleFactor_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -311,7 +347,7 @@ pub mod cudaobjdetect { #[inline] fn get_group_threshold(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getGroupThreshold_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getGroupThreshold_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -320,7 +356,7 @@ pub mod cudaobjdetect { #[inline] fn get_descriptor_format(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getDescriptorFormat_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getDescriptorFormat_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -330,7 +366,7 @@ pub mod cudaobjdetect { #[inline] fn get_descriptor_size(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getDescriptorSize_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getDescriptorSize_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -340,7 +376,7 @@ pub mod cudaobjdetect { #[inline] fn get_block_histogram_size(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getBlockHistogramSize_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getBlockHistogramSize_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -350,7 +386,7 @@ pub mod cudaobjdetect { #[inline] fn get_default_people_detector(&self) -> Result { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_getDefaultPeopleDetector_const(self.as_raw_HOG(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_getDefaultPeopleDetector_const(self.as_raw_CUDA_HOG(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; let ret = unsafe { core::Mat::opencv_from_extern(ret) }; @@ -359,24 +395,15 @@ pub mod cudaobjdetect { } - /// The class implements Histogram of Oriented Gradients ([Dalal2005](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Dalal2005)) object detector. - /// - /// - /// Note: - /// * An example applying the HOG descriptor for people detection can be found at - /// opencv_source_code/samples/cpp/peopledetect.cpp - /// * A CUDA example applying the HOG descriptor for people detection can be found at - /// opencv_source_code/samples/gpu/hog.cpp - /// * (Python) An example applying the HOG descriptor for people detection can be found at - /// opencv_source_code/samples/python/peopledetect.py - pub trait HOG: core::AlgorithmTrait + crate::cudaobjdetect::HOGConst { - fn as_raw_mut_HOG(&mut self) -> *mut c_void; + /// Mutable methods for [crate::cudaobjdetect::CUDA_HOG] + pub trait CUDA_HOGTrait: core::AlgorithmTrait + crate::cudaobjdetect::CUDA_HOGTraitConst { + fn as_raw_mut_CUDA_HOG(&mut self) -> *mut c_void; /// Gaussian smoothing window parameter. #[inline] fn set_win_sigma(&mut self, win_sigma: f64) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setWinSigma_double(self.as_raw_mut_HOG(), win_sigma, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setWinSigma_double(self.as_raw_mut_CUDA_HOG(), win_sigma, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -386,7 +413,7 @@ pub mod cudaobjdetect { #[inline] fn set_l2_hys_threshold(&mut self, threshold_l2hys: f64) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setL2HysThreshold_double(self.as_raw_mut_HOG(), threshold_l2hys, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setL2HysThreshold_double(self.as_raw_mut_CUDA_HOG(), threshold_l2hys, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -396,7 +423,7 @@ pub mod cudaobjdetect { #[inline] fn set_gamma_correction(&mut self, gamma_correction: bool) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setGammaCorrection_bool(self.as_raw_mut_HOG(), gamma_correction, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setGammaCorrection_bool(self.as_raw_mut_CUDA_HOG(), gamma_correction, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -406,7 +433,7 @@ pub mod cudaobjdetect { #[inline] fn set_num_levels(&mut self, nlevels: i32) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setNumLevels_int(self.as_raw_mut_HOG(), nlevels, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setNumLevels_int(self.as_raw_mut_CUDA_HOG(), nlevels, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -419,7 +446,7 @@ pub mod cudaobjdetect { #[inline] fn set_hit_threshold(&mut self, hit_threshold: f64) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setHitThreshold_double(self.as_raw_mut_HOG(), hit_threshold, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setHitThreshold_double(self.as_raw_mut_CUDA_HOG(), hit_threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -429,7 +456,7 @@ pub mod cudaobjdetect { #[inline] fn set_win_stride(&mut self, win_stride: core::Size) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setWinStride_Size(self.as_raw_mut_HOG(), win_stride.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setWinStride_Size(self.as_raw_mut_CUDA_HOG(), win_stride.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -439,7 +466,7 @@ pub mod cudaobjdetect { #[inline] fn set_scale_factor(&mut self, scale0: f64) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setScaleFactor_double(self.as_raw_mut_HOG(), scale0, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setScaleFactor_double(self.as_raw_mut_CUDA_HOG(), scale0, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -451,7 +478,7 @@ pub mod cudaobjdetect { #[inline] fn set_group_threshold(&mut self, group_threshold: i32) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setGroupThreshold_int(self.as_raw_mut_HOG(), group_threshold, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setGroupThreshold_int(self.as_raw_mut_CUDA_HOG(), group_threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -463,7 +490,7 @@ pub mod cudaobjdetect { #[inline] fn set_descriptor_format(&mut self, descr_format: crate::objdetect::HOGDescriptor_DescriptorStorageFormat) -> Result<()> { return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setDescriptorFormat_DescriptorStorageFormat(self.as_raw_mut_HOG(), descr_format, ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setDescriptorFormat_DescriptorStorageFormat(self.as_raw_mut_CUDA_HOG(), descr_format, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -474,7 +501,7 @@ pub mod cudaobjdetect { fn set_svm_detector(&mut self, detector: &dyn core::ToInputArray) -> Result<()> { extern_container_arg!(detector); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_setSVMDetector_const__InputArrayR(self.as_raw_mut_HOG(), detector.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_setSVMDetector_const__InputArrayR(self.as_raw_mut_CUDA_HOG(), detector.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -493,7 +520,7 @@ pub mod cudaobjdetect { fn detect(&mut self, img: &dyn core::ToInputArray, found_locations: &mut core::Vector, confidences: &mut core::Vector) -> Result<()> { extern_container_arg!(img); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_detect_const__InputArrayR_vectorLPointGR_vectorLdoubleGX(self.as_raw_mut_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_detect_const__InputArrayR_vectorLPointGR_vectorLdoubleGX(self.as_raw_mut_CUDA_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -503,7 +530,7 @@ pub mod cudaobjdetect { fn detect_1(&mut self, img: &dyn core::ToInputArray, found_locations: &mut core::Vector, confidences: &mut core::Vector) -> Result<()> { extern_container_arg!(img); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_detect_const__InputArrayR_vectorLPointGR_vectorLdoubleGR(self.as_raw_mut_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_detect_const__InputArrayR_vectorLPointGR_vectorLdoubleGR(self.as_raw_mut_CUDA_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -518,7 +545,7 @@ pub mod cudaobjdetect { fn detect_without_conf(&mut self, img: &dyn core::ToInputArray, found_locations: &mut core::Vector) -> Result<()> { extern_container_arg!(img); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_detectWithoutConf_const__InputArrayR_vectorLPointGR(self.as_raw_mut_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_detectWithoutConf_const__InputArrayR_vectorLPointGR(self.as_raw_mut_CUDA_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -537,7 +564,7 @@ pub mod cudaobjdetect { fn detect_multi_scale(&mut self, img: &dyn core::ToInputArray, found_locations: &mut core::Vector, confidences: &mut core::Vector) -> Result<()> { extern_container_arg!(img); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLdoubleGX(self.as_raw_mut_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLdoubleGX(self.as_raw_mut_CUDA_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -547,7 +574,7 @@ pub mod cudaobjdetect { fn detect_multi_scale_1(&mut self, img: &dyn core::ToInputArray, found_locations: &mut core::Vector, confidences: &mut core::Vector) -> Result<()> { extern_container_arg!(img); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLdoubleGR(self.as_raw_mut_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLdoubleGR(self.as_raw_mut_CUDA_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -562,7 +589,7 @@ pub mod cudaobjdetect { fn detect_multi_scale_without_conf(&mut self, img: &dyn core::ToInputArray, found_locations: &mut core::Vector) -> Result<()> { extern_container_arg!(img); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_detectMultiScaleWithoutConf_const__InputArrayR_vectorLRectGR(self.as_raw_mut_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_detectMultiScaleWithoutConf_const__InputArrayR_vectorLRectGR(self.as_raw_mut_CUDA_HOG(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -582,7 +609,7 @@ pub mod cudaobjdetect { extern_container_arg!(img); extern_container_arg!(descriptors); return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_HOG_compute_const__InputArrayR_const__OutputArrayR_StreamR(self.as_raw_mut_HOG(), img.as_raw__InputArray(), descriptors.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) }; + unsafe { sys::cv_cuda_HOG_compute_const__InputArrayR_const__OutputArrayR_StreamR(self.as_raw_mut_CUDA_HOG(), img.as_raw__InputArray(), descriptors.as_raw__OutputArray(), stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; Ok(ret) @@ -590,7 +617,49 @@ pub mod cudaobjdetect { } - impl dyn HOG + '_ { + /// The class implements Histogram of Oriented Gradients ([Dalal2005](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Dalal2005)) object detector. + /// + /// + /// Note: + /// * An example applying the HOG descriptor for people detection can be found at + /// opencv_source_code/samples/cpp/peopledetect.cpp + /// * A CUDA example applying the HOG descriptor for people detection can be found at + /// opencv_source_code/samples/gpu/hog.cpp + /// * (Python) An example applying the HOG descriptor for people detection can be found at + /// opencv_source_code/samples/python/peopledetect.py + pub struct CUDA_HOG { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_HOG } + + impl Drop for CUDA_HOG { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_HOG_delete(instance: *mut c_void); } + unsafe { cv_CUDA_HOG_delete(self.as_raw_mut_CUDA_HOG()) }; + } + } + + unsafe impl Send for CUDA_HOG {} + + impl core::AlgorithmTraitConst for CUDA_HOG { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_HOG { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaobjdetect::CUDA_HOGTraitConst for CUDA_HOG { + #[inline] fn as_raw_CUDA_HOG(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaobjdetect::CUDA_HOGTrait for CUDA_HOG { + #[inline] fn as_raw_mut_CUDA_HOG(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_HOG { /// Creates the HOG descriptor and detector. /// /// ## Parameters @@ -607,13 +676,16 @@ pub mod cudaobjdetect { /// * cell_size: Size(8,8) /// * nbins: 9 #[inline] - pub fn create(win_size: core::Size, block_size: core::Size, block_stride: core::Size, cell_size: core::Size, nbins: i32) -> Result> { + pub fn create(win_size: core::Size, block_size: core::Size, block_stride: core::Size, cell_size: core::Size, nbins: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_HOG_create_Size_Size_Size_Size_int(win_size.opencv_as_extern(), block_size.opencv_as_extern(), block_stride.opencv_as_extern(), cell_size.opencv_as_extern(), nbins, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { CUDA_HOG, core::Algorithm, cv_CUDA_HOG_to_Algorithm } +} diff --git a/docs/cudaoptflow.rs b/docs/cudaoptflow.rs index 6a3a18fa1..030edd0ab 100644 --- a/docs/cudaoptflow.rs +++ b/docs/cudaoptflow.rs @@ -2,7 +2,7 @@ pub mod cudaoptflow { //! # Optical Flow use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::CUDA_DenseOpticalFlowConst, super::CUDA_DenseOpticalFlow, super::CUDA_SparseOpticalFlowConst, super::CUDA_SparseOpticalFlow, super::CUDA_NvidiaHWOpticalFlowConst, super::CUDA_NvidiaHWOpticalFlow, super::CUDA_BroxOpticalFlowConst, super::CUDA_BroxOpticalFlow, super::CUDA_SparsePyrLKOpticalFlowConst, super::CUDA_SparsePyrLKOpticalFlow, super::CUDA_DensePyrLKOpticalFlowConst, super::CUDA_DensePyrLKOpticalFlow, super::CUDA_FarnebackOpticalFlowConst, super::CUDA_FarnebackOpticalFlow, super::CUDA_OpticalFlowDual_TVL1Const, super::CUDA_OpticalFlowDual_TVL1, super::CUDA_NvidiaOpticalFlow_1_0Const, super::CUDA_NvidiaOpticalFlow_1_0, super::CUDA_NvidiaOpticalFlow_2_0Const, super::CUDA_NvidiaOpticalFlow_2_0 }; + pub use { super::CUDA_DenseOpticalFlowTraitConst, super::CUDA_DenseOpticalFlowTrait, super::CUDA_SparseOpticalFlowTraitConst, super::CUDA_SparseOpticalFlowTrait, super::CUDA_NvidiaHWOpticalFlowTraitConst, super::CUDA_NvidiaHWOpticalFlowTrait, super::CUDA_BroxOpticalFlowTraitConst, super::CUDA_BroxOpticalFlowTrait, super::CUDA_SparsePyrLKOpticalFlowTraitConst, super::CUDA_SparsePyrLKOpticalFlowTrait, super::CUDA_DensePyrLKOpticalFlowTraitConst, super::CUDA_DensePyrLKOpticalFlowTrait, super::CUDA_FarnebackOpticalFlowTraitConst, super::CUDA_FarnebackOpticalFlowTrait, super::CUDA_OpticalFlowDual_TVL1TraitConst, super::CUDA_OpticalFlowDual_TVL1Trait, super::CUDA_NvidiaOpticalFlow_1_0TraitConst, super::CUDA_NvidiaOpticalFlow_1_0Trait, super::CUDA_NvidiaOpticalFlow_2_0TraitConst, super::CUDA_NvidiaOpticalFlow_2_0Trait }; } /// < Fast perf level results in high performance and low quality @@ -106,7 +106,7 @@ pub mod cudaoptflow { opencv_type_enum! { crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL } /// Constant methods for [crate::cudaoptflow::CUDA_BroxOpticalFlow] - pub trait CUDA_BroxOpticalFlowConst: crate::cudaoptflow::CUDA_DenseOpticalFlowConst { + pub trait CUDA_BroxOpticalFlowTraitConst: crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst { fn as_raw_CUDA_BroxOpticalFlow(&self) -> *const c_void; #[inline] @@ -168,8 +168,8 @@ pub mod cudaoptflow { } - /// Class computing the optical flow for two images using Brox et al Optical Flow algorithm ([Brox2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Brox2004)). - pub trait CUDA_BroxOpticalFlow: crate::cudaoptflow::CUDA_BroxOpticalFlowConst + crate::cudaoptflow::CUDA_DenseOpticalFlow { + /// Mutable methods for [crate::cudaoptflow::CUDA_BroxOpticalFlow] + pub trait CUDA_BroxOpticalFlowTrait: crate::cudaoptflow::CUDA_BroxOpticalFlowTraitConst + crate::cudaoptflow::CUDA_DenseOpticalFlowTrait { fn as_raw_mut_CUDA_BroxOpticalFlow(&mut self) -> *mut c_void; #[inline] @@ -228,7 +228,48 @@ pub mod cudaoptflow { } - impl dyn CUDA_BroxOpticalFlow + '_ { + /// Class computing the optical flow for two images using Brox et al Optical Flow algorithm ([Brox2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Brox2004)). + pub struct CUDA_BroxOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_BroxOpticalFlow } + + impl Drop for CUDA_BroxOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_BroxOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_CUDA_BroxOpticalFlow_delete(self.as_raw_mut_CUDA_BroxOpticalFlow()) }; + } + } + + unsafe impl Send for CUDA_BroxOpticalFlow {} + + impl core::AlgorithmTraitConst for CUDA_BroxOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_BroxOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for CUDA_BroxOpticalFlow { + #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for CUDA_BroxOpticalFlow { + #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_BroxOpticalFlowTraitConst for CUDA_BroxOpticalFlow { + #[inline] fn as_raw_CUDA_BroxOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_BroxOpticalFlowTrait for CUDA_BroxOpticalFlow { + #[inline] fn as_raw_mut_CUDA_BroxOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_BroxOpticalFlow { /// ## C++ default parameters /// * alpha: 0.197 /// * gamma: 50.0 @@ -237,24 +278,27 @@ pub mod cudaoptflow { /// * outer_iterations: 150 /// * solver_iterations: 10 #[inline] - pub fn create(alpha: f64, gamma: f64, scale_factor: f64, inner_iterations: i32, outer_iterations: i32, solver_iterations: i32) -> Result> { + pub fn create(alpha: f64, gamma: f64, scale_factor: f64, inner_iterations: i32, outer_iterations: i32, solver_iterations: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_BroxOpticalFlow_create_double_double_double_int_int_int(alpha, gamma, scale_factor, inner_iterations, outer_iterations, solver_iterations, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { CUDA_BroxOpticalFlow, core::Algorithm, cv_CUDA_BroxOpticalFlow_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_DenseOpticalFlow] - pub trait CUDA_DenseOpticalFlowConst: core::AlgorithmTraitConst { + pub trait CUDA_DenseOpticalFlowTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void; } - /// Base interface for dense optical flow algorithms. - pub trait CUDA_DenseOpticalFlow: core::AlgorithmTrait + crate::cudaoptflow::CUDA_DenseOpticalFlowConst { + /// Mutable methods for [crate::cudaoptflow::CUDA_DenseOpticalFlow] + pub trait CUDA_DenseOpticalFlowTrait: core::AlgorithmTrait + crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst { fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void; /// Calculates a dense optical flow. @@ -281,8 +325,46 @@ pub mod cudaoptflow { } + /// Base interface for dense optical flow algorithms. + pub struct CUDA_DenseOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_DenseOpticalFlow } + + impl Drop for CUDA_DenseOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_DenseOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_CUDA_DenseOpticalFlow_delete(self.as_raw_mut_CUDA_DenseOpticalFlow()) }; + } + } + + unsafe impl Send for CUDA_DenseOpticalFlow {} + + impl core::AlgorithmTraitConst for CUDA_DenseOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_DenseOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for CUDA_DenseOpticalFlow { + #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for CUDA_DenseOpticalFlow { + #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_DenseOpticalFlow { + } + + boxed_cast_base! { CUDA_DenseOpticalFlow, core::Algorithm, cv_CUDA_DenseOpticalFlow_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_DensePyrLKOpticalFlow] - pub trait CUDA_DensePyrLKOpticalFlowConst: crate::cudaoptflow::CUDA_DenseOpticalFlowConst { + pub trait CUDA_DensePyrLKOpticalFlowTraitConst: crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst { fn as_raw_CUDA_DensePyrLKOpticalFlow(&self) -> *const c_void; #[inline] @@ -323,11 +405,8 @@ pub mod cudaoptflow { } - /// Class used for calculating a dense optical flow. - /// - /// The class can calculate an optical flow for a dense optical flow using the - /// iterative Lucas-Kanade method with pyramids. - pub trait CUDA_DensePyrLKOpticalFlow: crate::cudaoptflow::CUDA_DenseOpticalFlow + crate::cudaoptflow::CUDA_DensePyrLKOpticalFlowConst { + /// Mutable methods for [crate::cudaoptflow::CUDA_DensePyrLKOpticalFlow] + pub trait CUDA_DensePyrLKOpticalFlowTrait: crate::cudaoptflow::CUDA_DenseOpticalFlowTrait + crate::cudaoptflow::CUDA_DensePyrLKOpticalFlowTraitConst { fn as_raw_mut_CUDA_DensePyrLKOpticalFlow(&mut self) -> *mut c_void; #[inline] @@ -368,25 +447,72 @@ pub mod cudaoptflow { } - impl dyn CUDA_DensePyrLKOpticalFlow + '_ { + /// Class used for calculating a dense optical flow. + /// + /// The class can calculate an optical flow for a dense optical flow using the + /// iterative Lucas-Kanade method with pyramids. + pub struct CUDA_DensePyrLKOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_DensePyrLKOpticalFlow } + + impl Drop for CUDA_DensePyrLKOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_DensePyrLKOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_CUDA_DensePyrLKOpticalFlow_delete(self.as_raw_mut_CUDA_DensePyrLKOpticalFlow()) }; + } + } + + unsafe impl Send for CUDA_DensePyrLKOpticalFlow {} + + impl core::AlgorithmTraitConst for CUDA_DensePyrLKOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_DensePyrLKOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for CUDA_DensePyrLKOpticalFlow { + #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for CUDA_DensePyrLKOpticalFlow { + #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_DensePyrLKOpticalFlowTraitConst for CUDA_DensePyrLKOpticalFlow { + #[inline] fn as_raw_CUDA_DensePyrLKOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_DensePyrLKOpticalFlowTrait for CUDA_DensePyrLKOpticalFlow { + #[inline] fn as_raw_mut_CUDA_DensePyrLKOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_DensePyrLKOpticalFlow { /// ## C++ default parameters /// * win_size: Size(13,13) /// * max_level: 3 /// * iters: 30 /// * use_initial_flow: false #[inline] - pub fn create(win_size: core::Size, max_level: i32, iters: i32, use_initial_flow: bool) -> Result> { + pub fn create(win_size: core::Size, max_level: i32, iters: i32, use_initial_flow: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_create_Size_int_int_bool(win_size.opencv_as_extern(), max_level, iters, use_initial_flow, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { CUDA_DensePyrLKOpticalFlow, core::Algorithm, cv_CUDA_DensePyrLKOpticalFlow_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_FarnebackOpticalFlow] - pub trait CUDA_FarnebackOpticalFlowConst: crate::cudaoptflow::CUDA_DenseOpticalFlowConst { + pub trait CUDA_FarnebackOpticalFlowTraitConst: crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst { fn as_raw_CUDA_FarnebackOpticalFlow(&self) -> *const c_void; #[inline] @@ -463,8 +589,8 @@ pub mod cudaoptflow { } - /// Class computing a dense optical flow using the Gunnar Farneback's algorithm. - pub trait CUDA_FarnebackOpticalFlow: crate::cudaoptflow::CUDA_DenseOpticalFlow + crate::cudaoptflow::CUDA_FarnebackOpticalFlowConst { + /// Mutable methods for [crate::cudaoptflow::CUDA_FarnebackOpticalFlow] + pub trait CUDA_FarnebackOpticalFlowTrait: crate::cudaoptflow::CUDA_DenseOpticalFlowTrait + crate::cudaoptflow::CUDA_FarnebackOpticalFlowTraitConst { fn as_raw_mut_CUDA_FarnebackOpticalFlow(&mut self) -> *mut c_void; #[inline] @@ -541,7 +667,48 @@ pub mod cudaoptflow { } - impl dyn CUDA_FarnebackOpticalFlow + '_ { + /// Class computing a dense optical flow using the Gunnar Farneback's algorithm. + pub struct CUDA_FarnebackOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_FarnebackOpticalFlow } + + impl Drop for CUDA_FarnebackOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_FarnebackOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_CUDA_FarnebackOpticalFlow_delete(self.as_raw_mut_CUDA_FarnebackOpticalFlow()) }; + } + } + + unsafe impl Send for CUDA_FarnebackOpticalFlow {} + + impl core::AlgorithmTraitConst for CUDA_FarnebackOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_FarnebackOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for CUDA_FarnebackOpticalFlow { + #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for CUDA_FarnebackOpticalFlow { + #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_FarnebackOpticalFlowTraitConst for CUDA_FarnebackOpticalFlow { + #[inline] fn as_raw_CUDA_FarnebackOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_FarnebackOpticalFlowTrait for CUDA_FarnebackOpticalFlow { + #[inline] fn as_raw_mut_CUDA_FarnebackOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_FarnebackOpticalFlow { /// ## C++ default parameters /// * num_levels: 5 /// * pyr_scale: 0.5 @@ -552,18 +719,21 @@ pub mod cudaoptflow { /// * poly_sigma: 1.1 /// * flags: 0 #[inline] - pub fn create(num_levels: i32, pyr_scale: f64, fast_pyramids: bool, win_size: i32, num_iters: i32, poly_n: i32, poly_sigma: f64, flags: i32) -> Result> { + pub fn create(num_levels: i32, pyr_scale: f64, fast_pyramids: bool, win_size: i32, num_iters: i32, poly_n: i32, poly_sigma: f64, flags: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_FarnebackOpticalFlow_create_int_double_bool_int_int_int_double_int(num_levels, pyr_scale, fast_pyramids, win_size, num_iters, poly_n, poly_sigma, flags, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { CUDA_FarnebackOpticalFlow, core::Algorithm, cv_CUDA_FarnebackOpticalFlow_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_NvidiaHWOpticalFlow] - pub trait CUDA_NvidiaHWOpticalFlowConst: core::AlgorithmTraitConst { + pub trait CUDA_NvidiaHWOpticalFlowTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_NvidiaHWOpticalFlow(&self) -> *const c_void; /// Returns grid size of output buffer as per the hardware's capability. @@ -578,8 +748,8 @@ pub mod cudaoptflow { } - /// Base Interface for optical flow algorithms using NVIDIA Optical Flow SDK. - pub trait CUDA_NvidiaHWOpticalFlow: core::AlgorithmTrait + crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowConst { + /// Mutable methods for [crate::cudaoptflow::CUDA_NvidiaHWOpticalFlow] + pub trait CUDA_NvidiaHWOpticalFlowTrait: core::AlgorithmTrait + crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTraitConst { fn as_raw_mut_CUDA_NvidiaHWOpticalFlow(&mut self) -> *mut c_void; /// Calculates Optical Flow using NVIDIA Optical Flow SDK. @@ -636,20 +806,52 @@ pub mod cudaoptflow { } + /// Base Interface for optical flow algorithms using NVIDIA Optical Flow SDK. + pub struct CUDA_NvidiaHWOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_NvidiaHWOpticalFlow } + + impl Drop for CUDA_NvidiaHWOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_NvidiaHWOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_CUDA_NvidiaHWOpticalFlow_delete(self.as_raw_mut_CUDA_NvidiaHWOpticalFlow()) }; + } + } + + unsafe impl Send for CUDA_NvidiaHWOpticalFlow {} + + impl core::AlgorithmTraitConst for CUDA_NvidiaHWOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_NvidiaHWOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTraitConst for CUDA_NvidiaHWOpticalFlow { + #[inline] fn as_raw_CUDA_NvidiaHWOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTrait for CUDA_NvidiaHWOpticalFlow { + #[inline] fn as_raw_mut_CUDA_NvidiaHWOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_NvidiaHWOpticalFlow { + } + + boxed_cast_base! { CUDA_NvidiaHWOpticalFlow, core::Algorithm, cv_CUDA_NvidiaHWOpticalFlow_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0] - pub trait CUDA_NvidiaOpticalFlow_1_0Const: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowConst { + pub trait CUDA_NvidiaOpticalFlow_1_0TraitConst: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTraitConst { fn as_raw_CUDA_NvidiaOpticalFlow_1_0(&self) -> *const c_void; } - /// Class for computing the optical flow vectors between two images using NVIDIA Optical Flow hardware and Optical Flow SDK 1.0. - /// - /// Note: - /// - A sample application demonstrating the use of NVIDIA Optical Flow can be found at - /// opencv_contrib_source_code/modules/cudaoptflow/samples/nvidia_optical_flow.cpp - /// - An example application comparing accuracy and performance of NVIDIA Optical Flow with other optical flow algorithms in OpenCV can be found at - /// opencv_contrib_source_code/modules/cudaoptflow/samples/optical_flow.cpp - pub trait CUDA_NvidiaOpticalFlow_1_0: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlow + crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0Const { + /// Mutable methods for [crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0] + pub trait CUDA_NvidiaOpticalFlow_1_0Trait: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTrait + crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0TraitConst { fn as_raw_mut_CUDA_NvidiaOpticalFlow_1_0(&mut self) -> *mut c_void; /// The NVIDIA optical flow hardware generates flow vectors at granularity gridSize, which can be queried via function getGridSize(). @@ -674,7 +876,54 @@ pub mod cudaoptflow { } - impl dyn CUDA_NvidiaOpticalFlow_1_0 + '_ { + /// Class for computing the optical flow vectors between two images using NVIDIA Optical Flow hardware and Optical Flow SDK 1.0. + /// + /// Note: + /// - A sample application demonstrating the use of NVIDIA Optical Flow can be found at + /// opencv_contrib_source_code/modules/cudaoptflow/samples/nvidia_optical_flow.cpp + /// - An example application comparing accuracy and performance of NVIDIA Optical Flow with other optical flow algorithms in OpenCV can be found at + /// opencv_contrib_source_code/modules/cudaoptflow/samples/optical_flow.cpp + pub struct CUDA_NvidiaOpticalFlow_1_0 { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_NvidiaOpticalFlow_1_0 } + + impl Drop for CUDA_NvidiaOpticalFlow_1_0 { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_NvidiaOpticalFlow_1_0_delete(instance: *mut c_void); } + unsafe { cv_CUDA_NvidiaOpticalFlow_1_0_delete(self.as_raw_mut_CUDA_NvidiaOpticalFlow_1_0()) }; + } + } + + unsafe impl Send for CUDA_NvidiaOpticalFlow_1_0 {} + + impl core::AlgorithmTraitConst for CUDA_NvidiaOpticalFlow_1_0 { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_NvidiaOpticalFlow_1_0 { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTraitConst for CUDA_NvidiaOpticalFlow_1_0 { + #[inline] fn as_raw_CUDA_NvidiaHWOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTrait for CUDA_NvidiaOpticalFlow_1_0 { + #[inline] fn as_raw_mut_CUDA_NvidiaHWOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0TraitConst for CUDA_NvidiaOpticalFlow_1_0 { + #[inline] fn as_raw_CUDA_NvidiaOpticalFlow_1_0(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0Trait for CUDA_NvidiaOpticalFlow_1_0 { + #[inline] fn as_raw_mut_CUDA_NvidiaOpticalFlow_1_0(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_NvidiaOpticalFlow_1_0 { /// Instantiate NVIDIA Optical Flow /// /// ## Parameters @@ -703,30 +952,27 @@ pub mod cudaoptflow { /// * input_stream: Stream::Null() /// * output_stream: Stream::Null() #[inline] - pub fn create(image_size: core::Size, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0_NVIDIA_OF_PERF_LEVEL, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result> { + pub fn create(image_size: core::Size, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0_NVIDIA_OF_PERF_LEVEL, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_NvidiaOpticalFlow_1_0_create_Size_NVIDIA_OF_PERF_LEVEL_bool_bool_bool_int_StreamR_StreamR(image_size.opencv_as_extern(), perf_preset, enable_temporal_hints, enable_external_hints, enable_cost_buffer, gpu_id, input_stream.as_raw_mut_Stream(), output_stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { CUDA_NvidiaOpticalFlow_1_0, core::Algorithm, cv_CUDA_NvidiaOpticalFlow_1_0_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0] - pub trait CUDA_NvidiaOpticalFlow_2_0Const: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowConst { + pub trait CUDA_NvidiaOpticalFlow_2_0TraitConst: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTraitConst { fn as_raw_CUDA_NvidiaOpticalFlow_2_0(&self) -> *const c_void; } - /// Class for computing the optical flow vectors between two images using NVIDIA Optical Flow hardware and Optical Flow SDK 2.0. - /// - /// Note: - /// - A sample application demonstrating the use of NVIDIA Optical Flow can be found at - /// opencv_contrib_source_code/modules/cudaoptflow/samples/nvidia_optical_flow.cpp - /// - An example application comparing accuracy and performance of NVIDIA Optical Flow with other optical flow algorithms in OpenCV can be found at - /// opencv_contrib_source_code/modules/cudaoptflow/samples/optical_flow.cpp - pub trait CUDA_NvidiaOpticalFlow_2_0: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlow + crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0Const { + /// Mutable methods for [crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0] + pub trait CUDA_NvidiaOpticalFlow_2_0Trait: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTrait + crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0TraitConst { fn as_raw_mut_CUDA_NvidiaOpticalFlow_2_0(&mut self) -> *mut c_void; /// convertToFloat() helper function converts the hardware-generated flow vectors to floating point representation (1 flow vector for gridSize). @@ -748,7 +994,54 @@ pub mod cudaoptflow { } - impl dyn CUDA_NvidiaOpticalFlow_2_0 + '_ { + /// Class for computing the optical flow vectors between two images using NVIDIA Optical Flow hardware and Optical Flow SDK 2.0. + /// + /// Note: + /// - A sample application demonstrating the use of NVIDIA Optical Flow can be found at + /// opencv_contrib_source_code/modules/cudaoptflow/samples/nvidia_optical_flow.cpp + /// - An example application comparing accuracy and performance of NVIDIA Optical Flow with other optical flow algorithms in OpenCV can be found at + /// opencv_contrib_source_code/modules/cudaoptflow/samples/optical_flow.cpp + pub struct CUDA_NvidiaOpticalFlow_2_0 { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_NvidiaOpticalFlow_2_0 } + + impl Drop for CUDA_NvidiaOpticalFlow_2_0 { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_NvidiaOpticalFlow_2_0_delete(instance: *mut c_void); } + unsafe { cv_CUDA_NvidiaOpticalFlow_2_0_delete(self.as_raw_mut_CUDA_NvidiaOpticalFlow_2_0()) }; + } + } + + unsafe impl Send for CUDA_NvidiaOpticalFlow_2_0 {} + + impl core::AlgorithmTraitConst for CUDA_NvidiaOpticalFlow_2_0 { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_NvidiaOpticalFlow_2_0 { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTraitConst for CUDA_NvidiaOpticalFlow_2_0 { + #[inline] fn as_raw_CUDA_NvidiaHWOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTrait for CUDA_NvidiaOpticalFlow_2_0 { + #[inline] fn as_raw_mut_CUDA_NvidiaHWOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0TraitConst for CUDA_NvidiaOpticalFlow_2_0 { + #[inline] fn as_raw_CUDA_NvidiaOpticalFlow_2_0(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0Trait for CUDA_NvidiaOpticalFlow_2_0 { + #[inline] fn as_raw_mut_CUDA_NvidiaOpticalFlow_2_0(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_NvidiaOpticalFlow_2_0 { /// Instantiate NVIDIA Optical Flow /// /// ## Parameters @@ -783,12 +1076,12 @@ pub mod cudaoptflow { /// * input_stream: Stream::Null() /// * output_stream: Stream::Null() #[inline] - pub fn create(image_size: core::Size, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL, output_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE, hint_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result> { + pub fn create(image_size: core::Size, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL, output_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE, hint_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_NvidiaOpticalFlow_2_0_create_Size_NVIDIA_OF_PERF_LEVEL_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE_NVIDIA_OF_HINT_VECTOR_GRID_SIZE_bool_bool_bool_int_StreamR_StreamR(image_size.opencv_as_extern(), perf_preset, output_grid_size, hint_grid_size, enable_temporal_hints, enable_external_hints, enable_cost_buffer, gpu_id, input_stream.as_raw_mut_Stream(), output_stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -827,18 +1120,21 @@ pub mod cudaoptflow { /// * input_stream: Stream::Null() /// * output_stream: Stream::Null() #[inline] - pub fn create_1(image_size: core::Size, mut roi_data: core::Vector, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL, output_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE, hint_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result> { + pub fn create_1(image_size: core::Size, mut roi_data: core::Vector, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL, output_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE, hint_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_NvidiaOpticalFlow_2_0_create_Size_vectorLRectG_NVIDIA_OF_PERF_LEVEL_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE_NVIDIA_OF_HINT_VECTOR_GRID_SIZE_bool_bool_bool_int_StreamR_StreamR(image_size.opencv_as_extern(), roi_data.as_raw_mut_VectorOfRect(), perf_preset, output_grid_size, hint_grid_size, enable_temporal_hints, enable_external_hints, enable_cost_buffer, gpu_id, input_stream.as_raw_mut_Stream(), output_stream.as_raw_mut_Stream(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { CUDA_NvidiaOpticalFlow_2_0, core::Algorithm, cv_CUDA_NvidiaOpticalFlow_2_0_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1] - pub trait CUDA_OpticalFlowDual_TVL1Const: crate::cudaoptflow::CUDA_DenseOpticalFlowConst { + pub trait CUDA_OpticalFlowDual_TVL1TraitConst: crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst { fn as_raw_CUDA_OpticalFlowDual_TVL1(&self) -> *const c_void; /// Time step of the numerical scheme. @@ -954,13 +1250,8 @@ pub mod cudaoptflow { } - /// Implementation of the Zach, Pock and Bischof Dual TV-L1 Optical Flow method. - /// - /// - /// Note: C. Zach, T. Pock and H. Bischof, "A Duality Based Approach for Realtime TV-L1 Optical Flow". - /// - /// Note: Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. "TV-L1 Optical Flow Estimation". - pub trait CUDA_OpticalFlowDual_TVL1: crate::cudaoptflow::CUDA_DenseOpticalFlow + crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1Const { + /// Mutable methods for [crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1] + pub trait CUDA_OpticalFlowDual_TVL1Trait: crate::cudaoptflow::CUDA_DenseOpticalFlowTrait + crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1TraitConst { fn as_raw_mut_CUDA_OpticalFlowDual_TVL1(&mut self) -> *mut c_void; #[inline] @@ -1055,7 +1346,53 @@ pub mod cudaoptflow { } - impl dyn CUDA_OpticalFlowDual_TVL1 + '_ { + /// Implementation of the Zach, Pock and Bischof Dual TV-L1 Optical Flow method. + /// + /// + /// Note: C. Zach, T. Pock and H. Bischof, "A Duality Based Approach for Realtime TV-L1 Optical Flow". + /// + /// Note: Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. "TV-L1 Optical Flow Estimation". + pub struct CUDA_OpticalFlowDual_TVL1 { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_OpticalFlowDual_TVL1 } + + impl Drop for CUDA_OpticalFlowDual_TVL1 { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_OpticalFlowDual_TVL1_delete(instance: *mut c_void); } + unsafe { cv_CUDA_OpticalFlowDual_TVL1_delete(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1()) }; + } + } + + unsafe impl Send for CUDA_OpticalFlowDual_TVL1 {} + + impl core::AlgorithmTraitConst for CUDA_OpticalFlowDual_TVL1 { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_OpticalFlowDual_TVL1 { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for CUDA_OpticalFlowDual_TVL1 { + #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for CUDA_OpticalFlowDual_TVL1 { + #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1TraitConst for CUDA_OpticalFlowDual_TVL1 { + #[inline] fn as_raw_CUDA_OpticalFlowDual_TVL1(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1Trait for CUDA_OpticalFlowDual_TVL1 { + #[inline] fn as_raw_mut_CUDA_OpticalFlowDual_TVL1(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_OpticalFlowDual_TVL1 { /// ## C++ default parameters /// * tau: 0.25 /// * lambda: 0.15 @@ -1068,24 +1405,27 @@ pub mod cudaoptflow { /// * gamma: 0.0 /// * use_initial_flow: false #[inline] - pub fn create(tau: f64, lambda: f64, theta: f64, nscales: i32, warps: i32, epsilon: f64, iterations: i32, scale_step: f64, gamma: f64, use_initial_flow: bool) -> Result> { + pub fn create(tau: f64, lambda: f64, theta: f64, nscales: i32, warps: i32, epsilon: f64, iterations: i32, scale_step: f64, gamma: f64, use_initial_flow: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_create_double_double_double_int_int_double_int_double_double_bool(tau, lambda, theta, nscales, warps, epsilon, iterations, scale_step, gamma, use_initial_flow, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { CUDA_OpticalFlowDual_TVL1, core::Algorithm, cv_CUDA_OpticalFlowDual_TVL1_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_SparseOpticalFlow] - pub trait CUDA_SparseOpticalFlowConst: core::AlgorithmTraitConst { + pub trait CUDA_SparseOpticalFlowTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_SparseOpticalFlow(&self) -> *const c_void; } - /// Base interface for sparse optical flow algorithms. - pub trait CUDA_SparseOpticalFlow: core::AlgorithmTrait + crate::cudaoptflow::CUDA_SparseOpticalFlowConst { + /// Mutable methods for [crate::cudaoptflow::CUDA_SparseOpticalFlow] + pub trait CUDA_SparseOpticalFlowTrait: core::AlgorithmTrait + crate::cudaoptflow::CUDA_SparseOpticalFlowTraitConst { fn as_raw_mut_CUDA_SparseOpticalFlow(&mut self) -> *mut c_void; /// Calculates a sparse optical flow. @@ -1120,8 +1460,46 @@ pub mod cudaoptflow { } + /// Base interface for sparse optical flow algorithms. + pub struct CUDA_SparseOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_SparseOpticalFlow } + + impl Drop for CUDA_SparseOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_SparseOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_CUDA_SparseOpticalFlow_delete(self.as_raw_mut_CUDA_SparseOpticalFlow()) }; + } + } + + unsafe impl Send for CUDA_SparseOpticalFlow {} + + impl core::AlgorithmTraitConst for CUDA_SparseOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_SparseOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_SparseOpticalFlowTraitConst for CUDA_SparseOpticalFlow { + #[inline] fn as_raw_CUDA_SparseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_SparseOpticalFlowTrait for CUDA_SparseOpticalFlow { + #[inline] fn as_raw_mut_CUDA_SparseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_SparseOpticalFlow { + } + + boxed_cast_base! { CUDA_SparseOpticalFlow, core::Algorithm, cv_CUDA_SparseOpticalFlow_to_Algorithm } + /// Constant methods for [crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlow] - pub trait CUDA_SparsePyrLKOpticalFlowConst: crate::cudaoptflow::CUDA_SparseOpticalFlowConst { + pub trait CUDA_SparsePyrLKOpticalFlowTraitConst: crate::cudaoptflow::CUDA_SparseOpticalFlowTraitConst { fn as_raw_CUDA_SparsePyrLKOpticalFlow(&self) -> *const c_void; #[inline] @@ -1162,18 +1540,8 @@ pub mod cudaoptflow { } - /// Class used for calculating a sparse optical flow. - /// - /// The class can calculate an optical flow for a sparse feature set using the - /// iterative Lucas-Kanade method with pyramids. - /// ## See also - /// calcOpticalFlowPyrLK - /// - /// - /// Note: - /// * An example of the Lucas Kanade optical flow algorithm can be found at - /// opencv_source_code/samples/gpu/pyrlk_optical_flow.cpp - pub trait CUDA_SparsePyrLKOpticalFlow: crate::cudaoptflow::CUDA_SparseOpticalFlow + crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlowConst { + /// Mutable methods for [crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlow] + pub trait CUDA_SparsePyrLKOpticalFlowTrait: crate::cudaoptflow::CUDA_SparseOpticalFlowTrait + crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlowTraitConst { fn as_raw_mut_CUDA_SparsePyrLKOpticalFlow(&mut self) -> *mut c_void; #[inline] @@ -1214,20 +1582,74 @@ pub mod cudaoptflow { } - impl dyn CUDA_SparsePyrLKOpticalFlow + '_ { + /// Class used for calculating a sparse optical flow. + /// + /// The class can calculate an optical flow for a sparse feature set using the + /// iterative Lucas-Kanade method with pyramids. + /// ## See also + /// calcOpticalFlowPyrLK + /// + /// + /// Note: + /// * An example of the Lucas Kanade optical flow algorithm can be found at + /// opencv_source_code/samples/gpu/pyrlk_optical_flow.cpp + pub struct CUDA_SparsePyrLKOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_SparsePyrLKOpticalFlow } + + impl Drop for CUDA_SparsePyrLKOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_SparsePyrLKOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_CUDA_SparsePyrLKOpticalFlow_delete(self.as_raw_mut_CUDA_SparsePyrLKOpticalFlow()) }; + } + } + + unsafe impl Send for CUDA_SparsePyrLKOpticalFlow {} + + impl core::AlgorithmTraitConst for CUDA_SparsePyrLKOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_SparsePyrLKOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_SparseOpticalFlowTraitConst for CUDA_SparsePyrLKOpticalFlow { + #[inline] fn as_raw_CUDA_SparseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_SparseOpticalFlowTrait for CUDA_SparsePyrLKOpticalFlow { + #[inline] fn as_raw_mut_CUDA_SparseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlowTraitConst for CUDA_SparsePyrLKOpticalFlow { + #[inline] fn as_raw_CUDA_SparsePyrLKOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlowTrait for CUDA_SparsePyrLKOpticalFlow { + #[inline] fn as_raw_mut_CUDA_SparsePyrLKOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_SparsePyrLKOpticalFlow { /// ## C++ default parameters /// * win_size: Size(21,21) /// * max_level: 3 /// * iters: 30 /// * use_initial_flow: false #[inline] - pub fn create(win_size: core::Size, max_level: i32, iters: i32, use_initial_flow: bool) -> Result> { + pub fn create(win_size: core::Size, max_level: i32, iters: i32, use_initial_flow: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_create_Size_int_int_bool(win_size.opencv_as_extern(), max_level, iters, use_initial_flow, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { CUDA_SparsePyrLKOpticalFlow, core::Algorithm, cv_CUDA_SparsePyrLKOpticalFlow_to_Algorithm } +} diff --git a/docs/cudastereo.rs b/docs/cudastereo.rs index 3f48be8e0..170b920cb 100644 --- a/docs/cudastereo.rs +++ b/docs/cudastereo.rs @@ -2,7 +2,7 @@ pub mod cudastereo { //! # Stereo Correspondence use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::CUDA_StereoBMConst, super::CUDA_StereoBM, super::CUDA_StereoBeliefPropagationConst, super::CUDA_StereoBeliefPropagation, super::CUDA_StereoConstantSpaceBPConst, super::CUDA_StereoConstantSpaceBP, super::CUDA_StereoSGMConst, super::CUDA_StereoSGM, super::CUDA_DisparityBilateralFilterConst, super::CUDA_DisparityBilateralFilter }; + pub use { super::CUDA_StereoBMTraitConst, super::CUDA_StereoBMTrait, super::CUDA_StereoBeliefPropagationTraitConst, super::CUDA_StereoBeliefPropagationTrait, super::CUDA_StereoConstantSpaceBPTraitConst, super::CUDA_StereoConstantSpaceBPTrait, super::CUDA_StereoSGMTraitConst, super::CUDA_StereoSGMTrait, super::CUDA_DisparityBilateralFilterTraitConst, super::CUDA_DisparityBilateralFilterTrait }; } /// Creates DisparityBilateralFilter object. @@ -17,12 +17,12 @@ pub mod cudastereo { /// * radius: 3 /// * iters: 1 #[inline] - pub fn create_disparity_bilateral_filter(ndisp: i32, radius: i32, iters: i32) -> Result> { + pub fn create_disparity_bilateral_filter(ndisp: i32, radius: i32, iters: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createDisparityBilateralFilter_int_int_int(ndisp, radius, iters, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -41,12 +41,12 @@ pub mod cudastereo { /// * num_disparities: 64 /// * block_size: 19 #[inline] - pub fn create_stereo_bm(num_disparities: i32, block_size: i32) -> Result> { + pub fn create_stereo_bm(num_disparities: i32, block_size: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createStereoBM_int_int(num_disparities, block_size, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -64,12 +64,12 @@ pub mod cudastereo { /// * levels: 5 /// * msg_type: CV_32F #[inline] - pub fn create_stereo_belief_propagation(ndisp: i32, iters: i32, levels: i32, msg_type: i32) -> Result> { + pub fn create_stereo_belief_propagation(ndisp: i32, iters: i32, levels: i32, msg_type: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createStereoBeliefPropagation_int_int_int_int(ndisp, iters, levels, msg_type, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -89,12 +89,12 @@ pub mod cudastereo { /// * nr_plane: 4 /// * msg_type: CV_32F #[inline] - pub fn create_stereo_constant_space_bp(ndisp: i32, iters: i32, levels: i32, nr_plane: i32, msg_type: i32) -> Result> { + pub fn create_stereo_constant_space_bp(ndisp: i32, iters: i32, levels: i32, nr_plane: i32, msg_type: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createStereoConstantSpaceBP_int_int_int_int_int(ndisp, iters, levels, nr_plane, msg_type, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -119,12 +119,12 @@ pub mod cudastereo { /// * uniqueness_ratio: 5 /// * mode: cv::cuda::StereoSGM::MODE_HH4 #[inline] - pub fn create_stereo_sgm(min_disparity: i32, num_disparities: i32, p1: i32, p2: i32, uniqueness_ratio: i32, mode: i32) -> Result> { + pub fn create_stereo_sgm(min_disparity: i32, num_disparities: i32, p1: i32, p2: i32, uniqueness_ratio: i32, mode: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_cuda_createStereoSGM_int_int_int_int_int_int(min_disparity, num_disparities, p1, p2, uniqueness_ratio, mode, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -199,7 +199,7 @@ pub mod cudastereo { } /// Constant methods for [crate::cudastereo::CUDA_DisparityBilateralFilter] - pub trait CUDA_DisparityBilateralFilterConst: core::AlgorithmTraitConst { + pub trait CUDA_DisparityBilateralFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_CUDA_DisparityBilateralFilter(&self) -> *const c_void; #[inline] @@ -261,10 +261,8 @@ pub mod cudastereo { } - /// Class refining a disparity map using joint bilateral filtering. : - /// - /// The class implements [Yang2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Yang2010) algorithm. - pub trait CUDA_DisparityBilateralFilter: core::AlgorithmTrait + crate::cudastereo::CUDA_DisparityBilateralFilterConst { + /// Mutable methods for [crate::cudastereo::CUDA_DisparityBilateralFilter] + pub trait CUDA_DisparityBilateralFilterTrait: core::AlgorithmTrait + crate::cudastereo::CUDA_DisparityBilateralFilterTraitConst { fn as_raw_mut_CUDA_DisparityBilateralFilter(&mut self) -> *mut c_void; /// Refines a disparity map using joint bilateral filtering. @@ -345,16 +343,54 @@ pub mod cudastereo { } + /// Class refining a disparity map using joint bilateral filtering. : + /// + /// The class implements [Yang2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Yang2010) algorithm. + pub struct CUDA_DisparityBilateralFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_DisparityBilateralFilter } + + impl Drop for CUDA_DisparityBilateralFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_DisparityBilateralFilter_delete(instance: *mut c_void); } + unsafe { cv_CUDA_DisparityBilateralFilter_delete(self.as_raw_mut_CUDA_DisparityBilateralFilter()) }; + } + } + + unsafe impl Send for CUDA_DisparityBilateralFilter {} + + impl core::AlgorithmTraitConst for CUDA_DisparityBilateralFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_DisparityBilateralFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudastereo::CUDA_DisparityBilateralFilterTraitConst for CUDA_DisparityBilateralFilter { + #[inline] fn as_raw_CUDA_DisparityBilateralFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudastereo::CUDA_DisparityBilateralFilterTrait for CUDA_DisparityBilateralFilter { + #[inline] fn as_raw_mut_CUDA_DisparityBilateralFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_DisparityBilateralFilter { + } + + boxed_cast_base! { CUDA_DisparityBilateralFilter, core::Algorithm, cv_CUDA_DisparityBilateralFilter_to_Algorithm } + /// Constant methods for [crate::cudastereo::CUDA_StereoBM] - pub trait CUDA_StereoBMConst: crate::calib3d::StereoBMConst { + pub trait CUDA_StereoBMTraitConst: crate::calib3d::StereoBMTraitConst { fn as_raw_CUDA_StereoBM(&self) -> *const c_void; } - /// Class computing stereo correspondence (disparity map) using the block matching algorithm. : - /// ## See also - /// StereoBM - pub trait CUDA_StereoBM: crate::calib3d::StereoBM + crate::cudastereo::CUDA_StereoBMConst { + /// Mutable methods for [crate::cudastereo::CUDA_StereoBM] + pub trait CUDA_StereoBMTrait: crate::calib3d::StereoBMTrait + crate::cudastereo::CUDA_StereoBMTraitConst { fn as_raw_mut_CUDA_StereoBM(&mut self) -> *mut c_void; #[inline] @@ -371,8 +407,64 @@ pub mod cudastereo { } + /// Class computing stereo correspondence (disparity map) using the block matching algorithm. : + /// ## See also + /// StereoBM + pub struct CUDA_StereoBM { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_StereoBM } + + impl Drop for CUDA_StereoBM { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_StereoBM_delete(instance: *mut c_void); } + unsafe { cv_CUDA_StereoBM_delete(self.as_raw_mut_CUDA_StereoBM()) }; + } + } + + unsafe impl Send for CUDA_StereoBM {} + + impl core::AlgorithmTraitConst for CUDA_StereoBM { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_StereoBM { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoBMTraitConst for CUDA_StereoBM { + #[inline] fn as_raw_StereoBM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoBMTrait for CUDA_StereoBM { + #[inline] fn as_raw_mut_StereoBM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoMatcherTraitConst for CUDA_StereoBM { + #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoMatcherTrait for CUDA_StereoBM { + #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudastereo::CUDA_StereoBMTraitConst for CUDA_StereoBM { + #[inline] fn as_raw_CUDA_StereoBM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudastereo::CUDA_StereoBMTrait for CUDA_StereoBM { + #[inline] fn as_raw_mut_CUDA_StereoBM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_StereoBM { + } + + boxed_cast_base! { CUDA_StereoBM, core::Algorithm, cv_CUDA_StereoBM_to_Algorithm } + /// Constant methods for [crate::cudastereo::CUDA_StereoBeliefPropagation] - pub trait CUDA_StereoBeliefPropagationConst: crate::calib3d::StereoMatcherConst { + pub trait CUDA_StereoBeliefPropagationTraitConst: crate::calib3d::StereoMatcherTraitConst { fn as_raw_CUDA_StereoBeliefPropagation(&self) -> *const c_void; /// number of BP iterations on each level @@ -447,40 +539,8 @@ pub mod cudastereo { } - /// Class computing stereo correspondence using the belief propagation algorithm. : - /// - /// The class implements algorithm described in [Felzenszwalb2006](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Felzenszwalb2006) . It can compute own data cost - /// (using a truncated linear model) or use a user-provided data cost. - /// - /// - /// Note: - /// StereoBeliefPropagation requires a lot of memory for message storage: - /// - /// ![block formula](https://latex.codecogs.com/png.latex?width%20%5C%5F%20step%20%20%5Ccdot%20height%20%20%5Ccdot%20ndisp%20%20%5Ccdot%204%20%20%5Ccdot%20%281%20%2B%200%2E25%29) - /// - /// and for data cost storage: - /// - /// ![block formula](https://latex.codecogs.com/png.latex?width%5C%5Fstep%20%5Ccdot%20height%20%5Ccdot%20ndisp%20%5Ccdot%20%281%20%2B%200%2E25%20%2B%200%2E0625%20%2B%20%20%5Cdotsm%20%2B%20%5Cfrac%7B1%7D%7B4%5E%7Blevels%7D%7D%29) - /// - /// width_step is the number of bytes in a line including padding. - /// - /// StereoBeliefPropagation uses a truncated linear model for the data cost and discontinuity terms: - /// - /// ![block formula](https://latex.codecogs.com/png.latex?DataCost%20%3D%20data%20%5C%5F%20weight%20%20%5Ccdot%20%5Cmin%20%28%20%5Clvert%20Img%5FLeft%28x%2Cy%29%2DImg%5FRight%28x%2Dd%2Cy%29%20%20%5Crvert%20%2C%20max%20%5C%5F%20data%20%5C%5F%20term%29) - /// - /// ![block formula](https://latex.codecogs.com/png.latex?DiscTerm%20%3D%20%20%5Cmin%20%28disc%20%5C%5F%20single%20%5C%5F%20jump%20%20%5Ccdot%20%5Clvert%20f%5F1%2Df%5F2%20%20%5Crvert%20%2C%20max%20%5C%5F%20disc%20%5C%5F%20term%29) - /// - /// For more details, see [Felzenszwalb2006](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Felzenszwalb2006) . - /// - /// By default, StereoBeliefPropagation uses floating-point arithmetics and the CV_32FC1 type for - /// messages. But it can also use fixed-point arithmetics and the CV_16SC1 message type for better - /// performance. To avoid an overflow in this case, the parameters must satisfy the following - /// requirement: - /// - /// ![block formula](https://latex.codecogs.com/png.latex?10%20%20%5Ccdot%202%5E%7Blevels%2D1%7D%20%20%5Ccdot%20max%20%5C%5F%20data%20%5C%5F%20term%20%3C%20SHRT%20%5C%5F%20MAX) - /// ## See also - /// StereoMatcher - pub trait CUDA_StereoBeliefPropagation: crate::calib3d::StereoMatcher + crate::cudastereo::CUDA_StereoBeliefPropagationConst { + /// Mutable methods for [crate::cudastereo::CUDA_StereoBeliefPropagation] + pub trait CUDA_StereoBeliefPropagationTrait: crate::calib3d::StereoMatcherTrait + crate::cudastereo::CUDA_StereoBeliefPropagationTraitConst { fn as_raw_mut_CUDA_StereoBeliefPropagation(&mut self) -> *mut c_void; /// Enables the stereo correspondence operator that finds the disparity for the specified data cost. @@ -594,7 +654,80 @@ pub mod cudastereo { } - impl dyn CUDA_StereoBeliefPropagation + '_ { + /// Class computing stereo correspondence using the belief propagation algorithm. : + /// + /// The class implements algorithm described in [Felzenszwalb2006](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Felzenszwalb2006) . It can compute own data cost + /// (using a truncated linear model) or use a user-provided data cost. + /// + /// + /// Note: + /// StereoBeliefPropagation requires a lot of memory for message storage: + /// + /// ![block formula](https://latex.codecogs.com/png.latex?width%20%5C%5F%20step%20%20%5Ccdot%20height%20%20%5Ccdot%20ndisp%20%20%5Ccdot%204%20%20%5Ccdot%20%281%20%2B%200%2E25%29) + /// + /// and for data cost storage: + /// + /// ![block formula](https://latex.codecogs.com/png.latex?width%5C%5Fstep%20%5Ccdot%20height%20%5Ccdot%20ndisp%20%5Ccdot%20%281%20%2B%200%2E25%20%2B%200%2E0625%20%2B%20%20%5Cdotsm%20%2B%20%5Cfrac%7B1%7D%7B4%5E%7Blevels%7D%7D%29) + /// + /// width_step is the number of bytes in a line including padding. + /// + /// StereoBeliefPropagation uses a truncated linear model for the data cost and discontinuity terms: + /// + /// ![block formula](https://latex.codecogs.com/png.latex?DataCost%20%3D%20data%20%5C%5F%20weight%20%20%5Ccdot%20%5Cmin%20%28%20%5Clvert%20Img%5FLeft%28x%2Cy%29%2DImg%5FRight%28x%2Dd%2Cy%29%20%20%5Crvert%20%2C%20max%20%5C%5F%20data%20%5C%5F%20term%29) + /// + /// ![block formula](https://latex.codecogs.com/png.latex?DiscTerm%20%3D%20%20%5Cmin%20%28disc%20%5C%5F%20single%20%5C%5F%20jump%20%20%5Ccdot%20%5Clvert%20f%5F1%2Df%5F2%20%20%5Crvert%20%2C%20max%20%5C%5F%20disc%20%5C%5F%20term%29) + /// + /// For more details, see [Felzenszwalb2006](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Felzenszwalb2006) . + /// + /// By default, StereoBeliefPropagation uses floating-point arithmetics and the CV_32FC1 type for + /// messages. But it can also use fixed-point arithmetics and the CV_16SC1 message type for better + /// performance. To avoid an overflow in this case, the parameters must satisfy the following + /// requirement: + /// + /// ![block formula](https://latex.codecogs.com/png.latex?10%20%20%5Ccdot%202%5E%7Blevels%2D1%7D%20%20%5Ccdot%20max%20%5C%5F%20data%20%5C%5F%20term%20%3C%20SHRT%20%5C%5F%20MAX) + /// ## See also + /// StereoMatcher + pub struct CUDA_StereoBeliefPropagation { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_StereoBeliefPropagation } + + impl Drop for CUDA_StereoBeliefPropagation { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_StereoBeliefPropagation_delete(instance: *mut c_void); } + unsafe { cv_CUDA_StereoBeliefPropagation_delete(self.as_raw_mut_CUDA_StereoBeliefPropagation()) }; + } + } + + unsafe impl Send for CUDA_StereoBeliefPropagation {} + + impl core::AlgorithmTraitConst for CUDA_StereoBeliefPropagation { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_StereoBeliefPropagation { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoMatcherTraitConst for CUDA_StereoBeliefPropagation { + #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoMatcherTrait for CUDA_StereoBeliefPropagation { + #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudastereo::CUDA_StereoBeliefPropagationTraitConst for CUDA_StereoBeliefPropagation { + #[inline] fn as_raw_CUDA_StereoBeliefPropagation(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudastereo::CUDA_StereoBeliefPropagationTrait for CUDA_StereoBeliefPropagation { + #[inline] fn as_raw_mut_CUDA_StereoBeliefPropagation(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_StereoBeliefPropagation { /// Uses a heuristic method to compute the recommended parameters ( ndisp, iters and levels ) for the /// specified image size ( width and height ). #[inline] @@ -607,8 +740,11 @@ pub mod cudastereo { } } + + boxed_cast_base! { CUDA_StereoBeliefPropagation, core::Algorithm, cv_CUDA_StereoBeliefPropagation_to_Algorithm } + /// Constant methods for [crate::cudastereo::CUDA_StereoConstantSpaceBP] - pub trait CUDA_StereoConstantSpaceBPConst: crate::cudastereo::CUDA_StereoBeliefPropagationConst { + pub trait CUDA_StereoConstantSpaceBPTraitConst: crate::cudastereo::CUDA_StereoBeliefPropagationTraitConst { fn as_raw_CUDA_StereoConstantSpaceBP(&self) -> *const c_void; /// number of active disparity on the first level @@ -632,6 +768,30 @@ pub mod cudastereo { } + /// Mutable methods for [crate::cudastereo::CUDA_StereoConstantSpaceBP] + pub trait CUDA_StereoConstantSpaceBPTrait: crate::cudastereo::CUDA_StereoBeliefPropagationTrait + crate::cudastereo::CUDA_StereoConstantSpaceBPTraitConst { + fn as_raw_mut_CUDA_StereoConstantSpaceBP(&mut self) -> *mut c_void; + + #[inline] + fn set_nr_plane(&mut self, nr_plane: i32) -> Result<()> { + return_send!(via ocvrs_return); + unsafe { sys::cv_cuda_StereoConstantSpaceBP_setNrPlane_int(self.as_raw_mut_CUDA_StereoConstantSpaceBP(), nr_plane, ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + #[inline] + fn set_use_local_init_data_cost(&mut self, use_local_init_data_cost: bool) -> Result<()> { + return_send!(via ocvrs_return); + unsafe { sys::cv_cuda_StereoConstantSpaceBP_setUseLocalInitDataCost_bool(self.as_raw_mut_CUDA_StereoConstantSpaceBP(), use_local_init_data_cost, ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// Class computing stereo correspondence using the constant space belief propagation algorithm. : /// /// The class implements algorithm described in [Yang2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Yang2010) . StereoConstantSpaceBP supports both local @@ -653,30 +813,55 @@ pub mod cudastereo { /// requirement: /// /// ![block formula](https://latex.codecogs.com/png.latex?10%20%20%5Ccdot%202%5E%7Blevels%2D1%7D%20%20%5Ccdot%20max%20%5C%5F%20data%20%5C%5F%20term%20%3C%20SHRT%20%5C%5F%20MAX) - pub trait CUDA_StereoConstantSpaceBP: crate::cudastereo::CUDA_StereoBeliefPropagation + crate::cudastereo::CUDA_StereoConstantSpaceBPConst { - fn as_raw_mut_CUDA_StereoConstantSpaceBP(&mut self) -> *mut c_void; + pub struct CUDA_StereoConstantSpaceBP { + ptr: *mut c_void + } + opencv_type_boxed! { CUDA_StereoConstantSpaceBP } + + impl Drop for CUDA_StereoConstantSpaceBP { #[inline] - fn set_nr_plane(&mut self, nr_plane: i32) -> Result<()> { - return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_StereoConstantSpaceBP_setNrPlane_int(self.as_raw_mut_CUDA_StereoConstantSpaceBP(), nr_plane, ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) - } - - #[inline] - fn set_use_local_init_data_cost(&mut self, use_local_init_data_cost: bool) -> Result<()> { - return_send!(via ocvrs_return); - unsafe { sys::cv_cuda_StereoConstantSpaceBP_setUseLocalInitDataCost_bool(self.as_raw_mut_CUDA_StereoConstantSpaceBP(), use_local_init_data_cost, ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_CUDA_StereoConstantSpaceBP_delete(instance: *mut c_void); } + unsafe { cv_CUDA_StereoConstantSpaceBP_delete(self.as_raw_mut_CUDA_StereoConstantSpaceBP()) }; } - } - impl dyn CUDA_StereoConstantSpaceBP + '_ { + unsafe impl Send for CUDA_StereoConstantSpaceBP {} + + impl core::AlgorithmTraitConst for CUDA_StereoConstantSpaceBP { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_StereoConstantSpaceBP { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudastereo::CUDA_StereoBeliefPropagationTraitConst for CUDA_StereoConstantSpaceBP { + #[inline] fn as_raw_CUDA_StereoBeliefPropagation(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudastereo::CUDA_StereoBeliefPropagationTrait for CUDA_StereoConstantSpaceBP { + #[inline] fn as_raw_mut_CUDA_StereoBeliefPropagation(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoMatcherTraitConst for CUDA_StereoConstantSpaceBP { + #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoMatcherTrait for CUDA_StereoConstantSpaceBP { + #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudastereo::CUDA_StereoConstantSpaceBPTraitConst for CUDA_StereoConstantSpaceBP { + #[inline] fn as_raw_CUDA_StereoConstantSpaceBP(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudastereo::CUDA_StereoConstantSpaceBPTrait for CUDA_StereoConstantSpaceBP { + #[inline] fn as_raw_mut_CUDA_StereoConstantSpaceBP(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_StereoConstantSpaceBP { /// Uses a heuristic method to compute parameters (ndisp, iters, levelsand nrplane) for the specified /// image size (widthand height). #[inline] @@ -689,23 +874,17 @@ pub mod cudastereo { } } + + boxed_cast_base! { CUDA_StereoConstantSpaceBP, core::Algorithm, cv_CUDA_StereoConstantSpaceBP_to_Algorithm } + /// Constant methods for [crate::cudastereo::CUDA_StereoSGM] - pub trait CUDA_StereoSGMConst: crate::calib3d::StereoSGBMConst { + pub trait CUDA_StereoSGMTraitConst: crate::calib3d::StereoSGBMTraitConst { fn as_raw_CUDA_StereoSGM(&self) -> *const c_void; } - /// The class implements the modified H. Hirschmuller algorithm [HH08](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_HH08). - /// Limitation and difference are as follows: - /// - /// * By default, the algorithm uses only 4 directions which are horizontal and vertical path instead of 8. - /// Set mode=StereoSGM::MODE_HH in createStereoSGM to run the full variant of the algorithm. - /// * Mutual Information cost function is not implemented. - /// Instead, Center-Symmetric Census Transform with ![inline formula](https://latex.codecogs.com/png.latex?9%20%5Ctimes%207) window size from [Spangenberg2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Spangenberg2013) - /// is used for robustness. - /// ## See also - /// cv::StereoSGBM - pub trait CUDA_StereoSGM: crate::calib3d::StereoSGBM + crate::cudastereo::CUDA_StereoSGMConst { + /// Mutable methods for [crate::cudastereo::CUDA_StereoSGM] + pub trait CUDA_StereoSGMTrait: crate::calib3d::StereoSGBMTrait + crate::cudastereo::CUDA_StereoSGMTraitConst { fn as_raw_mut_CUDA_StereoSGM(&mut self) -> *mut c_void; /// Computes disparity map for the specified stereo pair @@ -743,4 +922,67 @@ pub mod cudastereo { } } + + /// The class implements the modified H. Hirschmuller algorithm [HH08](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_HH08). + /// Limitation and difference are as follows: + /// + /// * By default, the algorithm uses only 4 directions which are horizontal and vertical path instead of 8. + /// Set mode=StereoSGM::MODE_HH in createStereoSGM to run the full variant of the algorithm. + /// * Mutual Information cost function is not implemented. + /// Instead, Center-Symmetric Census Transform with ![inline formula](https://latex.codecogs.com/png.latex?9%20%5Ctimes%207) window size from [Spangenberg2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Spangenberg2013) + /// is used for robustness. + /// ## See also + /// cv::StereoSGBM + pub struct CUDA_StereoSGM { + ptr: *mut c_void + } + + opencv_type_boxed! { CUDA_StereoSGM } + + impl Drop for CUDA_StereoSGM { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CUDA_StereoSGM_delete(instance: *mut c_void); } + unsafe { cv_CUDA_StereoSGM_delete(self.as_raw_mut_CUDA_StereoSGM()) }; + } + } + + unsafe impl Send for CUDA_StereoSGM {} + + impl core::AlgorithmTraitConst for CUDA_StereoSGM { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CUDA_StereoSGM { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoMatcherTraitConst for CUDA_StereoSGM { + #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoMatcherTrait for CUDA_StereoSGM { + #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::calib3d::StereoSGBMTraitConst for CUDA_StereoSGM { + #[inline] fn as_raw_StereoSGBM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::calib3d::StereoSGBMTrait for CUDA_StereoSGM { + #[inline] fn as_raw_mut_StereoSGBM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::cudastereo::CUDA_StereoSGMTraitConst for CUDA_StereoSGM { + #[inline] fn as_raw_CUDA_StereoSGM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::cudastereo::CUDA_StereoSGMTrait for CUDA_StereoSGM { + #[inline] fn as_raw_mut_CUDA_StereoSGM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CUDA_StereoSGM { + } + + boxed_cast_base! { CUDA_StereoSGM, core::Algorithm, cv_CUDA_StereoSGM_to_Algorithm } } diff --git a/docs/dnn.rs b/docs/dnn.rs index 4cfdc820c..ad13f0804 100644 --- a/docs/dnn.rs +++ b/docs/dnn.rs @@ -10,7 +10,7 @@ pub mod dnn { //! A network training is in principle not supported. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::DictValueTraitConst, super::DictValueTrait, super::DictTraitConst, super::DictTrait, super::LayerParamsTraitConst, super::LayerParamsTrait, super::BackendNodeTraitConst, super::BackendNodeTrait, super::BackendWrapperConst, super::BackendWrapper, super::LayerTraitConst, super::LayerTrait, super::NetTraitConst, super::NetTrait, super::ModelTraitConst, super::ModelTrait, super::ClassificationModelTraitConst, super::ClassificationModelTrait, super::KeypointsModelTraitConst, super::KeypointsModelTrait, super::SegmentationModelTraitConst, super::SegmentationModelTrait, super::DetectionModelTraitConst, super::DetectionModelTrait, super::TextRecognitionModelTraitConst, super::TextRecognitionModelTrait, super::TextDetectionModelTraitConst, super::TextDetectionModelTrait, super::TextDetectionModel_EASTTraitConst, super::TextDetectionModel_EASTTrait, super::TextDetectionModel_DBTraitConst, super::TextDetectionModel_DBTrait, super::LayerFactoryTraitConst, super::LayerFactoryTrait, super::BlankLayerTraitConst, super::BlankLayerTrait, super::ConstLayerTraitConst, super::ConstLayerTrait, super::LSTMLayerConst, super::LSTMLayer, super::GRULayerTraitConst, super::GRULayerTrait, super::RNNLayerConst, super::RNNLayer, super::BaseConvolutionLayerTraitConst, super::BaseConvolutionLayerTrait, super::ConvolutionLayerTraitConst, super::ConvolutionLayerTrait, super::ConvolutionLayerInt8TraitConst, super::ConvolutionLayerInt8Trait, super::DeconvolutionLayerTraitConst, super::DeconvolutionLayerTrait, super::LRNLayerTraitConst, super::LRNLayerTrait, super::ArgLayerTraitConst, super::ArgLayerTrait, super::GatherLayerTraitConst, super::GatherLayerTrait, super::PoolingLayerTraitConst, super::PoolingLayerTrait, super::PoolingLayerInt8TraitConst, super::PoolingLayerInt8Trait, super::ReduceLayerTraitConst, super::ReduceLayerTrait, super::ReduceLayerInt8TraitConst, super::ReduceLayerInt8Trait, super::SoftmaxLayerTraitConst, super::SoftmaxLayerTrait, super::SoftmaxLayerInt8TraitConst, super::SoftmaxLayerInt8Trait, super::InnerProductLayerTraitConst, super::InnerProductLayerTrait, super::InnerProductLayerInt8TraitConst, super::InnerProductLayerInt8Trait, super::MVNLayerTraitConst, super::MVNLayerTrait, super::ReshapeLayerTraitConst, super::ReshapeLayerTrait, super::FlattenLayerTraitConst, super::FlattenLayerTrait, super::QuantizeLayerTraitConst, super::QuantizeLayerTrait, super::DequantizeLayerTraitConst, super::DequantizeLayerTrait, super::RequantizeLayerTraitConst, super::RequantizeLayerTrait, super::ConcatLayerTraitConst, super::ConcatLayerTrait, super::SplitLayerTraitConst, super::SplitLayerTrait, super::SliceLayerTraitConst, super::SliceLayerTrait, super::PermuteLayerTraitConst, super::PermuteLayerTrait, super::ShuffleChannelLayerTraitConst, super::ShuffleChannelLayerTrait, super::PaddingLayerTraitConst, super::PaddingLayerTrait, super::ActivationLayerTraitConst, super::ActivationLayerTrait, super::ReLULayerTraitConst, super::ReLULayerTrait, super::ReLU6LayerTraitConst, super::ReLU6LayerTrait, super::ChannelsPReLULayerTraitConst, super::ChannelsPReLULayerTrait, super::ELULayerTraitConst, super::ELULayerTrait, super::TanHLayerTraitConst, super::TanHLayerTrait, super::SwishLayerTraitConst, super::SwishLayerTrait, super::MishLayerTraitConst, super::MishLayerTrait, super::SigmoidLayerTraitConst, super::SigmoidLayerTrait, super::BNLLLayerTraitConst, super::BNLLLayerTrait, super::AbsLayerTraitConst, super::AbsLayerTrait, super::PowerLayerTraitConst, super::PowerLayerTrait, super::ExpLayerTraitConst, super::ExpLayerTrait, super::CeilLayerTraitConst, super::CeilLayerTrait, super::FloorLayerTraitConst, super::FloorLayerTrait, super::LogLayerTraitConst, super::LogLayerTrait, super::RoundLayerTraitConst, super::RoundLayerTrait, super::SqrtLayerTraitConst, super::SqrtLayerTrait, super::NotLayerTraitConst, super::NotLayerTrait, super::AcosLayerTraitConst, super::AcosLayerTrait, super::AcoshLayerTraitConst, super::AcoshLayerTrait, super::AsinLayerTraitConst, super::AsinLayerTrait, super::AsinhLayerTraitConst, super::AsinhLayerTrait, super::AtanLayerTraitConst, super::AtanLayerTrait, super::AtanhLayerTraitConst, super::AtanhLayerTrait, super::CosLayerTraitConst, super::CosLayerTrait, super::CoshLayerTraitConst, super::CoshLayerTrait, super::ErfLayerTraitConst, super::ErfLayerTrait, super::HardSwishLayerTraitConst, super::HardSwishLayerTrait, super::SinLayerTraitConst, super::SinLayerTrait, super::SinhLayerTraitConst, super::SinhLayerTrait, super::SoftplusLayerTraitConst, super::SoftplusLayerTrait, super::SoftsignLayerTraitConst, super::SoftsignLayerTrait, super::TanLayerTraitConst, super::TanLayerTrait, super::CeluLayerTraitConst, super::CeluLayerTrait, super::HardSigmoidLayerTraitConst, super::HardSigmoidLayerTrait, super::SeluLayerTraitConst, super::SeluLayerTrait, super::ThresholdedReluLayerTraitConst, super::ThresholdedReluLayerTrait, super::ActivationLayerInt8TraitConst, super::ActivationLayerInt8Trait, super::SignLayerTraitConst, super::SignLayerTrait, super::ShrinkLayerTraitConst, super::ShrinkLayerTrait, super::ReciprocalLayerTraitConst, super::ReciprocalLayerTrait, super::CropLayerTraitConst, super::CropLayerTrait, super::EltwiseLayerTraitConst, super::EltwiseLayerTrait, super::EltwiseLayerInt8TraitConst, super::EltwiseLayerInt8Trait, super::NaryEltwiseLayerTraitConst, super::NaryEltwiseLayerTrait, super::BatchNormLayerTraitConst, super::BatchNormLayerTrait, super::BatchNormLayerInt8TraitConst, super::BatchNormLayerInt8Trait, super::MaxUnpoolLayerTraitConst, super::MaxUnpoolLayerTrait, super::ScaleLayerTraitConst, super::ScaleLayerTrait, super::ScaleLayerInt8TraitConst, super::ScaleLayerInt8Trait, super::ShiftLayerTraitConst, super::ShiftLayerTrait, super::ShiftLayerInt8TraitConst, super::ShiftLayerInt8Trait, super::CompareLayerTraitConst, super::CompareLayerTrait, super::DataAugmentationLayerTraitConst, super::DataAugmentationLayerTrait, super::CorrelationLayerTraitConst, super::CorrelationLayerTrait, super::AccumLayerTraitConst, super::AccumLayerTrait, super::FlowWarpLayerTraitConst, super::FlowWarpLayerTrait, super::PriorBoxLayerTraitConst, super::PriorBoxLayerTrait, super::ReorgLayerTraitConst, super::ReorgLayerTrait, super::RegionLayerTraitConst, super::RegionLayerTrait, super::DetectionOutputLayerTraitConst, super::DetectionOutputLayerTrait, super::NormalizeBBoxLayerTraitConst, super::NormalizeBBoxLayerTrait, super::ResizeLayerTraitConst, super::ResizeLayerTrait, super::InterpLayerTraitConst, super::InterpLayerTrait, super::ProposalLayerTraitConst, super::ProposalLayerTrait, super::CropAndResizeLayerTraitConst, super::CropAndResizeLayerTrait, super::CumSumLayerTraitConst, super::CumSumLayerTrait, super::ScatterLayerTraitConst, super::ScatterLayerTrait, super::ScatterNDLayerTraitConst, super::ScatterNDLayerTrait, super::TileLayerTraitConst, super::TileLayerTrait, super::_RangeTraitConst, super::_RangeTrait }; + pub use { super::DictValueTraitConst, super::DictValueTrait, super::DictTraitConst, super::DictTrait, super::LayerParamsTraitConst, super::LayerParamsTrait, super::BackendNodeTraitConst, super::BackendNodeTrait, super::BackendWrapperTraitConst, super::BackendWrapperTrait, super::LayerTraitConst, super::LayerTrait, super::NetTraitConst, super::NetTrait, super::ModelTraitConst, super::ModelTrait, super::ClassificationModelTraitConst, super::ClassificationModelTrait, super::KeypointsModelTraitConst, super::KeypointsModelTrait, super::SegmentationModelTraitConst, super::SegmentationModelTrait, super::DetectionModelTraitConst, super::DetectionModelTrait, super::TextRecognitionModelTraitConst, super::TextRecognitionModelTrait, super::TextDetectionModelTraitConst, super::TextDetectionModelTrait, super::TextDetectionModel_EASTTraitConst, super::TextDetectionModel_EASTTrait, super::TextDetectionModel_DBTraitConst, super::TextDetectionModel_DBTrait, super::LayerFactoryTraitConst, super::LayerFactoryTrait, super::BlankLayerTraitConst, super::BlankLayerTrait, super::ConstLayerTraitConst, super::ConstLayerTrait, super::LSTMLayerTraitConst, super::LSTMLayerTrait, super::GRULayerTraitConst, super::GRULayerTrait, super::RNNLayerTraitConst, super::RNNLayerTrait, super::BaseConvolutionLayerTraitConst, super::BaseConvolutionLayerTrait, super::ConvolutionLayerTraitConst, super::ConvolutionLayerTrait, super::ConvolutionLayerInt8TraitConst, super::ConvolutionLayerInt8Trait, super::DeconvolutionLayerTraitConst, super::DeconvolutionLayerTrait, super::LRNLayerTraitConst, super::LRNLayerTrait, super::ArgLayerTraitConst, super::ArgLayerTrait, super::GatherLayerTraitConst, super::GatherLayerTrait, super::PoolingLayerTraitConst, super::PoolingLayerTrait, super::PoolingLayerInt8TraitConst, super::PoolingLayerInt8Trait, super::ReduceLayerTraitConst, super::ReduceLayerTrait, super::ReduceLayerInt8TraitConst, super::ReduceLayerInt8Trait, super::SoftmaxLayerTraitConst, super::SoftmaxLayerTrait, super::SoftmaxLayerInt8TraitConst, super::SoftmaxLayerInt8Trait, super::InnerProductLayerTraitConst, super::InnerProductLayerTrait, super::InnerProductLayerInt8TraitConst, super::InnerProductLayerInt8Trait, super::MVNLayerTraitConst, super::MVNLayerTrait, super::ReshapeLayerTraitConst, super::ReshapeLayerTrait, super::FlattenLayerTraitConst, super::FlattenLayerTrait, super::QuantizeLayerTraitConst, super::QuantizeLayerTrait, super::DequantizeLayerTraitConst, super::DequantizeLayerTrait, super::RequantizeLayerTraitConst, super::RequantizeLayerTrait, super::ConcatLayerTraitConst, super::ConcatLayerTrait, super::SplitLayerTraitConst, super::SplitLayerTrait, super::SliceLayerTraitConst, super::SliceLayerTrait, super::PermuteLayerTraitConst, super::PermuteLayerTrait, super::ShuffleChannelLayerTraitConst, super::ShuffleChannelLayerTrait, super::PaddingLayerTraitConst, super::PaddingLayerTrait, super::ActivationLayerTraitConst, super::ActivationLayerTrait, super::ReLULayerTraitConst, super::ReLULayerTrait, super::ReLU6LayerTraitConst, super::ReLU6LayerTrait, super::ChannelsPReLULayerTraitConst, super::ChannelsPReLULayerTrait, super::ELULayerTraitConst, super::ELULayerTrait, super::TanHLayerTraitConst, super::TanHLayerTrait, super::SwishLayerTraitConst, super::SwishLayerTrait, super::MishLayerTraitConst, super::MishLayerTrait, super::SigmoidLayerTraitConst, super::SigmoidLayerTrait, super::BNLLLayerTraitConst, super::BNLLLayerTrait, super::AbsLayerTraitConst, super::AbsLayerTrait, super::PowerLayerTraitConst, super::PowerLayerTrait, super::ExpLayerTraitConst, super::ExpLayerTrait, super::CeilLayerTraitConst, super::CeilLayerTrait, super::FloorLayerTraitConst, super::FloorLayerTrait, super::LogLayerTraitConst, super::LogLayerTrait, super::RoundLayerTraitConst, super::RoundLayerTrait, super::SqrtLayerTraitConst, super::SqrtLayerTrait, super::NotLayerTraitConst, super::NotLayerTrait, super::AcosLayerTraitConst, super::AcosLayerTrait, super::AcoshLayerTraitConst, super::AcoshLayerTrait, super::AsinLayerTraitConst, super::AsinLayerTrait, super::AsinhLayerTraitConst, super::AsinhLayerTrait, super::AtanLayerTraitConst, super::AtanLayerTrait, super::AtanhLayerTraitConst, super::AtanhLayerTrait, super::CosLayerTraitConst, super::CosLayerTrait, super::CoshLayerTraitConst, super::CoshLayerTrait, super::ErfLayerTraitConst, super::ErfLayerTrait, super::HardSwishLayerTraitConst, super::HardSwishLayerTrait, super::SinLayerTraitConst, super::SinLayerTrait, super::SinhLayerTraitConst, super::SinhLayerTrait, super::SoftplusLayerTraitConst, super::SoftplusLayerTrait, super::SoftsignLayerTraitConst, super::SoftsignLayerTrait, super::TanLayerTraitConst, super::TanLayerTrait, super::CeluLayerTraitConst, super::CeluLayerTrait, super::HardSigmoidLayerTraitConst, super::HardSigmoidLayerTrait, super::SeluLayerTraitConst, super::SeluLayerTrait, super::ThresholdedReluLayerTraitConst, super::ThresholdedReluLayerTrait, super::ActivationLayerInt8TraitConst, super::ActivationLayerInt8Trait, super::SignLayerTraitConst, super::SignLayerTrait, super::ShrinkLayerTraitConst, super::ShrinkLayerTrait, super::ReciprocalLayerTraitConst, super::ReciprocalLayerTrait, super::CropLayerTraitConst, super::CropLayerTrait, super::EltwiseLayerTraitConst, super::EltwiseLayerTrait, super::EltwiseLayerInt8TraitConst, super::EltwiseLayerInt8Trait, super::NaryEltwiseLayerTraitConst, super::NaryEltwiseLayerTrait, super::BatchNormLayerTraitConst, super::BatchNormLayerTrait, super::BatchNormLayerInt8TraitConst, super::BatchNormLayerInt8Trait, super::MaxUnpoolLayerTraitConst, super::MaxUnpoolLayerTrait, super::ScaleLayerTraitConst, super::ScaleLayerTrait, super::ScaleLayerInt8TraitConst, super::ScaleLayerInt8Trait, super::ShiftLayerTraitConst, super::ShiftLayerTrait, super::ShiftLayerInt8TraitConst, super::ShiftLayerInt8Trait, super::CompareLayerTraitConst, super::CompareLayerTrait, super::DataAugmentationLayerTraitConst, super::DataAugmentationLayerTrait, super::CorrelationLayerTraitConst, super::CorrelationLayerTrait, super::AccumLayerTraitConst, super::AccumLayerTrait, super::FlowWarpLayerTraitConst, super::FlowWarpLayerTrait, super::PriorBoxLayerTraitConst, super::PriorBoxLayerTrait, super::ReorgLayerTraitConst, super::ReorgLayerTrait, super::RegionLayerTraitConst, super::RegionLayerTrait, super::DetectionOutputLayerTraitConst, super::DetectionOutputLayerTrait, super::NormalizeBBoxLayerTraitConst, super::NormalizeBBoxLayerTrait, super::ResizeLayerTraitConst, super::ResizeLayerTrait, super::InterpLayerTraitConst, super::InterpLayerTrait, super::ProposalLayerTraitConst, super::ProposalLayerTrait, super::CropAndResizeLayerTraitConst, super::CropAndResizeLayerTrait, super::CumSumLayerTraitConst, super::CumSumLayerTrait, super::ScatterLayerTraitConst, super::ScatterLayerTrait, super::ScatterNDLayerTraitConst, super::ScatterNDLayerTrait, super::TileLayerTraitConst, super::TileLayerTrait, super::_RangeTraitConst, super::_RangeTrait }; } pub const CV_DNN_BACKEND_INFERENCE_ENGINE_NGRAPH: &str = "NGRAPH"; @@ -2190,7 +2190,7 @@ pub mod dnn { } /// Constant methods for [crate::dnn::BackendWrapper] - pub trait BackendWrapperConst { + pub trait BackendWrapperTraitConst { fn as_raw_BackendWrapper(&self) -> *const c_void; /// Backend identifier. @@ -2209,8 +2209,8 @@ pub mod dnn { } - /// Derivatives of this class wraps cv::Mat for different backends and targets. - pub trait BackendWrapper: crate::dnn::BackendWrapperConst { + /// Mutable methods for [crate::dnn::BackendWrapper] + pub trait BackendWrapperTrait: crate::dnn::BackendWrapperTraitConst { fn as_raw_mut_BackendWrapper(&mut self) -> *mut c_void; /// Backend identifier. @@ -2249,6 +2249,34 @@ pub mod dnn { } + /// Derivatives of this class wraps cv::Mat for different backends and targets. + pub struct BackendWrapper { + ptr: *mut c_void + } + + opencv_type_boxed! { BackendWrapper } + + impl Drop for BackendWrapper { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackendWrapper_delete(instance: *mut c_void); } + unsafe { cv_BackendWrapper_delete(self.as_raw_mut_BackendWrapper()) }; + } + } + + unsafe impl Send for BackendWrapper {} + + impl crate::dnn::BackendWrapperTraitConst for BackendWrapper { + #[inline] fn as_raw_BackendWrapper(&self) -> *const c_void { self.as_raw() } + } + + impl crate::dnn::BackendWrapperTrait for BackendWrapper { + #[inline] fn as_raw_mut_BackendWrapper(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackendWrapper { + } + /// Constant methods for [crate::dnn::BaseConvolutionLayer] pub trait BaseConvolutionLayerTraitConst: crate::dnn::LayerTraitConst { fn as_raw_BaseConvolutionLayer(&self) -> *const c_void; @@ -6624,13 +6652,13 @@ pub mod dnn { boxed_cast_base! { LRNLayer, crate::dnn::Layer, cv_LRNLayer_to_Layer } /// Constant methods for [crate::dnn::LSTMLayer] - pub trait LSTMLayerConst: crate::dnn::LayerTraitConst { + pub trait LSTMLayerTraitConst: crate::dnn::LayerTraitConst { fn as_raw_LSTMLayer(&self) -> *const c_void; } - /// LSTM recurrent layer - pub trait LSTMLayer: crate::dnn::LSTMLayerConst + crate::dnn::LayerTrait { + /// Mutable methods for [crate::dnn::LSTMLayer] + pub trait LSTMLayerTrait: crate::dnn::LSTMLayerTraitConst + crate::dnn::LayerTrait { fn as_raw_mut_LSTMLayer(&mut self) -> *mut c_void; /// @@ -6752,19 +6780,65 @@ pub mod dnn { } - impl dyn LSTMLayer + '_ { + /// LSTM recurrent layer + pub struct LSTMLayer { + ptr: *mut c_void + } + + opencv_type_boxed! { LSTMLayer } + + impl Drop for LSTMLayer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LSTMLayer_delete(instance: *mut c_void); } + unsafe { cv_LSTMLayer_delete(self.as_raw_mut_LSTMLayer()) }; + } + } + + unsafe impl Send for LSTMLayer {} + + impl core::AlgorithmTraitConst for LSTMLayer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LSTMLayer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::dnn::LayerTraitConst for LSTMLayer { + #[inline] fn as_raw_Layer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::dnn::LayerTrait for LSTMLayer { + #[inline] fn as_raw_mut_Layer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::dnn::LSTMLayerTraitConst for LSTMLayer { + #[inline] fn as_raw_LSTMLayer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::dnn::LSTMLayerTrait for LSTMLayer { + #[inline] fn as_raw_mut_LSTMLayer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LSTMLayer { /// Creates instance of LSTM layer #[inline] - pub fn create(params: &crate::dnn::LayerParams) -> Result> { + pub fn create(params: &crate::dnn::LayerParams) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dnn_LSTMLayer_create_const_LayerParamsR(params.as_raw_LayerParams(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { LSTMLayer, core::Algorithm, cv_LSTMLayer_to_Algorithm } + + boxed_cast_base! { LSTMLayer, crate::dnn::Layer, cv_LSTMLayer_to_Layer } + /// Constant methods for [crate::dnn::Layer] pub trait LayerTraitConst: core::AlgorithmTraitConst { fn as_raw_Layer(&self) -> *const c_void; @@ -7109,7 +7183,7 @@ pub mod dnn { /// it helps prevent some memory management issues (if something wrong, /// Halide tests will be failed). #[inline] - fn init_halide(&mut self, inputs: &core::Vector>) -> Result> { + fn init_halide(&mut self, inputs: &core::Vector>) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dnn_Layer_initHalide_const_vectorLPtrLBackendWrapperGGR(self.as_raw_mut_Layer(), inputs.as_raw_VectorOfPtrOfBackendWrapper(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -7119,7 +7193,7 @@ pub mod dnn { } #[inline] - fn init_ngraph(&mut self, inputs: &core::Vector>, nodes: &core::Vector>) -> Result> { + fn init_ngraph(&mut self, inputs: &core::Vector>, nodes: &core::Vector>) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dnn_Layer_initNgraph_const_vectorLPtrLBackendWrapperGGR_const_vectorLPtrLBackendNodeGGR(self.as_raw_mut_Layer(), inputs.as_raw_VectorOfPtrOfBackendWrapper(), nodes.as_raw_VectorOfPtrOfBackendNode(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -7129,7 +7203,7 @@ pub mod dnn { } #[inline] - fn init_vk_com(&mut self, inputs: &core::Vector>) -> Result> { + fn init_vk_com(&mut self, inputs: &core::Vector>) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dnn_Layer_initVkCom_const_vectorLPtrLBackendWrapperGGR(self.as_raw_mut_Layer(), inputs.as_raw_VectorOfPtrOfBackendWrapper(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -7139,7 +7213,7 @@ pub mod dnn { } #[inline] - fn init_webnn(&mut self, inputs: &core::Vector>, nodes: &core::Vector>) -> Result> { + fn init_webnn(&mut self, inputs: &core::Vector>, nodes: &core::Vector>) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dnn_Layer_initWebnn_const_vectorLPtrLBackendWrapperGGR_const_vectorLPtrLBackendNodeGGR(self.as_raw_mut_Layer(), inputs.as_raw_VectorOfPtrOfBackendWrapper(), nodes.as_raw_VectorOfPtrOfBackendNode(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -7155,7 +7229,7 @@ pub mod dnn { /// * inputs: layer inputs /// * outputs: layer outputs #[inline] - unsafe fn init_cuda(&mut self, context: *mut c_void, inputs: &core::Vector>, outputs: &core::Vector>) -> Result> { + unsafe fn init_cuda(&mut self, context: *mut c_void, inputs: &core::Vector>, outputs: &core::Vector>) -> Result> { return_send!(via ocvrs_return); { sys::cv_dnn_Layer_initCUDA_voidX_const_vectorLPtrLBackendWrapperGGR_const_vectorLPtrLBackendWrapperGGR(self.as_raw_mut_Layer(), context, inputs.as_raw_VectorOfPtrOfBackendWrapper(), outputs.as_raw_VectorOfPtrOfBackendWrapper(), ocvrs_return.as_mut_ptr()) }; return_receive!(ocvrs_return => ret); @@ -7172,7 +7246,7 @@ pub mod dnn { /// * outputsWrapper: layer outputs /// * isLast: if the node is the last one of the TimVX Graph. #[inline] - unsafe fn init_tim_vx(&mut self, tim_vx_info: *mut c_void, inputs_wrapper: &core::Vector>, outputs_wrapper: &core::Vector>, is_last: bool) -> Result> { + unsafe fn init_tim_vx(&mut self, tim_vx_info: *mut c_void, inputs_wrapper: &core::Vector>, outputs_wrapper: &core::Vector>, is_last: bool) -> Result> { return_send!(via ocvrs_return); { sys::cv_dnn_Layer_initTimVX_voidX_const_vectorLPtrLBackendWrapperGGR_const_vectorLPtrLBackendWrapperGGR_bool(self.as_raw_mut_Layer(), tim_vx_info, inputs_wrapper.as_raw_VectorOfPtrOfBackendWrapper(), outputs_wrapper.as_raw_VectorOfPtrOfBackendWrapper(), is_last, ocvrs_return.as_mut_ptr()) }; return_receive!(ocvrs_return => ret); @@ -7188,7 +7262,7 @@ pub mod dnn { /// * index: layer id for op name /// * nodes: inputs of this node #[inline] - fn init_cann(&mut self, inputs_wrapper: &core::Vector>, index: i32, nodes: &core::Vector>) -> Result> { + fn init_cann(&mut self, inputs_wrapper: &core::Vector>, index: i32, nodes: &core::Vector>) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dnn_Layer_initCann_const_vectorLPtrLBackendWrapperGGR_const_int_const_vectorLPtrLBackendNodeGGR(self.as_raw_mut_Layer(), inputs_wrapper.as_raw_VectorOfPtrOfBackendWrapper(), index, nodes.as_raw_VectorOfPtrOfBackendNode(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -10450,24 +10524,13 @@ pub mod dnn { boxed_cast_base! { QuantizeLayer, crate::dnn::Layer, cv_QuantizeLayer_to_Layer } /// Constant methods for [crate::dnn::RNNLayer] - pub trait RNNLayerConst: crate::dnn::LayerTraitConst { + pub trait RNNLayerTraitConst: crate::dnn::LayerTraitConst { fn as_raw_RNNLayer(&self) -> *const c_void; } - /// Classical recurrent layer - /// - /// Accepts two inputs @f$x_t@f$ and @f$h_{t-1}@f$ and compute two outputs @f$o_t@f$ and @f$h_t@f$. - /// - /// - input: should contain packed input @f$x_t@f$. - /// - output: should contain output @f$o_t@f$ (and @f$h_t@f$ if setProduceHiddenOutput() is set to true). - /// - /// input[0] should have shape [`T`, `N`, `data_dims`] where `T` and `N` is number of timestamps and number of independent samples of @f$x_t@f$ respectively. - /// - /// output[0] will have shape [`T`, `N`, @f$N_o@f$], where @f$N_o@f$ is number of rows in @f$ W_{xo} @f$ matrix. - /// - /// If setProduceHiddenOutput() is set to true then @p output[1] will contain a Mat with shape [`T`, `N`, @f$N_h@f$], where @f$N_h@f$ is number of rows in @f$ W_{hh} @f$ matrix. - pub trait RNNLayer: crate::dnn::LayerTrait + crate::dnn::RNNLayerConst { + /// Mutable methods for [crate::dnn::RNNLayer] + pub trait RNNLayerTrait: crate::dnn::LayerTrait + crate::dnn::RNNLayerTraitConst { fn as_raw_mut_RNNLayer(&mut self) -> *mut c_void; /// Setups learned weights. @@ -10509,19 +10572,76 @@ pub mod dnn { } - impl dyn RNNLayer + '_ { + /// Classical recurrent layer + /// + /// Accepts two inputs @f$x_t@f$ and @f$h_{t-1}@f$ and compute two outputs @f$o_t@f$ and @f$h_t@f$. + /// + /// - input: should contain packed input @f$x_t@f$. + /// - output: should contain output @f$o_t@f$ (and @f$h_t@f$ if setProduceHiddenOutput() is set to true). + /// + /// input[0] should have shape [`T`, `N`, `data_dims`] where `T` and `N` is number of timestamps and number of independent samples of @f$x_t@f$ respectively. + /// + /// output[0] will have shape [`T`, `N`, @f$N_o@f$], where @f$N_o@f$ is number of rows in @f$ W_{xo} @f$ matrix. + /// + /// If setProduceHiddenOutput() is set to true then @p output[1] will contain a Mat with shape [`T`, `N`, @f$N_h@f$], where @f$N_h@f$ is number of rows in @f$ W_{hh} @f$ matrix. + pub struct RNNLayer { + ptr: *mut c_void + } + + opencv_type_boxed! { RNNLayer } + + impl Drop for RNNLayer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_RNNLayer_delete(instance: *mut c_void); } + unsafe { cv_RNNLayer_delete(self.as_raw_mut_RNNLayer()) }; + } + } + + unsafe impl Send for RNNLayer {} + + impl core::AlgorithmTraitConst for RNNLayer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for RNNLayer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::dnn::LayerTraitConst for RNNLayer { + #[inline] fn as_raw_Layer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::dnn::LayerTrait for RNNLayer { + #[inline] fn as_raw_mut_Layer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::dnn::RNNLayerTraitConst for RNNLayer { + #[inline] fn as_raw_RNNLayer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::dnn::RNNLayerTrait for RNNLayer { + #[inline] fn as_raw_mut_RNNLayer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl RNNLayer { /// Creates instance of RNNLayer #[inline] - pub fn create(params: &crate::dnn::LayerParams) -> Result> { + pub fn create(params: &crate::dnn::LayerParams) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dnn_RNNLayer_create_const_LayerParamsR(params.as_raw_LayerParams(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { RNNLayer, core::Algorithm, cv_RNNLayer_to_Algorithm } + + boxed_cast_base! { RNNLayer, crate::dnn::Layer, cv_RNNLayer_to_Layer } + /// Constant methods for [crate::dnn::ReLU6Layer] pub trait ReLU6LayerTraitConst: crate::dnn::ActivationLayerTraitConst { fn as_raw_ReLU6Layer(&self) -> *const c_void; diff --git a/docs/dpm.rs b/docs/dpm.rs index 58b665085..0623c4557 100644 --- a/docs/dpm.rs +++ b/docs/dpm.rs @@ -32,11 +32,11 @@ pub mod dpm { //! In OpenCV there is an C++ implementation of DPM cascade detector. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::DPMDetector_ObjectDetectionTraitConst, super::DPMDetector_ObjectDetectionTrait, super::DPMDetectorConst, super::DPMDetector }; + pub use { super::DPMDetector_ObjectDetectionTraitConst, super::DPMDetector_ObjectDetectionTrait, super::DPMDetectorTraitConst, super::DPMDetectorTrait }; } /// Constant methods for [crate::dpm::DPMDetector] - pub trait DPMDetectorConst { + pub trait DPMDetectorTraitConst { fn as_raw_DPMDetector(&self) -> *const c_void; #[inline] @@ -72,8 +72,8 @@ pub mod dpm { } - /// This is a C++ abstract class, it provides external user API to work with DPM. - pub trait DPMDetector: crate::dpm::DPMDetectorConst { + /// Mutable methods for [crate::dpm::DPMDetector] + pub trait DPMDetectorTrait: crate::dpm::DPMDetectorTraitConst { fn as_raw_mut_DPMDetector(&mut self) -> *mut c_void; /// Find rectangular regions in the given image that are likely to contain objects of loaded classes @@ -92,7 +92,32 @@ pub mod dpm { } - impl dyn DPMDetector + '_ { + /// This is a C++ abstract class, it provides external user API to work with DPM. + pub struct DPMDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { DPMDetector } + + impl Drop for DPMDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DPMDetector_delete(instance: *mut c_void); } + unsafe { cv_DPMDetector_delete(self.as_raw_mut_DPMDetector()) }; + } + } + + unsafe impl Send for DPMDetector {} + + impl crate::dpm::DPMDetectorTraitConst for DPMDetector { + #[inline] fn as_raw_DPMDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::dpm::DPMDetectorTrait for DPMDetector { + #[inline] fn as_raw_mut_DPMDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DPMDetector { /// Load the trained models from given .xml files and return cv::Ptr\. /// ## Parameters /// * filenames: A set of filenames storing the trained detectors (models). Each file contains one @@ -104,16 +129,17 @@ pub mod dpm { /// ## C++ default parameters /// * class_names: std::vector() #[inline] - pub fn create(filenames: &core::Vector, class_names: &core::Vector) -> Result> { + pub fn create(filenames: &core::Vector, class_names: &core::Vector) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dpm_DPMDetector_create_const_vectorLstringGR_const_vectorLstringGR(filenames.as_raw_VectorOfString(), class_names.as_raw_VectorOfString(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::dpm::DPMDetector_ObjectDetection] pub trait DPMDetector_ObjectDetectionTraitConst { fn as_raw_DPMDetector_ObjectDetection(&self) -> *const c_void; diff --git a/docs/face.rs b/docs/face.rs index 8e491072c..6a28cb641 100644 --- a/docs/face.rs +++ b/docs/face.rs @@ -5,40 +5,40 @@ pub mod face { //! - [tutorial_face_main] use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::PredictCollectorConst, super::PredictCollector, super::StandardCollectorTraitConst, super::StandardCollectorTrait, super::FaceRecognizerConst, super::FaceRecognizer, super::BasicFaceRecognizerConst, super::BasicFaceRecognizer, super::EigenFaceRecognizerConst, super::EigenFaceRecognizer, super::FisherFaceRecognizerConst, super::FisherFaceRecognizer, super::LBPHFaceRecognizerConst, super::LBPHFaceRecognizer, super::FacemarkConst, super::Facemark, super::CParamsTraitConst, super::CParamsTrait, super::FacemarkTrainConst, super::FacemarkTrain, super::FacemarkLBF_ParamsTraitConst, super::FacemarkLBF_ParamsTrait, super::FacemarkLBFConst, super::FacemarkLBF, super::FacemarkAAM_ParamsTraitConst, super::FacemarkAAM_ParamsTrait, super::FacemarkAAM_ConfigTraitConst, super::FacemarkAAM_ConfigTrait, super::FacemarkAAM_DataTraitConst, super::FacemarkAAM_DataTrait, super::FacemarkAAM_Model_TextureTraitConst, super::FacemarkAAM_Model_TextureTrait, super::FacemarkAAM_ModelTraitConst, super::FacemarkAAM_ModelTrait, super::FacemarkAAMConst, super::FacemarkAAM, super::FacemarkKazemi_ParamsTraitConst, super::FacemarkKazemi_ParamsTrait, super::FacemarkKazemiConst, super::FacemarkKazemi, super::MACEConst, super::MACE, super::BIFConst, super::BIF }; + pub use { super::PredictCollectorTraitConst, super::PredictCollectorTrait, super::StandardCollectorTraitConst, super::StandardCollectorTrait, super::FaceRecognizerTraitConst, super::FaceRecognizerTrait, super::BasicFaceRecognizerTraitConst, super::BasicFaceRecognizerTrait, super::EigenFaceRecognizerTraitConst, super::EigenFaceRecognizerTrait, super::FisherFaceRecognizerTraitConst, super::FisherFaceRecognizerTrait, super::LBPHFaceRecognizerTraitConst, super::LBPHFaceRecognizerTrait, super::FacemarkTraitConst, super::FacemarkTrait, super::CParamsTraitConst, super::CParamsTrait, super::FacemarkTrainTraitConst, super::FacemarkTrainTrait, super::FacemarkLBF_ParamsTraitConst, super::FacemarkLBF_ParamsTrait, super::FacemarkLBFTraitConst, super::FacemarkLBFTrait, super::FacemarkAAM_ParamsTraitConst, super::FacemarkAAM_ParamsTrait, super::FacemarkAAM_ConfigTraitConst, super::FacemarkAAM_ConfigTrait, super::FacemarkAAM_DataTraitConst, super::FacemarkAAM_DataTrait, super::FacemarkAAM_Model_TextureTraitConst, super::FacemarkAAM_Model_TextureTrait, super::FacemarkAAM_ModelTraitConst, super::FacemarkAAM_ModelTrait, super::FacemarkAAMTraitConst, super::FacemarkAAMTrait, super::FacemarkKazemi_ParamsTraitConst, super::FacemarkKazemi_ParamsTrait, super::FacemarkKazemiTraitConst, super::FacemarkKazemiTrait, super::MACETraitConst, super::MACETrait, super::BIFTraitConst, super::BIFTrait }; } pub type FN_FaceDetector = Option bool + Send + Sync + 'static>>; /// construct an AAM facemark detector #[inline] - pub fn create_facemark_aam() -> Result> { + pub fn create_facemark_aam() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_createFacemarkAAM(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// construct a Kazemi facemark detector #[inline] - pub fn create_facemark_kazemi() -> Result> { + pub fn create_facemark_kazemi() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_createFacemarkKazemi(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// construct an LBF facemark detector #[inline] - pub fn create_facemark_lbf() -> Result> { + pub fn create_facemark_lbf() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_createFacemarkLBF(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -310,7 +310,7 @@ pub mod face { } /// Constant methods for [crate::face::BIF] - pub trait BIFConst: core::AlgorithmTraitConst { + pub trait BIFTraitConst: core::AlgorithmTraitConst { fn as_raw_BIF(&self) -> *const c_void; /// ## Returns @@ -352,15 +352,48 @@ pub mod face { } + /// Mutable methods for [crate::face::BIF] + pub trait BIFTrait: core::AlgorithmTrait + crate::face::BIFTraitConst { + fn as_raw_mut_BIF(&mut self) -> *mut c_void; + + } + /// Implementation of bio-inspired features (BIF) from the paper: /// Guo, Guodong, et al. "Human age estimation using bio-inspired features." /// Computer Vision and Pattern Recognition, 2009. CVPR 2009. - pub trait BIF: core::AlgorithmTrait + crate::face::BIFConst { - fn as_raw_mut_BIF(&mut self) -> *mut c_void; + pub struct BIF { + ptr: *mut c_void + } + opencv_type_boxed! { BIF } + + impl Drop for BIF { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BIF_delete(instance: *mut c_void); } + unsafe { cv_BIF_delete(self.as_raw_mut_BIF()) }; + } } - impl dyn BIF + '_ { + unsafe impl Send for BIF {} + + impl core::AlgorithmTraitConst for BIF { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BIF { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::BIFTraitConst for BIF { + #[inline] fn as_raw_BIF(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::BIFTrait for BIF { + #[inline] fn as_raw_mut_BIF(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BIF { /// ## Parameters /// * num_bands: The number of filter bands (<=8) used for computing BIF. /// * num_rotations: The number of image rotations for computing BIF. @@ -371,18 +404,21 @@ pub mod face { /// * num_bands: 8 /// * num_rotations: 12 #[inline] - pub fn create(num_bands: i32, num_rotations: i32) -> Result> { + pub fn create(num_bands: i32, num_rotations: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_BIF_create_int_int(num_bands, num_rotations, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { BIF, core::Algorithm, cv_BIF_to_Algorithm } + /// Constant methods for [crate::face::BasicFaceRecognizer] - pub trait BasicFaceRecognizerConst: crate::face::FaceRecognizerConst { + pub trait BasicFaceRecognizerTraitConst: crate::face::FaceRecognizerTraitConst { fn as_raw_BasicFaceRecognizer(&self) -> *const c_void; /// ## See also @@ -477,7 +513,8 @@ pub mod face { } - pub trait BasicFaceRecognizer: crate::face::BasicFaceRecognizerConst + crate::face::FaceRecognizer { + /// Mutable methods for [crate::face::BasicFaceRecognizer] + pub trait BasicFaceRecognizerTrait: crate::face::BasicFaceRecognizerTraitConst + crate::face::FaceRecognizerTrait { fn as_raw_mut_BasicFaceRecognizer(&mut self) -> *mut c_void; /// ## See also @@ -513,6 +550,51 @@ pub mod face { } + pub struct BasicFaceRecognizer { + ptr: *mut c_void + } + + opencv_type_boxed! { BasicFaceRecognizer } + + impl Drop for BasicFaceRecognizer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BasicFaceRecognizer_delete(instance: *mut c_void); } + unsafe { cv_BasicFaceRecognizer_delete(self.as_raw_mut_BasicFaceRecognizer()) }; + } + } + + unsafe impl Send for BasicFaceRecognizer {} + + impl core::AlgorithmTraitConst for BasicFaceRecognizer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BasicFaceRecognizer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FaceRecognizerTraitConst for BasicFaceRecognizer { + #[inline] fn as_raw_FaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FaceRecognizerTrait for BasicFaceRecognizer { + #[inline] fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::BasicFaceRecognizerTraitConst for BasicFaceRecognizer { + #[inline] fn as_raw_BasicFaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::BasicFaceRecognizerTrait for BasicFaceRecognizer { + #[inline] fn as_raw_mut_BasicFaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BasicFaceRecognizer { + } + + boxed_cast_base! { BasicFaceRecognizer, core::Algorithm, cv_BasicFaceRecognizer_to_Algorithm } + /// Constant methods for [crate::face::CParams] pub trait CParamsTraitConst { fn as_raw_CParams(&self) -> *const c_void; @@ -658,17 +740,66 @@ pub mod face { } /// Constant methods for [crate::face::EigenFaceRecognizer] - pub trait EigenFaceRecognizerConst: crate::face::BasicFaceRecognizerConst { + pub trait EigenFaceRecognizerTraitConst: crate::face::BasicFaceRecognizerTraitConst { fn as_raw_EigenFaceRecognizer(&self) -> *const c_void; } - pub trait EigenFaceRecognizer: crate::face::BasicFaceRecognizer + crate::face::EigenFaceRecognizerConst { + /// Mutable methods for [crate::face::EigenFaceRecognizer] + pub trait EigenFaceRecognizerTrait: crate::face::BasicFaceRecognizerTrait + crate::face::EigenFaceRecognizerTraitConst { fn as_raw_mut_EigenFaceRecognizer(&mut self) -> *mut c_void; } - impl dyn EigenFaceRecognizer + '_ { + pub struct EigenFaceRecognizer { + ptr: *mut c_void + } + + opencv_type_boxed! { EigenFaceRecognizer } + + impl Drop for EigenFaceRecognizer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_EigenFaceRecognizer_delete(instance: *mut c_void); } + unsafe { cv_EigenFaceRecognizer_delete(self.as_raw_mut_EigenFaceRecognizer()) }; + } + } + + unsafe impl Send for EigenFaceRecognizer {} + + impl core::AlgorithmTraitConst for EigenFaceRecognizer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for EigenFaceRecognizer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::BasicFaceRecognizerTraitConst for EigenFaceRecognizer { + #[inline] fn as_raw_BasicFaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::BasicFaceRecognizerTrait for EigenFaceRecognizer { + #[inline] fn as_raw_mut_BasicFaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FaceRecognizerTraitConst for EigenFaceRecognizer { + #[inline] fn as_raw_FaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FaceRecognizerTrait for EigenFaceRecognizer { + #[inline] fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::EigenFaceRecognizerTraitConst for EigenFaceRecognizer { + #[inline] fn as_raw_EigenFaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::EigenFaceRecognizerTrait for EigenFaceRecognizer { + #[inline] fn as_raw_mut_EigenFaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl EigenFaceRecognizer { /// ## Parameters /// * num_components: The number of components (read: Eigenfaces) kept for this Principal /// Component Analysis. As a hint: There's no rule how many components (read: Eigenfaces) should be @@ -702,18 +833,21 @@ pub mod face { /// * num_components: 0 /// * threshold: DBL_MAX #[inline] - pub fn create(num_components: i32, threshold: f64) -> Result> { + pub fn create(num_components: i32, threshold: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_EigenFaceRecognizer_create_int_double(num_components, threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { EigenFaceRecognizer, core::Algorithm, cv_EigenFaceRecognizer_to_Algorithm } + /// Constant methods for [crate::face::FaceRecognizer] - pub trait FaceRecognizerConst: core::AlgorithmTraitConst { + pub trait FaceRecognizerTraitConst: core::AlgorithmTraitConst { fn as_raw_FaceRecognizer(&self) -> *const c_void; /// Predicts a label and associated confidence (e.g. distance) for a given input image. @@ -820,7 +954,7 @@ pub mod face { /// To implement this method u just have to do same internal cycle as in predict(InputArray src, CV_OUT int &label, CV_OUT double &confidence) but /// not try to get "best@ result, just resend it to caller side with given collector #[inline] - fn predict_collect(&self, src: &dyn core::ToInputArray, mut collector: core::Ptr) -> Result<()> { + fn predict_collect(&self, src: &dyn core::ToInputArray, mut collector: core::Ptr) -> Result<()> { extern_container_arg!(src); return_send!(via ocvrs_return); unsafe { sys::cv_face_FaceRecognizer_predict_const_const__InputArrayR_PtrLPredictCollectorG(self.as_raw_FaceRecognizer(), src.as_raw__InputArray(), collector.as_raw_mut_PtrOfPredictCollector(), ocvrs_return.as_mut_ptr()) }; @@ -928,108 +1062,8 @@ pub mod face { } - /// Abstract base class for all face recognition models - /// - /// All face recognition models in OpenCV are derived from the abstract base class FaceRecognizer, which - /// provides a unified access to all face recongition algorithms in OpenCV. - /// - /// ### Description - /// - /// I'll go a bit more into detail explaining FaceRecognizer, because it doesn't look like a powerful - /// interface at first sight. But: Every FaceRecognizer is an Algorithm, so you can easily get/set all - /// model internals (if allowed by the implementation). Algorithm is a relatively new OpenCV concept, - /// which is available since the 2.4 release. I suggest you take a look at its description. - /// - /// Algorithm provides the following features for all derived classes: - /// - /// * So called "virtual constructor". That is, each Algorithm derivative is registered at program - /// start and you can get the list of registered algorithms and create instance of a particular - /// algorithm by its name (see Algorithm::create). If you plan to add your own algorithms, it is - /// good practice to add a unique prefix to your algorithms to distinguish them from other - /// algorithms. - /// * Setting/Retrieving algorithm parameters by name. If you used video capturing functionality from - /// OpenCV highgui module, you are probably familar with cv::cvSetCaptureProperty, - /// ocvcvGetCaptureProperty, VideoCapture::set and VideoCapture::get. Algorithm provides similar - /// method where instead of integer id's you specify the parameter names as text Strings. See - /// Algorithm::set and Algorithm::get for details. - /// * Reading and writing parameters from/to XML or YAML files. Every Algorithm derivative can store - /// all its parameters and then read them back. There is no need to re-implement it each time. - /// - /// Moreover every FaceRecognizer supports the: - /// - /// * **Training** of a FaceRecognizer with FaceRecognizer::train on a given set of images (your face - /// database!). - /// * **Prediction** of a given sample image, that means a face. The image is given as a Mat. - /// * **Loading/Saving** the model state from/to a given XML or YAML. - /// * **Setting/Getting labels info**, that is stored as a string. String labels info is useful for - /// keeping names of the recognized people. - /// - /// - /// Note: When using the FaceRecognizer interface in combination with Python, please stick to Python 2. - /// Some underlying scripts like create_csv will not work in other versions, like Python 3. Setting the - /// Thresholds +++++++++++++++++++++++ - /// - /// Sometimes you run into the situation, when you want to apply a threshold on the prediction. A common - /// scenario in face recognition is to tell, whether a face belongs to the training dataset or if it is - /// unknown. You might wonder, why there's no public API in FaceRecognizer to set the threshold for the - /// prediction, but rest assured: It's supported. It just means there's no generic way in an abstract - /// class to provide an interface for setting/getting the thresholds of *every possible* FaceRecognizer - /// algorithm. The appropriate place to set the thresholds is in the constructor of the specific - /// FaceRecognizer and since every FaceRecognizer is a Algorithm (see above), you can get/set the - /// thresholds at runtime! - /// - /// Here is an example of setting a threshold for the Eigenfaces method, when creating the model: - /// - /// ```C++ - /// // Let's say we want to keep 10 Eigenfaces and have a threshold value of 10.0 - /// int num_components = 10; - /// double threshold = 10.0; - /// // Then if you want to have a cv::FaceRecognizer with a confidence threshold, - /// // create the concrete implementation with the appropriate parameters: - /// Ptr model = EigenFaceRecognizer::create(num_components, threshold); - /// ``` - /// - /// - /// Sometimes it's impossible to train the model, just to experiment with threshold values. Thanks to - /// Algorithm it's possible to set internal model thresholds during runtime. Let's see how we would - /// set/get the prediction for the Eigenface model, we've created above: - /// - /// ```C++ - /// // The following line reads the threshold from the Eigenfaces model: - /// double current_threshold = model->getDouble("threshold"); - /// // And this line sets the threshold to 0.0: - /// model->set("threshold", 0.0); - /// ``` - /// - /// - /// If you've set the threshold to 0.0 as we did above, then: - /// - /// ```C++ - /// // - /// Mat img = imread("person1/3.jpg", IMREAD_GRAYSCALE); - /// // Get a prediction from the model. Note: We've set a threshold of 0.0 above, - /// // since the distance is almost always larger than 0.0, you'll get -1 as - /// // label, which indicates, this face is unknown - /// int predicted_label = model->predict(img); - /// // ... - /// ``` - /// - /// - /// is going to yield -1 as predicted label, which states this face is unknown. - /// - /// ### Getting the name of a FaceRecognizer - /// - /// Since every FaceRecognizer is a Algorithm, you can use Algorithm::name to get the name of a - /// FaceRecognizer: - /// - /// ```C++ - /// // Create a FaceRecognizer: - /// Ptr model = EigenFaceRecognizer::create(); - /// // And here's how to get its name: - /// String name = model->name(); - /// ``` - /// - pub trait FaceRecognizer: core::AlgorithmTrait + crate::face::FaceRecognizerConst { + /// Mutable methods for [crate::face::FaceRecognizer] + pub trait FaceRecognizerTrait: core::AlgorithmTrait + crate::face::FaceRecognizerTraitConst { fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void; /// Trains a FaceRecognizer with given data and associated labels. @@ -1214,31 +1248,152 @@ pub mod face { } - /// Constant methods for [crate::face::Facemark] - pub trait FacemarkConst: core::AlgorithmTraitConst { - fn as_raw_Facemark(&self) -> *const c_void; - - } - - /// Abstract base class for all facemark models + /// Abstract base class for all face recognition models + /// + /// All face recognition models in OpenCV are derived from the abstract base class FaceRecognizer, which + /// provides a unified access to all face recongition algorithms in OpenCV. /// - /// To utilize this API in your program, please take a look at the [tutorial_table_of_content_facemark] /// ### Description /// - /// Facemark is a base class which provides universal access to any specific facemark algorithm. - /// Therefore, the users should declare a desired algorithm before they can use it in their application. + /// I'll go a bit more into detail explaining FaceRecognizer, because it doesn't look like a powerful + /// interface at first sight. But: Every FaceRecognizer is an Algorithm, so you can easily get/set all + /// model internals (if allowed by the implementation). Algorithm is a relatively new OpenCV concept, + /// which is available since the 2.4 release. I suggest you take a look at its description. + /// + /// Algorithm provides the following features for all derived classes: + /// + /// * So called "virtual constructor". That is, each Algorithm derivative is registered at program + /// start and you can get the list of registered algorithms and create instance of a particular + /// algorithm by its name (see Algorithm::create). If you plan to add your own algorithms, it is + /// good practice to add a unique prefix to your algorithms to distinguish them from other + /// algorithms. + /// * Setting/Retrieving algorithm parameters by name. If you used video capturing functionality from + /// OpenCV highgui module, you are probably familar with cv::cvSetCaptureProperty, + /// ocvcvGetCaptureProperty, VideoCapture::set and VideoCapture::get. Algorithm provides similar + /// method where instead of integer id's you specify the parameter names as text Strings. See + /// Algorithm::set and Algorithm::get for details. + /// * Reading and writing parameters from/to XML or YAML files. Every Algorithm derivative can store + /// all its parameters and then read them back. There is no need to re-implement it each time. + /// + /// Moreover every FaceRecognizer supports the: + /// + /// * **Training** of a FaceRecognizer with FaceRecognizer::train on a given set of images (your face + /// database!). + /// * **Prediction** of a given sample image, that means a face. The image is given as a Mat. + /// * **Loading/Saving** the model state from/to a given XML or YAML. + /// * **Setting/Getting labels info**, that is stored as a string. String labels info is useful for + /// keeping names of the recognized people. + /// + /// + /// Note: When using the FaceRecognizer interface in combination with Python, please stick to Python 2. + /// Some underlying scripts like create_csv will not work in other versions, like Python 3. Setting the + /// Thresholds +++++++++++++++++++++++ + /// + /// Sometimes you run into the situation, when you want to apply a threshold on the prediction. A common + /// scenario in face recognition is to tell, whether a face belongs to the training dataset or if it is + /// unknown. You might wonder, why there's no public API in FaceRecognizer to set the threshold for the + /// prediction, but rest assured: It's supported. It just means there's no generic way in an abstract + /// class to provide an interface for setting/getting the thresholds of *every possible* FaceRecognizer + /// algorithm. The appropriate place to set the thresholds is in the constructor of the specific + /// FaceRecognizer and since every FaceRecognizer is a Algorithm (see above), you can get/set the + /// thresholds at runtime! + /// + /// Here is an example of setting a threshold for the Eigenfaces method, when creating the model: /// - /// Here is an example on how to declare a facemark algorithm: /// ```C++ - /// // Using Facemark in your code: - /// Ptr facemark = createFacemarkLBF(); + /// // Let's say we want to keep 10 Eigenfaces and have a threshold value of 10.0 + /// int num_components = 10; + /// double threshold = 10.0; + /// // Then if you want to have a cv::FaceRecognizer with a confidence threshold, + /// // create the concrete implementation with the appropriate parameters: + /// Ptr model = EigenFaceRecognizer::create(num_components, threshold); /// ``` /// /// - /// The typical pipeline for facemark detection is as follows: - /// - Load the trained model using Facemark::loadModel. - /// - Perform the fitting on an image via Facemark::fit. - pub trait Facemark: core::AlgorithmTrait + crate::face::FacemarkConst { + /// Sometimes it's impossible to train the model, just to experiment with threshold values. Thanks to + /// Algorithm it's possible to set internal model thresholds during runtime. Let's see how we would + /// set/get the prediction for the Eigenface model, we've created above: + /// + /// ```C++ + /// // The following line reads the threshold from the Eigenfaces model: + /// double current_threshold = model->getDouble("threshold"); + /// // And this line sets the threshold to 0.0: + /// model->set("threshold", 0.0); + /// ``` + /// + /// + /// If you've set the threshold to 0.0 as we did above, then: + /// + /// ```C++ + /// // + /// Mat img = imread("person1/3.jpg", IMREAD_GRAYSCALE); + /// // Get a prediction from the model. Note: We've set a threshold of 0.0 above, + /// // since the distance is almost always larger than 0.0, you'll get -1 as + /// // label, which indicates, this face is unknown + /// int predicted_label = model->predict(img); + /// // ... + /// ``` + /// + /// + /// is going to yield -1 as predicted label, which states this face is unknown. + /// + /// ### Getting the name of a FaceRecognizer + /// + /// Since every FaceRecognizer is a Algorithm, you can use Algorithm::name to get the name of a + /// FaceRecognizer: + /// + /// ```C++ + /// // Create a FaceRecognizer: + /// Ptr model = EigenFaceRecognizer::create(); + /// // And here's how to get its name: + /// String name = model->name(); + /// ``` + /// + pub struct FaceRecognizer { + ptr: *mut c_void + } + + opencv_type_boxed! { FaceRecognizer } + + impl Drop for FaceRecognizer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FaceRecognizer_delete(instance: *mut c_void); } + unsafe { cv_FaceRecognizer_delete(self.as_raw_mut_FaceRecognizer()) }; + } + } + + unsafe impl Send for FaceRecognizer {} + + impl core::AlgorithmTraitConst for FaceRecognizer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FaceRecognizer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FaceRecognizerTraitConst for FaceRecognizer { + #[inline] fn as_raw_FaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FaceRecognizerTrait for FaceRecognizer { + #[inline] fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FaceRecognizer { + } + + boxed_cast_base! { FaceRecognizer, core::Algorithm, cv_FaceRecognizer_to_Algorithm } + + /// Constant methods for [crate::face::Facemark] + pub trait FacemarkTraitConst: core::AlgorithmTraitConst { + fn as_raw_Facemark(&self) -> *const c_void; + + } + + /// Mutable methods for [crate::face::Facemark] + pub trait FacemarkTrait: core::AlgorithmTrait + crate::face::FacemarkTraitConst { fn as_raw_mut_Facemark(&mut self) -> *mut c_void; /// A function to load the trained model before the fitting process. @@ -1289,13 +1444,69 @@ pub mod face { } + /// Abstract base class for all facemark models + /// + /// To utilize this API in your program, please take a look at the [tutorial_table_of_content_facemark] + /// ### Description + /// + /// Facemark is a base class which provides universal access to any specific facemark algorithm. + /// Therefore, the users should declare a desired algorithm before they can use it in their application. + /// + /// Here is an example on how to declare a facemark algorithm: + /// ```C++ + /// // Using Facemark in your code: + /// Ptr facemark = createFacemarkLBF(); + /// ``` + /// + /// + /// The typical pipeline for facemark detection is as follows: + /// - Load the trained model using Facemark::loadModel. + /// - Perform the fitting on an image via Facemark::fit. + pub struct Facemark { + ptr: *mut c_void + } + + opencv_type_boxed! { Facemark } + + impl Drop for Facemark { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Facemark_delete(instance: *mut c_void); } + unsafe { cv_Facemark_delete(self.as_raw_mut_Facemark()) }; + } + } + + unsafe impl Send for Facemark {} + + impl core::AlgorithmTraitConst for Facemark { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Facemark { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkTraitConst for Facemark { + #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkTrait for Facemark { + #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Facemark { + } + + boxed_cast_base! { Facemark, core::Algorithm, cv_Facemark_to_Algorithm } + /// Constant methods for [crate::face::FacemarkAAM] - pub trait FacemarkAAMConst: crate::face::FacemarkTrainConst { + pub trait FacemarkAAMTraitConst: crate::face::FacemarkTrainTraitConst { fn as_raw_FacemarkAAM(&self) -> *const c_void; } - pub trait FacemarkAAM: crate::face::FacemarkAAMConst + crate::face::FacemarkTrain { + /// Mutable methods for [crate::face::FacemarkAAM] + pub trait FacemarkAAMTrait: crate::face::FacemarkAAMTraitConst + crate::face::FacemarkTrainTrait { fn as_raw_mut_FacemarkAAM(&mut self) -> *mut c_void; /// overload with additional Config structures @@ -1313,22 +1524,73 @@ pub mod face { } - impl dyn FacemarkAAM + '_ { + pub struct FacemarkAAM { + ptr: *mut c_void + } + + opencv_type_boxed! { FacemarkAAM } + + impl Drop for FacemarkAAM { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FacemarkAAM_delete(instance: *mut c_void); } + unsafe { cv_FacemarkAAM_delete(self.as_raw_mut_FacemarkAAM()) }; + } + } + + unsafe impl Send for FacemarkAAM {} + + impl core::AlgorithmTraitConst for FacemarkAAM { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FacemarkAAM { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkTraitConst for FacemarkAAM { + #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkTrait for FacemarkAAM { + #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkTrainTraitConst for FacemarkAAM { + #[inline] fn as_raw_FacemarkTrain(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkTrainTrait for FacemarkAAM { + #[inline] fn as_raw_mut_FacemarkTrain(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkAAMTraitConst for FacemarkAAM { + #[inline] fn as_raw_FacemarkAAM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkAAMTrait for FacemarkAAM { + #[inline] fn as_raw_mut_FacemarkAAM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FacemarkAAM { /// initializer /// /// ## C++ default parameters /// * parameters: FacemarkAAM::Params() #[inline] - pub fn create(parameters: &crate::face::FacemarkAAM_Params) -> Result> { + pub fn create(parameters: &crate::face::FacemarkAAM_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_FacemarkAAM_create_const_ParamsR(parameters.as_raw_FacemarkAAM_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { FacemarkAAM, core::Algorithm, cv_FacemarkAAM_to_Algorithm } + /// Constant methods for [crate::face::FacemarkAAM_Config] pub trait FacemarkAAM_ConfigTraitConst { fn as_raw_FacemarkAAM_Config(&self) -> *const c_void; @@ -1971,12 +2233,13 @@ pub mod face { } /// Constant methods for [crate::face::FacemarkKazemi] - pub trait FacemarkKazemiConst: crate::face::FacemarkConst { + pub trait FacemarkKazemiTraitConst: crate::face::FacemarkTraitConst { fn as_raw_FacemarkKazemi(&self) -> *const c_void; } - pub trait FacemarkKazemi: crate::face::Facemark + crate::face::FacemarkKazemiConst { + /// Mutable methods for [crate::face::FacemarkKazemi] + pub trait FacemarkKazemiTrait: crate::face::FacemarkKazemiTraitConst + crate::face::FacemarkTrait { fn as_raw_mut_FacemarkKazemi(&mut self) -> *mut c_void; /// This function is used to train the model using gradient boosting to get a cascade of regressors @@ -2029,20 +2292,63 @@ pub mod face { } - impl dyn FacemarkKazemi + '_ { + pub struct FacemarkKazemi { + ptr: *mut c_void + } + + opencv_type_boxed! { FacemarkKazemi } + + impl Drop for FacemarkKazemi { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FacemarkKazemi_delete(instance: *mut c_void); } + unsafe { cv_FacemarkKazemi_delete(self.as_raw_mut_FacemarkKazemi()) }; + } + } + + unsafe impl Send for FacemarkKazemi {} + + impl core::AlgorithmTraitConst for FacemarkKazemi { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FacemarkKazemi { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkTraitConst for FacemarkKazemi { + #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkTrait for FacemarkKazemi { + #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkKazemiTraitConst for FacemarkKazemi { + #[inline] fn as_raw_FacemarkKazemi(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkKazemiTrait for FacemarkKazemi { + #[inline] fn as_raw_mut_FacemarkKazemi(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FacemarkKazemi { /// ## C++ default parameters /// * parameters: FacemarkKazemi::Params() #[inline] - pub fn create(parameters: &crate::face::FacemarkKazemi_Params) -> Result> { + pub fn create(parameters: &crate::face::FacemarkKazemi_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_FacemarkKazemi_create_const_ParamsR(parameters.as_raw_FacemarkKazemi_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { FacemarkKazemi, core::Algorithm, cv_FacemarkKazemi_to_Algorithm } + /// Constant methods for [crate::face::FacemarkKazemi_Params] pub trait FacemarkKazemi_ParamsTraitConst { fn as_raw_FacemarkKazemi_Params(&self) -> *const c_void; @@ -2222,30 +2528,82 @@ pub mod face { } /// Constant methods for [crate::face::FacemarkLBF] - pub trait FacemarkLBFConst: crate::face::FacemarkTrainConst { + pub trait FacemarkLBFTraitConst: crate::face::FacemarkTrainTraitConst { fn as_raw_FacemarkLBF(&self) -> *const c_void; } - pub trait FacemarkLBF: crate::face::FacemarkLBFConst + crate::face::FacemarkTrain { + /// Mutable methods for [crate::face::FacemarkLBF] + pub trait FacemarkLBFTrait: crate::face::FacemarkLBFTraitConst + crate::face::FacemarkTrainTrait { fn as_raw_mut_FacemarkLBF(&mut self) -> *mut c_void; } - impl dyn FacemarkLBF + '_ { + pub struct FacemarkLBF { + ptr: *mut c_void + } + + opencv_type_boxed! { FacemarkLBF } + + impl Drop for FacemarkLBF { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FacemarkLBF_delete(instance: *mut c_void); } + unsafe { cv_FacemarkLBF_delete(self.as_raw_mut_FacemarkLBF()) }; + } + } + + unsafe impl Send for FacemarkLBF {} + + impl core::AlgorithmTraitConst for FacemarkLBF { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FacemarkLBF { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkTraitConst for FacemarkLBF { + #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkTrait for FacemarkLBF { + #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkTrainTraitConst for FacemarkLBF { + #[inline] fn as_raw_FacemarkTrain(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkTrainTrait for FacemarkLBF { + #[inline] fn as_raw_mut_FacemarkTrain(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkLBFTraitConst for FacemarkLBF { + #[inline] fn as_raw_FacemarkLBF(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkLBFTrait for FacemarkLBF { + #[inline] fn as_raw_mut_FacemarkLBF(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FacemarkLBF { /// ## C++ default parameters /// * parameters: FacemarkLBF::Params() #[inline] - pub fn create(parameters: &crate::face::FacemarkLBF_Params) -> Result> { + pub fn create(parameters: &crate::face::FacemarkLBF_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_FacemarkLBF_create_const_ParamsR(parameters.as_raw_FacemarkLBF_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { FacemarkLBF, core::Algorithm, cv_FacemarkLBF_to_Algorithm } + /// Constant methods for [crate::face::FacemarkLBF_Params] pub trait FacemarkLBF_ParamsTraitConst { fn as_raw_FacemarkLBF_Params(&self) -> *const c_void; @@ -2507,39 +2865,13 @@ pub mod face { } /// Constant methods for [crate::face::FacemarkTrain] - pub trait FacemarkTrainConst: crate::face::FacemarkConst { + pub trait FacemarkTrainTraitConst: crate::face::FacemarkTraitConst { fn as_raw_FacemarkTrain(&self) -> *const c_void; } - /// Abstract base class for trainable facemark models - /// - /// To utilize this API in your program, please take a look at the [tutorial_table_of_content_facemark] - /// ### Description - /// - /// The AAM and LBF facemark models in OpenCV are derived from the abstract base class FacemarkTrain, which - /// provides a unified access to those facemark algorithms in OpenCV. - /// - /// Here is an example on how to declare facemark algorithm: - /// ```C++ - /// // Using Facemark in your code: - /// Ptr facemark = FacemarkLBF::create(); - /// ``` - /// - /// - /// - /// The typical pipeline for facemark detection is listed as follows: - /// - (Non-mandatory) Set a user defined face detection using FacemarkTrain::setFaceDetector. - /// The facemark algorithms are designed to fit the facial points into a face. - /// Therefore, the face information should be provided to the facemark algorithm. - /// Some algorithms might provides a default face recognition function. - /// However, the users might prefer to use their own face detector to obtains the best possible detection result. - /// - (Non-mandatory) Training the model for a specific algorithm using FacemarkTrain::training. - /// In this case, the model should be automatically saved by the algorithm. - /// If the user already have a trained model, then this part can be omitted. - /// - Load the trained model using Facemark::loadModel. - /// - Perform the fitting via the Facemark::fit. - pub trait FacemarkTrain: crate::face::Facemark + crate::face::FacemarkTrainConst { + /// Mutable methods for [crate::face::FacemarkTrain] + pub trait FacemarkTrainTrait: crate::face::FacemarkTrainTraitConst + crate::face::FacemarkTrait { fn as_raw_mut_FacemarkTrain(&mut self) -> *mut c_void; /// Add one training sample to the trainer. @@ -2723,18 +3055,139 @@ pub mod face { } + /// Abstract base class for trainable facemark models + /// + /// To utilize this API in your program, please take a look at the [tutorial_table_of_content_facemark] + /// ### Description + /// + /// The AAM and LBF facemark models in OpenCV are derived from the abstract base class FacemarkTrain, which + /// provides a unified access to those facemark algorithms in OpenCV. + /// + /// Here is an example on how to declare facemark algorithm: + /// ```C++ + /// // Using Facemark in your code: + /// Ptr facemark = FacemarkLBF::create(); + /// ``` + /// + /// + /// + /// The typical pipeline for facemark detection is listed as follows: + /// - (Non-mandatory) Set a user defined face detection using FacemarkTrain::setFaceDetector. + /// The facemark algorithms are designed to fit the facial points into a face. + /// Therefore, the face information should be provided to the facemark algorithm. + /// Some algorithms might provides a default face recognition function. + /// However, the users might prefer to use their own face detector to obtains the best possible detection result. + /// - (Non-mandatory) Training the model for a specific algorithm using FacemarkTrain::training. + /// In this case, the model should be automatically saved by the algorithm. + /// If the user already have a trained model, then this part can be omitted. + /// - Load the trained model using Facemark::loadModel. + /// - Perform the fitting via the Facemark::fit. + pub struct FacemarkTrain { + ptr: *mut c_void + } + + opencv_type_boxed! { FacemarkTrain } + + impl Drop for FacemarkTrain { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FacemarkTrain_delete(instance: *mut c_void); } + unsafe { cv_FacemarkTrain_delete(self.as_raw_mut_FacemarkTrain()) }; + } + } + + unsafe impl Send for FacemarkTrain {} + + impl core::AlgorithmTraitConst for FacemarkTrain { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FacemarkTrain { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkTraitConst for FacemarkTrain { + #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkTrait for FacemarkTrain { + #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FacemarkTrainTraitConst for FacemarkTrain { + #[inline] fn as_raw_FacemarkTrain(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FacemarkTrainTrait for FacemarkTrain { + #[inline] fn as_raw_mut_FacemarkTrain(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FacemarkTrain { + } + + boxed_cast_base! { FacemarkTrain, core::Algorithm, cv_FacemarkTrain_to_Algorithm } + /// Constant methods for [crate::face::FisherFaceRecognizer] - pub trait FisherFaceRecognizerConst: crate::face::BasicFaceRecognizerConst { + pub trait FisherFaceRecognizerTraitConst: crate::face::BasicFaceRecognizerTraitConst { fn as_raw_FisherFaceRecognizer(&self) -> *const c_void; } - pub trait FisherFaceRecognizer: crate::face::BasicFaceRecognizer + crate::face::FisherFaceRecognizerConst { + /// Mutable methods for [crate::face::FisherFaceRecognizer] + pub trait FisherFaceRecognizerTrait: crate::face::BasicFaceRecognizerTrait + crate::face::FisherFaceRecognizerTraitConst { fn as_raw_mut_FisherFaceRecognizer(&mut self) -> *mut c_void; } - impl dyn FisherFaceRecognizer + '_ { + pub struct FisherFaceRecognizer { + ptr: *mut c_void + } + + opencv_type_boxed! { FisherFaceRecognizer } + + impl Drop for FisherFaceRecognizer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FisherFaceRecognizer_delete(instance: *mut c_void); } + unsafe { cv_FisherFaceRecognizer_delete(self.as_raw_mut_FisherFaceRecognizer()) }; + } + } + + unsafe impl Send for FisherFaceRecognizer {} + + impl core::AlgorithmTraitConst for FisherFaceRecognizer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FisherFaceRecognizer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::BasicFaceRecognizerTraitConst for FisherFaceRecognizer { + #[inline] fn as_raw_BasicFaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::BasicFaceRecognizerTrait for FisherFaceRecognizer { + #[inline] fn as_raw_mut_BasicFaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FaceRecognizerTraitConst for FisherFaceRecognizer { + #[inline] fn as_raw_FaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FaceRecognizerTrait for FisherFaceRecognizer { + #[inline] fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FisherFaceRecognizerTraitConst for FisherFaceRecognizer { + #[inline] fn as_raw_FisherFaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FisherFaceRecognizerTrait for FisherFaceRecognizer { + #[inline] fn as_raw_mut_FisherFaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FisherFaceRecognizer { /// ## Parameters /// * num_components: The number of components (read: Fisherfaces) kept for this Linear /// Discriminant Analysis with the Fisherfaces criterion. It's useful to keep all components, that @@ -2769,18 +3222,21 @@ pub mod face { /// * num_components: 0 /// * threshold: DBL_MAX #[inline] - pub fn create(num_components: i32, threshold: f64) -> Result> { + pub fn create(num_components: i32, threshold: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_FisherFaceRecognizer_create_int_double(num_components, threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { FisherFaceRecognizer, core::Algorithm, cv_FisherFaceRecognizer_to_Algorithm } + /// Constant methods for [crate::face::LBPHFaceRecognizer] - pub trait LBPHFaceRecognizerConst: crate::face::FaceRecognizerConst { + pub trait LBPHFaceRecognizerTraitConst: crate::face::FaceRecognizerTraitConst { fn as_raw_LBPHFaceRecognizer(&self) -> *const c_void; /// ## See also @@ -2860,7 +3316,8 @@ pub mod face { } - pub trait LBPHFaceRecognizer: crate::face::FaceRecognizer + crate::face::LBPHFaceRecognizerConst { + /// Mutable methods for [crate::face::LBPHFaceRecognizer] + pub trait LBPHFaceRecognizerTrait: crate::face::FaceRecognizerTrait + crate::face::LBPHFaceRecognizerTraitConst { fn as_raw_mut_LBPHFaceRecognizer(&mut self) -> *mut c_void; /// ## See also @@ -2920,7 +3377,47 @@ pub mod face { } - impl dyn LBPHFaceRecognizer + '_ { + pub struct LBPHFaceRecognizer { + ptr: *mut c_void + } + + opencv_type_boxed! { LBPHFaceRecognizer } + + impl Drop for LBPHFaceRecognizer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LBPHFaceRecognizer_delete(instance: *mut c_void); } + unsafe { cv_LBPHFaceRecognizer_delete(self.as_raw_mut_LBPHFaceRecognizer()) }; + } + } + + unsafe impl Send for LBPHFaceRecognizer {} + + impl core::AlgorithmTraitConst for LBPHFaceRecognizer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LBPHFaceRecognizer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::FaceRecognizerTraitConst for LBPHFaceRecognizer { + #[inline] fn as_raw_FaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::FaceRecognizerTrait for LBPHFaceRecognizer { + #[inline] fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::LBPHFaceRecognizerTraitConst for LBPHFaceRecognizer { + #[inline] fn as_raw_LBPHFaceRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::LBPHFaceRecognizerTrait for LBPHFaceRecognizer { + #[inline] fn as_raw_mut_LBPHFaceRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LBPHFaceRecognizer { /// ## Parameters /// * radius: The radius used for building the Circular Local Binary Pattern. The greater the /// radius, the smoother the image but more spatial information you can get. @@ -2960,18 +3457,21 @@ pub mod face { /// * grid_y: 8 /// * threshold: DBL_MAX #[inline] - pub fn create(radius: i32, neighbors: i32, grid_x: i32, grid_y: i32, threshold: f64) -> Result> { + pub fn create(radius: i32, neighbors: i32, grid_x: i32, grid_y: i32, threshold: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_LBPHFaceRecognizer_create_int_int_int_int_double(radius, neighbors, grid_x, grid_y, threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { LBPHFaceRecognizer, core::Algorithm, cv_LBPHFaceRecognizer_to_Algorithm } + /// Constant methods for [crate::face::MACE] - pub trait MACEConst: core::AlgorithmTraitConst { + pub trait MACETraitConst: core::AlgorithmTraitConst { fn as_raw_MACE(&self) -> *const c_void; /// correlate query img and threshold to min class value @@ -2989,6 +3489,40 @@ pub mod face { } + /// Mutable methods for [crate::face::MACE] + pub trait MACETrait: core::AlgorithmTrait + crate::face::MACETraitConst { + fn as_raw_mut_MACE(&mut self) -> *mut c_void; + + /// optionally encrypt images with random convolution + /// ## Parameters + /// * passphrase: a crc64 random seed will get generated from this + #[inline] + fn salt(&mut self, passphrase: &str) -> Result<()> { + extern_container_arg!(passphrase); + return_send!(via ocvrs_return); + unsafe { sys::cv_face_MACE_salt_const_StringR(self.as_raw_mut_MACE(), passphrase.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + /// train it on positive features + /// compute the mace filter: `h = D(-1) * X * (X(+) * D(-1) * X)(-1) * C` + /// also calculate a minimal threshold for this class, the smallest self-similarity from the train images + /// ## Parameters + /// * images: a vector with the train images + #[inline] + fn train(&mut self, images: &dyn core::ToInputArray) -> Result<()> { + extern_container_arg!(images); + return_send!(via ocvrs_return); + unsafe { sys::cv_face_MACE_train_const__InputArrayR(self.as_raw_mut_MACE(), images.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// Minimum Average Correlation Energy Filter /// useful for authentication with (cancellable) biometrical features. /// (does not need many positives to train (10-50), and no negatives at all, also robust to noise/salting) @@ -3041,40 +3575,39 @@ pub mod face { /// reloaded->same(some_image); /// ``` /// - pub trait MACE: core::AlgorithmTrait + crate::face::MACEConst { - fn as_raw_mut_MACE(&mut self) -> *mut c_void; + pub struct MACE { + ptr: *mut c_void + } - /// optionally encrypt images with random convolution - /// ## Parameters - /// * passphrase: a crc64 random seed will get generated from this - #[inline] - fn salt(&mut self, passphrase: &str) -> Result<()> { - extern_container_arg!(passphrase); - return_send!(via ocvrs_return); - unsafe { sys::cv_face_MACE_salt_const_StringR(self.as_raw_mut_MACE(), passphrase.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) - } - - /// train it on positive features - /// compute the mace filter: `h = D(-1) * X * (X(+) * D(-1) * X)(-1) * C` - /// also calculate a minimal threshold for this class, the smallest self-similarity from the train images - /// ## Parameters - /// * images: a vector with the train images + opencv_type_boxed! { MACE } + + impl Drop for MACE { #[inline] - fn train(&mut self, images: &dyn core::ToInputArray) -> Result<()> { - extern_container_arg!(images); - return_send!(via ocvrs_return); - unsafe { sys::cv_face_MACE_train_const__InputArrayR(self.as_raw_mut_MACE(), images.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_MACE_delete(instance: *mut c_void); } + unsafe { cv_MACE_delete(self.as_raw_mut_MACE()) }; } - } - impl dyn MACE + '_ { + unsafe impl Send for MACE {} + + impl core::AlgorithmTraitConst for MACE { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MACE { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::face::MACETraitConst for MACE { + #[inline] fn as_raw_MACE(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::MACETrait for MACE { + #[inline] fn as_raw_mut_MACE(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MACE { /// constructor /// ## Parameters /// * filename: build a new MACE instance from a pre-serialized FileStorage @@ -3083,14 +3616,14 @@ pub mod face { /// ## C++ default parameters /// * objname: String() #[inline] - pub fn load(filename: &str, objname: &str) -> Result> { + pub fn load(filename: &str, objname: &str) -> Result> { extern_container_arg!(filename); extern_container_arg!(objname); return_send!(via ocvrs_return); unsafe { sys::cv_face_MACE_load_const_StringR_const_StringR(filename.opencv_as_extern(), objname.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3101,24 +3634,27 @@ pub mod face { /// ## C++ default parameters /// * imgsize: 64 #[inline] - pub fn create(imgsize: i32) -> Result> { + pub fn create(imgsize: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_face_MACE_create_int(imgsize, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { MACE, core::Algorithm, cv_MACE_to_Algorithm } + /// Constant methods for [crate::face::PredictCollector] - pub trait PredictCollectorConst { + pub trait PredictCollectorTraitConst { fn as_raw_PredictCollector(&self) -> *const c_void; } - /// Abstract base class for all strategies of prediction result handling - pub trait PredictCollector: crate::face::PredictCollectorConst { + /// Mutable methods for [crate::face::PredictCollector] + pub trait PredictCollectorTrait: crate::face::PredictCollectorTraitConst { fn as_raw_mut_PredictCollector(&mut self) -> *mut c_void; /// Interface method called by face recognizer before results processing @@ -3148,8 +3684,38 @@ pub mod face { } + /// Abstract base class for all strategies of prediction result handling + pub struct PredictCollector { + ptr: *mut c_void + } + + opencv_type_boxed! { PredictCollector } + + impl Drop for PredictCollector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_PredictCollector_delete(instance: *mut c_void); } + unsafe { cv_PredictCollector_delete(self.as_raw_mut_PredictCollector()) }; + } + } + + unsafe impl Send for PredictCollector {} + + impl crate::face::PredictCollectorTraitConst for PredictCollector { + #[inline] fn as_raw_PredictCollector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::face::PredictCollectorTrait for PredictCollector { + #[inline] fn as_raw_mut_PredictCollector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl PredictCollector { + } + + boxed_cast_descendant! { PredictCollector, crate::face::StandardCollector, cv_PredictCollector_to_StandardCollector } + /// Constant methods for [crate::face::StandardCollector] - pub trait StandardCollectorTraitConst: crate::face::PredictCollectorConst { + pub trait StandardCollectorTraitConst: crate::face::PredictCollectorTraitConst { fn as_raw_StandardCollector(&self) -> *const c_void; /// Returns label with minimal distance @@ -3192,7 +3758,7 @@ pub mod face { } /// Mutable methods for [crate::face::StandardCollector] - pub trait StandardCollectorTrait: crate::face::PredictCollector + crate::face::StandardCollectorTraitConst { + pub trait StandardCollectorTrait: crate::face::PredictCollectorTrait + crate::face::StandardCollectorTraitConst { fn as_raw_mut_StandardCollector(&mut self) -> *mut c_void; /// overloaded interface method @@ -3236,11 +3802,11 @@ pub mod face { unsafe impl Send for StandardCollector {} - impl crate::face::PredictCollectorConst for StandardCollector { + impl crate::face::PredictCollectorTraitConst for StandardCollector { #[inline] fn as_raw_PredictCollector(&self) -> *const c_void { self.as_raw() } } - impl crate::face::PredictCollector for StandardCollector { + impl crate::face::PredictCollectorTrait for StandardCollector { #[inline] fn as_raw_mut_PredictCollector(&mut self) -> *mut c_void { self.as_raw_mut() } } diff --git a/docs/features2d.rs b/docs/features2d.rs index ce5fb2ae6..a94de2b9c 100644 --- a/docs/features2d.rs +++ b/docs/features2d.rs @@ -17,7 +17,7 @@ pub mod features2d { //! # Interface use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::KeyPointsFilterTraitConst, super::KeyPointsFilterTrait, super::Feature2DTraitConst, super::Feature2DTrait, super::AffineFeatureConst, super::AffineFeature, super::SIFTConst, super::SIFT, super::BRISKConst, super::BRISK, super::ORBConst, super::ORB, super::MSERConst, super::MSER, super::FastFeatureDetectorConst, super::FastFeatureDetector, super::AgastFeatureDetectorConst, super::AgastFeatureDetector, super::GFTTDetectorConst, super::GFTTDetector, super::SimpleBlobDetectorConst, super::SimpleBlobDetector, super::KAZEConst, super::KAZE, super::AKAZEConst, super::AKAZE, super::DescriptorMatcherConst, super::DescriptorMatcher, super::BFMatcherTraitConst, super::BFMatcherTrait, super::FlannBasedMatcherTraitConst, super::FlannBasedMatcherTrait, super::BOWTrainerConst, super::BOWTrainer, super::BOWKMeansTrainerTraitConst, super::BOWKMeansTrainerTrait, super::BOWImgDescriptorExtractorTraitConst, super::BOWImgDescriptorExtractorTrait }; + pub use { super::KeyPointsFilterTraitConst, super::KeyPointsFilterTrait, super::Feature2DTraitConst, super::Feature2DTrait, super::AffineFeatureTraitConst, super::AffineFeatureTrait, super::SIFTTraitConst, super::SIFTTrait, super::BRISKTraitConst, super::BRISKTrait, super::ORBTraitConst, super::ORBTrait, super::MSERTraitConst, super::MSERTrait, super::FastFeatureDetectorTraitConst, super::FastFeatureDetectorTrait, super::AgastFeatureDetectorTraitConst, super::AgastFeatureDetectorTrait, super::GFTTDetectorTraitConst, super::GFTTDetectorTrait, super::SimpleBlobDetectorTraitConst, super::SimpleBlobDetectorTrait, super::KAZETraitConst, super::KAZETrait, super::AKAZETraitConst, super::AKAZETrait, super::DescriptorMatcherTraitConst, super::DescriptorMatcherTrait, super::BFMatcherTraitConst, super::BFMatcherTrait, super::FlannBasedMatcherTraitConst, super::FlannBasedMatcherTrait, super::BOWTrainerTraitConst, super::BOWTrainerTrait, super::BOWKMeansTrainerTraitConst, super::BOWKMeansTrainerTrait, super::BOWImgDescriptorExtractorTraitConst, super::BOWImgDescriptorExtractorTrait }; } pub const AKAZE_DESCRIPTOR_KAZE: i32 = 3; @@ -152,8 +152,8 @@ pub mod features2d { opencv_type_enum! { crate::features2d::ORB_ScoreType } - pub type AffineDescriptorExtractor = dyn crate::features2d::AffineFeature; - pub type AffineFeatureDetector = dyn crate::features2d::AffineFeature; + pub type AffineDescriptorExtractor = crate::features2d::AffineFeature; + pub type AffineFeatureDetector = crate::features2d::AffineFeature; /// Extractors of keypoint descriptors in OpenCV have wrappers with a common interface that enables you /// to easily switch between different algorithms solving the same problem. This section is devoted to /// computing descriptors represented as vectors in a multidimensional space. All objects that implement @@ -163,8 +163,8 @@ pub mod features2d { /// between different algorithms solving the same problem. All objects that implement keypoint detectors /// inherit the FeatureDetector interface. pub type FeatureDetector = crate::features2d::Feature2D; - pub type SiftDescriptorExtractor = dyn crate::features2d::SIFT; - pub type SiftFeatureDetector = dyn crate::features2d::SIFT; + pub type SiftDescriptorExtractor = crate::features2d::SIFT; + pub type SiftFeatureDetector = crate::features2d::SIFT; /// Detects corners using the AGAST algorithm /// /// ## Parameters @@ -460,7 +460,7 @@ pub mod features2d { } /// Constant methods for [crate::features2d::AKAZE] - pub trait AKAZEConst: crate::features2d::Feature2DTraitConst { + pub trait AKAZETraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_AKAZE(&self) -> *const c_void; #[inline] @@ -538,24 +538,8 @@ pub mod features2d { } - /// Class implementing the AKAZE keypoint detector and descriptor extractor, described in [ANB13](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_ANB13). - /// - /// @details AKAZE descriptors can only be used with KAZE or AKAZE keypoints. This class is thread-safe. - /// - /// - /// Note: When you need descriptors use Feature2D::detectAndCompute, which - /// provides better performance. When using Feature2D::detect followed by - /// Feature2D::compute scale space pyramid is computed twice. - /// - /// - /// Note: AKAZE implements T-API. When image is passed as UMat some parts of the algorithm - /// will use OpenCL. - /// - /// - /// Note: [ANB13] Fast Explicit Diffusion for Accelerated Features in Nonlinear - /// Scale Spaces. Pablo F. Alcantarilla, Jesús Nuevo and Adrien Bartoli. In - /// British Machine Vision Conference (BMVC), Bristol, UK, September 2013. - pub trait AKAZE: crate::features2d::AKAZEConst + crate::features2d::Feature2DTrait { + /// Mutable methods for [crate::features2d::AKAZE] + pub trait AKAZETrait: crate::features2d::AKAZETraitConst + crate::features2d::Feature2DTrait { fn as_raw_mut_AKAZE(&mut self) -> *mut c_void; #[inline] @@ -623,7 +607,64 @@ pub mod features2d { } - impl dyn AKAZE + '_ { + /// Class implementing the AKAZE keypoint detector and descriptor extractor, described in [ANB13](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_ANB13). + /// + /// @details AKAZE descriptors can only be used with KAZE or AKAZE keypoints. This class is thread-safe. + /// + /// + /// Note: When you need descriptors use Feature2D::detectAndCompute, which + /// provides better performance. When using Feature2D::detect followed by + /// Feature2D::compute scale space pyramid is computed twice. + /// + /// + /// Note: AKAZE implements T-API. When image is passed as UMat some parts of the algorithm + /// will use OpenCL. + /// + /// + /// Note: [ANB13] Fast Explicit Diffusion for Accelerated Features in Nonlinear + /// Scale Spaces. Pablo F. Alcantarilla, Jesús Nuevo and Adrien Bartoli. In + /// British Machine Vision Conference (BMVC), Bristol, UK, September 2013. + pub struct AKAZE { + ptr: *mut c_void + } + + opencv_type_boxed! { AKAZE } + + impl Drop for AKAZE { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_AKAZE_delete(instance: *mut c_void); } + unsafe { cv_AKAZE_delete(self.as_raw_mut_AKAZE()) }; + } + } + + unsafe impl Send for AKAZE {} + + impl core::AlgorithmTraitConst for AKAZE { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for AKAZE { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for AKAZE { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for AKAZE { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::AKAZETraitConst for AKAZE { + #[inline] fn as_raw_AKAZE(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::AKAZETrait for AKAZE { + #[inline] fn as_raw_mut_AKAZE(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl AKAZE { /// The AKAZE constructor /// /// ## Parameters @@ -646,18 +687,23 @@ pub mod features2d { /// * n_octave_layers: 4 /// * diffusivity: KAZE::DIFF_PM_G2 #[inline] - pub fn create(descriptor_type: crate::features2d::AKAZE_DescriptorType, descriptor_size: i32, descriptor_channels: i32, threshold: f32, n_octaves: i32, n_octave_layers: i32, diffusivity: crate::features2d::KAZE_DiffusivityType) -> Result> { + pub fn create(descriptor_type: crate::features2d::AKAZE_DescriptorType, descriptor_size: i32, descriptor_channels: i32, threshold: f32, n_octaves: i32, n_octave_layers: i32, diffusivity: crate::features2d::KAZE_DiffusivityType) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_AKAZE_create_DescriptorType_int_int_float_int_int_DiffusivityType(descriptor_type, descriptor_size, descriptor_channels, threshold, n_octaves, n_octave_layers, diffusivity, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { AKAZE, core::Algorithm, cv_AKAZE_to_Algorithm } + + boxed_cast_base! { AKAZE, crate::features2d::Feature2D, cv_AKAZE_to_Feature2D } + /// Constant methods for [crate::features2d::AffineFeature] - pub trait AffineFeatureConst: crate::features2d::Feature2DTraitConst { + pub trait AffineFeatureTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_AffineFeature(&self) -> *const c_void; #[inline] @@ -681,9 +727,8 @@ pub mod features2d { } - /// Class for implementing the wrapper which makes detectors and extractors to be affine invariant, - /// described as ASIFT in [YM11](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_YM11) . - pub trait AffineFeature: crate::features2d::AffineFeatureConst + crate::features2d::Feature2DTrait { + /// Mutable methods for [crate::features2d::AffineFeature] + pub trait AffineFeatureTrait: crate::features2d::AffineFeatureTraitConst + crate::features2d::Feature2DTrait { fn as_raw_mut_AffineFeature(&mut self) -> *mut c_void; #[inline] @@ -697,7 +742,49 @@ pub mod features2d { } - impl dyn AffineFeature + '_ { + /// Class for implementing the wrapper which makes detectors and extractors to be affine invariant, + /// described as ASIFT in [YM11](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_YM11) . + pub struct AffineFeature { + ptr: *mut c_void + } + + opencv_type_boxed! { AffineFeature } + + impl Drop for AffineFeature { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_AffineFeature_delete(instance: *mut c_void); } + unsafe { cv_AffineFeature_delete(self.as_raw_mut_AffineFeature()) }; + } + } + + unsafe impl Send for AffineFeature {} + + impl core::AlgorithmTraitConst for AffineFeature { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for AffineFeature { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for AffineFeature { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for AffineFeature { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::AffineFeatureTraitConst for AffineFeature { + #[inline] fn as_raw_AffineFeature(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::AffineFeatureTrait for AffineFeature { + #[inline] fn as_raw_mut_AffineFeature(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl AffineFeature { /// ## Parameters /// * backend: The detector/extractor you want to use as backend. /// * maxTilt: The highest power index of tilt factor. 5 is used in the paper as tilt sampling range n. @@ -711,18 +798,23 @@ pub mod features2d { /// * tilt_step: 1.4142135623730951f /// * rotate_step_base: 72 #[inline] - pub fn create(backend: &core::Ptr, max_tilt: i32, min_tilt: i32, tilt_step: f32, rotate_step_base: f32) -> Result> { + pub fn create(backend: &core::Ptr, max_tilt: i32, min_tilt: i32, tilt_step: f32, rotate_step_base: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_AffineFeature_create_const_PtrLFeature2DGR_int_int_float_float(backend.as_raw_PtrOfFeature2D(), max_tilt, min_tilt, tilt_step, rotate_step_base, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { AffineFeature, core::Algorithm, cv_AffineFeature_to_Algorithm } + + boxed_cast_base! { AffineFeature, crate::features2d::Feature2D, cv_AffineFeature_to_Feature2D } + /// Constant methods for [crate::features2d::AgastFeatureDetector] - pub trait AgastFeatureDetectorConst: crate::features2d::Feature2DTraitConst { + pub trait AgastFeatureDetectorTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_AgastFeatureDetector(&self) -> *const c_void; #[inline] @@ -764,8 +856,8 @@ pub mod features2d { } - /// Wrapping class for feature detection using the AGAST method. : - pub trait AgastFeatureDetector: crate::features2d::AgastFeatureDetectorConst + crate::features2d::Feature2DTrait { + /// Mutable methods for [crate::features2d::AgastFeatureDetector] + pub trait AgastFeatureDetectorTrait: crate::features2d::AgastFeatureDetectorTraitConst + crate::features2d::Feature2DTrait { fn as_raw_mut_AgastFeatureDetector(&mut self) -> *mut c_void; #[inline] @@ -797,24 +889,70 @@ pub mod features2d { } - impl dyn AgastFeatureDetector + '_ { + /// Wrapping class for feature detection using the AGAST method. : + pub struct AgastFeatureDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { AgastFeatureDetector } + + impl Drop for AgastFeatureDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_AgastFeatureDetector_delete(instance: *mut c_void); } + unsafe { cv_AgastFeatureDetector_delete(self.as_raw_mut_AgastFeatureDetector()) }; + } + } + + unsafe impl Send for AgastFeatureDetector {} + + impl core::AlgorithmTraitConst for AgastFeatureDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for AgastFeatureDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for AgastFeatureDetector { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for AgastFeatureDetector { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::AgastFeatureDetectorTraitConst for AgastFeatureDetector { + #[inline] fn as_raw_AgastFeatureDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::AgastFeatureDetectorTrait for AgastFeatureDetector { + #[inline] fn as_raw_mut_AgastFeatureDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl AgastFeatureDetector { /// ## C++ default parameters /// * threshold: 10 /// * nonmax_suppression: true /// * typ: AgastFeatureDetector::OAST_9_16 #[inline] - pub fn create(threshold: i32, nonmax_suppression: bool, typ: crate::features2d::AgastFeatureDetector_DetectorType) -> Result> { + pub fn create(threshold: i32, nonmax_suppression: bool, typ: crate::features2d::AgastFeatureDetector_DetectorType) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_AgastFeatureDetector_create_int_bool_DetectorType(threshold, nonmax_suppression, typ, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { AgastFeatureDetector, core::Algorithm, cv_AgastFeatureDetector_to_Algorithm } + + boxed_cast_base! { AgastFeatureDetector, crate::features2d::Feature2D, cv_AgastFeatureDetector_to_Feature2D } + /// Constant methods for [crate::features2d::BFMatcher] - pub trait BFMatcherTraitConst: crate::features2d::DescriptorMatcherConst { + pub trait BFMatcherTraitConst: crate::features2d::DescriptorMatcherTraitConst { fn as_raw_BFMatcher(&self) -> *const c_void; #[inline] @@ -830,19 +968,19 @@ pub mod features2d { /// * empty_train_data: false #[inline] #[must_use] - fn clone(&self, empty_train_data: bool) -> Result> { + fn clone(&self, empty_train_data: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_BFMatcher_clone_const_bool(self.as_raw_BFMatcher(), empty_train_data, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::features2d::BFMatcher] - pub trait BFMatcherTrait: crate::features2d::BFMatcherTraitConst + crate::features2d::DescriptorMatcher { + pub trait BFMatcherTrait: crate::features2d::BFMatcherTraitConst + crate::features2d::DescriptorMatcherTrait { fn as_raw_mut_BFMatcher(&mut self) -> *mut c_void; } @@ -876,11 +1014,11 @@ pub mod features2d { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::features2d::DescriptorMatcherConst for BFMatcher { + impl crate::features2d::DescriptorMatcherTraitConst for BFMatcher { #[inline] fn as_raw_DescriptorMatcher(&self) -> *const c_void { self.as_raw() } } - impl crate::features2d::DescriptorMatcher for BFMatcher { + impl crate::features2d::DescriptorMatcherTrait for BFMatcher { #[inline] fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1103,7 +1241,7 @@ pub mod features2d { /// * dmatcher: Descriptor matcher that is used to find the nearest word of the trained vocabulary /// for each keypoint descriptor of the image. #[inline] - pub fn new(dextractor: &core::Ptr, dmatcher: &core::Ptr) -> Result { + pub fn new(dextractor: &core::Ptr, dmatcher: &core::Ptr) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_const_PtrLFeature2DGR_const_PtrLDescriptorMatcherGR(dextractor.as_raw_PtrOfFeature2D(), dmatcher.as_raw_PtrOfDescriptorMatcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1122,7 +1260,7 @@ pub mod features2d { /// /// ## Overloaded parameters #[inline] - pub fn new_1(dmatcher: &core::Ptr) -> Result { + pub fn new_1(dmatcher: &core::Ptr) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_const_PtrLDescriptorMatcherGR(dmatcher.as_raw_PtrOfDescriptorMatcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1134,7 +1272,7 @@ pub mod features2d { } /// Constant methods for [crate::features2d::BOWKMeansTrainer] - pub trait BOWKMeansTrainerTraitConst: crate::features2d::BOWTrainerConst { + pub trait BOWKMeansTrainerTraitConst: crate::features2d::BOWTrainerTraitConst { fn as_raw_BOWKMeansTrainer(&self) -> *const c_void; #[inline] @@ -1160,7 +1298,7 @@ pub mod features2d { } /// Mutable methods for [crate::features2d::BOWKMeansTrainer] - pub trait BOWKMeansTrainerTrait: crate::features2d::BOWKMeansTrainerTraitConst + crate::features2d::BOWTrainer { + pub trait BOWKMeansTrainerTrait: crate::features2d::BOWKMeansTrainerTraitConst + crate::features2d::BOWTrainerTrait { fn as_raw_mut_BOWKMeansTrainer(&mut self) -> *mut c_void; } @@ -1182,11 +1320,11 @@ pub mod features2d { unsafe impl Send for BOWKMeansTrainer {} - impl crate::features2d::BOWTrainerConst for BOWKMeansTrainer { + impl crate::features2d::BOWTrainerTraitConst for BOWKMeansTrainer { #[inline] fn as_raw_BOWTrainer(&self) -> *const c_void { self.as_raw() } } - impl crate::features2d::BOWTrainer for BOWKMeansTrainer { + impl crate::features2d::BOWTrainerTrait for BOWKMeansTrainer { #[inline] fn as_raw_mut_BOWTrainer(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1220,7 +1358,7 @@ pub mod features2d { } /// Constant methods for [crate::features2d::BOWTrainer] - pub trait BOWTrainerConst { + pub trait BOWTrainerTraitConst { fn as_raw_BOWTrainer(&self) -> *const c_void; /// Returns a training set of descriptors. @@ -1286,11 +1424,8 @@ pub mod features2d { } - /// Abstract base class for training the *bag of visual words* vocabulary from a set of descriptors. - /// - /// For details, see, for example, *Visual Categorization with Bags of Keypoints* by Gabriella Csurka, - /// Christopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. : - pub trait BOWTrainer: crate::features2d::BOWTrainerConst { + /// Mutable methods for [crate::features2d::BOWTrainer] + pub trait BOWTrainerTrait: crate::features2d::BOWTrainerTraitConst { fn as_raw_mut_BOWTrainer(&mut self) -> *mut c_void; /// Adds descriptors to a training set. @@ -1320,8 +1455,41 @@ pub mod features2d { } + /// Abstract base class for training the *bag of visual words* vocabulary from a set of descriptors. + /// + /// For details, see, for example, *Visual Categorization with Bags of Keypoints* by Gabriella Csurka, + /// Christopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. : + pub struct BOWTrainer { + ptr: *mut c_void + } + + opencv_type_boxed! { BOWTrainer } + + impl Drop for BOWTrainer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BOWTrainer_delete(instance: *mut c_void); } + unsafe { cv_BOWTrainer_delete(self.as_raw_mut_BOWTrainer()) }; + } + } + + unsafe impl Send for BOWTrainer {} + + impl crate::features2d::BOWTrainerTraitConst for BOWTrainer { + #[inline] fn as_raw_BOWTrainer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::BOWTrainerTrait for BOWTrainer { + #[inline] fn as_raw_mut_BOWTrainer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BOWTrainer { + } + + boxed_cast_descendant! { BOWTrainer, crate::features2d::BOWKMeansTrainer, cv_BOWTrainer_to_BOWKMeansTrainer } + /// Constant methods for [crate::features2d::BRISK] - pub trait BRISKConst: crate::features2d::Feature2DTraitConst { + pub trait BRISKTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_BRISK(&self) -> *const c_void; #[inline] @@ -1363,8 +1531,8 @@ pub mod features2d { } - /// Class implementing the BRISK keypoint detector and descriptor extractor, described in [LCS11](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LCS11) . - pub trait BRISK: crate::features2d::BRISKConst + crate::features2d::Feature2DTrait { + /// Mutable methods for [crate::features2d::BRISK] + pub trait BRISKTrait: crate::features2d::BRISKTraitConst + crate::features2d::Feature2DTrait { fn as_raw_mut_BRISK(&mut self) -> *mut c_void; /// Set detection threshold. @@ -1406,7 +1574,48 @@ pub mod features2d { } - impl dyn BRISK + '_ { + /// Class implementing the BRISK keypoint detector and descriptor extractor, described in [LCS11](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LCS11) . + pub struct BRISK { + ptr: *mut c_void + } + + opencv_type_boxed! { BRISK } + + impl Drop for BRISK { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BRISK_delete(instance: *mut c_void); } + unsafe { cv_BRISK_delete(self.as_raw_mut_BRISK()) }; + } + } + + unsafe impl Send for BRISK {} + + impl core::AlgorithmTraitConst for BRISK { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BRISK { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for BRISK { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for BRISK { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::BRISKTraitConst for BRISK { + #[inline] fn as_raw_BRISK(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::BRISKTrait for BRISK { + #[inline] fn as_raw_mut_BRISK(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BRISK { /// The BRISK constructor /// /// ## Parameters @@ -1420,12 +1629,12 @@ pub mod features2d { /// * octaves: 3 /// * pattern_scale: 1.0f #[inline] - pub fn create(thresh: i32, octaves: i32, pattern_scale: f32) -> Result> { + pub fn create(thresh: i32, octaves: i32, pattern_scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_BRISK_create_int_int_float(thresh, octaves, pattern_scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1447,12 +1656,12 @@ pub mod features2d { /// * d_min: 8.2f /// * index_change: std::vector() #[inline] - pub fn create_with_pattern(radius_list: &core::Vector, number_list: &core::Vector, d_max: f32, d_min: f32, index_change: &core::Vector) -> Result> { + pub fn create_with_pattern(radius_list: &core::Vector, number_list: &core::Vector, d_max: f32, d_min: f32, index_change: &core::Vector) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_BRISK_create_const_vectorLfloatGR_const_vectorLintGR_float_float_const_vectorLintGR(radius_list.as_raw_VectorOff32(), number_list.as_raw_VectorOfi32(), d_max, d_min, index_change.as_raw_VectorOfi32(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1476,18 +1685,23 @@ pub mod features2d { /// * d_min: 8.2f /// * index_change: std::vector() #[inline] - pub fn create_with_pattern_threshold_octaves(thresh: i32, octaves: i32, radius_list: &core::Vector, number_list: &core::Vector, d_max: f32, d_min: f32, index_change: &core::Vector) -> Result> { + pub fn create_with_pattern_threshold_octaves(thresh: i32, octaves: i32, radius_list: &core::Vector, number_list: &core::Vector, d_max: f32, d_min: f32, index_change: &core::Vector) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_BRISK_create_int_int_const_vectorLfloatGR_const_vectorLintGR_float_float_const_vectorLintGR(thresh, octaves, radius_list.as_raw_VectorOff32(), number_list.as_raw_VectorOfi32(), d_max, d_min, index_change.as_raw_VectorOfi32(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { BRISK, core::Algorithm, cv_BRISK_to_Algorithm } + + boxed_cast_base! { BRISK, crate::features2d::Feature2D, cv_BRISK_to_Feature2D } + /// Constant methods for [crate::features2d::DescriptorMatcher] - pub trait DescriptorMatcherConst: core::AlgorithmTraitConst { + pub trait DescriptorMatcherTraitConst: core::AlgorithmTraitConst { fn as_raw_DescriptorMatcher(&self) -> *const c_void; /// Returns a constant link to the train descriptor collection trainDescCollection . @@ -1651,12 +1865,12 @@ pub mod features2d { /// * empty_train_data: false #[inline] #[must_use] - fn clone(&self, empty_train_data: bool) -> Result> { + fn clone(&self, empty_train_data: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_DescriptorMatcher_clone_const_bool(self.as_raw_DescriptorMatcher(), empty_train_data, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1682,11 +1896,8 @@ pub mod features2d { } - /// Abstract base class for matching keypoint descriptors. - /// - /// It has two groups of match methods: for matching descriptors of an image with another image or with - /// an image set. - pub trait DescriptorMatcher: core::AlgorithmTrait + crate::features2d::DescriptorMatcherConst { + /// Mutable methods for [crate::features2d::DescriptorMatcher] + pub trait DescriptorMatcherTrait: core::AlgorithmTrait + crate::features2d::DescriptorMatcherTraitConst { fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void; /// Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor @@ -1883,7 +2094,43 @@ pub mod features2d { } - impl dyn DescriptorMatcher + '_ { + /// Abstract base class for matching keypoint descriptors. + /// + /// It has two groups of match methods: for matching descriptors of an image with another image or with + /// an image set. + pub struct DescriptorMatcher { + ptr: *mut c_void + } + + opencv_type_boxed! { DescriptorMatcher } + + impl Drop for DescriptorMatcher { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DescriptorMatcher_delete(instance: *mut c_void); } + unsafe { cv_DescriptorMatcher_delete(self.as_raw_mut_DescriptorMatcher()) }; + } + } + + unsafe impl Send for DescriptorMatcher {} + + impl core::AlgorithmTraitConst for DescriptorMatcher { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DescriptorMatcher { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::DescriptorMatcherTraitConst for DescriptorMatcher { + #[inline] fn as_raw_DescriptorMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::DescriptorMatcherTrait for DescriptorMatcher { + #[inline] fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DescriptorMatcher { /// Creates a descriptor matcher of a given type with the default parameters (using default /// constructor). /// @@ -1896,29 +2143,36 @@ pub mod features2d { /// * `BruteForce-Hamming(2)` /// * `FlannBased` #[inline] - pub fn create(descriptor_matcher_type: &str) -> Result> { + pub fn create(descriptor_matcher_type: &str) -> Result> { extern_container_arg!(descriptor_matcher_type); return_send!(via ocvrs_return); unsafe { sys::cv_DescriptorMatcher_create_const_StringR(descriptor_matcher_type.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_with_matcher_type(matcher_type: crate::features2d::DescriptorMatcher_MatcherType) -> Result> { + pub fn create_with_matcher_type(matcher_type: crate::features2d::DescriptorMatcher_MatcherType) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_DescriptorMatcher_create_const_MatcherTypeR(&matcher_type, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_descendant! { DescriptorMatcher, crate::features2d::BFMatcher, cv_DescriptorMatcher_to_BFMatcher } + + boxed_cast_descendant! { DescriptorMatcher, crate::features2d::FlannBasedMatcher, cv_DescriptorMatcher_to_FlannBasedMatcher } + + boxed_cast_base! { DescriptorMatcher, core::Algorithm, cv_DescriptorMatcher_to_Algorithm } + /// Constant methods for [crate::features2d::FastFeatureDetector] - pub trait FastFeatureDetectorConst: crate::features2d::Feature2DTraitConst { + pub trait FastFeatureDetectorTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_FastFeatureDetector(&self) -> *const c_void; #[inline] @@ -1960,8 +2214,8 @@ pub mod features2d { } - /// Wrapping class for feature detection using the FAST method. : - pub trait FastFeatureDetector: crate::features2d::FastFeatureDetectorConst + crate::features2d::Feature2DTrait { + /// Mutable methods for [crate::features2d::FastFeatureDetector] + pub trait FastFeatureDetectorTrait: crate::features2d::FastFeatureDetectorTraitConst + crate::features2d::Feature2DTrait { fn as_raw_mut_FastFeatureDetector(&mut self) -> *mut c_void; #[inline] @@ -1993,22 +2247,68 @@ pub mod features2d { } - impl dyn FastFeatureDetector + '_ { + /// Wrapping class for feature detection using the FAST method. : + pub struct FastFeatureDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { FastFeatureDetector } + + impl Drop for FastFeatureDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FastFeatureDetector_delete(instance: *mut c_void); } + unsafe { cv_FastFeatureDetector_delete(self.as_raw_mut_FastFeatureDetector()) }; + } + } + + unsafe impl Send for FastFeatureDetector {} + + impl core::AlgorithmTraitConst for FastFeatureDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FastFeatureDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for FastFeatureDetector { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for FastFeatureDetector { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::FastFeatureDetectorTraitConst for FastFeatureDetector { + #[inline] fn as_raw_FastFeatureDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::FastFeatureDetectorTrait for FastFeatureDetector { + #[inline] fn as_raw_mut_FastFeatureDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FastFeatureDetector { /// ## C++ default parameters /// * threshold: 10 /// * nonmax_suppression: true /// * typ: FastFeatureDetector::TYPE_9_16 #[inline] - pub fn create(threshold: i32, nonmax_suppression: bool, typ: crate::features2d::FastFeatureDetector_DetectorType) -> Result> { + pub fn create(threshold: i32, nonmax_suppression: bool, typ: crate::features2d::FastFeatureDetector_DetectorType) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_FastFeatureDetector_create_int_bool_DetectorType(threshold, nonmax_suppression, typ, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { FastFeatureDetector, core::Algorithm, cv_FastFeatureDetector_to_Algorithm } + + boxed_cast_base! { FastFeatureDetector, crate::features2d::Feature2D, cv_FastFeatureDetector_to_Feature2D } + /// Constant methods for [crate::features2d::Feature2D] pub trait Feature2DTraitConst: core::AlgorithmTraitConst { fn as_raw_Feature2D(&self) -> *const c_void; @@ -2287,7 +2587,7 @@ pub mod features2d { boxed_cast_base! { Feature2D, core::Algorithm, cv_Feature2D_to_Algorithm } /// Constant methods for [crate::features2d::FlannBasedMatcher] - pub trait FlannBasedMatcherTraitConst: crate::features2d::DescriptorMatcherConst { + pub trait FlannBasedMatcherTraitConst: crate::features2d::DescriptorMatcherTraitConst { fn as_raw_FlannBasedMatcher(&self) -> *const c_void; #[inline] @@ -2312,19 +2612,19 @@ pub mod features2d { /// * empty_train_data: false #[inline] #[must_use] - fn clone(&self, empty_train_data: bool) -> Result> { + fn clone(&self, empty_train_data: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_FlannBasedMatcher_clone_const_bool(self.as_raw_FlannBasedMatcher(), empty_train_data, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::features2d::FlannBasedMatcher] - pub trait FlannBasedMatcherTrait: crate::features2d::DescriptorMatcher + crate::features2d::FlannBasedMatcherTraitConst { + pub trait FlannBasedMatcherTrait: crate::features2d::DescriptorMatcherTrait + crate::features2d::FlannBasedMatcherTraitConst { fn as_raw_mut_FlannBasedMatcher(&mut self) -> *mut c_void; #[inline] @@ -2396,11 +2696,11 @@ pub mod features2d { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::features2d::DescriptorMatcherConst for FlannBasedMatcher { + impl crate::features2d::DescriptorMatcherTraitConst for FlannBasedMatcher { #[inline] fn as_raw_DescriptorMatcher(&self) -> *const c_void { self.as_raw() } } - impl crate::features2d::DescriptorMatcher for FlannBasedMatcher { + impl crate::features2d::DescriptorMatcherTrait for FlannBasedMatcher { #[inline] fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2441,7 +2741,7 @@ pub mod features2d { boxed_cast_base! { FlannBasedMatcher, core::Algorithm, cv_FlannBasedMatcher_to_Algorithm } /// Constant methods for [crate::features2d::GFTTDetector] - pub trait GFTTDetectorConst: crate::features2d::Feature2DTraitConst { + pub trait GFTTDetectorTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_GFTTDetector(&self) -> *const c_void; #[inline] @@ -2510,8 +2810,8 @@ pub mod features2d { } - /// Wrapping class for feature detection using the goodFeaturesToTrack function. : - pub trait GFTTDetector: crate::features2d::Feature2DTrait + crate::features2d::GFTTDetectorConst { + /// Mutable methods for [crate::features2d::GFTTDetector] + pub trait GFTTDetectorTrait: crate::features2d::Feature2DTrait + crate::features2d::GFTTDetectorTraitConst { fn as_raw_mut_GFTTDetector(&mut self) -> *mut c_void; #[inline] @@ -2588,7 +2888,48 @@ pub mod features2d { } - impl dyn GFTTDetector + '_ { + /// Wrapping class for feature detection using the goodFeaturesToTrack function. : + pub struct GFTTDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { GFTTDetector } + + impl Drop for GFTTDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GFTTDetector_delete(instance: *mut c_void); } + unsafe { cv_GFTTDetector_delete(self.as_raw_mut_GFTTDetector()) }; + } + } + + unsafe impl Send for GFTTDetector {} + + impl core::AlgorithmTraitConst for GFTTDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GFTTDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for GFTTDetector { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for GFTTDetector { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::GFTTDetectorTraitConst for GFTTDetector { + #[inline] fn as_raw_GFTTDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::GFTTDetectorTrait for GFTTDetector { + #[inline] fn as_raw_mut_GFTTDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GFTTDetector { /// ## C++ default parameters /// * max_corners: 1000 /// * quality_level: 0.01 @@ -2597,12 +2938,12 @@ pub mod features2d { /// * use_harris_detector: false /// * k: 0.04 #[inline] - pub fn create(max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, use_harris_detector: bool, k: f64) -> Result> { + pub fn create(max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, use_harris_detector: bool, k: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_GFTTDetector_create_int_double_double_int_bool_double(max_corners, quality_level, min_distance, block_size, use_harris_detector, k, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2610,18 +2951,23 @@ pub mod features2d { /// * use_harris_detector: false /// * k: 0.04 #[inline] - pub fn create_with_gradient(max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, gradiant_size: i32, use_harris_detector: bool, k: f64) -> Result> { + pub fn create_with_gradient(max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, gradiant_size: i32, use_harris_detector: bool, k: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_GFTTDetector_create_int_double_double_int_int_bool_double(max_corners, quality_level, min_distance, block_size, gradiant_size, use_harris_detector, k, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { GFTTDetector, core::Algorithm, cv_GFTTDetector_to_Algorithm } + + boxed_cast_base! { GFTTDetector, crate::features2d::Feature2D, cv_GFTTDetector_to_Feature2D } + /// Constant methods for [crate::features2d::KAZE] - pub trait KAZEConst: crate::features2d::Feature2DTraitConst { + pub trait KAZETraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_KAZE(&self) -> *const c_void; #[inline] @@ -2690,13 +3036,8 @@ pub mod features2d { } - /// Class implementing the KAZE keypoint detector and descriptor extractor, described in [ABD12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_ABD12) . - /// - /// - /// Note: AKAZE descriptor can only be used with KAZE or AKAZE keypoints .. [ABD12] KAZE Features. Pablo - /// F. Alcantarilla, Adrien Bartoli and Andrew J. Davison. In European Conference on Computer Vision - /// (ECCV), Fiorenze, Italy, October 2012. - pub trait KAZE: crate::features2d::Feature2DTrait + crate::features2d::KAZEConst { + /// Mutable methods for [crate::features2d::KAZE] + pub trait KAZETrait: crate::features2d::Feature2DTrait + crate::features2d::KAZETraitConst { fn as_raw_mut_KAZE(&mut self) -> *mut c_void; #[inline] @@ -2755,7 +3096,53 @@ pub mod features2d { } - impl dyn KAZE + '_ { + /// Class implementing the KAZE keypoint detector and descriptor extractor, described in [ABD12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_ABD12) . + /// + /// + /// Note: AKAZE descriptor can only be used with KAZE or AKAZE keypoints .. [ABD12] KAZE Features. Pablo + /// F. Alcantarilla, Adrien Bartoli and Andrew J. Davison. In European Conference on Computer Vision + /// (ECCV), Fiorenze, Italy, October 2012. + pub struct KAZE { + ptr: *mut c_void + } + + opencv_type_boxed! { KAZE } + + impl Drop for KAZE { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_KAZE_delete(instance: *mut c_void); } + unsafe { cv_KAZE_delete(self.as_raw_mut_KAZE()) }; + } + } + + unsafe impl Send for KAZE {} + + impl core::AlgorithmTraitConst for KAZE { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for KAZE { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for KAZE { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for KAZE { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::KAZETraitConst for KAZE { + #[inline] fn as_raw_KAZE(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::KAZETrait for KAZE { + #[inline] fn as_raw_mut_KAZE(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl KAZE { /// The KAZE constructor /// /// ## Parameters @@ -2775,16 +3162,21 @@ pub mod features2d { /// * n_octave_layers: 4 /// * diffusivity: KAZE::DIFF_PM_G2 #[inline] - pub fn create(extended: bool, upright: bool, threshold: f32, n_octaves: i32, n_octave_layers: i32, diffusivity: crate::features2d::KAZE_DiffusivityType) -> Result> { + pub fn create(extended: bool, upright: bool, threshold: f32, n_octaves: i32, n_octave_layers: i32, diffusivity: crate::features2d::KAZE_DiffusivityType) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_KAZE_create_bool_bool_float_int_int_DiffusivityType(extended, upright, threshold, n_octaves, n_octave_layers, diffusivity, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { KAZE, core::Algorithm, cv_KAZE_to_Algorithm } + + boxed_cast_base! { KAZE, crate::features2d::Feature2D, cv_KAZE_to_Feature2D } + /// Constant methods for [crate::features2d::KeyPointsFilter] pub trait KeyPointsFilterTraitConst { fn as_raw_KeyPointsFilter(&self) -> *const c_void; @@ -2904,7 +3296,7 @@ pub mod features2d { } /// Constant methods for [crate::features2d::MSER] - pub trait MSERConst: crate::features2d::Feature2DTraitConst { + pub trait MSERTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_MSER(&self) -> *const c_void; #[inline] @@ -3009,21 +3401,8 @@ pub mod features2d { } - /// Maximally stable extremal region extractor - /// - /// The class encapsulates all the parameters of the %MSER extraction algorithm (see [wiki - /// article](http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions)). - /// - /// - there are two different implementation of %MSER: one for grey image, one for color image - /// - /// - the grey image algorithm is taken from: [nister2008linear](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_nister2008linear) ; the paper claims to be faster - /// than union-find method; it actually get 1.5~2m/s on my centrino L7200 1.2GHz laptop. - /// - /// - the color image algorithm is taken from: [forssen2007maximally](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_forssen2007maximally) ; it should be much slower - /// than grey image method ( 3~4 times ) - /// - /// - (Python) A complete example showing the use of the %MSER detector can be found at samples/python/mser.py - pub trait MSER: crate::features2d::Feature2DTrait + crate::features2d::MSERConst { + /// Mutable methods for [crate::features2d::MSER] + pub trait MSERTrait: crate::features2d::Feature2DTrait + crate::features2d::MSERTraitConst { fn as_raw_mut_MSER(&mut self) -> *mut c_void; /// Detect %MSER regions @@ -3134,7 +3513,61 @@ pub mod features2d { } - impl dyn MSER + '_ { + /// Maximally stable extremal region extractor + /// + /// The class encapsulates all the parameters of the %MSER extraction algorithm (see [wiki + /// article](http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions)). + /// + /// - there are two different implementation of %MSER: one for grey image, one for color image + /// + /// - the grey image algorithm is taken from: [nister2008linear](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_nister2008linear) ; the paper claims to be faster + /// than union-find method; it actually get 1.5~2m/s on my centrino L7200 1.2GHz laptop. + /// + /// - the color image algorithm is taken from: [forssen2007maximally](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_forssen2007maximally) ; it should be much slower + /// than grey image method ( 3~4 times ) + /// + /// - (Python) A complete example showing the use of the %MSER detector can be found at samples/python/mser.py + pub struct MSER { + ptr: *mut c_void + } + + opencv_type_boxed! { MSER } + + impl Drop for MSER { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MSER_delete(instance: *mut c_void); } + unsafe { cv_MSER_delete(self.as_raw_mut_MSER()) }; + } + } + + unsafe impl Send for MSER {} + + impl core::AlgorithmTraitConst for MSER { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MSER { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for MSER { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for MSER { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::MSERTraitConst for MSER { + #[inline] fn as_raw_MSER(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::MSERTrait for MSER { + #[inline] fn as_raw_mut_MSER(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MSER { /// Full constructor for %MSER detector /// /// ## Parameters @@ -3159,18 +3592,23 @@ pub mod features2d { /// * min_margin: 0.003 /// * edge_blur_size: 5 #[inline] - pub fn create(delta: i32, min_area: i32, max_area: i32, max_variation: f64, min_diversity: f64, max_evolution: i32, area_threshold: f64, min_margin: f64, edge_blur_size: i32) -> Result> { + pub fn create(delta: i32, min_area: i32, max_area: i32, max_variation: f64, min_diversity: f64, max_evolution: i32, area_threshold: f64, min_margin: f64, edge_blur_size: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_MSER_create_int_int_int_double_double_int_double_double_int(delta, min_area, max_area, max_variation, min_diversity, max_evolution, area_threshold, min_margin, edge_blur_size, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { MSER, core::Algorithm, cv_MSER_to_Algorithm } + + boxed_cast_base! { MSER, crate::features2d::Feature2D, cv_MSER_to_Feature2D } + /// Constant methods for [crate::features2d::ORB] - pub trait ORBConst: crate::features2d::Feature2DTraitConst { + pub trait ORBTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_ORB(&self) -> *const c_void; #[inline] @@ -3266,13 +3704,8 @@ pub mod features2d { } - /// Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor - /// - /// described in [RRKB11](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_RRKB11) . The algorithm uses FAST in pyramids to detect stable keypoints, selects - /// the strongest features using FAST or Harris response, finds their orientation using first-order - /// moments and computes the descriptors using BRIEF (where the coordinates of random point pairs (or - /// k-tuples) are rotated according to the measured orientation). - pub trait ORB: crate::features2d::Feature2DTrait + crate::features2d::ORBConst { + /// Mutable methods for [crate::features2d::ORB] + pub trait ORBTrait: crate::features2d::Feature2DTrait + crate::features2d::ORBTraitConst { fn as_raw_mut_ORB(&mut self) -> *mut c_void; #[inline] @@ -3358,7 +3791,53 @@ pub mod features2d { } - impl dyn ORB + '_ { + /// Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor + /// + /// described in [RRKB11](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_RRKB11) . The algorithm uses FAST in pyramids to detect stable keypoints, selects + /// the strongest features using FAST or Harris response, finds their orientation using first-order + /// moments and computes the descriptors using BRIEF (where the coordinates of random point pairs (or + /// k-tuples) are rotated according to the measured orientation). + pub struct ORB { + ptr: *mut c_void + } + + opencv_type_boxed! { ORB } + + impl Drop for ORB { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ORB_delete(instance: *mut c_void); } + unsafe { cv_ORB_delete(self.as_raw_mut_ORB()) }; + } + } + + unsafe impl Send for ORB {} + + impl core::AlgorithmTraitConst for ORB { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ORB { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for ORB { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for ORB { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::ORBTraitConst for ORB { + #[inline] fn as_raw_ORB(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::ORBTrait for ORB { + #[inline] fn as_raw_mut_ORB(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ORB { pub const kBytes: i32 = 32; /// The ORB constructor /// @@ -3403,18 +3882,23 @@ pub mod features2d { /// * patch_size: 31 /// * fast_threshold: 20 #[inline] - pub fn create(nfeatures: i32, scale_factor: f32, nlevels: i32, edge_threshold: i32, first_level: i32, wta_k: i32, score_type: crate::features2d::ORB_ScoreType, patch_size: i32, fast_threshold: i32) -> Result> { + pub fn create(nfeatures: i32, scale_factor: f32, nlevels: i32, edge_threshold: i32, first_level: i32, wta_k: i32, score_type: crate::features2d::ORB_ScoreType, patch_size: i32, fast_threshold: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ORB_create_int_float_int_int_int_int_ScoreType_int_int(nfeatures, scale_factor, nlevels, edge_threshold, first_level, wta_k, score_type, patch_size, fast_threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { ORB, core::Algorithm, cv_ORB_to_Algorithm } + + boxed_cast_base! { ORB, crate::features2d::Feature2D, cv_ORB_to_Feature2D } + /// Constant methods for [crate::features2d::SIFT] - pub trait SIFTConst: crate::features2d::Feature2DTraitConst { + pub trait SIFTTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_SIFT(&self) -> *const c_void; #[inline] @@ -3474,9 +3958,8 @@ pub mod features2d { } - /// Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform - /// (SIFT) algorithm by D. Lowe [Lowe04](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Lowe04) . - pub trait SIFT: crate::features2d::Feature2DTrait + crate::features2d::SIFTConst { + /// Mutable methods for [crate::features2d::SIFT] + pub trait SIFTTrait: crate::features2d::Feature2DTrait + crate::features2d::SIFTTraitConst { fn as_raw_mut_SIFT(&mut self) -> *mut c_void; #[inline] @@ -3526,7 +4009,49 @@ pub mod features2d { } - impl dyn SIFT + '_ { + /// Class for extracting keypoints and computing descriptors using the Scale Invariant Feature Transform + /// (SIFT) algorithm by D. Lowe [Lowe04](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Lowe04) . + pub struct SIFT { + ptr: *mut c_void + } + + opencv_type_boxed! { SIFT } + + impl Drop for SIFT { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SIFT_delete(instance: *mut c_void); } + unsafe { cv_SIFT_delete(self.as_raw_mut_SIFT()) }; + } + } + + unsafe impl Send for SIFT {} + + impl core::AlgorithmTraitConst for SIFT { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SIFT { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for SIFT { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for SIFT { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::SIFTTraitConst for SIFT { + #[inline] fn as_raw_SIFT(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::SIFTTrait for SIFT { + #[inline] fn as_raw_mut_SIFT(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SIFT { /// ## Parameters /// * nfeatures: The number of best features to retain. The features are ranked by their scores /// (measured in SIFT algorithm as the local contrast) @@ -3556,12 +4081,12 @@ pub mod features2d { /// * edge_threshold: 10 /// * sigma: 1.6 #[inline] - pub fn create(nfeatures: i32, n_octave_layers: i32, contrast_threshold: f64, edge_threshold: f64, sigma: f64) -> Result> { + pub fn create(nfeatures: i32, n_octave_layers: i32, contrast_threshold: f64, edge_threshold: f64, sigma: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_SIFT_create_int_int_double_double_double(nfeatures, n_octave_layers, contrast_threshold, edge_threshold, sigma, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3590,18 +4115,23 @@ pub mod features2d { /// /// * descriptorType: The type of descriptors. Only CV_32F and CV_8U are supported. #[inline] - pub fn create_1(nfeatures: i32, n_octave_layers: i32, contrast_threshold: f64, edge_threshold: f64, sigma: f64, descriptor_type: i32) -> Result> { + pub fn create_1(nfeatures: i32, n_octave_layers: i32, contrast_threshold: f64, edge_threshold: f64, sigma: f64, descriptor_type: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_SIFT_create_int_int_double_double_double_int(nfeatures, n_octave_layers, contrast_threshold, edge_threshold, sigma, descriptor_type, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { SIFT, core::Algorithm, cv_SIFT_to_Algorithm } + + boxed_cast_base! { SIFT, crate::features2d::Feature2D, cv_SIFT_to_Feature2D } + /// Constant methods for [crate::features2d::SimpleBlobDetector] - pub trait SimpleBlobDetectorConst: crate::features2d::Feature2DTraitConst { + pub trait SimpleBlobDetectorTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_SimpleBlobDetector(&self) -> *const c_void; #[inline] @@ -3635,6 +4165,21 @@ pub mod features2d { } + /// Mutable methods for [crate::features2d::SimpleBlobDetector] + pub trait SimpleBlobDetectorTrait: crate::features2d::Feature2DTrait + crate::features2d::SimpleBlobDetectorTraitConst { + fn as_raw_mut_SimpleBlobDetector(&mut self) -> *mut c_void; + + #[inline] + fn set_params(&mut self, params: crate::features2d::SimpleBlobDetector_Params) -> Result<()> { + return_send!(via ocvrs_return); + unsafe { sys::cv_SimpleBlobDetector_setParams_const_ParamsR(self.as_raw_mut_SimpleBlobDetector(), ¶ms, ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// Class for extracting blobs from an image. : /// /// The class implements a simple algorithm for extracting blobs from an image: @@ -3665,34 +4210,65 @@ pub mod features2d { /// minConvexity (inclusive) and maxConvexity (exclusive). /// /// Default values of parameters are tuned to extract dark circular blobs. - pub trait SimpleBlobDetector: crate::features2d::Feature2DTrait + crate::features2d::SimpleBlobDetectorConst { - fn as_raw_mut_SimpleBlobDetector(&mut self) -> *mut c_void; + pub struct SimpleBlobDetector { + ptr: *mut c_void + } + opencv_type_boxed! { SimpleBlobDetector } + + impl Drop for SimpleBlobDetector { #[inline] - fn set_params(&mut self, params: crate::features2d::SimpleBlobDetector_Params) -> Result<()> { - return_send!(via ocvrs_return); - unsafe { sys::cv_SimpleBlobDetector_setParams_const_ParamsR(self.as_raw_mut_SimpleBlobDetector(), ¶ms, ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_SimpleBlobDetector_delete(instance: *mut c_void); } + unsafe { cv_SimpleBlobDetector_delete(self.as_raw_mut_SimpleBlobDetector()) }; } - } - impl dyn SimpleBlobDetector + '_ { + unsafe impl Send for SimpleBlobDetector {} + + impl core::AlgorithmTraitConst for SimpleBlobDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SimpleBlobDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for SimpleBlobDetector { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for SimpleBlobDetector { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::SimpleBlobDetectorTraitConst for SimpleBlobDetector { + #[inline] fn as_raw_SimpleBlobDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::SimpleBlobDetectorTrait for SimpleBlobDetector { + #[inline] fn as_raw_mut_SimpleBlobDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SimpleBlobDetector { /// ## C++ default parameters /// * parameters: SimpleBlobDetector::Params() #[inline] - pub fn create(parameters: crate::features2d::SimpleBlobDetector_Params) -> Result> { + pub fn create(parameters: crate::features2d::SimpleBlobDetector_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_SimpleBlobDetector_create_const_ParamsR(¶meters, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { SimpleBlobDetector, core::Algorithm, cv_SimpleBlobDetector_to_Algorithm } + + boxed_cast_base! { SimpleBlobDetector, crate::features2d::Feature2D, cv_SimpleBlobDetector_to_Feature2D } + #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq)] pub struct SimpleBlobDetector_Params { diff --git a/docs/freetype.rs b/docs/freetype.rs index 3242e015d..55024cac7 100644 --- a/docs/freetype.rs +++ b/docs/freetype.rs @@ -13,29 +13,30 @@ pub mod freetype { //! - If line_type parameter is 16(or CV_AA), drawing glyph is smooth. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::FreeType2Const, super::FreeType2 }; + pub use { super::FreeType2TraitConst, super::FreeType2Trait }; } /// Create FreeType2 Instance /// /// The function createFreeType2 create instance to draw UTF-8 strings. #[inline] - pub fn create_free_type2() -> Result> { + pub fn create_free_type2() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_freetype_createFreeType2(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Constant methods for [crate::freetype::FreeType2] - pub trait FreeType2Const: core::AlgorithmTraitConst { + pub trait FreeType2TraitConst: core::AlgorithmTraitConst { fn as_raw_FreeType2(&self) -> *const c_void; } - pub trait FreeType2: core::AlgorithmTrait + crate::freetype::FreeType2Const { + /// Mutable methods for [crate::freetype::FreeType2] + pub trait FreeType2Trait: core::AlgorithmTrait + crate::freetype::FreeType2TraitConst { fn as_raw_mut_FreeType2(&mut self) -> *mut c_void; /// Load font data. @@ -164,4 +165,41 @@ pub mod freetype { } } + + pub struct FreeType2 { + ptr: *mut c_void + } + + opencv_type_boxed! { FreeType2 } + + impl Drop for FreeType2 { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FreeType2_delete(instance: *mut c_void); } + unsafe { cv_FreeType2_delete(self.as_raw_mut_FreeType2()) }; + } + } + + unsafe impl Send for FreeType2 {} + + impl core::AlgorithmTraitConst for FreeType2 { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FreeType2 { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::freetype::FreeType2TraitConst for FreeType2 { + #[inline] fn as_raw_FreeType2(&self) -> *const c_void { self.as_raw() } + } + + impl crate::freetype::FreeType2Trait for FreeType2 { + #[inline] fn as_raw_mut_FreeType2(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FreeType2 { + } + + boxed_cast_base! { FreeType2, core::Algorithm, cv_FreeType2_to_Algorithm } } diff --git a/docs/gapi.rs b/docs/gapi.rs index bcbe9901b..0e1561bc2 100644 --- a/docs/gapi.rs +++ b/docs/gapi.rs @@ -8,7 +8,7 @@ pub mod gapi { //! # G-API Serialization functionality use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::anyTraitConst, super::anyTrait, super::TextTraitConst, super::TextTrait, super::ImageTraitConst, super::ImageTrait, super::PolyTraitConst, super::PolyTrait, super::GCompileArgTraitConst, super::GCompileArgTrait, super::GMatTraitConst, super::GMatTrait, super::GMatPTraitConst, super::GMatPTrait, super::GMatDescTraitConst, super::GMatDescTrait, super::GScalarTraitConst, super::GScalarTrait, super::GScalarDescTraitConst, super::GScalarDescTrait, super::GArrayDescTraitConst, super::GArrayDescTrait, super::GArrayUTraitConst, super::GArrayUTrait, super::GOpaqueDescTraitConst, super::GOpaqueDescTrait, super::GOpaqueUTraitConst, super::GOpaqueUTrait, super::GFrameTraitConst, super::GFrameTrait, super::GFrameDescTraitConst, super::GFrameDescTrait, super::ScalarTraitConst, super::ScalarTrait, super::MediaFrameTraitConst, super::MediaFrameTrait, super::MediaFrame_ViewTraitConst, super::MediaFrame_ViewTrait, super::MediaFrame_IAdapterConst, super::MediaFrame_IAdapter, super::RMat_ViewTraitConst, super::RMat_ViewTrait, super::RMat_IAdapterConst, super::RMat_IAdapter, super::RMatTraitConst, super::RMatTrait, super::GArgTraitConst, super::GArgTrait, super::GRunArgTraitConst, super::GRunArgTrait, super::DataTraitConst, super::DataTrait, super::ExtractArgsCallbackTraitConst, super::ExtractArgsCallbackTrait, super::ExtractMetaCallbackTraitConst, super::ExtractMetaCallbackTrait, super::GCompiledTraitConst, super::GCompiledTrait, super::GStreamingCompiledTraitConst, super::GStreamingCompiledTrait, super::GComputationTraitConst, super::GComputationTrait, super::GCallTraitConst, super::GCallTrait, super::GTransformTraitConst, super::GTransformTrait, super::GTypeInfoTraitConst, super::GTypeInfoTrait, super::GKernelTraitConst, super::GKernelTrait, super::GKernelImplTraitConst, super::GKernelImplTrait, super::GBackendTraitConst, super::GBackendTrait, super::GFunctorConst, super::GFunctor, super::GKernelPackageTraitConst, super::GKernelPackageTrait, super::use_onlyTraitConst, super::use_onlyTrait }; + pub use { super::anyTraitConst, super::anyTrait, super::TextTraitConst, super::TextTrait, super::ImageTraitConst, super::ImageTrait, super::PolyTraitConst, super::PolyTrait, super::GCompileArgTraitConst, super::GCompileArgTrait, super::GMatTraitConst, super::GMatTrait, super::GMatPTraitConst, super::GMatPTrait, super::GMatDescTraitConst, super::GMatDescTrait, super::GScalarTraitConst, super::GScalarTrait, super::GScalarDescTraitConst, super::GScalarDescTrait, super::GArrayDescTraitConst, super::GArrayDescTrait, super::GArrayUTraitConst, super::GArrayUTrait, super::GOpaqueDescTraitConst, super::GOpaqueDescTrait, super::GOpaqueUTraitConst, super::GOpaqueUTrait, super::GFrameTraitConst, super::GFrameTrait, super::GFrameDescTraitConst, super::GFrameDescTrait, super::ScalarTraitConst, super::ScalarTrait, super::MediaFrameTraitConst, super::MediaFrameTrait, super::MediaFrame_ViewTraitConst, super::MediaFrame_ViewTrait, super::MediaFrame_IAdapterTraitConst, super::MediaFrame_IAdapterTrait, super::RMat_ViewTraitConst, super::RMat_ViewTrait, super::RMat_IAdapterTraitConst, super::RMat_IAdapterTrait, super::RMatTraitConst, super::RMatTrait, super::GArgTraitConst, super::GArgTrait, super::GRunArgTraitConst, super::GRunArgTrait, super::DataTraitConst, super::DataTrait, super::ExtractArgsCallbackTraitConst, super::ExtractArgsCallbackTrait, super::ExtractMetaCallbackTraitConst, super::ExtractMetaCallbackTrait, super::GCompiledTraitConst, super::GCompiledTrait, super::GStreamingCompiledTraitConst, super::GStreamingCompiledTrait, super::GComputationTraitConst, super::GComputationTrait, super::GCallTraitConst, super::GCallTrait, super::GTransformTraitConst, super::GTransformTrait, super::GTypeInfoTraitConst, super::GTypeInfoTrait, super::GKernelTraitConst, super::GKernelTrait, super::GKernelImplTraitConst, super::GKernelImplTrait, super::GBackendTraitConst, super::GBackendTrait, super::GFunctorTraitConst, super::GFunctorTrait, super::GKernelPackageTraitConst, super::GKernelPackageTrait, super::use_onlyTraitConst, super::use_onlyTrait }; } pub const ArgKind_GARRAY: i32 = 6; @@ -140,7 +140,7 @@ pub mod gapi { pub type GRunArgs = core::Vector; pub type GShapes = core::Vector; pub type GTypesInfo = core::Vector; - pub type RMat_Adapter = dyn crate::gapi::RMat_IAdapter; + pub type RMat_Adapter = crate::gapi::RMat_IAdapter; pub type RMat_View_stepsT = core::Vector; pub type GMat2 = core::Tuple<(crate::gapi::GMat, crate::gapi::GMat)>; pub type GMat3 = core::Tuple<(crate::gapi::GMat, crate::gapi::GMat, crate::gapi::GMat)>; @@ -6002,7 +6002,7 @@ pub mod gapi { fn as_raw_mut_GKernelPackage(&mut self) -> *mut c_void; #[inline] - fn include(&mut self, functor: &dyn crate::gapi::GFunctor) -> Result<()> { + fn include(&mut self, functor: &crate::gapi::GFunctor) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_GKernelPackage_include_const_GFunctorR(self.as_raw_mut_GKernelPackage(), functor.as_raw_GFunctor(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -7394,7 +7394,7 @@ pub mod gapi { } /// Constant methods for [crate::gapi::MediaFrame_IAdapter] - pub trait MediaFrame_IAdapterConst { + pub trait MediaFrame_IAdapterTraitConst { fn as_raw_MediaFrame_IAdapter(&self) -> *const c_void; #[inline] @@ -7419,6 +7419,12 @@ pub mod gapi { } + /// Mutable methods for [crate::gapi::MediaFrame_IAdapter] + pub trait MediaFrame_IAdapterTrait: crate::gapi::MediaFrame_IAdapterTraitConst { + fn as_raw_mut_MediaFrame_IAdapter(&mut self) -> *mut c_void; + + } + /// An interface class for MediaFrame data adapters. /// /// Implement this interface to wrap media data in the MediaFrame. It @@ -7428,9 +7434,31 @@ pub mod gapi { /// media data may be passed to graph without any copy. For example, a /// GStreamer-based stream source can implement an adapter over /// `GstBuffer` and G-API will transparently use it in the graph. - pub trait MediaFrame_IAdapter: crate::gapi::MediaFrame_IAdapterConst { - fn as_raw_mut_MediaFrame_IAdapter(&mut self) -> *mut c_void; + pub struct MediaFrame_IAdapter { + ptr: *mut c_void + } + + opencv_type_boxed! { MediaFrame_IAdapter } + + impl Drop for MediaFrame_IAdapter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MediaFrame_IAdapter_delete(instance: *mut c_void); } + unsafe { cv_MediaFrame_IAdapter_delete(self.as_raw_mut_MediaFrame_IAdapter()) }; + } + } + unsafe impl Send for MediaFrame_IAdapter {} + + impl crate::gapi::MediaFrame_IAdapterTraitConst for MediaFrame_IAdapter { + #[inline] fn as_raw_MediaFrame_IAdapter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::gapi::MediaFrame_IAdapterTrait for MediaFrame_IAdapter { + #[inline] fn as_raw_mut_MediaFrame_IAdapter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MediaFrame_IAdapter { } /// Constant methods for [crate::gapi::MediaFrame_View] @@ -7582,7 +7610,7 @@ pub mod gapi { } /// Constant methods for [crate::gapi::RMat_IAdapter] - pub trait RMat_IAdapterConst { + pub trait RMat_IAdapterTraitConst { fn as_raw_RMat_IAdapter(&self) -> *const c_void; #[inline] @@ -7597,11 +7625,39 @@ pub mod gapi { } - pub trait RMat_IAdapter: crate::gapi::RMat_IAdapterConst { + /// Mutable methods for [crate::gapi::RMat_IAdapter] + pub trait RMat_IAdapterTrait: crate::gapi::RMat_IAdapterTraitConst { fn as_raw_mut_RMat_IAdapter(&mut self) -> *mut c_void; } + pub struct RMat_IAdapter { + ptr: *mut c_void + } + + opencv_type_boxed! { RMat_IAdapter } + + impl Drop for RMat_IAdapter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_RMat_IAdapter_delete(instance: *mut c_void); } + unsafe { cv_RMat_IAdapter_delete(self.as_raw_mut_RMat_IAdapter()) }; + } + } + + unsafe impl Send for RMat_IAdapter {} + + impl crate::gapi::RMat_IAdapterTraitConst for RMat_IAdapter { + #[inline] fn as_raw_RMat_IAdapter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::gapi::RMat_IAdapterTrait for RMat_IAdapter { + #[inline] fn as_raw_mut_RMat_IAdapter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl RMat_IAdapter { + } + /// Constant methods for [crate::gapi::RMat_View] pub trait RMat_ViewTraitConst { fn as_raw_RMat_View(&self) -> *const c_void; @@ -7983,7 +8039,7 @@ pub mod gapi { } /// Constant methods for [crate::gapi::GFunctor] - pub trait GFunctorConst { + pub trait GFunctorTraitConst { fn as_raw_GFunctor(&self) -> *const c_void; #[inline] @@ -8018,12 +8074,40 @@ pub mod gapi { } - /// @private - pub trait GFunctor: crate::gapi::GFunctorConst { + /// Mutable methods for [crate::gapi::GFunctor] + pub trait GFunctorTrait: crate::gapi::GFunctorTraitConst { fn as_raw_mut_GFunctor(&mut self) -> *mut c_void; } + /// @private + pub struct GFunctor { + ptr: *mut c_void + } + + opencv_type_boxed! { GFunctor } + + impl Drop for GFunctor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GFunctor_delete(instance: *mut c_void); } + unsafe { cv_GFunctor_delete(self.as_raw_mut_GFunctor()) }; + } + } + + unsafe impl Send for GFunctor {} + + impl crate::gapi::GFunctorTraitConst for GFunctor { + #[inline] fn as_raw_GFunctor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::gapi::GFunctorTrait for GFunctor { + #[inline] fn as_raw_mut_GFunctor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GFunctor { + } + /// Constant methods for [crate::gapi::Scalar] pub trait ScalarTraitConst { fn as_raw_Scalar(&self) -> *const c_void; diff --git a/docs/hdf.rs b/docs/hdf.rs index fc2b3d678..ac891e462 100644 --- a/docs/hdf.rs +++ b/docs/hdf.rs @@ -11,7 +11,7 @@ pub mod hdf { //! means cmake should find it using `find_package(HDF5)` . use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::HDF5Const, super::HDF5 }; + pub use { super::HDF5TraitConst, super::HDF5Trait }; } /// Get the chunk sizes of a dataset. see also: dsgetsize() @@ -71,18 +71,18 @@ pub mod hdf { /// ``` /// #[inline] - pub fn open(hdf5_filename: &str) -> Result> { + pub fn open(hdf5_filename: &str) -> Result> { extern_container_arg!(hdf5_filename); return_send!(via ocvrs_return); unsafe { sys::cv_hdf_open_const_StringR(hdf5_filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Constant methods for [crate::hdf::HDF5] - pub trait HDF5Const { + pub trait HDF5TraitConst { fn as_raw_HDF5(&self) -> *const c_void; /// Check if label exists or not. @@ -1176,10 +1176,8 @@ pub mod hdf { } - /// Hierarchical Data Format version 5 interface. - /// - /// Notice that this module is compiled only when hdf5 is correctly installed. - pub trait HDF5: crate::hdf::HDF5Const { + /// Mutable methods for [crate::hdf::HDF5] + pub trait HDF5Trait: crate::hdf::HDF5TraitConst { fn as_raw_mut_HDF5(&mut self) -> *mut c_void; /// Close and release hdf5 object. @@ -1454,4 +1452,34 @@ pub mod hdf { } } + + /// Hierarchical Data Format version 5 interface. + /// + /// Notice that this module is compiled only when hdf5 is correctly installed. + pub struct HDF5 { + ptr: *mut c_void + } + + opencv_type_boxed! { HDF5 } + + impl Drop for HDF5 { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_HDF5_delete(instance: *mut c_void); } + unsafe { cv_HDF5_delete(self.as_raw_mut_HDF5()) }; + } + } + + unsafe impl Send for HDF5 {} + + impl crate::hdf::HDF5TraitConst for HDF5 { + #[inline] fn as_raw_HDF5(&self) -> *const c_void { self.as_raw() } + } + + impl crate::hdf::HDF5Trait for HDF5 { + #[inline] fn as_raw_mut_HDF5(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl HDF5 { + } } diff --git a/docs/hfs.rs b/docs/hfs.rs index 038e78104..443925f30 100644 --- a/docs/hfs.rs +++ b/docs/hfs.rs @@ -32,16 +32,17 @@ pub mod hfs { //! Hierarchical Feature Selection for Efficient Image Segmentation, ECCV 2016 use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::HfsSegmentConst, super::HfsSegment }; + pub use { super::HfsSegmentTraitConst, super::HfsSegmentTrait }; } /// Constant methods for [crate::hfs::HfsSegment] - pub trait HfsSegmentConst: core::AlgorithmTraitConst { + pub trait HfsSegmentTraitConst: core::AlgorithmTraitConst { fn as_raw_HfsSegment(&self) -> *const c_void; } - pub trait HfsSegment: core::AlgorithmTrait + crate::hfs::HfsSegmentConst { + /// Mutable methods for [crate::hfs::HfsSegment] + pub trait HfsSegmentTrait: core::AlgorithmTrait + crate::hfs::HfsSegmentTraitConst { fn as_raw_mut_HfsSegment(&mut self) -> *mut c_void; /// set and get the parameter segEgbThresholdI. @@ -246,7 +247,39 @@ pub mod hfs { } - impl dyn HfsSegment + '_ { + pub struct HfsSegment { + ptr: *mut c_void + } + + opencv_type_boxed! { HfsSegment } + + impl Drop for HfsSegment { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_HfsSegment_delete(instance: *mut c_void); } + unsafe { cv_HfsSegment_delete(self.as_raw_mut_HfsSegment()) }; + } + } + + unsafe impl Send for HfsSegment {} + + impl core::AlgorithmTraitConst for HfsSegment { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for HfsSegment { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::hfs::HfsSegmentTraitConst for HfsSegment { + #[inline] fn as_raw_HfsSegment(&self) -> *const c_void { self.as_raw() } + } + + impl crate::hfs::HfsSegmentTrait for HfsSegment { + #[inline] fn as_raw_mut_HfsSegment(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl HfsSegment { /// create a hfs object /// ## Parameters /// * height: : the height of the input image @@ -268,13 +301,16 @@ pub mod hfs { /// * slic_spixel_size: 8 /// * num_slic_iter: 5 #[inline] - pub fn create(height: i32, width: i32, seg_egb_threshold_i: f32, min_region_size_i: i32, seg_egb_threshold_ii: f32, min_region_size_ii: i32, spatial_weight: f32, slic_spixel_size: i32, num_slic_iter: i32) -> Result> { + pub fn create(height: i32, width: i32, seg_egb_threshold_i: f32, min_region_size_i: i32, seg_egb_threshold_ii: f32, min_region_size_ii: i32, spatial_weight: f32, slic_spixel_size: i32, num_slic_iter: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_hfs_HfsSegment_create_int_int_float_int_float_int_float_int_int(height, width, seg_egb_threshold_i, min_region_size_i, seg_egb_threshold_ii, min_region_size_ii, spatial_weight, slic_spixel_size, num_slic_iter, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { HfsSegment, core::Algorithm, cv_HfsSegment_to_Algorithm } +} diff --git a/docs/imgproc.rs b/docs/imgproc.rs index c9fa55560..45031df4b 100644 --- a/docs/imgproc.rs +++ b/docs/imgproc.rs @@ -149,7 +149,7 @@ pub mod imgproc { //! # Interface use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::GeneralizedHoughConst, super::GeneralizedHough, super::GeneralizedHoughBallardConst, super::GeneralizedHoughBallard, super::GeneralizedHoughGuilConst, super::GeneralizedHoughGuil, super::CLAHEConst, super::CLAHE, super::Subdiv2DTraitConst, super::Subdiv2DTrait, super::LineSegmentDetectorConst, super::LineSegmentDetector, super::LineIteratorTraitConst, super::LineIteratorTrait, super::IntelligentScissorsMBTraitConst, super::IntelligentScissorsMBTrait }; + pub use { super::GeneralizedHoughTraitConst, super::GeneralizedHoughTrait, super::GeneralizedHoughBallardTraitConst, super::GeneralizedHoughBallardTrait, super::GeneralizedHoughGuilTraitConst, super::GeneralizedHoughGuilTrait, super::CLAHETraitConst, super::CLAHETrait, super::Subdiv2DTraitConst, super::Subdiv2DTrait, super::LineSegmentDetectorTraitConst, super::LineSegmentDetectorTrait, super::LineIteratorTraitConst, super::LineIteratorTrait, super::IntelligentScissorsMBTraitConst, super::IntelligentScissorsMBTrait }; } /// the threshold value ![inline formula](https://latex.codecogs.com/png.latex?T%28x%2C%20y%29) is a weighted sum (cross-correlation with a Gaussian @@ -3746,34 +3746,34 @@ pub mod imgproc { /// * clip_limit: 40.0 /// * tile_grid_size: Size(8,8) #[inline] - pub fn create_clahe(clip_limit: f64, tile_grid_size: core::Size) -> Result> { + pub fn create_clahe(clip_limit: f64, tile_grid_size: core::Size) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createCLAHE_double_Size(clip_limit, tile_grid_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it. #[inline] - pub fn create_generalized_hough_ballard() -> Result> { + pub fn create_generalized_hough_ballard() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createGeneralizedHoughBallard(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it. #[inline] - pub fn create_generalized_hough_guil() -> Result> { + pub fn create_generalized_hough_guil() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createGeneralizedHoughGuil(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3828,12 +3828,12 @@ pub mod imgproc { /// * density_th: 0.7 /// * n_bins: 1024 #[inline] - pub fn create_line_segment_detector(refine: i32, scale: f64, sigma_scale: f64, quant: f64, ang_th: f64, log_eps: f64, density_th: f64, n_bins: i32) -> Result> { + pub fn create_line_segment_detector(refine: i32, scale: f64, sigma_scale: f64, quant: f64, ang_th: f64, log_eps: f64, density_th: f64, n_bins: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createLineSegmentDetector_int_double_double_double_double_double_double_int(refine, scale, sigma_scale, quant, ang_th, log_eps, density_th, n_bins, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -6979,7 +6979,7 @@ pub mod imgproc { } /// Constant methods for [crate::imgproc::CLAHE] - pub trait CLAHEConst: core::AlgorithmTraitConst { + pub trait CLAHETraitConst: core::AlgorithmTraitConst { fn as_raw_CLAHE(&self) -> *const c_void; /// Returns threshold value for contrast limiting. @@ -7004,8 +7004,8 @@ pub mod imgproc { } - /// Base class for Contrast Limited Adaptive Histogram Equalization. - pub trait CLAHE: core::AlgorithmTrait + crate::imgproc::CLAHEConst { + /// Mutable methods for [crate::imgproc::CLAHE] + pub trait CLAHETrait: core::AlgorithmTrait + crate::imgproc::CLAHETraitConst { fn as_raw_mut_CLAHE(&mut self) -> *mut c_void; /// Equalizes the histogram of a grayscale image using Contrast Limited Adaptive Histogram Equalization. @@ -7062,8 +7062,46 @@ pub mod imgproc { } + /// Base class for Contrast Limited Adaptive Histogram Equalization. + pub struct CLAHE { + ptr: *mut c_void + } + + opencv_type_boxed! { CLAHE } + + impl Drop for CLAHE { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CLAHE_delete(instance: *mut c_void); } + unsafe { cv_CLAHE_delete(self.as_raw_mut_CLAHE()) }; + } + } + + unsafe impl Send for CLAHE {} + + impl core::AlgorithmTraitConst for CLAHE { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CLAHE { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::imgproc::CLAHETraitConst for CLAHE { + #[inline] fn as_raw_CLAHE(&self) -> *const c_void { self.as_raw() } + } + + impl crate::imgproc::CLAHETrait for CLAHE { + #[inline] fn as_raw_mut_CLAHE(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CLAHE { + } + + boxed_cast_base! { CLAHE, core::Algorithm, cv_CLAHE_to_Algorithm } + /// Constant methods for [crate::imgproc::GeneralizedHough] - pub trait GeneralizedHoughConst: core::AlgorithmTraitConst { + pub trait GeneralizedHoughTraitConst: core::AlgorithmTraitConst { fn as_raw_GeneralizedHough(&self) -> *const c_void; #[inline] @@ -7113,8 +7151,8 @@ pub mod imgproc { } - /// finds arbitrary template in the grayscale image using Generalized Hough Transform - pub trait GeneralizedHough: core::AlgorithmTrait + crate::imgproc::GeneralizedHoughConst { + /// Mutable methods for [crate::imgproc::GeneralizedHough] + pub trait GeneralizedHoughTrait: core::AlgorithmTrait + crate::imgproc::GeneralizedHoughTraitConst { fn as_raw_mut_GeneralizedHough(&mut self) -> *mut c_void; /// set template to search @@ -7229,8 +7267,46 @@ pub mod imgproc { } + /// finds arbitrary template in the grayscale image using Generalized Hough Transform + pub struct GeneralizedHough { + ptr: *mut c_void + } + + opencv_type_boxed! { GeneralizedHough } + + impl Drop for GeneralizedHough { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GeneralizedHough_delete(instance: *mut c_void); } + unsafe { cv_GeneralizedHough_delete(self.as_raw_mut_GeneralizedHough()) }; + } + } + + unsafe impl Send for GeneralizedHough {} + + impl core::AlgorithmTraitConst for GeneralizedHough { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GeneralizedHough { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::imgproc::GeneralizedHoughTraitConst for GeneralizedHough { + #[inline] fn as_raw_GeneralizedHough(&self) -> *const c_void { self.as_raw() } + } + + impl crate::imgproc::GeneralizedHoughTrait for GeneralizedHough { + #[inline] fn as_raw_mut_GeneralizedHough(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GeneralizedHough { + } + + boxed_cast_base! { GeneralizedHough, core::Algorithm, cv_GeneralizedHough_to_Algorithm } + /// Constant methods for [crate::imgproc::GeneralizedHoughBallard] - pub trait GeneralizedHoughBallardConst: crate::imgproc::GeneralizedHoughConst { + pub trait GeneralizedHoughBallardTraitConst: crate::imgproc::GeneralizedHoughTraitConst { fn as_raw_GeneralizedHoughBallard(&self) -> *const c_void; #[inline] @@ -7253,10 +7329,8 @@ pub mod imgproc { } - /// finds arbitrary template in the grayscale image using Generalized Hough Transform - /// - /// Detects position only without translation and rotation [Ballard1981](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Ballard1981) . - pub trait GeneralizedHoughBallard: crate::imgproc::GeneralizedHough + crate::imgproc::GeneralizedHoughBallardConst { + /// Mutable methods for [crate::imgproc::GeneralizedHoughBallard] + pub trait GeneralizedHoughBallardTrait: crate::imgproc::GeneralizedHoughBallardTraitConst + crate::imgproc::GeneralizedHoughTrait { fn as_raw_mut_GeneralizedHoughBallard(&mut self) -> *mut c_void; /// R-Table levels. @@ -7281,8 +7355,56 @@ pub mod imgproc { } + /// finds arbitrary template in the grayscale image using Generalized Hough Transform + /// + /// Detects position only without translation and rotation [Ballard1981](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Ballard1981) . + pub struct GeneralizedHoughBallard { + ptr: *mut c_void + } + + opencv_type_boxed! { GeneralizedHoughBallard } + + impl Drop for GeneralizedHoughBallard { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GeneralizedHoughBallard_delete(instance: *mut c_void); } + unsafe { cv_GeneralizedHoughBallard_delete(self.as_raw_mut_GeneralizedHoughBallard()) }; + } + } + + unsafe impl Send for GeneralizedHoughBallard {} + + impl core::AlgorithmTraitConst for GeneralizedHoughBallard { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GeneralizedHoughBallard { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::imgproc::GeneralizedHoughTraitConst for GeneralizedHoughBallard { + #[inline] fn as_raw_GeneralizedHough(&self) -> *const c_void { self.as_raw() } + } + + impl crate::imgproc::GeneralizedHoughTrait for GeneralizedHoughBallard { + #[inline] fn as_raw_mut_GeneralizedHough(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::imgproc::GeneralizedHoughBallardTraitConst for GeneralizedHoughBallard { + #[inline] fn as_raw_GeneralizedHoughBallard(&self) -> *const c_void { self.as_raw() } + } + + impl crate::imgproc::GeneralizedHoughBallardTrait for GeneralizedHoughBallard { + #[inline] fn as_raw_mut_GeneralizedHoughBallard(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GeneralizedHoughBallard { + } + + boxed_cast_base! { GeneralizedHoughBallard, core::Algorithm, cv_GeneralizedHoughBallard_to_Algorithm } + /// Constant methods for [crate::imgproc::GeneralizedHoughGuil] - pub trait GeneralizedHoughGuilConst: crate::imgproc::GeneralizedHoughConst { + pub trait GeneralizedHoughGuilTraitConst: crate::imgproc::GeneralizedHoughTraitConst { fn as_raw_GeneralizedHoughGuil(&self) -> *const c_void; #[inline] @@ -7395,10 +7517,8 @@ pub mod imgproc { } - /// finds arbitrary template in the grayscale image using Generalized Hough Transform - /// - /// Detects position, translation and rotation [Guil1999](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Guil1999) . - pub trait GeneralizedHoughGuil: crate::imgproc::GeneralizedHough + crate::imgproc::GeneralizedHoughGuilConst { + /// Mutable methods for [crate::imgproc::GeneralizedHoughGuil] + pub trait GeneralizedHoughGuilTrait: crate::imgproc::GeneralizedHoughGuilTraitConst + crate::imgproc::GeneralizedHoughTrait { fn as_raw_mut_GeneralizedHoughGuil(&mut self) -> *mut c_void; /// Angle difference in degrees between two points in feature. @@ -7523,6 +7643,54 @@ pub mod imgproc { } + /// finds arbitrary template in the grayscale image using Generalized Hough Transform + /// + /// Detects position, translation and rotation [Guil1999](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Guil1999) . + pub struct GeneralizedHoughGuil { + ptr: *mut c_void + } + + opencv_type_boxed! { GeneralizedHoughGuil } + + impl Drop for GeneralizedHoughGuil { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GeneralizedHoughGuil_delete(instance: *mut c_void); } + unsafe { cv_GeneralizedHoughGuil_delete(self.as_raw_mut_GeneralizedHoughGuil()) }; + } + } + + unsafe impl Send for GeneralizedHoughGuil {} + + impl core::AlgorithmTraitConst for GeneralizedHoughGuil { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GeneralizedHoughGuil { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::imgproc::GeneralizedHoughTraitConst for GeneralizedHoughGuil { + #[inline] fn as_raw_GeneralizedHough(&self) -> *const c_void { self.as_raw() } + } + + impl crate::imgproc::GeneralizedHoughTrait for GeneralizedHoughGuil { + #[inline] fn as_raw_mut_GeneralizedHough(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::imgproc::GeneralizedHoughGuilTraitConst for GeneralizedHoughGuil { + #[inline] fn as_raw_GeneralizedHoughGuil(&self) -> *const c_void { self.as_raw() } + } + + impl crate::imgproc::GeneralizedHoughGuilTrait for GeneralizedHoughGuil { + #[inline] fn as_raw_mut_GeneralizedHoughGuil(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GeneralizedHoughGuil { + } + + boxed_cast_base! { GeneralizedHoughGuil, core::Algorithm, cv_GeneralizedHoughGuil_to_Algorithm } + /// Constant methods for [crate::imgproc::LineIterator] pub trait LineIteratorTraitConst { fn as_raw_LineIterator(&self) -> *const c_void; @@ -7866,19 +8034,13 @@ pub mod imgproc { } /// Constant methods for [crate::imgproc::LineSegmentDetector] - pub trait LineSegmentDetectorConst: core::AlgorithmTraitConst { + pub trait LineSegmentDetectorTraitConst: core::AlgorithmTraitConst { fn as_raw_LineSegmentDetector(&self) -> *const c_void; } - /// Line segment detector class - /// - /// following the algorithm described at [Rafael12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Rafael12) . - /// - /// - /// Note: Implementation has been removed from OpenCV version 3.4.6 to 3.4.15 and version 4.1.0 to 4.5.3 due original code license conflict. - /// restored again after [Computation of a NFA](https://github.com/rafael-grompone-von-gioi/binomial_nfa) code published under the MIT license. - pub trait LineSegmentDetector: core::AlgorithmTrait + crate::imgproc::LineSegmentDetectorConst { + /// Mutable methods for [crate::imgproc::LineSegmentDetector] + pub trait LineSegmentDetectorTrait: core::AlgorithmTrait + crate::imgproc::LineSegmentDetectorTraitConst { fn as_raw_mut_LineSegmentDetector(&mut self) -> *mut c_void; /// Finds lines in the input image. @@ -7961,6 +8123,50 @@ pub mod imgproc { } + /// Line segment detector class + /// + /// following the algorithm described at [Rafael12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Rafael12) . + /// + /// + /// Note: Implementation has been removed from OpenCV version 3.4.6 to 3.4.15 and version 4.1.0 to 4.5.3 due original code license conflict. + /// restored again after [Computation of a NFA](https://github.com/rafael-grompone-von-gioi/binomial_nfa) code published under the MIT license. + pub struct LineSegmentDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { LineSegmentDetector } + + impl Drop for LineSegmentDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LineSegmentDetector_delete(instance: *mut c_void); } + unsafe { cv_LineSegmentDetector_delete(self.as_raw_mut_LineSegmentDetector()) }; + } + } + + unsafe impl Send for LineSegmentDetector {} + + impl core::AlgorithmTraitConst for LineSegmentDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LineSegmentDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::imgproc::LineSegmentDetectorTraitConst for LineSegmentDetector { + #[inline] fn as_raw_LineSegmentDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::imgproc::LineSegmentDetectorTrait for LineSegmentDetector { + #[inline] fn as_raw_mut_LineSegmentDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LineSegmentDetector { + } + + boxed_cast_base! { LineSegmentDetector, core::Algorithm, cv_LineSegmentDetector_to_Algorithm } + /// Constant methods for [crate::imgproc::Subdiv2D] pub trait Subdiv2DTraitConst { fn as_raw_Subdiv2D(&self) -> *const c_void; diff --git a/docs/mcc.rs b/docs/mcc.rs index 0084b73f1..afa70c58e 100644 --- a/docs/mcc.rs +++ b/docs/mcc.rs @@ -17,7 +17,7 @@ pub mod mcc { //! image. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::MCC_CCheckerConst, super::MCC_CChecker, super::MCC_CCheckerDrawConst, super::MCC_CCheckerDraw, super::MCC_DetectorParametersTraitConst, super::MCC_DetectorParametersTrait, super::MCC_CCheckerDetectorConst, super::MCC_CCheckerDetector, super::ColorCorrectionModelTraitConst, super::ColorCorrectionModelTrait }; + pub use { super::MCC_CCheckerTraitConst, super::MCC_CCheckerTrait, super::MCC_CCheckerDrawTraitConst, super::MCC_CCheckerDrawTrait, super::MCC_DetectorParametersTraitConst, super::MCC_DetectorParametersTrait, super::MCC_CCheckerDetectorTraitConst, super::MCC_CCheckerDetectorTrait, super::ColorCorrectionModelTraitConst, super::ColorCorrectionModelTrait }; } /// The CCM with the shape ![inline formula](https://latex.codecogs.com/png.latex?3%5Ctimes3) performs linear transformation on color values. @@ -846,19 +846,13 @@ pub mod mcc { } /// Constant methods for [crate::mcc::MCC_CChecker] - pub trait MCC_CCheckerConst { + pub trait MCC_CCheckerTraitConst { fn as_raw_MCC_CChecker(&self) -> *const c_void; } - /// CChecker - /// - /// \brief checker object - /// - /// This class contains the information about the detected checkers,i.e, their - /// type, the corners of the chart, the color profile, the cost, centers chart, - /// etc. - pub trait MCC_CChecker: crate::mcc::MCC_CCheckerConst { + /// Mutable methods for [crate::mcc::MCC_CChecker] + pub trait MCC_CCheckerTrait: crate::mcc::MCC_CCheckerTraitConst { fn as_raw_mut_MCC_CChecker(&mut self) -> *mut c_void; #[inline] @@ -974,28 +968,60 @@ pub mod mcc { } - impl dyn MCC_CChecker + '_ { + /// CChecker + /// + /// \brief checker object + /// + /// This class contains the information about the detected checkers,i.e, their + /// type, the corners of the chart, the color profile, the cost, centers chart, + /// etc. + pub struct MCC_CChecker { + ptr: *mut c_void + } + + opencv_type_boxed! { MCC_CChecker } + + impl Drop for MCC_CChecker { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MCC_CChecker_delete(instance: *mut c_void); } + unsafe { cv_MCC_CChecker_delete(self.as_raw_mut_MCC_CChecker()) }; + } + } + + unsafe impl Send for MCC_CChecker {} + + impl crate::mcc::MCC_CCheckerTraitConst for MCC_CChecker { + #[inline] fn as_raw_MCC_CChecker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::mcc::MCC_CCheckerTrait for MCC_CChecker { + #[inline] fn as_raw_mut_MCC_CChecker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MCC_CChecker { /// \brief Create a new CChecker object. /// \return A pointer to the implementation of the CChecker #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_mcc_CChecker_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::mcc::MCC_CCheckerDetector] - pub trait MCC_CCheckerDetectorConst: core::AlgorithmTraitConst { + pub trait MCC_CCheckerDetectorTraitConst: core::AlgorithmTraitConst { fn as_raw_MCC_CCheckerDetector(&self) -> *const c_void; } - /// A class to find the positions of the ColorCharts in the image. - pub trait MCC_CCheckerDetector: core::AlgorithmTrait + crate::mcc::MCC_CCheckerDetectorConst { + /// Mutable methods for [crate::mcc::MCC_CCheckerDetector] + pub trait MCC_CCheckerDetectorTrait: core::AlgorithmTrait + crate::mcc::MCC_CCheckerDetectorTraitConst { fn as_raw_mut_MCC_CCheckerDetector(&mut self) -> *mut c_void; /// \brief Set the net which will be used to find the approximate @@ -1089,48 +1115,103 @@ pub mod mcc { /// \return checker A single colorchecker, if atleast one colorchecker /// was detected, 'nullptr' otherwise. #[inline] - fn get_best_color_checker(&mut self) -> Result> { + fn get_best_color_checker(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_mcc_CCheckerDetector_getBestColorChecker(self.as_raw_mut_MCC_CCheckerDetector(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// \brief Get the list of all detected colorcheckers /// \return checkers vector of colorcheckers #[inline] - fn get_list_color_checker(&mut self) -> Result>> { + fn get_list_color_checker(&mut self) -> Result>> { return_send!(via ocvrs_return); unsafe { sys::cv_mcc_CCheckerDetector_getListColorChecker(self.as_raw_mut_MCC_CCheckerDetector(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Vector::>::opencv_from_extern(ret) }; + let ret = unsafe { core::Vector::>::opencv_from_extern(ret) }; Ok(ret) } } - impl dyn MCC_CCheckerDetector + '_ { + /// A class to find the positions of the ColorCharts in the image. + pub struct MCC_CCheckerDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { MCC_CCheckerDetector } + + impl Drop for MCC_CCheckerDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MCC_CCheckerDetector_delete(instance: *mut c_void); } + unsafe { cv_MCC_CCheckerDetector_delete(self.as_raw_mut_MCC_CCheckerDetector()) }; + } + } + + unsafe impl Send for MCC_CCheckerDetector {} + + impl core::AlgorithmTraitConst for MCC_CCheckerDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MCC_CCheckerDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::mcc::MCC_CCheckerDetectorTraitConst for MCC_CCheckerDetector { + #[inline] fn as_raw_MCC_CCheckerDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::mcc::MCC_CCheckerDetectorTrait for MCC_CCheckerDetector { + #[inline] fn as_raw_mut_MCC_CCheckerDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MCC_CCheckerDetector { /// \brief Returns the implementation of the CCheckerDetector. #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_mcc_CCheckerDetector_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { MCC_CCheckerDetector, core::Algorithm, cv_MCC_CCheckerDetector_to_Algorithm } + /// Constant methods for [crate::mcc::MCC_CCheckerDraw] - pub trait MCC_CCheckerDrawConst { + pub trait MCC_CCheckerDrawTraitConst { fn as_raw_MCC_CCheckerDraw(&self) -> *const c_void; } + /// Mutable methods for [crate::mcc::MCC_CCheckerDraw] + pub trait MCC_CCheckerDrawTrait: crate::mcc::MCC_CCheckerDrawTraitConst { + fn as_raw_mut_MCC_CCheckerDraw(&mut self) -> *mut c_void; + + /// \brief Draws the checker to the given image. + /// \param img image in color space BGR + /// \return void + #[inline] + fn draw(&mut self, img: &mut dyn core::ToInputOutputArray) -> Result<()> { + extern_container_arg!(img); + return_send!(via ocvrs_return); + unsafe { sys::cv_mcc_CCheckerDraw_draw_const__InputOutputArrayR(self.as_raw_mut_MCC_CCheckerDraw(), img.as_raw__InputOutputArray(), ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// \brief checker draw /// /// This class contains the functions for drawing a detected chart. This class @@ -1144,25 +1225,31 @@ pub mod mcc { /// The reason for this type of design is that in some videos we can assume that /// the checker is always in the same position, even if the image changes, so /// the drawing will always take place at the same position. - pub trait MCC_CCheckerDraw: crate::mcc::MCC_CCheckerDrawConst { - fn as_raw_mut_MCC_CCheckerDraw(&mut self) -> *mut c_void; + pub struct MCC_CCheckerDraw { + ptr: *mut c_void + } - /// \brief Draws the checker to the given image. - /// \param img image in color space BGR - /// \return void + opencv_type_boxed! { MCC_CCheckerDraw } + + impl Drop for MCC_CCheckerDraw { #[inline] - fn draw(&mut self, img: &mut dyn core::ToInputOutputArray) -> Result<()> { - extern_container_arg!(img); - return_send!(via ocvrs_return); - unsafe { sys::cv_mcc_CCheckerDraw_draw_const__InputOutputArrayR(self.as_raw_mut_MCC_CCheckerDraw(), img.as_raw__InputOutputArray(), ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_MCC_CCheckerDraw_delete(instance: *mut c_void); } + unsafe { cv_MCC_CCheckerDraw_delete(self.as_raw_mut_MCC_CCheckerDraw()) }; } - } - impl dyn MCC_CCheckerDraw + '_ { + unsafe impl Send for MCC_CCheckerDraw {} + + impl crate::mcc::MCC_CCheckerDrawTraitConst for MCC_CCheckerDraw { + #[inline] fn as_raw_MCC_CCheckerDraw(&self) -> *const c_void { self.as_raw() } + } + + impl crate::mcc::MCC_CCheckerDrawTrait for MCC_CCheckerDraw { + #[inline] fn as_raw_mut_MCC_CCheckerDraw(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MCC_CCheckerDraw { /// \brief Create a new CCheckerDraw object. /// \param pChecker The checker which will be drawn by this object. /// \param color The color by with which the squares of the checker @@ -1175,16 +1262,17 @@ pub mod mcc { /// * color: CV_RGB(0,250,0) /// * thickness: 2 #[inline] - pub fn create(mut p_checker: core::Ptr, color: core::Scalar, thickness: i32) -> Result> { + pub fn create(mut p_checker: core::Ptr, color: core::Scalar, thickness: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_mcc_CCheckerDraw_create_PtrLCCheckerG_Scalar_int(p_checker.as_raw_mut_PtrOfMCC_CChecker(), color.opencv_as_extern(), thickness, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::mcc::MCC_DetectorParameters] pub trait MCC_DetectorParametersTraitConst { fn as_raw_MCC_DetectorParameters(&self) -> *const c_void; diff --git a/docs/ml.rs b/docs/ml.rs index 937e00431..8fa5ae402 100644 --- a/docs/ml.rs +++ b/docs/ml.rs @@ -12,7 +12,7 @@ pub mod ml { //! See detailed overview here: [ml_intro]. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::ParamGridTraitConst, super::ParamGridTrait, super::TrainDataConst, super::TrainData, super::StatModelConst, super::StatModel, super::NormalBayesClassifierConst, super::NormalBayesClassifier, super::KNearestConst, super::KNearest, super::SVM_KernelConst, super::SVM_Kernel, super::SVMConst, super::SVM, super::EMConst, super::EM, super::DTrees_NodeTraitConst, super::DTrees_NodeTrait, super::DTrees_SplitTraitConst, super::DTrees_SplitTrait, super::DTreesConst, super::DTrees, super::RTreesConst, super::RTrees, super::BoostConst, super::Boost, super::ANN_MLPConst, super::ANN_MLP, super::LogisticRegressionConst, super::LogisticRegression, super::SVMSGDConst, super::SVMSGD }; + pub use { super::ParamGridTraitConst, super::ParamGridTrait, super::TrainDataTraitConst, super::TrainDataTrait, super::StatModelTraitConst, super::StatModelTrait, super::NormalBayesClassifierTraitConst, super::NormalBayesClassifierTrait, super::KNearestTraitConst, super::KNearestTrait, super::SVM_KernelTraitConst, super::SVM_KernelTrait, super::SVMTraitConst, super::SVMTrait, super::EMTraitConst, super::EMTrait, super::DTrees_NodeTraitConst, super::DTrees_NodeTrait, super::DTrees_SplitTraitConst, super::DTrees_SplitTrait, super::DTreesTraitConst, super::DTreesTrait, super::RTreesTraitConst, super::RTreesTrait, super::BoostTraitConst, super::BoostTrait, super::ANN_MLPTraitConst, super::ANN_MLPTrait, super::LogisticRegressionTraitConst, super::LogisticRegressionTrait, super::SVMSGDTraitConst, super::SVMSGDTrait }; } /// The simulated annealing algorithm. See [Kirkpatrick83](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Kirkpatrick83) for details. @@ -469,7 +469,7 @@ pub mod ml { opencv_type_enum! { crate::ml::VariableTypes } - pub type ANN_MLP_ANNEAL = dyn crate::ml::ANN_MLP; + pub type ANN_MLP_ANNEAL = crate::ml::ANN_MLP; /// Creates test set #[inline] pub fn create_concentric_spheres_test_set(nsamples: i32, nfeatures: i32, nclasses: i32, samples: &mut dyn core::ToOutputArray, responses: &mut dyn core::ToOutputArray) -> Result<()> { @@ -502,7 +502,7 @@ pub mod ml { } /// Constant methods for [crate::ml::ANN_MLP] - pub trait ANN_MLPConst: crate::ml::StatModelConst { + pub trait ANN_MLPTraitConst: crate::ml::StatModelTraitConst { fn as_raw_ANN_MLP(&self) -> *const c_void; /// Returns current training method @@ -702,18 +702,8 @@ pub mod ml { } - /// Artificial Neural Networks - Multi-Layer Perceptrons. - /// - /// Unlike many other models in ML that are constructed and trained at once, in the MLP model these - /// steps are separated. First, a network with the specified topology is created using the non-default - /// constructor or the method ANN_MLP::create. All the weights are set to zeros. Then, the network is - /// trained using a set of input and output vectors. The training procedure can be repeated more than - /// once, that is, the weights can be adjusted based on the new training data. - /// - /// Additional flags for StatModel::train are available: ANN_MLP::TrainFlags. - /// ## See also - /// [ml_intro_ann] - pub trait ANN_MLP: crate::ml::ANN_MLPConst + crate::ml::StatModel { + /// Mutable methods for [crate::ml::ANN_MLP] + pub trait ANN_MLPTrait: crate::ml::ANN_MLPTraitConst + crate::ml::StatModelTrait { fn as_raw_mut_ANN_MLP(&mut self) -> *mut c_void; /// Sets training method and common parameters. @@ -940,18 +930,69 @@ pub mod ml { } - impl dyn ANN_MLP + '_ { + /// Artificial Neural Networks - Multi-Layer Perceptrons. + /// + /// Unlike many other models in ML that are constructed and trained at once, in the MLP model these + /// steps are separated. First, a network with the specified topology is created using the non-default + /// constructor or the method ANN_MLP::create. All the weights are set to zeros. Then, the network is + /// trained using a set of input and output vectors. The training procedure can be repeated more than + /// once, that is, the weights can be adjusted based on the new training data. + /// + /// Additional flags for StatModel::train are available: ANN_MLP::TrainFlags. + /// ## See also + /// [ml_intro_ann] + pub struct ANN_MLP { + ptr: *mut c_void + } + + opencv_type_boxed! { ANN_MLP } + + impl Drop for ANN_MLP { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ANN_MLP_delete(instance: *mut c_void); } + unsafe { cv_ANN_MLP_delete(self.as_raw_mut_ANN_MLP()) }; + } + } + + unsafe impl Send for ANN_MLP {} + + impl core::AlgorithmTraitConst for ANN_MLP { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ANN_MLP { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for ANN_MLP { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for ANN_MLP { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::ANN_MLPTraitConst for ANN_MLP { + #[inline] fn as_raw_ANN_MLP(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::ANN_MLPTrait for ANN_MLP { + #[inline] fn as_raw_mut_ANN_MLP(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ANN_MLP { /// Creates empty model /// /// Use StatModel::train to train the model, Algorithm::load\(filename) to load the pre-trained model. /// Note that the train method has optional flags: ANN_MLP::TrainFlags. #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_ANN_MLP_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -963,19 +1004,22 @@ pub mod ml { /// ## Parameters /// * filepath: path to serialized ANN #[inline] - pub fn load(filepath: &str) -> Result> { + pub fn load(filepath: &str) -> Result> { extern_container_arg!(filepath); return_send!(via ocvrs_return); unsafe { sys::cv_ml_ANN_MLP_load_const_StringR(filepath.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { ANN_MLP, core::Algorithm, cv_ANN_MLP_to_Algorithm } + /// Constant methods for [crate::ml::Boost] - pub trait BoostConst: crate::ml::DTreesConst { + pub trait BoostTraitConst: crate::ml::DTreesTraitConst { fn as_raw_Boost(&self) -> *const c_void; /// Type of the boosting algorithm. @@ -1020,10 +1064,8 @@ pub mod ml { } - /// Boosted tree classifier derived from DTrees - /// ## See also - /// [ml_intro_boost] - pub trait Boost: crate::ml::BoostConst + crate::ml::DTrees { + /// Mutable methods for [crate::ml::Boost] + pub trait BoostTrait: crate::ml::BoostTraitConst + crate::ml::DTreesTrait { fn as_raw_mut_Boost(&mut self) -> *mut c_void; /// Type of the boosting algorithm. @@ -1068,16 +1110,67 @@ pub mod ml { } - impl dyn Boost + '_ { + /// Boosted tree classifier derived from DTrees + /// ## See also + /// [ml_intro_boost] + pub struct Boost { + ptr: *mut c_void + } + + opencv_type_boxed! { Boost } + + impl Drop for Boost { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Boost_delete(instance: *mut c_void); } + unsafe { cv_Boost_delete(self.as_raw_mut_Boost()) }; + } + } + + unsafe impl Send for Boost {} + + impl core::AlgorithmTraitConst for Boost { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Boost { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::DTreesTraitConst for Boost { + #[inline] fn as_raw_DTrees(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::DTreesTrait for Boost { + #[inline] fn as_raw_mut_DTrees(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for Boost { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for Boost { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::BoostTraitConst for Boost { + #[inline] fn as_raw_Boost(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::BoostTrait for Boost { + #[inline] fn as_raw_mut_Boost(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Boost { /// Creates the empty model. /// Use StatModel::train to train the model, Algorithm::load\(filename) to load the pre-trained model. #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_Boost_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1094,20 +1187,23 @@ pub mod ml { /// ## C++ default parameters /// * node_name: String() #[inline] - pub fn load(filepath: &str, node_name: &str) -> Result> { + pub fn load(filepath: &str, node_name: &str) -> Result> { extern_container_arg!(filepath); extern_container_arg!(node_name); return_send!(via ocvrs_return); unsafe { sys::cv_ml_Boost_load_const_StringR_const_StringR(filepath.opencv_as_extern(), node_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { Boost, core::Algorithm, cv_Boost_to_Algorithm } + /// Constant methods for [crate::ml::DTrees] - pub trait DTreesConst: crate::ml::StatModelConst { + pub trait DTreesTraitConst: crate::ml::StatModelTraitConst { fn as_raw_DTrees(&self) -> *const c_void; /// Cluster possible values of a categorical variable into K\<=maxCategories clusters to @@ -1314,15 +1410,8 @@ pub mod ml { } - /// The class represents a single decision tree or a collection of decision trees. - /// - /// The current public interface of the class allows user to train only a single decision tree, however - /// the class is capable of storing multiple decision trees and using them for prediction (by summing - /// responses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost) - /// use this capability to implement decision tree ensembles. - /// ## See also - /// [ml_intro_trees] - pub trait DTrees: crate::ml::DTreesConst + crate::ml::StatModel { + /// Mutable methods for [crate::ml::DTrees] + pub trait DTreesTrait: crate::ml::DTreesTraitConst + crate::ml::StatModelTrait { fn as_raw_mut_DTrees(&mut self) -> *mut c_void; /// Cluster possible values of a categorical variable into K\<=maxCategories clusters to @@ -1478,19 +1567,67 @@ pub mod ml { } - impl dyn DTrees + '_ { + /// The class represents a single decision tree or a collection of decision trees. + /// + /// The current public interface of the class allows user to train only a single decision tree, however + /// the class is capable of storing multiple decision trees and using them for prediction (by summing + /// responses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost) + /// use this capability to implement decision tree ensembles. + /// ## See also + /// [ml_intro_trees] + pub struct DTrees { + ptr: *mut c_void + } + + opencv_type_boxed! { DTrees } + + impl Drop for DTrees { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DTrees_delete(instance: *mut c_void); } + unsafe { cv_DTrees_delete(self.as_raw_mut_DTrees()) }; + } + } + + unsafe impl Send for DTrees {} + + impl core::AlgorithmTraitConst for DTrees { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DTrees { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for DTrees { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for DTrees { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::DTreesTraitConst for DTrees { + #[inline] fn as_raw_DTrees(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::DTreesTrait for DTrees { + #[inline] fn as_raw_mut_DTrees(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DTrees { /// Creates the empty model /// /// The static method creates empty decision tree with the specified parameters. It should be then /// trained using train method (see StatModel::train). Alternatively, you can load the model from /// file using Algorithm::load\(filename). #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_DTrees_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1507,18 +1644,21 @@ pub mod ml { /// ## C++ default parameters /// * node_name: String() #[inline] - pub fn load(filepath: &str, node_name: &str) -> Result> { + pub fn load(filepath: &str, node_name: &str) -> Result> { extern_container_arg!(filepath); extern_container_arg!(node_name); return_send!(via ocvrs_return); unsafe { sys::cv_ml_DTrees_load_const_StringR_const_StringR(filepath.opencv_as_extern(), node_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { DTrees, core::Algorithm, cv_DTrees_to_Algorithm } + /// Constant methods for [crate::ml::DTrees_Node] pub trait DTrees_NodeTraitConst { fn as_raw_DTrees_Node(&self) -> *const c_void; @@ -1838,7 +1978,7 @@ pub mod ml { } /// Constant methods for [crate::ml::EM] - pub trait EMConst: crate::ml::StatModelConst { + pub trait EMTraitConst: crate::ml::StatModelTraitConst { fn as_raw_EM(&self) -> *const c_void; /// The number of mixture components in the Gaussian mixture model. @@ -1971,10 +2111,8 @@ pub mod ml { } - /// The class implements the Expectation Maximization algorithm. - /// ## See also - /// [ml_intro_em] - pub trait EM: crate::ml::EMConst + crate::ml::StatModel { + /// Mutable methods for [crate::ml::EM] + pub trait EMTrait: crate::ml::EMTraitConst + crate::ml::StatModelTrait { fn as_raw_mut_EM(&mut self) -> *mut c_void; /// The number of mixture components in the Gaussian mixture model. @@ -2155,17 +2293,60 @@ pub mod ml { } - impl dyn EM + '_ { + /// The class implements the Expectation Maximization algorithm. + /// ## See also + /// [ml_intro_em] + pub struct EM { + ptr: *mut c_void + } + + opencv_type_boxed! { EM } + + impl Drop for EM { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_EM_delete(instance: *mut c_void); } + unsafe { cv_EM_delete(self.as_raw_mut_EM()) }; + } + } + + unsafe impl Send for EM {} + + impl core::AlgorithmTraitConst for EM { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for EM { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for EM { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for EM { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::EMTraitConst for EM { + #[inline] fn as_raw_EM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::EMTrait for EM { + #[inline] fn as_raw_mut_EM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl EM { /// Creates empty %EM model. /// The model should be trained then using StatModel::train(traindata, flags) method. Alternatively, you /// can use one of the EM::train\* methods or load it from file using Algorithm::load\(filename). #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_EM_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2182,20 +2363,23 @@ pub mod ml { /// ## C++ default parameters /// * node_name: String() #[inline] - pub fn load(filepath: &str, node_name: &str) -> Result> { + pub fn load(filepath: &str, node_name: &str) -> Result> { extern_container_arg!(filepath); extern_container_arg!(node_name); return_send!(via ocvrs_return); unsafe { sys::cv_ml_EM_load_const_StringR_const_StringR(filepath.opencv_as_extern(), node_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { EM, core::Algorithm, cv_EM_to_Algorithm } + /// Constant methods for [crate::ml::KNearest] - pub trait KNearestConst: crate::ml::StatModelConst { + pub trait KNearestTraitConst: crate::ml::StatModelTraitConst { fn as_raw_KNearest(&self) -> *const c_void; /// Default number of neighbors to use in predict method. @@ -2291,10 +2475,8 @@ pub mod ml { } - /// The class implements K-Nearest Neighbors model - /// ## See also - /// [ml_intro_knn] - pub trait KNearest: crate::ml::KNearestConst + crate::ml::StatModel { + /// Mutable methods for [crate::ml::KNearest] + pub trait KNearestTrait: crate::ml::KNearestTraitConst + crate::ml::StatModelTrait { fn as_raw_mut_KNearest(&mut self) -> *mut c_void; /// Default number of neighbors to use in predict method. @@ -2347,17 +2529,60 @@ pub mod ml { } - impl dyn KNearest + '_ { + /// The class implements K-Nearest Neighbors model + /// ## See also + /// [ml_intro_knn] + pub struct KNearest { + ptr: *mut c_void + } + + opencv_type_boxed! { KNearest } + + impl Drop for KNearest { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_KNearest_delete(instance: *mut c_void); } + unsafe { cv_KNearest_delete(self.as_raw_mut_KNearest()) }; + } + } + + unsafe impl Send for KNearest {} + + impl core::AlgorithmTraitConst for KNearest { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for KNearest { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for KNearest { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for KNearest { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::KNearestTraitConst for KNearest { + #[inline] fn as_raw_KNearest(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::KNearestTrait for KNearest { + #[inline] fn as_raw_mut_KNearest(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl KNearest { /// Creates the empty model /// /// The static method creates empty %KNearest classifier. It should be then trained using StatModel::train method. #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_KNearest_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2369,19 +2594,22 @@ pub mod ml { /// ## Parameters /// * filepath: path to serialized KNearest #[inline] - pub fn load(filepath: &str) -> Result> { + pub fn load(filepath: &str) -> Result> { extern_container_arg!(filepath); return_send!(via ocvrs_return); unsafe { sys::cv_ml_KNearest_load_const_StringR(filepath.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { KNearest, core::Algorithm, cv_KNearest_to_Algorithm } + /// Constant methods for [crate::ml::LogisticRegression] - pub trait LogisticRegressionConst: crate::ml::StatModelConst { + pub trait LogisticRegressionTraitConst: crate::ml::StatModelTraitConst { fn as_raw_LogisticRegression(&self) -> *const c_void; /// Learning rate. @@ -2496,10 +2724,8 @@ pub mod ml { } - /// Implements Logistic Regression classifier. - /// ## See also - /// [ml_intro_lr] - pub trait LogisticRegression: crate::ml::LogisticRegressionConst + crate::ml::StatModel { + /// Mutable methods for [crate::ml::LogisticRegression] + pub trait LogisticRegressionTrait: crate::ml::LogisticRegressionTraitConst + crate::ml::StatModelTrait { fn as_raw_mut_LogisticRegression(&mut self) -> *mut c_void; /// Learning rate. @@ -2578,17 +2804,60 @@ pub mod ml { } - impl dyn LogisticRegression + '_ { + /// Implements Logistic Regression classifier. + /// ## See also + /// [ml_intro_lr] + pub struct LogisticRegression { + ptr: *mut c_void + } + + opencv_type_boxed! { LogisticRegression } + + impl Drop for LogisticRegression { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LogisticRegression_delete(instance: *mut c_void); } + unsafe { cv_LogisticRegression_delete(self.as_raw_mut_LogisticRegression()) }; + } + } + + unsafe impl Send for LogisticRegression {} + + impl core::AlgorithmTraitConst for LogisticRegression { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LogisticRegression { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for LogisticRegression { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for LogisticRegression { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::LogisticRegressionTraitConst for LogisticRegression { + #[inline] fn as_raw_LogisticRegression(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::LogisticRegressionTrait for LogisticRegression { + #[inline] fn as_raw_mut_LogisticRegression(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LogisticRegression { /// Creates empty model. /// /// Creates Logistic Regression model with parameters given. #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_LogisticRegression_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2605,20 +2874,23 @@ pub mod ml { /// ## C++ default parameters /// * node_name: String() #[inline] - pub fn load(filepath: &str, node_name: &str) -> Result> { + pub fn load(filepath: &str, node_name: &str) -> Result> { extern_container_arg!(filepath); extern_container_arg!(node_name); return_send!(via ocvrs_return); unsafe { sys::cv_ml_LogisticRegression_load_const_StringR_const_StringR(filepath.opencv_as_extern(), node_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { LogisticRegression, core::Algorithm, cv_LogisticRegression_to_Algorithm } + /// Constant methods for [crate::ml::NormalBayesClassifier] - pub trait NormalBayesClassifierConst: crate::ml::StatModelConst { + pub trait NormalBayesClassifierTraitConst: crate::ml::StatModelTraitConst { fn as_raw_NormalBayesClassifier(&self) -> *const c_void; /// Predicts the response for sample(s). @@ -2645,24 +2917,65 @@ pub mod ml { } + /// Mutable methods for [crate::ml::NormalBayesClassifier] + pub trait NormalBayesClassifierTrait: crate::ml::NormalBayesClassifierTraitConst + crate::ml::StatModelTrait { + fn as_raw_mut_NormalBayesClassifier(&mut self) -> *mut c_void; + + } + /// Bayes classifier for normally distributed data. /// ## See also /// [ml_intro_bayes] - pub trait NormalBayesClassifier: crate::ml::NormalBayesClassifierConst + crate::ml::StatModel { - fn as_raw_mut_NormalBayesClassifier(&mut self) -> *mut c_void; + pub struct NormalBayesClassifier { + ptr: *mut c_void + } + + opencv_type_boxed! { NormalBayesClassifier } + + impl Drop for NormalBayesClassifier { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_NormalBayesClassifier_delete(instance: *mut c_void); } + unsafe { cv_NormalBayesClassifier_delete(self.as_raw_mut_NormalBayesClassifier()) }; + } + } + + unsafe impl Send for NormalBayesClassifier {} + impl core::AlgorithmTraitConst for NormalBayesClassifier { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } } - impl dyn NormalBayesClassifier + '_ { + impl core::AlgorithmTrait for NormalBayesClassifier { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for NormalBayesClassifier { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for NormalBayesClassifier { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::NormalBayesClassifierTraitConst for NormalBayesClassifier { + #[inline] fn as_raw_NormalBayesClassifier(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::NormalBayesClassifierTrait for NormalBayesClassifier { + #[inline] fn as_raw_mut_NormalBayesClassifier(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl NormalBayesClassifier { /// Creates empty model /// Use StatModel::train to train the model after creation. #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_NormalBayesClassifier_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2679,18 +2992,21 @@ pub mod ml { /// ## C++ default parameters /// * node_name: String() #[inline] - pub fn load(filepath: &str, node_name: &str) -> Result> { + pub fn load(filepath: &str, node_name: &str) -> Result> { extern_container_arg!(filepath); extern_container_arg!(node_name); return_send!(via ocvrs_return); unsafe { sys::cv_ml_NormalBayesClassifier_load_const_StringR_const_StringR(filepath.opencv_as_extern(), node_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { NormalBayesClassifier, core::Algorithm, cv_NormalBayesClassifier_to_Algorithm } + /// Constant methods for [crate::ml::ParamGrid] pub trait ParamGridTraitConst { fn as_raw_ParamGrid(&self) -> *const c_void; @@ -2832,7 +3148,7 @@ pub mod ml { } /// Constant methods for [crate::ml::RTrees] - pub trait RTreesConst: crate::ml::DTreesConst { + pub trait RTreesTraitConst: crate::ml::DTreesTraitConst { fn as_raw_RTrees(&self) -> *const c_void; /// If true then variable importance will be calculated and then it can be retrieved by RTrees::getVarImportance. @@ -2926,10 +3242,8 @@ pub mod ml { } - /// The class implements the random forest predictor. - /// ## See also - /// [ml_intro_rtrees] - pub trait RTrees: crate::ml::DTrees + crate::ml::RTreesConst { + /// Mutable methods for [crate::ml::RTrees] + pub trait RTreesTrait: crate::ml::DTreesTrait + crate::ml::RTreesTraitConst { fn as_raw_mut_RTrees(&mut self) -> *mut c_void; /// If true then variable importance will be calculated and then it can be retrieved by RTrees::getVarImportance. @@ -2980,20 +3294,71 @@ pub mod ml { } - impl dyn RTrees + '_ { - /// Creates the empty model. - /// Use StatModel::train to train the model, StatModel::train to create and train the model, - /// Algorithm::load to load the pre-trained model. + /// The class implements the random forest predictor. + /// ## See also + /// [ml_intro_rtrees] + pub struct RTrees { + ptr: *mut c_void + } + + opencv_type_boxed! { RTrees } + + impl Drop for RTrees { #[inline] - pub fn create() -> Result> { - return_send!(via ocvrs_return); - unsafe { sys::cv_ml_RTrees_create(ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_RTrees_delete(instance: *mut c_void); } + unsafe { cv_RTrees_delete(self.as_raw_mut_RTrees()) }; } - + } + + unsafe impl Send for RTrees {} + + impl core::AlgorithmTraitConst for RTrees { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for RTrees { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::DTreesTraitConst for RTrees { + #[inline] fn as_raw_DTrees(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::DTreesTrait for RTrees { + #[inline] fn as_raw_mut_DTrees(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for RTrees { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for RTrees { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::RTreesTraitConst for RTrees { + #[inline] fn as_raw_RTrees(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::RTreesTrait for RTrees { + #[inline] fn as_raw_mut_RTrees(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl RTrees { + /// Creates the empty model. + /// Use StatModel::train to train the model, StatModel::train to create and train the model, + /// Algorithm::load to load the pre-trained model. + #[inline] + pub fn create() -> Result> { + return_send!(via ocvrs_return); + unsafe { sys::cv_ml_RTrees_create(ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + Ok(ret) + } + /// Loads and creates a serialized RTree from a file /// /// Use RTree::save to serialize and store an RTree to disk. @@ -3007,20 +3372,23 @@ pub mod ml { /// ## C++ default parameters /// * node_name: String() #[inline] - pub fn load(filepath: &str, node_name: &str) -> Result> { + pub fn load(filepath: &str, node_name: &str) -> Result> { extern_container_arg!(filepath); extern_container_arg!(node_name); return_send!(via ocvrs_return); unsafe { sys::cv_ml_RTrees_load_const_StringR_const_StringR(filepath.opencv_as_extern(), node_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { RTrees, core::Algorithm, cv_RTrees_to_Algorithm } + /// Constant methods for [crate::ml::SVM] - pub trait SVMConst: crate::ml::StatModelConst { + pub trait SVMTraitConst: crate::ml::StatModelTraitConst { fn as_raw_SVM(&self) -> *const c_void; /// Type of a %SVM formulation. @@ -3214,10 +3582,8 @@ pub mod ml { } - /// Support Vector Machines. - /// ## See also - /// [ml_intro_svm] - pub trait SVM: crate::ml::SVMConst + crate::ml::StatModel { + /// Mutable methods for [crate::ml::SVM] + pub trait SVMTrait: crate::ml::SVMTraitConst + crate::ml::StatModelTrait { fn as_raw_mut_SVM(&mut self) -> *mut c_void; /// Type of a %SVM formulation. @@ -3356,7 +3722,7 @@ pub mod ml { /// Initialize with custom kernel. /// See SVM::Kernel class for implementation details #[inline] - fn set_custom_kernel(&mut self, _kernel: &core::Ptr) -> Result<()> { + fn set_custom_kernel(&mut self, _kernel: &core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_SVM_setCustomKernel_const_PtrLKernelGR(self.as_raw_mut_SVM(), _kernel.as_raw_PtrOfSVM_Kernel(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3409,7 +3775,7 @@ pub mod ml { /// * degree_grid: getDefaultGrid(DEGREE) /// * balanced: false #[inline] - fn train_auto(&mut self, data: &core::Ptr, k_fold: i32, mut cgrid: crate::ml::ParamGrid, mut gamma_grid: crate::ml::ParamGrid, mut p_grid: crate::ml::ParamGrid, mut nu_grid: crate::ml::ParamGrid, mut coeff_grid: crate::ml::ParamGrid, mut degree_grid: crate::ml::ParamGrid, balanced: bool) -> Result { + fn train_auto(&mut self, data: &core::Ptr, k_fold: i32, mut cgrid: crate::ml::ParamGrid, mut gamma_grid: crate::ml::ParamGrid, mut p_grid: crate::ml::ParamGrid, mut nu_grid: crate::ml::ParamGrid, mut coeff_grid: crate::ml::ParamGrid, mut degree_grid: crate::ml::ParamGrid, balanced: bool) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_ml_SVM_trainAuto_const_PtrLTrainDataGR_int_ParamGrid_ParamGrid_ParamGrid_ParamGrid_ParamGrid_ParamGrid_bool(self.as_raw_mut_SVM(), data.as_raw_PtrOfTrainData(), k_fold, cgrid.as_raw_mut_ParamGrid(), gamma_grid.as_raw_mut_ParamGrid(), p_grid.as_raw_mut_ParamGrid(), nu_grid.as_raw_mut_ParamGrid(), coeff_grid.as_raw_mut_ParamGrid(), degree_grid.as_raw_mut_ParamGrid(), balanced, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3468,7 +3834,50 @@ pub mod ml { } - impl dyn SVM + '_ { + /// Support Vector Machines. + /// ## See also + /// [ml_intro_svm] + pub struct SVM { + ptr: *mut c_void + } + + opencv_type_boxed! { SVM } + + impl Drop for SVM { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SVM_delete(instance: *mut c_void); } + unsafe { cv_SVM_delete(self.as_raw_mut_SVM()) }; + } + } + + unsafe impl Send for SVM {} + + impl core::AlgorithmTraitConst for SVM { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SVM { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for SVM { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for SVM { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::SVMTraitConst for SVM { + #[inline] fn as_raw_SVM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::SVMTrait for SVM { + #[inline] fn as_raw_mut_SVM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SVM { /// Generates a grid for %SVM parameters. /// /// ## Parameters @@ -3509,12 +3918,12 @@ pub mod ml { /// Use StatModel::train to train the model. Since %SVM has several parameters, you may want to /// find the best parameters for your problem, it can be done with SVM::trainAuto. #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_SVM_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3526,19 +3935,22 @@ pub mod ml { /// ## Parameters /// * filepath: path to serialized svm #[inline] - pub fn load(filepath: &str) -> Result> { + pub fn load(filepath: &str) -> Result> { extern_container_arg!(filepath); return_send!(via ocvrs_return); unsafe { sys::cv_ml_SVM_load_const_StringR(filepath.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { SVM, core::Algorithm, cv_SVM_to_Algorithm } + /// Constant methods for [crate::ml::SVM_Kernel] - pub trait SVM_KernelConst: core::AlgorithmTraitConst { + pub trait SVM_KernelTraitConst: core::AlgorithmTraitConst { fn as_raw_SVM_Kernel(&self) -> *const c_void; #[inline] @@ -3552,7 +3964,8 @@ pub mod ml { } - pub trait SVM_Kernel: core::AlgorithmTrait + crate::ml::SVM_KernelConst { + /// Mutable methods for [crate::ml::SVM_Kernel] + pub trait SVM_KernelTrait: core::AlgorithmTrait + crate::ml::SVM_KernelTraitConst { fn as_raw_mut_SVM_Kernel(&mut self) -> *mut c_void; #[inline] @@ -3566,8 +3979,45 @@ pub mod ml { } + pub struct SVM_Kernel { + ptr: *mut c_void + } + + opencv_type_boxed! { SVM_Kernel } + + impl Drop for SVM_Kernel { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SVM_Kernel_delete(instance: *mut c_void); } + unsafe { cv_SVM_Kernel_delete(self.as_raw_mut_SVM_Kernel()) }; + } + } + + unsafe impl Send for SVM_Kernel {} + + impl core::AlgorithmTraitConst for SVM_Kernel { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SVM_Kernel { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::SVM_KernelTraitConst for SVM_Kernel { + #[inline] fn as_raw_SVM_Kernel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::SVM_KernelTrait for SVM_Kernel { + #[inline] fn as_raw_mut_SVM_Kernel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SVM_Kernel { + } + + boxed_cast_base! { SVM_Kernel, core::Algorithm, cv_SVM_Kernel_to_Algorithm } + /// Constant methods for [crate::ml::SVMSGD] - pub trait SVMSGDConst: crate::ml::StatModelConst { + pub trait SVMSGDTraitConst: crate::ml::StatModelTraitConst { fn as_raw_SVMSGD(&self) -> *const c_void; /// %Algorithm type, one of SVMSGD::SvmsgdType. @@ -3646,78 +4096,8 @@ pub mod ml { } - /// ! - /// Stochastic Gradient Descent SVM classifier - /// - /// SVMSGD provides a fast and easy-to-use implementation of the SVM classifier using the Stochastic Gradient Descent approach, - /// as presented in [bottou2010large](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_bottou2010large). - /// - /// The classifier has following parameters: - /// - model type, - /// - margin type, - /// - margin regularization (![inline formula](https://latex.codecogs.com/png.latex?%5Clambda)), - /// - initial step size (![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%5F0)), - /// - step decreasing power (![inline formula](https://latex.codecogs.com/png.latex?c)), - /// - and termination criteria. - /// - /// The model type may have one of the following values: \ref SGD and \ref ASGD. - /// - /// - \ref SGD is the classic version of SVMSGD classifier: every next step is calculated by the formula - /// ![block formula](https://latex.codecogs.com/png.latex?w%5F%7Bt%2B1%7D%20%3D%20w%5Ft%20%2D%20%5Cgamma%28t%29%20%5Cfrac%7BdQ%5Fi%7D%7Bdw%7D%20%7C%5F%7Bw%20%3D%20w%5Ft%7D) - /// where - /// - ![inline formula](https://latex.codecogs.com/png.latex?w%5Ft) is the weights vector for decision function at step ![inline formula](https://latex.codecogs.com/png.latex?t), - /// - ![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%28t%29) is the step size of model parameters at the iteration ![inline formula](https://latex.codecogs.com/png.latex?t), it is decreased on each step by the formula - /// ![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%28t%29%20%3D%20%5Cgamma%5F0%20%20%281%20%2B%20%5Clambda%20%20%5Cgamma%5F0%20t%29%20%5E%20%7B%2Dc%7D) - /// - ![inline formula](https://latex.codecogs.com/png.latex?Q%5Fi) is the target functional from SVM task for sample with number ![inline formula](https://latex.codecogs.com/png.latex?i), this sample is chosen stochastically on each step of the algorithm. - /// - /// - \ref ASGD is Average Stochastic Gradient Descent SVM Classifier. ASGD classifier averages weights vector on each step of algorithm by the formula - /// ![inline formula](https://latex.codecogs.com/png.latex?%5Cwidehat%7Bw%7D%5F%7Bt%2B1%7D%20%3D%20%5Cfrac%7Bt%7D%7B1%2Bt%7D%5Cwidehat%7Bw%7D%5F%7Bt%7D%20%2B%20%5Cfrac%7B1%7D%7B1%2Bt%7Dw%5F%7Bt%2B1%7D) - /// - /// The recommended model type is ASGD (following [bottou2010large](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_bottou2010large)). - /// - /// The margin type may have one of the following values: \ref SOFT_MARGIN or \ref HARD_MARGIN. - /// - /// - You should use \ref HARD_MARGIN type, if you have linearly separable sets. - /// - You should use \ref SOFT_MARGIN type, if you have non-linearly separable sets or sets with outliers. - /// - In the general case (if you know nothing about linear separability of your sets), use SOFT_MARGIN. - /// - /// The other parameters may be described as follows: - /// - Margin regularization parameter is responsible for weights decreasing at each step and for the strength of restrictions on outliers - /// (the less the parameter, the less probability that an outlier will be ignored). - /// Recommended value for SGD model is 0.0001, for ASGD model is 0.00001. - /// - /// - Initial step size parameter is the initial value for the step size ![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%28t%29). - /// You will have to find the best initial step for your problem. - /// - /// - Step decreasing power is the power parameter for ![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%28t%29) decreasing by the formula, mentioned above. - /// Recommended value for SGD model is 1, for ASGD model is 0.75. - /// - /// - Termination criteria can be TermCriteria::COUNT, TermCriteria::EPS or TermCriteria::COUNT + TermCriteria::EPS. - /// You will have to find the best termination criteria for your problem. - /// - /// Note that the parameters margin regularization, initial step size, and step decreasing power should be positive. - /// - /// To use SVMSGD algorithm do as follows: - /// - /// - first, create the SVMSGD object. The algorithm will set optimal parameters by default, but you can set your own parameters via functions setSvmsgdType(), - /// setMarginType(), setMarginRegularization(), setInitialStepSize(), and setStepDecreasingPower(). - /// - /// - then the SVM model can be trained using the train features and the correspondent labels by the method train(). - /// - /// - after that, the label of a new feature vector can be predicted using the method predict(). - /// - /// ```C++ - /// // Create empty object - /// cv::Ptr svmsgd = SVMSGD::create(); - /// - /// // Train the Stochastic Gradient Descent SVM - /// svmsgd->train(trainData); - /// - /// // Predict labels for the new samples - /// svmsgd->predict(samples, responses); - /// ``` - /// - pub trait SVMSGD: crate::ml::SVMSGDConst + crate::ml::StatModel { + /// Mutable methods for [crate::ml::SVMSGD] + pub trait SVMSGDTrait: crate::ml::SVMSGDTraitConst + crate::ml::StatModelTrait { fn as_raw_mut_SVMSGD(&mut self) -> *mut c_void; /// ## Returns @@ -3836,17 +4216,128 @@ pub mod ml { } - impl dyn SVMSGD + '_ { + /// ! + /// Stochastic Gradient Descent SVM classifier + /// + /// SVMSGD provides a fast and easy-to-use implementation of the SVM classifier using the Stochastic Gradient Descent approach, + /// as presented in [bottou2010large](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_bottou2010large). + /// + /// The classifier has following parameters: + /// - model type, + /// - margin type, + /// - margin regularization (![inline formula](https://latex.codecogs.com/png.latex?%5Clambda)), + /// - initial step size (![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%5F0)), + /// - step decreasing power (![inline formula](https://latex.codecogs.com/png.latex?c)), + /// - and termination criteria. + /// + /// The model type may have one of the following values: \ref SGD and \ref ASGD. + /// + /// - \ref SGD is the classic version of SVMSGD classifier: every next step is calculated by the formula + /// ![block formula](https://latex.codecogs.com/png.latex?w%5F%7Bt%2B1%7D%20%3D%20w%5Ft%20%2D%20%5Cgamma%28t%29%20%5Cfrac%7BdQ%5Fi%7D%7Bdw%7D%20%7C%5F%7Bw%20%3D%20w%5Ft%7D) + /// where + /// - ![inline formula](https://latex.codecogs.com/png.latex?w%5Ft) is the weights vector for decision function at step ![inline formula](https://latex.codecogs.com/png.latex?t), + /// - ![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%28t%29) is the step size of model parameters at the iteration ![inline formula](https://latex.codecogs.com/png.latex?t), it is decreased on each step by the formula + /// ![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%28t%29%20%3D%20%5Cgamma%5F0%20%20%281%20%2B%20%5Clambda%20%20%5Cgamma%5F0%20t%29%20%5E%20%7B%2Dc%7D) + /// - ![inline formula](https://latex.codecogs.com/png.latex?Q%5Fi) is the target functional from SVM task for sample with number ![inline formula](https://latex.codecogs.com/png.latex?i), this sample is chosen stochastically on each step of the algorithm. + /// + /// - \ref ASGD is Average Stochastic Gradient Descent SVM Classifier. ASGD classifier averages weights vector on each step of algorithm by the formula + /// ![inline formula](https://latex.codecogs.com/png.latex?%5Cwidehat%7Bw%7D%5F%7Bt%2B1%7D%20%3D%20%5Cfrac%7Bt%7D%7B1%2Bt%7D%5Cwidehat%7Bw%7D%5F%7Bt%7D%20%2B%20%5Cfrac%7B1%7D%7B1%2Bt%7Dw%5F%7Bt%2B1%7D) + /// + /// The recommended model type is ASGD (following [bottou2010large](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_bottou2010large)). + /// + /// The margin type may have one of the following values: \ref SOFT_MARGIN or \ref HARD_MARGIN. + /// + /// - You should use \ref HARD_MARGIN type, if you have linearly separable sets. + /// - You should use \ref SOFT_MARGIN type, if you have non-linearly separable sets or sets with outliers. + /// - In the general case (if you know nothing about linear separability of your sets), use SOFT_MARGIN. + /// + /// The other parameters may be described as follows: + /// - Margin regularization parameter is responsible for weights decreasing at each step and for the strength of restrictions on outliers + /// (the less the parameter, the less probability that an outlier will be ignored). + /// Recommended value for SGD model is 0.0001, for ASGD model is 0.00001. + /// + /// - Initial step size parameter is the initial value for the step size ![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%28t%29). + /// You will have to find the best initial step for your problem. + /// + /// - Step decreasing power is the power parameter for ![inline formula](https://latex.codecogs.com/png.latex?%5Cgamma%28t%29) decreasing by the formula, mentioned above. + /// Recommended value for SGD model is 1, for ASGD model is 0.75. + /// + /// - Termination criteria can be TermCriteria::COUNT, TermCriteria::EPS or TermCriteria::COUNT + TermCriteria::EPS. + /// You will have to find the best termination criteria for your problem. + /// + /// Note that the parameters margin regularization, initial step size, and step decreasing power should be positive. + /// + /// To use SVMSGD algorithm do as follows: + /// + /// - first, create the SVMSGD object. The algorithm will set optimal parameters by default, but you can set your own parameters via functions setSvmsgdType(), + /// setMarginType(), setMarginRegularization(), setInitialStepSize(), and setStepDecreasingPower(). + /// + /// - then the SVM model can be trained using the train features and the correspondent labels by the method train(). + /// + /// - after that, the label of a new feature vector can be predicted using the method predict(). + /// + /// ```C++ + /// // Create empty object + /// cv::Ptr svmsgd = SVMSGD::create(); + /// + /// // Train the Stochastic Gradient Descent SVM + /// svmsgd->train(trainData); + /// + /// // Predict labels for the new samples + /// svmsgd->predict(samples, responses); + /// ``` + /// + pub struct SVMSGD { + ptr: *mut c_void + } + + opencv_type_boxed! { SVMSGD } + + impl Drop for SVMSGD { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SVMSGD_delete(instance: *mut c_void); } + unsafe { cv_SVMSGD_delete(self.as_raw_mut_SVMSGD()) }; + } + } + + unsafe impl Send for SVMSGD {} + + impl core::AlgorithmTraitConst for SVMSGD { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SVMSGD { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for SVMSGD { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for SVMSGD { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::SVMSGDTraitConst for SVMSGD { + #[inline] fn as_raw_SVMSGD(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::SVMSGDTrait for SVMSGD { + #[inline] fn as_raw_mut_SVMSGD(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SVMSGD { /// Creates empty model. /// Use StatModel::train to train the model. Since %SVMSGD has several parameters, you may want to /// find the best parameters for your problem or use setOptimalParameters() to set some default parameters. #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ml_SVMSGD_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3863,20 +4354,23 @@ pub mod ml { /// ## C++ default parameters /// * node_name: String() #[inline] - pub fn load(filepath: &str, node_name: &str) -> Result> { + pub fn load(filepath: &str, node_name: &str) -> Result> { extern_container_arg!(filepath); extern_container_arg!(node_name); return_send!(via ocvrs_return); unsafe { sys::cv_ml_SVMSGD_load_const_StringR_const_StringR(filepath.opencv_as_extern(), node_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { SVMSGD, core::Algorithm, cv_SVMSGD_to_Algorithm } + /// Constant methods for [crate::ml::StatModel] - pub trait StatModelConst: core::AlgorithmTraitConst { + pub trait StatModelTraitConst: core::AlgorithmTraitConst { fn as_raw_StatModel(&self) -> *const c_void; /// Returns the number of variables in training samples @@ -3932,7 +4426,7 @@ pub mod ml { /// The method uses StatModel::predict to compute the error. For regression models the error is /// computed as RMS, for classifiers - as a percent of missclassified samples (0%-100%). #[inline] - fn calc_error(&self, data: &core::Ptr, test: bool, resp: &mut dyn core::ToOutputArray) -> Result { + fn calc_error(&self, data: &core::Ptr, test: bool, resp: &mut dyn core::ToOutputArray) -> Result { extern_container_arg!(resp); return_send!(via ocvrs_return); unsafe { sys::cv_ml_StatModel_calcError_const_const_PtrLTrainDataGR_bool_const__OutputArrayR(self.as_raw_StatModel(), data.as_raw_PtrOfTrainData(), test, resp.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) }; @@ -3964,8 +4458,8 @@ pub mod ml { } - /// Base class for statistical models in OpenCV ML. - pub trait StatModel: core::AlgorithmTrait + crate::ml::StatModelConst { + /// Mutable methods for [crate::ml::StatModel] + pub trait StatModelTrait: core::AlgorithmTrait + crate::ml::StatModelTraitConst { fn as_raw_mut_StatModel(&mut self) -> *mut c_void; /// Trains the statistical model @@ -3979,7 +4473,7 @@ pub mod ml { /// ## C++ default parameters /// * flags: 0 #[inline] - fn train_with_data(&mut self, train_data: &core::Ptr, flags: i32) -> Result { + fn train_with_data(&mut self, train_data: &core::Ptr, flags: i32) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_ml_StatModel_train_const_PtrLTrainDataGR_int(self.as_raw_mut_StatModel(), train_data.as_raw_PtrOfTrainData(), flags, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -4006,8 +4500,46 @@ pub mod ml { } + /// Base class for statistical models in OpenCV ML. + pub struct StatModel { + ptr: *mut c_void + } + + opencv_type_boxed! { StatModel } + + impl Drop for StatModel { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_StatModel_delete(instance: *mut c_void); } + unsafe { cv_StatModel_delete(self.as_raw_mut_StatModel()) }; + } + } + + unsafe impl Send for StatModel {} + + impl core::AlgorithmTraitConst for StatModel { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for StatModel { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ml::StatModelTraitConst for StatModel { + #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::StatModelTrait for StatModel { + #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StatModel { + } + + boxed_cast_base! { StatModel, core::Algorithm, cv_StatModel_to_Algorithm } + /// Constant methods for [crate::ml::TrainData] - pub trait TrainDataConst { + pub trait TrainDataTraitConst { fn as_raw_TrainData(&self) -> *const c_void; #[inline] @@ -4374,15 +4906,8 @@ pub mod ml { } - /// Class encapsulating training data. - /// - /// Please note that the class only specifies the interface of training data, but not implementation. - /// All the statistical model classes in _ml_ module accepts Ptr\ as parameter. In other - /// words, you can create your own class derived from TrainData and pass smart pointer to the instance - /// of this class into StatModel::train. - /// ## See also - /// [ml_intro_data] - pub trait TrainData: crate::ml::TrainDataConst { + /// Mutable methods for [crate::ml::TrainData] + pub trait TrainDataTrait: crate::ml::TrainDataTraitConst { fn as_raw_mut_TrainData(&mut self) -> *mut c_void; /// Splits the training data into the training and test parts @@ -4431,7 +4956,39 @@ pub mod ml { } - impl dyn TrainData + '_ { + /// Class encapsulating training data. + /// + /// Please note that the class only specifies the interface of training data, but not implementation. + /// All the statistical model classes in _ml_ module accepts Ptr\ as parameter. In other + /// words, you can create your own class derived from TrainData and pass smart pointer to the instance + /// of this class into StatModel::train. + /// ## See also + /// [ml_intro_data] + pub struct TrainData { + ptr: *mut c_void + } + + opencv_type_boxed! { TrainData } + + impl Drop for TrainData { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TrainData_delete(instance: *mut c_void); } + unsafe { cv_TrainData_delete(self.as_raw_mut_TrainData()) }; + } + } + + unsafe impl Send for TrainData {} + + impl crate::ml::TrainDataTraitConst for TrainData { + #[inline] fn as_raw_TrainData(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ml::TrainDataTrait for TrainData { + #[inline] fn as_raw_mut_TrainData(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TrainData { #[inline] pub fn missing_value() -> Result { return_send!(via ocvrs_return); @@ -4508,14 +5065,14 @@ pub mod ml { /// * delimiter: ',' /// * missch: '?' #[inline] - pub fn load_from_csv(filename: &str, header_line_count: i32, response_start_idx: i32, response_end_idx: i32, var_type_spec: &str, delimiter: i8, missch: i8) -> Result> { + pub fn load_from_csv(filename: &str, header_line_count: i32, response_start_idx: i32, response_end_idx: i32, var_type_spec: &str, delimiter: i8, missch: i8) -> Result> { extern_container_arg!(filename); extern_container_arg!(var_type_spec); return_send!(via ocvrs_return); unsafe { sys::cv_ml_TrainData_loadFromCSV_const_StringR_int_int_int_const_StringR_char_char(filename.opencv_as_extern(), header_line_count, response_start_idx, response_end_idx, var_type_spec.opencv_as_extern(), delimiter, missch, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -4545,7 +5102,7 @@ pub mod ml { /// * sample_weights: noArray() /// * var_type: noArray() #[inline] - pub fn create(samples: &dyn core::ToInputArray, layout: i32, responses: &dyn core::ToInputArray, var_idx: &dyn core::ToInputArray, sample_idx: &dyn core::ToInputArray, sample_weights: &dyn core::ToInputArray, var_type: &dyn core::ToInputArray) -> Result> { + pub fn create(samples: &dyn core::ToInputArray, layout: i32, responses: &dyn core::ToInputArray, var_idx: &dyn core::ToInputArray, sample_idx: &dyn core::ToInputArray, sample_weights: &dyn core::ToInputArray, var_type: &dyn core::ToInputArray) -> Result> { extern_container_arg!(samples); extern_container_arg!(responses); extern_container_arg!(var_idx); @@ -4556,8 +5113,9 @@ pub mod ml { unsafe { sys::cv_ml_TrainData_create_const__InputArrayR_int_const__InputArrayR_const__InputArrayR_const__InputArrayR_const__InputArrayR_const__InputArrayR(samples.as_raw__InputArray(), layout, responses.as_raw__InputArray(), var_idx.as_raw__InputArray(), sample_idx.as_raw__InputArray(), sample_weights.as_raw__InputArray(), var_type.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } +} diff --git a/docs/objdetect.rs b/docs/objdetect.rs index 7f1370bcd..a76038870 100644 --- a/docs/objdetect.rs +++ b/docs/objdetect.rs @@ -75,7 +75,7 @@ pub mod objdetect { //! for Google Summer of Code 2015 (GSoC 15). use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::SimilarRectsTraitConst, super::SimilarRectsTrait, super::BaseCascadeClassifier_MaskGeneratorConst, super::BaseCascadeClassifier_MaskGenerator, super::BaseCascadeClassifierConst, super::BaseCascadeClassifier, super::CascadeClassifierTraitConst, super::CascadeClassifierTrait, super::DetectionROITraitConst, super::DetectionROITrait, super::HOGDescriptorTraitConst, super::HOGDescriptorTrait, super::QRCodeEncoderConst, super::QRCodeEncoder, super::QRCodeDetectorTraitConst, super::QRCodeDetectorTrait, super::DetectionBasedTracker_ParametersTraitConst, super::DetectionBasedTracker_ParametersTrait, super::DetectionBasedTracker_IDetectorConst, super::DetectionBasedTracker_IDetector, super::DetectionBasedTracker_ExtObjectTraitConst, super::DetectionBasedTracker_ExtObjectTrait, super::DetectionBasedTrackerTraitConst, super::DetectionBasedTrackerTrait, super::FaceDetectorYNConst, super::FaceDetectorYN, super::FaceRecognizerSFConst, super::FaceRecognizerSF, super::DictionaryTraitConst, super::DictionaryTrait, super::BoardTraitConst, super::BoardTrait, super::GridBoardTraitConst, super::GridBoardTrait, super::CharucoBoardTraitConst, super::CharucoBoardTrait, super::DetectorParametersTraitConst, super::DetectorParametersTrait, super::ArucoDetectorTraitConst, super::ArucoDetectorTrait, super::CharucoParametersTraitConst, super::CharucoParametersTrait, super::CharucoDetectorTraitConst, super::CharucoDetectorTrait }; + pub use { super::SimilarRectsTraitConst, super::SimilarRectsTrait, super::BaseCascadeClassifier_MaskGeneratorTraitConst, super::BaseCascadeClassifier_MaskGeneratorTrait, super::BaseCascadeClassifierTraitConst, super::BaseCascadeClassifierTrait, super::CascadeClassifierTraitConst, super::CascadeClassifierTrait, super::DetectionROITraitConst, super::DetectionROITrait, super::HOGDescriptorTraitConst, super::HOGDescriptorTrait, super::QRCodeEncoderTraitConst, super::QRCodeEncoderTrait, super::QRCodeDetectorTraitConst, super::QRCodeDetectorTrait, super::DetectionBasedTracker_ParametersTraitConst, super::DetectionBasedTracker_ParametersTrait, super::DetectionBasedTracker_IDetectorTraitConst, super::DetectionBasedTracker_IDetectorTrait, super::DetectionBasedTracker_ExtObjectTraitConst, super::DetectionBasedTracker_ExtObjectTrait, super::DetectionBasedTrackerTraitConst, super::DetectionBasedTrackerTrait, super::FaceDetectorYNTraitConst, super::FaceDetectorYNTrait, super::FaceRecognizerSFTraitConst, super::FaceRecognizerSFTrait, super::DictionaryTraitConst, super::DictionaryTrait, super::BoardTraitConst, super::BoardTrait, super::GridBoardTraitConst, super::GridBoardTrait, super::CharucoBoardTraitConst, super::CharucoBoardTrait, super::DetectorParametersTraitConst, super::DetectorParametersTrait, super::ArucoDetectorTraitConst, super::ArucoDetectorTrait, super::CharucoParametersTraitConst, super::CharucoParametersTrait, super::CharucoDetectorTraitConst, super::CharucoDetectorTrait }; } pub const CASCADE_DO_CANNY_PRUNING: i32 = 1; @@ -460,12 +460,12 @@ pub mod objdetect { } #[inline] - pub fn create_face_detection_mask_generator() -> Result> { + pub fn create_face_detection_mask_generator() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createFaceDetectionMaskGenerator(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -595,7 +595,7 @@ pub mod objdetect { } /// Constant methods for [crate::objdetect::BaseCascadeClassifier] - pub trait BaseCascadeClassifierConst: core::AlgorithmTraitConst { + pub trait BaseCascadeClassifierTraitConst: core::AlgorithmTraitConst { fn as_raw_BaseCascadeClassifier(&self) -> *const c_void; #[inline] @@ -636,7 +636,8 @@ pub mod objdetect { } - pub trait BaseCascadeClassifier: core::AlgorithmTrait + crate::objdetect::BaseCascadeClassifierConst { + /// Mutable methods for [crate::objdetect::BaseCascadeClassifier] + pub trait BaseCascadeClassifierTrait: core::AlgorithmTrait + crate::objdetect::BaseCascadeClassifierTraitConst { fn as_raw_mut_BaseCascadeClassifier(&mut self) -> *mut c_void; #[inline] @@ -689,7 +690,7 @@ pub mod objdetect { } #[inline] - fn set_mask_generator(&mut self, mask_generator: &core::Ptr) -> Result<()> { + fn set_mask_generator(&mut self, mask_generator: &core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_BaseCascadeClassifier_setMaskGenerator_const_PtrLMaskGeneratorGR(self.as_raw_mut_BaseCascadeClassifier(), mask_generator.as_raw_PtrOfBaseCascadeClassifier_MaskGenerator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -698,24 +699,62 @@ pub mod objdetect { } #[inline] - fn get_mask_generator(&mut self) -> Result> { + fn get_mask_generator(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_BaseCascadeClassifier_getMaskGenerator(self.as_raw_mut_BaseCascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + pub struct BaseCascadeClassifier { + ptr: *mut c_void + } + + opencv_type_boxed! { BaseCascadeClassifier } + + impl Drop for BaseCascadeClassifier { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BaseCascadeClassifier_delete(instance: *mut c_void); } + unsafe { cv_BaseCascadeClassifier_delete(self.as_raw_mut_BaseCascadeClassifier()) }; + } + } + + unsafe impl Send for BaseCascadeClassifier {} + + impl core::AlgorithmTraitConst for BaseCascadeClassifier { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BaseCascadeClassifier { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::objdetect::BaseCascadeClassifierTraitConst for BaseCascadeClassifier { + #[inline] fn as_raw_BaseCascadeClassifier(&self) -> *const c_void { self.as_raw() } + } + + impl crate::objdetect::BaseCascadeClassifierTrait for BaseCascadeClassifier { + #[inline] fn as_raw_mut_BaseCascadeClassifier(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BaseCascadeClassifier { + } + + boxed_cast_base! { BaseCascadeClassifier, core::Algorithm, cv_BaseCascadeClassifier_to_Algorithm } + /// Constant methods for [crate::objdetect::BaseCascadeClassifier_MaskGenerator] - pub trait BaseCascadeClassifier_MaskGeneratorConst { + pub trait BaseCascadeClassifier_MaskGeneratorTraitConst { fn as_raw_BaseCascadeClassifier_MaskGenerator(&self) -> *const c_void; } - pub trait BaseCascadeClassifier_MaskGenerator: crate::objdetect::BaseCascadeClassifier_MaskGeneratorConst { + /// Mutable methods for [crate::objdetect::BaseCascadeClassifier_MaskGenerator] + pub trait BaseCascadeClassifier_MaskGeneratorTrait: crate::objdetect::BaseCascadeClassifier_MaskGeneratorTraitConst { fn as_raw_mut_BaseCascadeClassifier_MaskGenerator(&mut self) -> *mut c_void; #[inline] @@ -739,6 +778,33 @@ pub mod objdetect { } + pub struct BaseCascadeClassifier_MaskGenerator { + ptr: *mut c_void + } + + opencv_type_boxed! { BaseCascadeClassifier_MaskGenerator } + + impl Drop for BaseCascadeClassifier_MaskGenerator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BaseCascadeClassifier_MaskGenerator_delete(instance: *mut c_void); } + unsafe { cv_BaseCascadeClassifier_MaskGenerator_delete(self.as_raw_mut_BaseCascadeClassifier_MaskGenerator()) }; + } + } + + unsafe impl Send for BaseCascadeClassifier_MaskGenerator {} + + impl crate::objdetect::BaseCascadeClassifier_MaskGeneratorTraitConst for BaseCascadeClassifier_MaskGenerator { + #[inline] fn as_raw_BaseCascadeClassifier_MaskGenerator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::objdetect::BaseCascadeClassifier_MaskGeneratorTrait for BaseCascadeClassifier_MaskGenerator { + #[inline] fn as_raw_mut_BaseCascadeClassifier_MaskGenerator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BaseCascadeClassifier_MaskGenerator { + } + /// Constant methods for [crate::objdetect::CascadeClassifier] pub trait CascadeClassifierTraitConst { fn as_raw_CascadeClassifier(&self) -> *const c_void; @@ -787,14 +853,14 @@ pub mod objdetect { fn as_raw_mut_CascadeClassifier(&mut self) -> *mut c_void; #[inline] - fn cc(&mut self) -> core::Ptr { + fn cc(&mut self) -> core::Ptr { let ret = unsafe { sys::cv_CascadeClassifier_getPropCc(self.as_raw_mut_CascadeClassifier()) }; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; ret } #[inline] - fn set_cc(&mut self, mut val: core::Ptr) { + fn set_cc(&mut self, mut val: core::Ptr) { let ret = unsafe { sys::cv_CascadeClassifier_setPropCc_PtrLBaseCascadeClassifierG(self.as_raw_mut_CascadeClassifier(), val.as_raw_mut_PtrOfBaseCascadeClassifier()) }; ret } @@ -967,7 +1033,7 @@ pub mod objdetect { } #[inline] - fn set_mask_generator(&mut self, mask_generator: &core::Ptr) -> Result<()> { + fn set_mask_generator(&mut self, mask_generator: &core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_CascadeClassifier_setMaskGenerator_const_PtrLMaskGeneratorGR(self.as_raw_mut_CascadeClassifier(), mask_generator.as_raw_PtrOfBaseCascadeClassifier_MaskGenerator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -976,12 +1042,12 @@ pub mod objdetect { } #[inline] - fn get_mask_generator(&mut self) -> Result> { + fn get_mask_generator(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_CascadeClassifier_getMaskGenerator(self.as_raw_mut_CascadeClassifier(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1184,7 +1250,7 @@ pub mod objdetect { impl DetectionBasedTracker { #[inline] - pub fn new(mut main_detector: core::Ptr, mut tracking_detector: core::Ptr, params: &crate::objdetect::DetectionBasedTracker_Parameters) -> Result { + pub fn new(mut main_detector: core::Ptr, mut tracking_detector: core::Ptr, params: &crate::objdetect::DetectionBasedTracker_Parameters) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_DetectionBasedTracker_DetectionBasedTracker_PtrLIDetectorG_PtrLIDetectorG_const_ParametersR(main_detector.as_raw_mut_PtrOfDetectionBasedTracker_IDetector(), tracking_detector.as_raw_mut_PtrOfDetectionBasedTracker_IDetector(), params.as_raw_DetectionBasedTracker_Parameters(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1293,7 +1359,7 @@ pub mod objdetect { } /// Constant methods for [crate::objdetect::DetectionBasedTracker_IDetector] - pub trait DetectionBasedTracker_IDetectorConst { + pub trait DetectionBasedTracker_IDetectorTraitConst { fn as_raw_DetectionBasedTracker_IDetector(&self) -> *const c_void; #[inline] @@ -1316,7 +1382,8 @@ pub mod objdetect { } - pub trait DetectionBasedTracker_IDetector: crate::objdetect::DetectionBasedTracker_IDetectorConst { + /// Mutable methods for [crate::objdetect::DetectionBasedTracker_IDetector] + pub trait DetectionBasedTracker_IDetectorTrait: crate::objdetect::DetectionBasedTracker_IDetectorTraitConst { fn as_raw_mut_DetectionBasedTracker_IDetector(&mut self) -> *mut c_void; #[inline] @@ -1384,6 +1451,33 @@ pub mod objdetect { } + pub struct DetectionBasedTracker_IDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { DetectionBasedTracker_IDetector } + + impl Drop for DetectionBasedTracker_IDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DetectionBasedTracker_IDetector_delete(instance: *mut c_void); } + unsafe { cv_DetectionBasedTracker_IDetector_delete(self.as_raw_mut_DetectionBasedTracker_IDetector()) }; + } + } + + unsafe impl Send for DetectionBasedTracker_IDetector {} + + impl crate::objdetect::DetectionBasedTracker_IDetectorTraitConst for DetectionBasedTracker_IDetector { + #[inline] fn as_raw_DetectionBasedTracker_IDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::objdetect::DetectionBasedTracker_IDetectorTrait for DetectionBasedTracker_IDetector { + #[inline] fn as_raw_mut_DetectionBasedTracker_IDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DetectionBasedTracker_IDetector { + } + /// Constant methods for [crate::objdetect::DetectionBasedTracker_Parameters] pub trait DetectionBasedTracker_ParametersTraitConst { fn as_raw_DetectionBasedTracker_Parameters(&self) -> *const c_void; @@ -1542,15 +1636,13 @@ pub mod objdetect { } /// Constant methods for [crate::objdetect::FaceDetectorYN] - pub trait FaceDetectorYNConst { + pub trait FaceDetectorYNTraitConst { fn as_raw_FaceDetectorYN(&self) -> *const c_void; } - /// DNN-based face detector - /// - /// model download link: - pub trait FaceDetectorYN: crate::objdetect::FaceDetectorYNConst { + /// Mutable methods for [crate::objdetect::FaceDetectorYN] + pub trait FaceDetectorYNTrait: crate::objdetect::FaceDetectorYNTraitConst { fn as_raw_mut_FaceDetectorYN(&mut self) -> *mut c_void; /// Set the size for the network input, which overwrites the input size of creating model. Call this method when the size of input image does not match the input size when creating model @@ -1659,7 +1751,34 @@ pub mod objdetect { } - impl dyn FaceDetectorYN + '_ { + /// DNN-based face detector + /// + /// model download link: + pub struct FaceDetectorYN { + ptr: *mut c_void + } + + opencv_type_boxed! { FaceDetectorYN } + + impl Drop for FaceDetectorYN { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FaceDetectorYN_delete(instance: *mut c_void); } + unsafe { cv_FaceDetectorYN_delete(self.as_raw_mut_FaceDetectorYN()) }; + } + } + + unsafe impl Send for FaceDetectorYN {} + + impl crate::objdetect::FaceDetectorYNTraitConst for FaceDetectorYN { + #[inline] fn as_raw_FaceDetectorYN(&self) -> *const c_void { self.as_raw() } + } + + impl crate::objdetect::FaceDetectorYNTrait for FaceDetectorYN { + #[inline] fn as_raw_mut_FaceDetectorYN(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FaceDetectorYN { /// Creates an instance of this class with given parameters /// /// ## Parameters @@ -1679,20 +1798,21 @@ pub mod objdetect { /// * backend_id: 0 /// * target_id: 0 #[inline] - pub fn create(model: &str, config: &str, input_size: core::Size, score_threshold: f32, nms_threshold: f32, top_k: i32, backend_id: i32, target_id: i32) -> Result> { + pub fn create(model: &str, config: &str, input_size: core::Size, score_threshold: f32, nms_threshold: f32, top_k: i32, backend_id: i32, target_id: i32) -> Result> { extern_container_arg!(model); extern_container_arg!(config); return_send!(via ocvrs_return); unsafe { sys::cv_FaceDetectorYN_create_const_StringR_const_StringR_const_SizeR_float_float_int_int_int(model.opencv_as_extern(), config.opencv_as_extern(), &input_size, score_threshold, nms_threshold, top_k, backend_id, target_id, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::objdetect::FaceRecognizerSF] - pub trait FaceRecognizerSFConst { + pub trait FaceRecognizerSFTraitConst { fn as_raw_FaceRecognizerSF(&self) -> *const c_void; /// Aligning image to put face on the standard position @@ -1733,10 +1853,8 @@ pub mod objdetect { } - /// DNN-based face recognizer - /// - /// model download link: - pub trait FaceRecognizerSF: crate::objdetect::FaceRecognizerSFConst { + /// Mutable methods for [crate::objdetect::FaceRecognizerSF] + pub trait FaceRecognizerSFTrait: crate::objdetect::FaceRecognizerSFTraitConst { fn as_raw_mut_FaceRecognizerSF(&mut self) -> *mut c_void; /// Extracting face feature from aligned image @@ -1756,7 +1874,34 @@ pub mod objdetect { } - impl dyn FaceRecognizerSF + '_ { + /// DNN-based face recognizer + /// + /// model download link: + pub struct FaceRecognizerSF { + ptr: *mut c_void + } + + opencv_type_boxed! { FaceRecognizerSF } + + impl Drop for FaceRecognizerSF { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FaceRecognizerSF_delete(instance: *mut c_void); } + unsafe { cv_FaceRecognizerSF_delete(self.as_raw_mut_FaceRecognizerSF()) }; + } + } + + unsafe impl Send for FaceRecognizerSF {} + + impl crate::objdetect::FaceRecognizerSFTraitConst for FaceRecognizerSF { + #[inline] fn as_raw_FaceRecognizerSF(&self) -> *const c_void { self.as_raw() } + } + + impl crate::objdetect::FaceRecognizerSFTrait for FaceRecognizerSF { + #[inline] fn as_raw_mut_FaceRecognizerSF(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FaceRecognizerSF { /// Creates an instance of this class with given parameters /// ## Parameters /// * model: the path of the onnx model used for face recognition @@ -1768,18 +1913,19 @@ pub mod objdetect { /// * backend_id: 0 /// * target_id: 0 #[inline] - pub fn create(model: &str, config: &str, backend_id: i32, target_id: i32) -> Result> { + pub fn create(model: &str, config: &str, backend_id: i32, target_id: i32) -> Result> { extern_container_arg!(model); extern_container_arg!(config); return_send!(via ocvrs_return); unsafe { sys::cv_FaceRecognizerSF_create_const_StringR_const_StringR_int_int(model.opencv_as_extern(), config.opencv_as_extern(), backend_id, target_id, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::objdetect::HOGDescriptor] pub trait HOGDescriptorTraitConst { fn as_raw_HOGDescriptor(&self) -> *const c_void; @@ -2748,12 +2894,13 @@ pub mod objdetect { } /// Constant methods for [crate::objdetect::QRCodeEncoder] - pub trait QRCodeEncoderConst { + pub trait QRCodeEncoderTraitConst { fn as_raw_QRCodeEncoder(&self) -> *const c_void; } - pub trait QRCodeEncoder: crate::objdetect::QRCodeEncoderConst { + /// Mutable methods for [crate::objdetect::QRCodeEncoder] + pub trait QRCodeEncoderTrait: crate::objdetect::QRCodeEncoderTraitConst { fn as_raw_mut_QRCodeEncoder(&mut self) -> *mut c_void; /// Generates QR code from input string. @@ -2788,7 +2935,31 @@ pub mod objdetect { } - impl dyn QRCodeEncoder + '_ { + pub struct QRCodeEncoder { + ptr: *mut c_void + } + + opencv_type_boxed! { QRCodeEncoder } + + impl Drop for QRCodeEncoder { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_QRCodeEncoder_delete(instance: *mut c_void); } + unsafe { cv_QRCodeEncoder_delete(self.as_raw_mut_QRCodeEncoder()) }; + } + } + + unsafe impl Send for QRCodeEncoder {} + + impl crate::objdetect::QRCodeEncoderTraitConst for QRCodeEncoder { + #[inline] fn as_raw_QRCodeEncoder(&self) -> *const c_void { self.as_raw() } + } + + impl crate::objdetect::QRCodeEncoderTrait for QRCodeEncoder { + #[inline] fn as_raw_mut_QRCodeEncoder(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl QRCodeEncoder { /// Constructor /// ## Parameters /// * parameters: QR code encoder parameters QRCodeEncoder::Params @@ -2796,16 +2967,17 @@ pub mod objdetect { /// ## C++ default parameters /// * parameters: QRCodeEncoder::Params() #[inline] - pub fn create(parameters: crate::objdetect::QRCodeEncoder_Params) -> Result> { + pub fn create(parameters: crate::objdetect::QRCodeEncoder_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_QRCodeEncoder_create_const_ParamsR(¶meters, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// QR code encoder parameters. /// ## Parameters /// * version: The optional version of QR code (by default - maximum possible depending on diff --git a/docs/optflow.rs b/docs/optflow.rs index b210bfa87..2180ec933 100644 --- a/docs/optflow.rs +++ b/docs/optflow.rs @@ -20,7 +20,7 @@ pub mod optflow { //! - cv::optflow::writeOpticalFlow use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::PCAPriorTraitConst, super::PCAPriorTrait, super::OpticalFlowPCAFlowTraitConst, super::OpticalFlowPCAFlowTrait, super::GPCPatchDescriptorTraitConst, super::GPCPatchDescriptorTrait, super::GPCPatchSampleTraitConst, super::GPCPatchSampleTrait, super::GPCTrainingSamplesTraitConst, super::GPCTrainingSamplesTrait, super::GPCTreeTraitConst, super::GPCTreeTrait, super::GPCDetailsTraitConst, super::GPCDetailsTrait, super::RLOFOpticalFlowParameterTraitConst, super::RLOFOpticalFlowParameterTrait, super::DenseRLOFOpticalFlowConst, super::DenseRLOFOpticalFlow, super::SparseRLOFOpticalFlowConst, super::SparseRLOFOpticalFlow, super::DualTVL1OpticalFlowConst, super::DualTVL1OpticalFlow }; + pub use { super::PCAPriorTraitConst, super::PCAPriorTrait, super::OpticalFlowPCAFlowTraitConst, super::OpticalFlowPCAFlowTrait, super::GPCPatchDescriptorTraitConst, super::GPCPatchDescriptorTrait, super::GPCPatchSampleTraitConst, super::GPCPatchSampleTrait, super::GPCTrainingSamplesTraitConst, super::GPCTrainingSamplesTrait, super::GPCTreeTraitConst, super::GPCTreeTrait, super::GPCDetailsTraitConst, super::GPCDetailsTrait, super::RLOFOpticalFlowParameterTraitConst, super::RLOFOpticalFlowParameterTrait, super::DenseRLOFOpticalFlowTraitConst, super::DenseRLOFOpticalFlowTrait, super::SparseRLOFOpticalFlowTraitConst, super::SparseRLOFOpticalFlowTrait, super::DualTVL1OpticalFlowTraitConst, super::DualTVL1OpticalFlowTrait }; } /// Better quality but slow @@ -492,89 +492,89 @@ pub mod optflow { /// * member float omega /// Relaxation factor in SOR #[inline] - pub fn create_opt_flow_deep_flow() -> Result> { + pub fn create_opt_flow_deep_flow() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_createOptFlow_DeepFlow(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Additional interface to the Dense RLOF algorithm - optflow::calcOpticalFlowDenseRLOF() #[inline] - pub fn create_opt_flow_dense_rlof() -> Result> { + pub fn create_opt_flow_dense_rlof() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_createOptFlow_DenseRLOF(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates instance of cv::DenseOpticalFlow #[inline] - pub fn create_opt_flow_dual_tvl1() -> Result> { + pub fn create_opt_flow_dual_tvl1() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_createOptFlow_DualTVL1(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Additional interface to the Farneback's algorithm - calcOpticalFlowFarneback() #[inline] - pub fn create_opt_flow_farneback() -> Result> { + pub fn create_opt_flow_farneback() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_createOptFlow_Farneback(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates an instance of PCAFlow #[inline] - pub fn create_opt_flow_pca_flow() -> Result> { + pub fn create_opt_flow_pca_flow() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_createOptFlow_PCAFlow(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Additional interface to the SimpleFlow algorithm - calcOpticalFlowSF() #[inline] - pub fn create_opt_flow_simple_flow() -> Result> { + pub fn create_opt_flow_simple_flow() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_createOptFlow_SimpleFlow(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Additional interface to the Sparse RLOF algorithm - optflow::calcOpticalFlowSparseRLOF() #[inline] - pub fn create_opt_flow_sparse_rlof() -> Result> { + pub fn create_opt_flow_sparse_rlof() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_createOptFlow_SparseRLOF(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Additional interface to the SparseToDenseFlow algorithm - calcOpticalFlowSparseToDense() #[inline] - pub fn create_opt_flow_sparse_to_dense() -> Result> { + pub fn create_opt_flow_sparse_to_dense() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_createOptFlow_SparseToDense(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -598,7 +598,7 @@ pub mod optflow { } /// Constant methods for [crate::optflow::DenseRLOFOpticalFlow] - pub trait DenseRLOFOpticalFlowConst: crate::video::DenseOpticalFlowConst { + pub trait DenseRLOFOpticalFlowTraitConst: crate::video::DenseOpticalFlowTraitConst { fn as_raw_DenseRLOFOpticalFlow(&self) -> *const c_void; /// Configuration of the RLOF alogrithm. @@ -782,34 +782,8 @@ pub mod optflow { } - /// Fast dense optical flow computation based on robust local optical flow (RLOF) algorithms and sparse-to-dense interpolation - /// scheme. - /// - /// The RLOF is a fast local optical flow approach described in [Senst2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2012) [Senst2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2013) [Senst2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2014) - /// and [Senst2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2016) similar to the pyramidal iterative Lucas-Kanade method as - /// proposed by [Bouguet00](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Bouguet00). More details and experiments can be found in the following thesis [Senst2019](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2019). - /// The implementation is derived from optflow::calcOpticalFlowPyrLK(). - /// - /// The sparse-to-dense interpolation scheme allows for fast computation of dense optical flow using RLOF (see [Geistert2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Geistert2016)). - /// For this scheme the following steps are applied: - /// -# motion vector seeded at a regular sampled grid are computed. The sparsity of this grid can be configured with setGridStep - /// -# (optinally) errornous motion vectors are filter based on the forward backward confidence. The threshold can be configured - /// with setForwardBackward. The filter is only applied if the threshold >0 but than the runtime is doubled due to the estimation - /// of the backward flow. - /// -# Vector field interpolation is applied to the motion vector set to obtain a dense vector field. - /// - /// For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details. - /// Parameters have been described in [Senst2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2012) [Senst2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2013) [Senst2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2014) and [Senst2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2016). - /// - /// - /// Note: If the grid size is set to (1,1) and the forward backward threshold <= 0 than pixelwise dense optical flow field is - /// computed by RLOF without using interpolation. - /// - /// - /// Note: Note that in output, if no correspondences are found between \a I0 and \a I1, the \a flow is set to 0. - /// ## See also - /// optflow::calcOpticalFlowDenseRLOF(), optflow::RLOFOpticalFlowParameter - pub trait DenseRLOFOpticalFlow: crate::optflow::DenseRLOFOpticalFlowConst + crate::video::DenseOpticalFlow { + /// Mutable methods for [crate::optflow::DenseRLOFOpticalFlow] + pub trait DenseRLOFOpticalFlowTrait: crate::optflow::DenseRLOFOpticalFlowTraitConst + crate::video::DenseOpticalFlowTrait { fn as_raw_mut_DenseRLOFOpticalFlow(&mut self) -> *mut c_void; /// Configuration of the RLOF alogrithm. @@ -990,7 +964,74 @@ pub mod optflow { } - impl dyn DenseRLOFOpticalFlow + '_ { + /// Fast dense optical flow computation based on robust local optical flow (RLOF) algorithms and sparse-to-dense interpolation + /// scheme. + /// + /// The RLOF is a fast local optical flow approach described in [Senst2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2012) [Senst2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2013) [Senst2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2014) + /// and [Senst2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2016) similar to the pyramidal iterative Lucas-Kanade method as + /// proposed by [Bouguet00](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Bouguet00). More details and experiments can be found in the following thesis [Senst2019](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2019). + /// The implementation is derived from optflow::calcOpticalFlowPyrLK(). + /// + /// The sparse-to-dense interpolation scheme allows for fast computation of dense optical flow using RLOF (see [Geistert2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Geistert2016)). + /// For this scheme the following steps are applied: + /// -# motion vector seeded at a regular sampled grid are computed. The sparsity of this grid can be configured with setGridStep + /// -# (optinally) errornous motion vectors are filter based on the forward backward confidence. The threshold can be configured + /// with setForwardBackward. The filter is only applied if the threshold >0 but than the runtime is doubled due to the estimation + /// of the backward flow. + /// -# Vector field interpolation is applied to the motion vector set to obtain a dense vector field. + /// + /// For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details. + /// Parameters have been described in [Senst2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2012) [Senst2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2013) [Senst2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2014) and [Senst2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2016). + /// + /// + /// Note: If the grid size is set to (1,1) and the forward backward threshold <= 0 than pixelwise dense optical flow field is + /// computed by RLOF without using interpolation. + /// + /// + /// Note: Note that in output, if no correspondences are found between \a I0 and \a I1, the \a flow is set to 0. + /// ## See also + /// optflow::calcOpticalFlowDenseRLOF(), optflow::RLOFOpticalFlowParameter + pub struct DenseRLOFOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { DenseRLOFOpticalFlow } + + impl Drop for DenseRLOFOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DenseRLOFOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_DenseRLOFOpticalFlow_delete(self.as_raw_mut_DenseRLOFOpticalFlow()) }; + } + } + + unsafe impl Send for DenseRLOFOpticalFlow {} + + impl core::AlgorithmTraitConst for DenseRLOFOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DenseRLOFOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::DenseOpticalFlowTraitConst for DenseRLOFOpticalFlow { + #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::DenseOpticalFlowTrait for DenseRLOFOpticalFlow { + #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::optflow::DenseRLOFOpticalFlowTraitConst for DenseRLOFOpticalFlow { + #[inline] fn as_raw_DenseRLOFOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::optflow::DenseRLOFOpticalFlowTrait for DenseRLOFOpticalFlow { + #[inline] fn as_raw_mut_DenseRLOFOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DenseRLOFOpticalFlow { /// Creates instance of optflow::DenseRLOFOpticalFlow /// /// ## Parameters @@ -1023,18 +1064,21 @@ pub mod optflow { /// * fgs_sigma: 1.5f /// * use_variational_refinement: false #[inline] - pub fn create(mut rlof_param: core::Ptr, forward_backward_threshold: f32, grid_step: core::Size, interp_type: crate::optflow::InterpolationType, epic_k: i32, epic_sigma: f32, epic_lambda: f32, ric_sp_size: i32, ric_slic_type: i32, use_post_proc: bool, fgs_lambda: f32, fgs_sigma: f32, use_variational_refinement: bool) -> Result> { + pub fn create(mut rlof_param: core::Ptr, forward_backward_threshold: f32, grid_step: core::Size, interp_type: crate::optflow::InterpolationType, epic_k: i32, epic_sigma: f32, epic_lambda: f32, ric_sp_size: i32, ric_slic_type: i32, use_post_proc: bool, fgs_lambda: f32, fgs_sigma: f32, use_variational_refinement: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_DenseRLOFOpticalFlow_create_PtrLRLOFOpticalFlowParameterG_float_Size_InterpolationType_int_float_float_int_int_bool_float_float_bool(rlof_param.as_raw_mut_PtrOfRLOFOpticalFlowParameter(), forward_backward_threshold, grid_step.opencv_as_extern(), interp_type, epic_k, epic_sigma, epic_lambda, ric_sp_size, ric_slic_type, use_post_proc, fgs_lambda, fgs_sigma, use_variational_refinement, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { DenseRLOFOpticalFlow, core::Algorithm, cv_DenseRLOFOpticalFlow_to_Algorithm } + /// Constant methods for [crate::optflow::DualTVL1OpticalFlow] - pub trait DualTVL1OpticalFlowConst: crate::video::DenseOpticalFlowConst { + pub trait DualTVL1OpticalFlowTraitConst: crate::video::DenseOpticalFlowTraitConst { fn as_raw_DualTVL1OpticalFlow(&self) -> *const c_void; /// Time step of the numerical scheme @@ -1183,48 +1227,8 @@ pub mod optflow { } - /// "Dual TV L1" Optical Flow Algorithm. - /// - /// The class implements the "Dual TV L1" optical flow algorithm described in [Zach2007](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zach2007) and - /// [Javier2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Javier2012) . - /// Here are important members of the class that control the algorithm, which you can set after - /// constructing the class instance: - /// - /// * member double tau - /// Time step of the numerical scheme. - /// - /// * member double lambda - /// Weight parameter for the data term, attachment parameter. This is the most relevant - /// parameter, which determines the smoothness of the output. The smaller this parameter is, - /// the smoother the solutions we obtain. It depends on the range of motions of the images, so - /// its value should be adapted to each image sequence. - /// - /// * member double theta - /// Weight parameter for (u - v)\^2, tightness parameter. It serves as a link between the - /// attachment and the regularization terms. In theory, it should have a small value in order - /// to maintain both parts in correspondence. The method is stable for a large range of values - /// of this parameter. - /// - /// * member int nscales - /// Number of scales used to create the pyramid of images. - /// - /// * member int warps - /// Number of warpings per scale. Represents the number of times that I1(x+u0) and grad( - /// I1(x+u0) ) are computed per scale. This is a parameter that assures the stability of the - /// method. It also affects the running time, so it is a compromise between speed and - /// accuracy. - /// - /// * member double epsilon - /// Stopping criterion threshold used in the numerical scheme, which is a trade-off between - /// precision and running time. A small value will yield more accurate solutions at the - /// expense of a slower convergence. - /// - /// * member int iterations - /// Stopping criterion iterations number used in the numerical scheme. - /// - /// C. Zach, T. Pock and H. Bischof, "A Duality Based Approach for Realtime TV-L1 Optical Flow". - /// Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. "TV-L1 Optical Flow Estimation". - pub trait DualTVL1OpticalFlow: crate::optflow::DualTVL1OpticalFlowConst + crate::video::DenseOpticalFlow { + /// Mutable methods for [crate::optflow::DualTVL1OpticalFlow] + pub trait DualTVL1OpticalFlowTrait: crate::optflow::DualTVL1OpticalFlowTraitConst + crate::video::DenseOpticalFlowTrait { fn as_raw_mut_DualTVL1OpticalFlow(&mut self) -> *mut c_void; /// Time step of the numerical scheme @@ -1373,7 +1377,88 @@ pub mod optflow { } - impl dyn DualTVL1OpticalFlow + '_ { + /// "Dual TV L1" Optical Flow Algorithm. + /// + /// The class implements the "Dual TV L1" optical flow algorithm described in [Zach2007](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zach2007) and + /// [Javier2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Javier2012) . + /// Here are important members of the class that control the algorithm, which you can set after + /// constructing the class instance: + /// + /// * member double tau + /// Time step of the numerical scheme. + /// + /// * member double lambda + /// Weight parameter for the data term, attachment parameter. This is the most relevant + /// parameter, which determines the smoothness of the output. The smaller this parameter is, + /// the smoother the solutions we obtain. It depends on the range of motions of the images, so + /// its value should be adapted to each image sequence. + /// + /// * member double theta + /// Weight parameter for (u - v)\^2, tightness parameter. It serves as a link between the + /// attachment and the regularization terms. In theory, it should have a small value in order + /// to maintain both parts in correspondence. The method is stable for a large range of values + /// of this parameter. + /// + /// * member int nscales + /// Number of scales used to create the pyramid of images. + /// + /// * member int warps + /// Number of warpings per scale. Represents the number of times that I1(x+u0) and grad( + /// I1(x+u0) ) are computed per scale. This is a parameter that assures the stability of the + /// method. It also affects the running time, so it is a compromise between speed and + /// accuracy. + /// + /// * member double epsilon + /// Stopping criterion threshold used in the numerical scheme, which is a trade-off between + /// precision and running time. A small value will yield more accurate solutions at the + /// expense of a slower convergence. + /// + /// * member int iterations + /// Stopping criterion iterations number used in the numerical scheme. + /// + /// C. Zach, T. Pock and H. Bischof, "A Duality Based Approach for Realtime TV-L1 Optical Flow". + /// Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. "TV-L1 Optical Flow Estimation". + pub struct DualTVL1OpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { DualTVL1OpticalFlow } + + impl Drop for DualTVL1OpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DualTVL1OpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_DualTVL1OpticalFlow_delete(self.as_raw_mut_DualTVL1OpticalFlow()) }; + } + } + + unsafe impl Send for DualTVL1OpticalFlow {} + + impl core::AlgorithmTraitConst for DualTVL1OpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DualTVL1OpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::DenseOpticalFlowTraitConst for DualTVL1OpticalFlow { + #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::DenseOpticalFlowTrait for DualTVL1OpticalFlow { + #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::optflow::DualTVL1OpticalFlowTraitConst for DualTVL1OpticalFlow { + #[inline] fn as_raw_DualTVL1OpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::optflow::DualTVL1OpticalFlowTrait for DualTVL1OpticalFlow { + #[inline] fn as_raw_mut_DualTVL1OpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DualTVL1OpticalFlow { /// Creates instance of cv::DualTVL1OpticalFlow /// /// ## C++ default parameters @@ -1390,16 +1475,19 @@ pub mod optflow { /// * median_filtering: 5 /// * use_initial_flow: false #[inline] - pub fn create(tau: f64, lambda: f64, theta: f64, nscales: i32, warps: i32, epsilon: f64, innner_iterations: i32, outer_iterations: i32, scale_step: f64, gamma: f64, median_filtering: i32, use_initial_flow: bool) -> Result> { + pub fn create(tau: f64, lambda: f64, theta: f64, nscales: i32, warps: i32, epsilon: f64, innner_iterations: i32, outer_iterations: i32, scale_step: f64, gamma: f64, median_filtering: i32, use_initial_flow: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_DualTVL1OpticalFlow_create_double_double_double_int_int_double_int_int_double_double_int_bool(tau, lambda, theta, nscales, warps, epsilon, innner_iterations, outer_iterations, scale_step, gamma, median_filtering, use_initial_flow, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { DualTVL1OpticalFlow, core::Algorithm, cv_DualTVL1OpticalFlow_to_Algorithm } + /// Constant methods for [crate::optflow::GPCDetails] pub trait GPCDetailsTraitConst { fn as_raw_GPCDetails(&self) -> *const c_void; @@ -1935,13 +2023,13 @@ pub mod optflow { } /// Constant methods for [crate::optflow::OpticalFlowPCAFlow] - pub trait OpticalFlowPCAFlowTraitConst: crate::video::DenseOpticalFlowConst { + pub trait OpticalFlowPCAFlowTraitConst: crate::video::DenseOpticalFlowTraitConst { fn as_raw_OpticalFlowPCAFlow(&self) -> *const c_void; } /// Mutable methods for [crate::optflow::OpticalFlowPCAFlow] - pub trait OpticalFlowPCAFlowTrait: crate::optflow::OpticalFlowPCAFlowTraitConst + crate::video::DenseOpticalFlow { + pub trait OpticalFlowPCAFlowTrait: crate::optflow::OpticalFlowPCAFlowTraitConst + crate::video::DenseOpticalFlowTrait { fn as_raw_mut_OpticalFlowPCAFlow(&mut self) -> *mut c_void; #[inline] @@ -1992,11 +2080,11 @@ pub mod optflow { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::video::DenseOpticalFlowConst for OpticalFlowPCAFlow { + impl crate::video::DenseOpticalFlowTraitConst for OpticalFlowPCAFlow { #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } } - impl crate::video::DenseOpticalFlow for OpticalFlowPCAFlow { + impl crate::video::DenseOpticalFlowTrait for OpticalFlowPCAFlow { #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2648,7 +2736,7 @@ pub mod optflow { } /// Constant methods for [crate::optflow::SparseRLOFOpticalFlow] - pub trait SparseRLOFOpticalFlowConst: crate::video::SparseOpticalFlowConst { + pub trait SparseRLOFOpticalFlowTraitConst: crate::video::SparseOpticalFlowTraitConst { fn as_raw_SparseRLOFOpticalFlow(&self) -> *const c_void; /// @copydoc DenseRLOFOpticalFlow::setRLOFOpticalFlowParameter @@ -2683,21 +2771,8 @@ pub mod optflow { } - /// Class used for calculation sparse optical flow and feature tracking with robust local optical flow (RLOF) algorithms. - /// - /// The RLOF is a fast local optical flow approach described in [Senst2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2012) [Senst2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2013) [Senst2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2014) - /// and [Senst2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2016) similar to the pyramidal iterative Lucas-Kanade method as - /// proposed by [Bouguet00](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Bouguet00). More details and experiments can be found in the following thesis [Senst2019](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2019). - /// The implementation is derived from optflow::calcOpticalFlowPyrLK(). - /// - /// For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details. - /// Parameters have been described in [Senst2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2012), [Senst2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2013), [Senst2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2014) and [Senst2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2016). - /// - /// - /// Note: SIMD parallelization is only available when compiling with SSE4.1. - /// ## See also - /// optflow::calcOpticalFlowSparseRLOF(), optflow::RLOFOpticalFlowParameter - pub trait SparseRLOFOpticalFlow: crate::optflow::SparseRLOFOpticalFlowConst + crate::video::SparseOpticalFlow { + /// Mutable methods for [crate::optflow::SparseRLOFOpticalFlow] + pub trait SparseRLOFOpticalFlowTrait: crate::optflow::SparseRLOFOpticalFlowTraitConst + crate::video::SparseOpticalFlowTrait { fn as_raw_mut_SparseRLOFOpticalFlow(&mut self) -> *mut c_void; /// @copydoc DenseRLOFOpticalFlow::setRLOFOpticalFlowParameter @@ -2728,7 +2803,61 @@ pub mod optflow { } - impl dyn SparseRLOFOpticalFlow + '_ { + /// Class used for calculation sparse optical flow and feature tracking with robust local optical flow (RLOF) algorithms. + /// + /// The RLOF is a fast local optical flow approach described in [Senst2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2012) [Senst2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2013) [Senst2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2014) + /// and [Senst2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2016) similar to the pyramidal iterative Lucas-Kanade method as + /// proposed by [Bouguet00](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Bouguet00). More details and experiments can be found in the following thesis [Senst2019](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2019). + /// The implementation is derived from optflow::calcOpticalFlowPyrLK(). + /// + /// For the RLOF configuration see optflow::RLOFOpticalFlowParameter for further details. + /// Parameters have been described in [Senst2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2012), [Senst2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2013), [Senst2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2014) and [Senst2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Senst2016). + /// + /// + /// Note: SIMD parallelization is only available when compiling with SSE4.1. + /// ## See also + /// optflow::calcOpticalFlowSparseRLOF(), optflow::RLOFOpticalFlowParameter + pub struct SparseRLOFOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { SparseRLOFOpticalFlow } + + impl Drop for SparseRLOFOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SparseRLOFOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_SparseRLOFOpticalFlow_delete(self.as_raw_mut_SparseRLOFOpticalFlow()) }; + } + } + + unsafe impl Send for SparseRLOFOpticalFlow {} + + impl core::AlgorithmTraitConst for SparseRLOFOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SparseRLOFOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::SparseOpticalFlowTraitConst for SparseRLOFOpticalFlow { + #[inline] fn as_raw_SparseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::SparseOpticalFlowTrait for SparseRLOFOpticalFlow { + #[inline] fn as_raw_mut_SparseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::optflow::SparseRLOFOpticalFlowTraitConst for SparseRLOFOpticalFlow { + #[inline] fn as_raw_SparseRLOFOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::optflow::SparseRLOFOpticalFlowTrait for SparseRLOFOpticalFlow { + #[inline] fn as_raw_mut_SparseRLOFOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SparseRLOFOpticalFlow { /// Creates instance of SparseRLOFOpticalFlow /// /// ## Parameters @@ -2739,13 +2868,16 @@ pub mod optflow { /// * rlof_param: Ptr() /// * forward_backward_threshold: 1.f #[inline] - pub fn create(mut rlof_param: core::Ptr, forward_backward_threshold: f32) -> Result> { + pub fn create(mut rlof_param: core::Ptr, forward_backward_threshold: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_optflow_SparseRLOFOpticalFlow_create_PtrLRLOFOpticalFlowParameterG_float(rlof_param.as_raw_mut_PtrOfRLOFOpticalFlowParameter(), forward_backward_threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { SparseRLOFOpticalFlow, core::Algorithm, cv_SparseRLOFOpticalFlow_to_Algorithm } +} diff --git a/docs/ovis.rs b/docs/ovis.rs index 963861d4e..8a20cc840 100644 --- a/docs/ovis.rs +++ b/docs/ovis.rs @@ -27,7 +27,7 @@ pub mod ovis { //! You should still use ogre-meshviewer to verify that the geometry is converted correctly. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::WindowSceneConst, super::WindowScene }; + pub use { super::WindowSceneTraitConst, super::WindowSceneTrait }; } pub const ENTITY_AABB_WORLD: i32 = 2; @@ -224,13 +224,13 @@ pub mod ovis { /// ## C++ default parameters /// * flags: SCENE_INTERACTIVE|SCENE_AA #[inline] - pub fn create_window(title: &str, size: core::Size, flags: i32) -> Result> { + pub fn create_window(title: &str, size: core::Size, flags: i32) -> Result> { extern_container_arg!(title); return_send!(via ocvrs_return); unsafe { sys::cv_ovis_createWindow_const_StringR_const_SizeR_int(title.opencv_as_extern(), &size, flags, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -333,13 +333,13 @@ pub mod ovis { } /// Constant methods for [crate::ovis::WindowScene] - pub trait WindowSceneConst { + pub trait WindowSceneTraitConst { fn as_raw_WindowScene(&self) -> *const c_void; } - /// A 3D viewport and the associated scene - pub trait WindowScene: crate::ovis::WindowSceneConst { + /// Mutable methods for [crate::ovis::WindowScene] + pub trait WindowSceneTrait: crate::ovis::WindowSceneTraitConst { fn as_raw_mut_WindowScene(&mut self) -> *mut c_void; /// set window background to custom image/ color @@ -832,4 +832,32 @@ pub mod ovis { } } + + /// A 3D viewport and the associated scene + pub struct WindowScene { + ptr: *mut c_void + } + + opencv_type_boxed! { WindowScene } + + impl Drop for WindowScene { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_WindowScene_delete(instance: *mut c_void); } + unsafe { cv_WindowScene_delete(self.as_raw_mut_WindowScene()) }; + } + } + + unsafe impl Send for WindowScene {} + + impl crate::ovis::WindowSceneTraitConst for WindowScene { + #[inline] fn as_raw_WindowScene(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ovis::WindowSceneTrait for WindowScene { + #[inline] fn as_raw_mut_WindowScene(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl WindowScene { + } } diff --git a/docs/phase_unwrapping.rs b/docs/phase_unwrapping.rs index c10f92ff5..613de5d30 100644 --- a/docs/phase_unwrapping.rs +++ b/docs/phase_unwrapping.rs @@ -16,26 +16,17 @@ pub mod phase_unwrapping { //! In this module, a quality-guided phase unwrapping is implemented following the approach described in [histogramUnwrapping](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_histogramUnwrapping) . use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::PhaseUnwrappingConst, super::PhaseUnwrapping, super::HistogramPhaseUnwrappingConst, super::HistogramPhaseUnwrapping }; + pub use { super::PhaseUnwrappingTraitConst, super::PhaseUnwrappingTrait, super::HistogramPhaseUnwrappingTraitConst, super::HistogramPhaseUnwrappingTrait }; } /// Constant methods for [crate::phase_unwrapping::HistogramPhaseUnwrapping] - pub trait HistogramPhaseUnwrappingConst: crate::phase_unwrapping::PhaseUnwrappingConst { + pub trait HistogramPhaseUnwrappingTraitConst: crate::phase_unwrapping::PhaseUnwrappingTraitConst { fn as_raw_HistogramPhaseUnwrapping(&self) -> *const c_void; } - /// Class implementing two-dimensional phase unwrapping based on [histogramUnwrapping](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_histogramUnwrapping) - /// This algorithm belongs to the quality-guided phase unwrapping methods. - /// First, it computes a reliability map from second differences between a pixel and its eight neighbours. - /// Reliability values lie between 0 and 16*pi*pi. Then, this reliability map is used to compute - /// the reliabilities of "edges". An edge is an entity defined by two pixels that are connected - /// horizontally or vertically. Its reliability is found by adding the the reliabilities of the - /// two pixels connected through it. Edges are sorted in a histogram based on their reliability values. - /// This histogram is then used to unwrap pixels, starting from the highest quality pixel. - /// - /// The wrapped phase map and the unwrapped result are stored in CV_32FC1 Mat. - pub trait HistogramPhaseUnwrapping: crate::phase_unwrapping::HistogramPhaseUnwrappingConst + crate::phase_unwrapping::PhaseUnwrapping { + /// Mutable methods for [crate::phase_unwrapping::HistogramPhaseUnwrapping] + pub trait HistogramPhaseUnwrappingTrait: crate::phase_unwrapping::HistogramPhaseUnwrappingTraitConst + crate::phase_unwrapping::PhaseUnwrappingTrait { fn as_raw_mut_HistogramPhaseUnwrapping(&mut self) -> *mut c_void; /// Get the reliability map computed from the wrapped phase map. @@ -54,7 +45,57 @@ pub mod phase_unwrapping { } - impl dyn HistogramPhaseUnwrapping + '_ { + /// Class implementing two-dimensional phase unwrapping based on [histogramUnwrapping](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_histogramUnwrapping) + /// This algorithm belongs to the quality-guided phase unwrapping methods. + /// First, it computes a reliability map from second differences between a pixel and its eight neighbours. + /// Reliability values lie between 0 and 16*pi*pi. Then, this reliability map is used to compute + /// the reliabilities of "edges". An edge is an entity defined by two pixels that are connected + /// horizontally or vertically. Its reliability is found by adding the the reliabilities of the + /// two pixels connected through it. Edges are sorted in a histogram based on their reliability values. + /// This histogram is then used to unwrap pixels, starting from the highest quality pixel. + /// + /// The wrapped phase map and the unwrapped result are stored in CV_32FC1 Mat. + pub struct HistogramPhaseUnwrapping { + ptr: *mut c_void + } + + opencv_type_boxed! { HistogramPhaseUnwrapping } + + impl Drop for HistogramPhaseUnwrapping { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_HistogramPhaseUnwrapping_delete(instance: *mut c_void); } + unsafe { cv_HistogramPhaseUnwrapping_delete(self.as_raw_mut_HistogramPhaseUnwrapping()) }; + } + } + + unsafe impl Send for HistogramPhaseUnwrapping {} + + impl core::AlgorithmTraitConst for HistogramPhaseUnwrapping { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for HistogramPhaseUnwrapping { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::phase_unwrapping::PhaseUnwrappingTraitConst for HistogramPhaseUnwrapping { + #[inline] fn as_raw_PhaseUnwrapping(&self) -> *const c_void { self.as_raw() } + } + + impl crate::phase_unwrapping::PhaseUnwrappingTrait for HistogramPhaseUnwrapping { + #[inline] fn as_raw_mut_PhaseUnwrapping(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::phase_unwrapping::HistogramPhaseUnwrappingTraitConst for HistogramPhaseUnwrapping { + #[inline] fn as_raw_HistogramPhaseUnwrapping(&self) -> *const c_void { self.as_raw() } + } + + impl crate::phase_unwrapping::HistogramPhaseUnwrappingTrait for HistogramPhaseUnwrapping { + #[inline] fn as_raw_mut_HistogramPhaseUnwrapping(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl HistogramPhaseUnwrapping { /// Constructor /// /// ## Parameters @@ -63,16 +104,19 @@ pub mod phase_unwrapping { /// ## C++ default parameters /// * parameters: HistogramPhaseUnwrapping::Params() #[inline] - pub fn create(parameters: crate::phase_unwrapping::HistogramPhaseUnwrapping_Params) -> Result> { + pub fn create(parameters: crate::phase_unwrapping::HistogramPhaseUnwrapping_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_phase_unwrapping_HistogramPhaseUnwrapping_create_const_ParamsR(¶meters, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { HistogramPhaseUnwrapping, core::Algorithm, cv_HistogramPhaseUnwrapping_to_Algorithm } + /// Parameters of phaseUnwrapping constructor. /// /// ## Parameters @@ -106,13 +150,13 @@ pub mod phase_unwrapping { } /// Constant methods for [crate::phase_unwrapping::PhaseUnwrapping] - pub trait PhaseUnwrappingConst: core::AlgorithmTraitConst { + pub trait PhaseUnwrappingTraitConst: core::AlgorithmTraitConst { fn as_raw_PhaseUnwrapping(&self) -> *const c_void; } - /// Abstract base class for phase unwrapping. - pub trait PhaseUnwrapping: core::AlgorithmTrait + crate::phase_unwrapping::PhaseUnwrappingConst { + /// Mutable methods for [crate::phase_unwrapping::PhaseUnwrapping] + pub trait PhaseUnwrappingTrait: core::AlgorithmTrait + crate::phase_unwrapping::PhaseUnwrappingTraitConst { fn as_raw_mut_PhaseUnwrapping(&mut self) -> *mut c_void; /// Unwraps a 2D phase map. @@ -137,4 +181,42 @@ pub mod phase_unwrapping { } } + + /// Abstract base class for phase unwrapping. + pub struct PhaseUnwrapping { + ptr: *mut c_void + } + + opencv_type_boxed! { PhaseUnwrapping } + + impl Drop for PhaseUnwrapping { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_PhaseUnwrapping_delete(instance: *mut c_void); } + unsafe { cv_PhaseUnwrapping_delete(self.as_raw_mut_PhaseUnwrapping()) }; + } + } + + unsafe impl Send for PhaseUnwrapping {} + + impl core::AlgorithmTraitConst for PhaseUnwrapping { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for PhaseUnwrapping { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::phase_unwrapping::PhaseUnwrappingTraitConst for PhaseUnwrapping { + #[inline] fn as_raw_PhaseUnwrapping(&self) -> *const c_void { self.as_raw() } + } + + impl crate::phase_unwrapping::PhaseUnwrappingTrait for PhaseUnwrapping { + #[inline] fn as_raw_mut_PhaseUnwrapping(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl PhaseUnwrapping { + } + + boxed_cast_base! { PhaseUnwrapping, core::Algorithm, cv_PhaseUnwrapping_to_Algorithm } } diff --git a/docs/photo.rs b/docs/photo.rs index b7443d1f9..7c1443230 100644 --- a/docs/photo.rs +++ b/docs/photo.rs @@ -32,7 +32,7 @@ pub mod photo { //! # C API use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::TonemapConst, super::Tonemap, super::TonemapDragoConst, super::TonemapDrago, super::TonemapReinhardConst, super::TonemapReinhard, super::TonemapMantiukConst, super::TonemapMantiuk, super::AlignExposuresConst, super::AlignExposures, super::AlignMTBConst, super::AlignMTB, super::CalibrateCRFConst, super::CalibrateCRF, super::CalibrateDebevecConst, super::CalibrateDebevec, super::CalibrateRobertsonConst, super::CalibrateRobertson, super::MergeExposuresConst, super::MergeExposures, super::MergeDebevecConst, super::MergeDebevec, super::MergeMertensConst, super::MergeMertens, super::MergeRobertsonConst, super::MergeRobertson }; + pub use { super::TonemapTraitConst, super::TonemapTrait, super::TonemapDragoTraitConst, super::TonemapDragoTrait, super::TonemapReinhardTraitConst, super::TonemapReinhardTrait, super::TonemapMantiukTraitConst, super::TonemapMantiukTrait, super::AlignExposuresTraitConst, super::AlignExposuresTrait, super::AlignMTBTraitConst, super::AlignMTBTrait, super::CalibrateCRFTraitConst, super::CalibrateCRFTrait, super::CalibrateDebevecTraitConst, super::CalibrateDebevecTrait, super::CalibrateRobertsonTraitConst, super::CalibrateRobertsonTrait, super::MergeExposuresTraitConst, super::MergeExposuresTrait, super::MergeDebevecTraitConst, super::MergeDebevecTrait, super::MergeMertensTraitConst, super::MergeMertensTrait, super::MergeRobertsonTraitConst, super::MergeRobertsonTrait }; } /// Use Navier-Stokes based method @@ -94,12 +94,12 @@ pub mod photo { /// * exclude_range: 4 /// * cut: true #[inline] - pub fn create_align_mtb(max_bits: i32, exclude_range: i32, cut: bool) -> Result> { + pub fn create_align_mtb(max_bits: i32, exclude_range: i32, cut: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createAlignMTB_int_int_bool(max_bits, exclude_range, cut, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -117,12 +117,12 @@ pub mod photo { /// * lambda: 10.0f /// * random: false #[inline] - pub fn create_calibrate_debevec(samples: i32, lambda: f32, random: bool) -> Result> { + pub fn create_calibrate_debevec(samples: i32, lambda: f32, random: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createCalibrateDebevec_int_float_bool(samples, lambda, random, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -136,23 +136,23 @@ pub mod photo { /// * max_iter: 30 /// * threshold: 0.01f #[inline] - pub fn create_calibrate_robertson(max_iter: i32, threshold: f32) -> Result> { + pub fn create_calibrate_robertson(max_iter: i32, threshold: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createCalibrateRobertson_int_float(max_iter, threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates MergeDebevec object #[inline] - pub fn create_merge_debevec() -> Result> { + pub fn create_merge_debevec() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createMergeDebevec(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -168,23 +168,23 @@ pub mod photo { /// * saturation_weight: 1.0f /// * exposure_weight: 0.0f #[inline] - pub fn create_merge_mertens(contrast_weight: f32, saturation_weight: f32, exposure_weight: f32) -> Result> { + pub fn create_merge_mertens(contrast_weight: f32, saturation_weight: f32, exposure_weight: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createMergeMertens_float_float_float(contrast_weight, saturation_weight, exposure_weight, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates MergeRobertson object #[inline] - pub fn create_merge_robertson() -> Result> { + pub fn create_merge_robertson() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createMergeRobertson(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -202,12 +202,12 @@ pub mod photo { /// * saturation: 1.0f /// * bias: 0.85f #[inline] - pub fn create_tonemap_drago(gamma: f32, saturation: f32, bias: f32) -> Result> { + pub fn create_tonemap_drago(gamma: f32, saturation: f32, bias: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createTonemapDrago_float_float_float(gamma, saturation, bias, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -224,12 +224,12 @@ pub mod photo { /// * scale: 0.7f /// * saturation: 1.0f #[inline] - pub fn create_tonemap_mantiuk(gamma: f32, scale: f32, saturation: f32) -> Result> { + pub fn create_tonemap_mantiuk(gamma: f32, scale: f32, saturation: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createTonemapMantiuk_float_float_float(gamma, scale, saturation, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -249,12 +249,12 @@ pub mod photo { /// * light_adapt: 1.0f /// * color_adapt: 0.0f #[inline] - pub fn create_tonemap_reinhard(gamma: f32, intensity: f32, light_adapt: f32, color_adapt: f32) -> Result> { + pub fn create_tonemap_reinhard(gamma: f32, intensity: f32, light_adapt: f32, color_adapt: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createTonemapReinhard_float_float_float_float(gamma, intensity, light_adapt, color_adapt, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -268,12 +268,12 @@ pub mod photo { /// ## C++ default parameters /// * gamma: 1.0f #[inline] - pub fn create_tonemap(gamma: f32) -> Result> { + pub fn create_tonemap(gamma: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createTonemap_float(gamma, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -945,13 +945,13 @@ pub mod photo { } /// Constant methods for [crate::photo::AlignExposures] - pub trait AlignExposuresConst: core::AlgorithmTraitConst { + pub trait AlignExposuresTraitConst: core::AlgorithmTraitConst { fn as_raw_AlignExposures(&self) -> *const c_void; } - /// The base class for algorithms that align images of the same scene with different exposures - pub trait AlignExposures: core::AlgorithmTrait + crate::photo::AlignExposuresConst { + /// Mutable methods for [crate::photo::AlignExposures] + pub trait AlignExposuresTrait: core::AlgorithmTrait + crate::photo::AlignExposuresTraitConst { fn as_raw_mut_AlignExposures(&mut self) -> *mut c_void; /// Aligns images @@ -976,8 +976,46 @@ pub mod photo { } + /// The base class for algorithms that align images of the same scene with different exposures + pub struct AlignExposures { + ptr: *mut c_void + } + + opencv_type_boxed! { AlignExposures } + + impl Drop for AlignExposures { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_AlignExposures_delete(instance: *mut c_void); } + unsafe { cv_AlignExposures_delete(self.as_raw_mut_AlignExposures()) }; + } + } + + unsafe impl Send for AlignExposures {} + + impl core::AlgorithmTraitConst for AlignExposures { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for AlignExposures { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::AlignExposuresTraitConst for AlignExposures { + #[inline] fn as_raw_AlignExposures(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::AlignExposuresTrait for AlignExposures { + #[inline] fn as_raw_mut_AlignExposures(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl AlignExposures { + } + + boxed_cast_base! { AlignExposures, core::Algorithm, cv_AlignExposures_to_Algorithm } + /// Constant methods for [crate::photo::AlignMTB] - pub trait AlignMTBConst: crate::photo::AlignExposuresConst { + pub trait AlignMTBTraitConst: crate::photo::AlignExposuresTraitConst { fn as_raw_AlignMTB(&self) -> *const c_void; #[inline] @@ -1009,15 +1047,8 @@ pub mod photo { } - /// This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median - /// luminance and 0 otherwise) and than aligns the resulting bitmaps using bit operations. - /// - /// It is invariant to exposure, so exposure values and camera response are not necessary. - /// - /// In this implementation new image regions are filled with zeros. - /// - /// For more information see [GW03](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_GW03) . - pub trait AlignMTB: crate::photo::AlignExposures + crate::photo::AlignMTBConst { + /// Mutable methods for [crate::photo::AlignMTB] + pub trait AlignMTBTrait: crate::photo::AlignExposuresTrait + crate::photo::AlignMTBTraitConst { fn as_raw_mut_AlignMTB(&mut self) -> *mut c_void; #[inline] @@ -1128,14 +1159,67 @@ pub mod photo { } + /// This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median + /// luminance and 0 otherwise) and than aligns the resulting bitmaps using bit operations. + /// + /// It is invariant to exposure, so exposure values and camera response are not necessary. + /// + /// In this implementation new image regions are filled with zeros. + /// + /// For more information see [GW03](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_GW03) . + pub struct AlignMTB { + ptr: *mut c_void + } + + opencv_type_boxed! { AlignMTB } + + impl Drop for AlignMTB { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_AlignMTB_delete(instance: *mut c_void); } + unsafe { cv_AlignMTB_delete(self.as_raw_mut_AlignMTB()) }; + } + } + + unsafe impl Send for AlignMTB {} + + impl core::AlgorithmTraitConst for AlignMTB { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for AlignMTB { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::AlignExposuresTraitConst for AlignMTB { + #[inline] fn as_raw_AlignExposures(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::AlignExposuresTrait for AlignMTB { + #[inline] fn as_raw_mut_AlignExposures(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::AlignMTBTraitConst for AlignMTB { + #[inline] fn as_raw_AlignMTB(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::AlignMTBTrait for AlignMTB { + #[inline] fn as_raw_mut_AlignMTB(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl AlignMTB { + } + + boxed_cast_base! { AlignMTB, core::Algorithm, cv_AlignMTB_to_Algorithm } + /// Constant methods for [crate::photo::CalibrateCRF] - pub trait CalibrateCRFConst: core::AlgorithmTraitConst { + pub trait CalibrateCRFTraitConst: core::AlgorithmTraitConst { fn as_raw_CalibrateCRF(&self) -> *const c_void; } - /// The base class for camera response calibration algorithms. - pub trait CalibrateCRF: core::AlgorithmTrait + crate::photo::CalibrateCRFConst { + /// Mutable methods for [crate::photo::CalibrateCRF] + pub trait CalibrateCRFTrait: core::AlgorithmTrait + crate::photo::CalibrateCRFTraitConst { fn as_raw_mut_CalibrateCRF(&mut self) -> *mut c_void; /// Recovers inverse camera response. @@ -1158,8 +1242,46 @@ pub mod photo { } + /// The base class for camera response calibration algorithms. + pub struct CalibrateCRF { + ptr: *mut c_void + } + + opencv_type_boxed! { CalibrateCRF } + + impl Drop for CalibrateCRF { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CalibrateCRF_delete(instance: *mut c_void); } + unsafe { cv_CalibrateCRF_delete(self.as_raw_mut_CalibrateCRF()) }; + } + } + + unsafe impl Send for CalibrateCRF {} + + impl core::AlgorithmTraitConst for CalibrateCRF { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CalibrateCRF { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::CalibrateCRFTraitConst for CalibrateCRF { + #[inline] fn as_raw_CalibrateCRF(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::CalibrateCRFTrait for CalibrateCRF { + #[inline] fn as_raw_mut_CalibrateCRF(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CalibrateCRF { + } + + boxed_cast_base! { CalibrateCRF, core::Algorithm, cv_CalibrateCRF_to_Algorithm } + /// Constant methods for [crate::photo::CalibrateDebevec] - pub trait CalibrateDebevecConst: crate::photo::CalibrateCRFConst { + pub trait CalibrateDebevecTraitConst: crate::photo::CalibrateCRFTraitConst { fn as_raw_CalibrateDebevec(&self) -> *const c_void; #[inline] @@ -1191,12 +1313,8 @@ pub mod photo { } - /// Inverse camera response function is extracted for each brightness value by minimizing an objective - /// function as linear system. Objective function is constructed using pixel values on the same position - /// in all images, extra term is added to make the result smoother. - /// - /// For more information see [DM97](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_DM97) . - pub trait CalibrateDebevec: crate::photo::CalibrateCRF + crate::photo::CalibrateDebevecConst { + /// Mutable methods for [crate::photo::CalibrateDebevec] + pub trait CalibrateDebevecTrait: crate::photo::CalibrateCRFTrait + crate::photo::CalibrateDebevecTraitConst { fn as_raw_mut_CalibrateDebevec(&mut self) -> *mut c_void; #[inline] @@ -1228,8 +1346,58 @@ pub mod photo { } + /// Inverse camera response function is extracted for each brightness value by minimizing an objective + /// function as linear system. Objective function is constructed using pixel values on the same position + /// in all images, extra term is added to make the result smoother. + /// + /// For more information see [DM97](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_DM97) . + pub struct CalibrateDebevec { + ptr: *mut c_void + } + + opencv_type_boxed! { CalibrateDebevec } + + impl Drop for CalibrateDebevec { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CalibrateDebevec_delete(instance: *mut c_void); } + unsafe { cv_CalibrateDebevec_delete(self.as_raw_mut_CalibrateDebevec()) }; + } + } + + unsafe impl Send for CalibrateDebevec {} + + impl core::AlgorithmTraitConst for CalibrateDebevec { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CalibrateDebevec { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::CalibrateCRFTraitConst for CalibrateDebevec { + #[inline] fn as_raw_CalibrateCRF(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::CalibrateCRFTrait for CalibrateDebevec { + #[inline] fn as_raw_mut_CalibrateCRF(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::CalibrateDebevecTraitConst for CalibrateDebevec { + #[inline] fn as_raw_CalibrateDebevec(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::CalibrateDebevecTrait for CalibrateDebevec { + #[inline] fn as_raw_mut_CalibrateDebevec(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CalibrateDebevec { + } + + boxed_cast_base! { CalibrateDebevec, core::Algorithm, cv_CalibrateDebevec_to_Algorithm } + /// Constant methods for [crate::photo::CalibrateRobertson] - pub trait CalibrateRobertsonConst: crate::photo::CalibrateCRFConst { + pub trait CalibrateRobertsonTraitConst: crate::photo::CalibrateCRFTraitConst { fn as_raw_CalibrateRobertson(&self) -> *const c_void; #[inline] @@ -1262,11 +1430,8 @@ pub mod photo { } - /// Inverse camera response function is extracted for each brightness value by minimizing an objective - /// function as linear system. This algorithm uses all image pixels. - /// - /// For more information see [RB99](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_RB99) . - pub trait CalibrateRobertson: crate::photo::CalibrateCRF + crate::photo::CalibrateRobertsonConst { + /// Mutable methods for [crate::photo::CalibrateRobertson] + pub trait CalibrateRobertsonTrait: crate::photo::CalibrateCRFTrait + crate::photo::CalibrateRobertsonTraitConst { fn as_raw_mut_CalibrateRobertson(&mut self) -> *mut c_void; #[inline] @@ -1289,17 +1454,63 @@ pub mod photo { } + /// Inverse camera response function is extracted for each brightness value by minimizing an objective + /// function as linear system. This algorithm uses all image pixels. + /// + /// For more information see [RB99](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_RB99) . + pub struct CalibrateRobertson { + ptr: *mut c_void + } + + opencv_type_boxed! { CalibrateRobertson } + + impl Drop for CalibrateRobertson { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_CalibrateRobertson_delete(instance: *mut c_void); } + unsafe { cv_CalibrateRobertson_delete(self.as_raw_mut_CalibrateRobertson()) }; + } + } + + unsafe impl Send for CalibrateRobertson {} + + impl core::AlgorithmTraitConst for CalibrateRobertson { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for CalibrateRobertson { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::CalibrateCRFTraitConst for CalibrateRobertson { + #[inline] fn as_raw_CalibrateCRF(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::CalibrateCRFTrait for CalibrateRobertson { + #[inline] fn as_raw_mut_CalibrateCRF(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::CalibrateRobertsonTraitConst for CalibrateRobertson { + #[inline] fn as_raw_CalibrateRobertson(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::CalibrateRobertsonTrait for CalibrateRobertson { + #[inline] fn as_raw_mut_CalibrateRobertson(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl CalibrateRobertson { + } + + boxed_cast_base! { CalibrateRobertson, core::Algorithm, cv_CalibrateRobertson_to_Algorithm } + /// Constant methods for [crate::photo::MergeDebevec] - pub trait MergeDebevecConst: crate::photo::MergeExposuresConst { + pub trait MergeDebevecTraitConst: crate::photo::MergeExposuresTraitConst { fn as_raw_MergeDebevec(&self) -> *const c_void; } - /// The resulting HDR image is calculated as weighted average of the exposures considering exposure - /// values and camera response. - /// - /// For more information see [DM97](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_DM97) . - pub trait MergeDebevec: crate::photo::MergeDebevecConst + crate::photo::MergeExposures { + /// Mutable methods for [crate::photo::MergeDebevec] + pub trait MergeDebevecTrait: crate::photo::MergeDebevecTraitConst + crate::photo::MergeExposuresTrait { fn as_raw_mut_MergeDebevec(&mut self) -> *mut c_void; #[inline] @@ -1329,14 +1540,63 @@ pub mod photo { } + /// The resulting HDR image is calculated as weighted average of the exposures considering exposure + /// values and camera response. + /// + /// For more information see [DM97](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_DM97) . + pub struct MergeDebevec { + ptr: *mut c_void + } + + opencv_type_boxed! { MergeDebevec } + + impl Drop for MergeDebevec { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MergeDebevec_delete(instance: *mut c_void); } + unsafe { cv_MergeDebevec_delete(self.as_raw_mut_MergeDebevec()) }; + } + } + + unsafe impl Send for MergeDebevec {} + + impl core::AlgorithmTraitConst for MergeDebevec { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MergeDebevec { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::MergeExposuresTraitConst for MergeDebevec { + #[inline] fn as_raw_MergeExposures(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::MergeExposuresTrait for MergeDebevec { + #[inline] fn as_raw_mut_MergeExposures(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::MergeDebevecTraitConst for MergeDebevec { + #[inline] fn as_raw_MergeDebevec(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::MergeDebevecTrait for MergeDebevec { + #[inline] fn as_raw_mut_MergeDebevec(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MergeDebevec { + } + + boxed_cast_base! { MergeDebevec, core::Algorithm, cv_MergeDebevec_to_Algorithm } + /// Constant methods for [crate::photo::MergeExposures] - pub trait MergeExposuresConst: core::AlgorithmTraitConst { + pub trait MergeExposuresTraitConst: core::AlgorithmTraitConst { fn as_raw_MergeExposures(&self) -> *const c_void; } - /// The base class algorithms that can merge exposure sequence to a single image. - pub trait MergeExposures: core::AlgorithmTrait + crate::photo::MergeExposuresConst { + /// Mutable methods for [crate::photo::MergeExposures] + pub trait MergeExposuresTrait: core::AlgorithmTrait + crate::photo::MergeExposuresTraitConst { fn as_raw_mut_MergeExposures(&mut self) -> *mut c_void; /// Merges images. @@ -1362,8 +1622,46 @@ pub mod photo { } + /// The base class algorithms that can merge exposure sequence to a single image. + pub struct MergeExposures { + ptr: *mut c_void + } + + opencv_type_boxed! { MergeExposures } + + impl Drop for MergeExposures { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MergeExposures_delete(instance: *mut c_void); } + unsafe { cv_MergeExposures_delete(self.as_raw_mut_MergeExposures()) }; + } + } + + unsafe impl Send for MergeExposures {} + + impl core::AlgorithmTraitConst for MergeExposures { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MergeExposures { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::MergeExposuresTraitConst for MergeExposures { + #[inline] fn as_raw_MergeExposures(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::MergeExposuresTrait for MergeExposures { + #[inline] fn as_raw_mut_MergeExposures(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MergeExposures { + } + + boxed_cast_base! { MergeExposures, core::Algorithm, cv_MergeExposures_to_Algorithm } + /// Constant methods for [crate::photo::MergeMertens] - pub trait MergeMertensConst: crate::photo::MergeExposuresConst { + pub trait MergeMertensTraitConst: crate::photo::MergeExposuresTraitConst { fn as_raw_MergeMertens(&self) -> *const c_void; #[inline] @@ -1395,17 +1693,8 @@ pub mod photo { } - /// Pixels are weighted using contrast, saturation and well-exposedness measures, than images are - /// combined using laplacian pyramids. - /// - /// The resulting image weight is constructed as weighted average of contrast, saturation and - /// well-exposedness measures. - /// - /// The resulting image doesn't require tonemapping and can be converted to 8-bit image by multiplying - /// by 255, but it's recommended to apply gamma correction and/or linear tonemapping. - /// - /// For more information see [MK07](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_MK07) . - pub trait MergeMertens: crate::photo::MergeExposures + crate::photo::MergeMertensConst { + /// Mutable methods for [crate::photo::MergeMertens] + pub trait MergeMertensTrait: crate::photo::MergeExposuresTrait + crate::photo::MergeMertensTraitConst { fn as_raw_mut_MergeMertens(&mut self) -> *mut c_void; #[inline] @@ -1466,17 +1755,69 @@ pub mod photo { } + /// Pixels are weighted using contrast, saturation and well-exposedness measures, than images are + /// combined using laplacian pyramids. + /// + /// The resulting image weight is constructed as weighted average of contrast, saturation and + /// well-exposedness measures. + /// + /// The resulting image doesn't require tonemapping and can be converted to 8-bit image by multiplying + /// by 255, but it's recommended to apply gamma correction and/or linear tonemapping. + /// + /// For more information see [MK07](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_MK07) . + pub struct MergeMertens { + ptr: *mut c_void + } + + opencv_type_boxed! { MergeMertens } + + impl Drop for MergeMertens { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MergeMertens_delete(instance: *mut c_void); } + unsafe { cv_MergeMertens_delete(self.as_raw_mut_MergeMertens()) }; + } + } + + unsafe impl Send for MergeMertens {} + + impl core::AlgorithmTraitConst for MergeMertens { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MergeMertens { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::MergeExposuresTraitConst for MergeMertens { + #[inline] fn as_raw_MergeExposures(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::MergeExposuresTrait for MergeMertens { + #[inline] fn as_raw_mut_MergeExposures(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::MergeMertensTraitConst for MergeMertens { + #[inline] fn as_raw_MergeMertens(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::MergeMertensTrait for MergeMertens { + #[inline] fn as_raw_mut_MergeMertens(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MergeMertens { + } + + boxed_cast_base! { MergeMertens, core::Algorithm, cv_MergeMertens_to_Algorithm } + /// Constant methods for [crate::photo::MergeRobertson] - pub trait MergeRobertsonConst: crate::photo::MergeExposuresConst { + pub trait MergeRobertsonTraitConst: crate::photo::MergeExposuresTraitConst { fn as_raw_MergeRobertson(&self) -> *const c_void; } - /// The resulting HDR image is calculated as weighted average of the exposures considering exposure - /// values and camera response. - /// - /// For more information see [RB99](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_RB99) . - pub trait MergeRobertson: crate::photo::MergeExposures + crate::photo::MergeRobertsonConst { + /// Mutable methods for [crate::photo::MergeRobertson] + pub trait MergeRobertsonTrait: crate::photo::MergeExposuresTrait + crate::photo::MergeRobertsonTraitConst { fn as_raw_mut_MergeRobertson(&mut self) -> *mut c_void; #[inline] @@ -1506,8 +1847,57 @@ pub mod photo { } + /// The resulting HDR image is calculated as weighted average of the exposures considering exposure + /// values and camera response. + /// + /// For more information see [RB99](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_RB99) . + pub struct MergeRobertson { + ptr: *mut c_void + } + + opencv_type_boxed! { MergeRobertson } + + impl Drop for MergeRobertson { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MergeRobertson_delete(instance: *mut c_void); } + unsafe { cv_MergeRobertson_delete(self.as_raw_mut_MergeRobertson()) }; + } + } + + unsafe impl Send for MergeRobertson {} + + impl core::AlgorithmTraitConst for MergeRobertson { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MergeRobertson { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::MergeExposuresTraitConst for MergeRobertson { + #[inline] fn as_raw_MergeExposures(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::MergeExposuresTrait for MergeRobertson { + #[inline] fn as_raw_mut_MergeExposures(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::MergeRobertsonTraitConst for MergeRobertson { + #[inline] fn as_raw_MergeRobertson(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::MergeRobertsonTrait for MergeRobertson { + #[inline] fn as_raw_mut_MergeRobertson(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MergeRobertson { + } + + boxed_cast_base! { MergeRobertson, core::Algorithm, cv_MergeRobertson_to_Algorithm } + /// Constant methods for [crate::photo::Tonemap] - pub trait TonemapConst: core::AlgorithmTraitConst { + pub trait TonemapTraitConst: core::AlgorithmTraitConst { fn as_raw_Tonemap(&self) -> *const c_void; #[inline] @@ -1521,8 +1911,8 @@ pub mod photo { } - /// Base class for tonemapping algorithms - tools that are used to map HDR image to 8-bit range. - pub trait Tonemap: core::AlgorithmTrait + crate::photo::TonemapConst { + /// Mutable methods for [crate::photo::Tonemap] + pub trait TonemapTrait: core::AlgorithmTrait + crate::photo::TonemapTraitConst { fn as_raw_mut_Tonemap(&mut self) -> *mut c_void; /// Tonemaps image @@ -1552,8 +1942,46 @@ pub mod photo { } + /// Base class for tonemapping algorithms - tools that are used to map HDR image to 8-bit range. + pub struct Tonemap { + ptr: *mut c_void + } + + opencv_type_boxed! { Tonemap } + + impl Drop for Tonemap { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Tonemap_delete(instance: *mut c_void); } + unsafe { cv_Tonemap_delete(self.as_raw_mut_Tonemap()) }; + } + } + + unsafe impl Send for Tonemap {} + + impl core::AlgorithmTraitConst for Tonemap { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Tonemap { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::TonemapTraitConst for Tonemap { + #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::TonemapTrait for Tonemap { + #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Tonemap { + } + + boxed_cast_base! { Tonemap, core::Algorithm, cv_Tonemap_to_Algorithm } + /// Constant methods for [crate::photo::TonemapDrago] - pub trait TonemapDragoConst: crate::photo::TonemapConst { + pub trait TonemapDragoTraitConst: crate::photo::TonemapTraitConst { fn as_raw_TonemapDrago(&self) -> *const c_void; #[inline] @@ -1576,16 +2004,8 @@ pub mod photo { } - /// Adaptive logarithmic mapping is a fast global tonemapping algorithm that scales the image in - /// logarithmic domain. - /// - /// Since it's a global operator the same function is applied to all the pixels, it is controlled by the - /// bias parameter. - /// - /// Optional saturation enhancement is possible as described in [FL02](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_FL02) . - /// - /// For more information see [DM03](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_DM03) . - pub trait TonemapDrago: crate::photo::Tonemap + crate::photo::TonemapDragoConst { + /// Mutable methods for [crate::photo::TonemapDrago] + pub trait TonemapDragoTrait: crate::photo::TonemapDragoTraitConst + crate::photo::TonemapTrait { fn as_raw_mut_TonemapDrago(&mut self) -> *mut c_void; #[inline] @@ -1608,8 +2028,62 @@ pub mod photo { } + /// Adaptive logarithmic mapping is a fast global tonemapping algorithm that scales the image in + /// logarithmic domain. + /// + /// Since it's a global operator the same function is applied to all the pixels, it is controlled by the + /// bias parameter. + /// + /// Optional saturation enhancement is possible as described in [FL02](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_FL02) . + /// + /// For more information see [DM03](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_DM03) . + pub struct TonemapDrago { + ptr: *mut c_void + } + + opencv_type_boxed! { TonemapDrago } + + impl Drop for TonemapDrago { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TonemapDrago_delete(instance: *mut c_void); } + unsafe { cv_TonemapDrago_delete(self.as_raw_mut_TonemapDrago()) }; + } + } + + unsafe impl Send for TonemapDrago {} + + impl core::AlgorithmTraitConst for TonemapDrago { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for TonemapDrago { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::TonemapTraitConst for TonemapDrago { + #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::TonemapTrait for TonemapDrago { + #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::TonemapDragoTraitConst for TonemapDrago { + #[inline] fn as_raw_TonemapDrago(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::TonemapDragoTrait for TonemapDrago { + #[inline] fn as_raw_mut_TonemapDrago(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TonemapDrago { + } + + boxed_cast_base! { TonemapDrago, core::Algorithm, cv_TonemapDrago_to_Algorithm } + /// Constant methods for [crate::photo::TonemapMantiuk] - pub trait TonemapMantiukConst: crate::photo::TonemapConst { + pub trait TonemapMantiukTraitConst: crate::photo::TonemapTraitConst { fn as_raw_TonemapMantiuk(&self) -> *const c_void; #[inline] @@ -1632,12 +2106,8 @@ pub mod photo { } - /// This algorithm transforms image to contrast using gradients on all levels of gaussian pyramid, - /// transforms contrast values to HVS response and scales the response. After this the image is - /// reconstructed from new contrast values. - /// - /// For more information see [MM06](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_MM06) . - pub trait TonemapMantiuk: crate::photo::Tonemap + crate::photo::TonemapMantiukConst { + /// Mutable methods for [crate::photo::TonemapMantiuk] + pub trait TonemapMantiukTrait: crate::photo::TonemapMantiukTraitConst + crate::photo::TonemapTrait { fn as_raw_mut_TonemapMantiuk(&mut self) -> *mut c_void; #[inline] @@ -1660,8 +2130,58 @@ pub mod photo { } + /// This algorithm transforms image to contrast using gradients on all levels of gaussian pyramid, + /// transforms contrast values to HVS response and scales the response. After this the image is + /// reconstructed from new contrast values. + /// + /// For more information see [MM06](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_MM06) . + pub struct TonemapMantiuk { + ptr: *mut c_void + } + + opencv_type_boxed! { TonemapMantiuk } + + impl Drop for TonemapMantiuk { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TonemapMantiuk_delete(instance: *mut c_void); } + unsafe { cv_TonemapMantiuk_delete(self.as_raw_mut_TonemapMantiuk()) }; + } + } + + unsafe impl Send for TonemapMantiuk {} + + impl core::AlgorithmTraitConst for TonemapMantiuk { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for TonemapMantiuk { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::TonemapTraitConst for TonemapMantiuk { + #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::TonemapTrait for TonemapMantiuk { + #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::TonemapMantiukTraitConst for TonemapMantiuk { + #[inline] fn as_raw_TonemapMantiuk(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::TonemapMantiukTrait for TonemapMantiuk { + #[inline] fn as_raw_mut_TonemapMantiuk(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TonemapMantiuk { + } + + boxed_cast_base! { TonemapMantiuk, core::Algorithm, cv_TonemapMantiuk_to_Algorithm } + /// Constant methods for [crate::photo::TonemapReinhard] - pub trait TonemapReinhardConst: crate::photo::TonemapConst { + pub trait TonemapReinhardTraitConst: crate::photo::TonemapTraitConst { fn as_raw_TonemapReinhard(&self) -> *const c_void; #[inline] @@ -1693,13 +2213,8 @@ pub mod photo { } - /// This is a global tonemapping operator that models human visual system. - /// - /// Mapping function is controlled by adaptation parameter, that is computed using light adaptation and - /// color adaptation. - /// - /// For more information see [RD05](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_RD05) . - pub trait TonemapReinhard: crate::photo::Tonemap + crate::photo::TonemapReinhardConst { + /// Mutable methods for [crate::photo::TonemapReinhard] + pub trait TonemapReinhardTrait: crate::photo::TonemapReinhardTraitConst + crate::photo::TonemapTrait { fn as_raw_mut_TonemapReinhard(&mut self) -> *mut c_void; #[inline] @@ -1730,4 +2245,55 @@ pub mod photo { } } + + /// This is a global tonemapping operator that models human visual system. + /// + /// Mapping function is controlled by adaptation parameter, that is computed using light adaptation and + /// color adaptation. + /// + /// For more information see [RD05](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_RD05) . + pub struct TonemapReinhard { + ptr: *mut c_void + } + + opencv_type_boxed! { TonemapReinhard } + + impl Drop for TonemapReinhard { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TonemapReinhard_delete(instance: *mut c_void); } + unsafe { cv_TonemapReinhard_delete(self.as_raw_mut_TonemapReinhard()) }; + } + } + + unsafe impl Send for TonemapReinhard {} + + impl core::AlgorithmTraitConst for TonemapReinhard { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for TonemapReinhard { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::TonemapTraitConst for TonemapReinhard { + #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::TonemapTrait for TonemapReinhard { + #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::TonemapReinhardTraitConst for TonemapReinhard { + #[inline] fn as_raw_TonemapReinhard(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::TonemapReinhardTrait for TonemapReinhard { + #[inline] fn as_raw_mut_TonemapReinhard(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TonemapReinhard { + } + + boxed_cast_base! { TonemapReinhard, core::Algorithm, cv_TonemapReinhard_to_Algorithm } } diff --git a/docs/plot.rs b/docs/plot.rs index 2da7a755c..228b9106b 100644 --- a/docs/plot.rs +++ b/docs/plot.rs @@ -2,16 +2,17 @@ pub mod plot { //! # Plot function for Mat data use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::Plot2dConst, super::Plot2d }; + pub use { super::Plot2dTraitConst, super::Plot2dTrait }; } /// Constant methods for [crate::plot::Plot2d] - pub trait Plot2dConst: core::AlgorithmTraitConst { + pub trait Plot2dTraitConst: core::AlgorithmTraitConst { fn as_raw_Plot2d(&self) -> *const c_void; } - pub trait Plot2d: core::AlgorithmTrait + crate::plot::Plot2dConst { + /// Mutable methods for [crate::plot::Plot2d] + pub trait Plot2dTrait: core::AlgorithmTrait + crate::plot::Plot2dTraitConst { fn as_raw_mut_Plot2d(&mut self) -> *mut c_void; #[inline] @@ -188,20 +189,52 @@ pub mod plot { } - impl dyn Plot2d + '_ { + pub struct Plot2d { + ptr: *mut c_void + } + + opencv_type_boxed! { Plot2d } + + impl Drop for Plot2d { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Plot2d_delete(instance: *mut c_void); } + unsafe { cv_Plot2d_delete(self.as_raw_mut_Plot2d()) }; + } + } + + unsafe impl Send for Plot2d {} + + impl core::AlgorithmTraitConst for Plot2d { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Plot2d { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::plot::Plot2dTraitConst for Plot2d { + #[inline] fn as_raw_Plot2d(&self) -> *const c_void { self.as_raw() } + } + + impl crate::plot::Plot2dTrait for Plot2d { + #[inline] fn as_raw_mut_Plot2d(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Plot2d { /// Creates Plot2d object /// /// ## Parameters /// * data: ![inline formula](https://latex.codecogs.com/png.latex?1xN) or ![inline formula](https://latex.codecogs.com/png.latex?Nx1) matrix containing ![inline formula](https://latex.codecogs.com/png.latex?Y) values of points to plot. ![inline formula](https://latex.codecogs.com/png.latex?X) values /// will be equal to indexes of correspondind elements in data matrix. #[inline] - pub fn create(data: &dyn core::ToInputArray) -> Result> { + pub fn create(data: &dyn core::ToInputArray) -> Result> { extern_container_arg!(data); return_send!(via ocvrs_return); unsafe { sys::cv_plot_Plot2d_create_const__InputArrayR(data.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -211,15 +244,18 @@ pub mod plot { /// * dataX: ![inline formula](https://latex.codecogs.com/png.latex?1xN) or ![inline formula](https://latex.codecogs.com/png.latex?Nx1) matrix ![inline formula](https://latex.codecogs.com/png.latex?X) values of points to plot. /// * dataY: ![inline formula](https://latex.codecogs.com/png.latex?1xN) or ![inline formula](https://latex.codecogs.com/png.latex?Nx1) matrix containing ![inline formula](https://latex.codecogs.com/png.latex?Y) values of points to plot. #[inline] - pub fn create_1(data_x: &dyn core::ToInputArray, data_y: &dyn core::ToInputArray) -> Result> { + pub fn create_1(data_x: &dyn core::ToInputArray, data_y: &dyn core::ToInputArray) -> Result> { extern_container_arg!(data_x); extern_container_arg!(data_y); return_send!(via ocvrs_return); unsafe { sys::cv_plot_Plot2d_create_const__InputArrayR_const__InputArrayR(data_x.as_raw__InputArray(), data_y.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { Plot2d, core::Algorithm, cv_Plot2d_to_Algorithm } +} diff --git a/docs/quality.rs b/docs/quality.rs index ad02ac967..11eab4add 100644 --- a/docs/quality.rs +++ b/docs/quality.rs @@ -1,17 +1,17 @@ pub mod quality { use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::QualityBaseConst, super::QualityBase, super::QualityMSETraitConst, super::QualityMSETrait, super::QualityPSNRTraitConst, super::QualityPSNRTrait, super::QualitySSIMTraitConst, super::QualitySSIMTrait, super::QualityGMSDTraitConst, super::QualityGMSDTrait, super::QualityBRISQUETraitConst, super::QualityBRISQUETrait }; + pub use { super::QualityBaseTraitConst, super::QualityBaseTrait, super::QualityMSETraitConst, super::QualityMSETrait, super::QualityPSNRTraitConst, super::QualityPSNRTrait, super::QualitySSIMTraitConst, super::QualitySSIMTrait, super::QualityGMSDTraitConst, super::QualityGMSDTrait, super::QualityBRISQUETraitConst, super::QualityBRISQUETrait }; } /// Constant methods for [crate::quality::QualityBRISQUE] - pub trait QualityBRISQUETraitConst: crate::quality::QualityBaseConst { + pub trait QualityBRISQUETraitConst: crate::quality::QualityBaseTraitConst { fn as_raw_QualityBRISQUE(&self) -> *const c_void; } /// Mutable methods for [crate::quality::QualityBRISQUE] - pub trait QualityBRISQUETrait: crate::quality::QualityBRISQUETraitConst + crate::quality::QualityBase { + pub trait QualityBRISQUETrait: crate::quality::QualityBRISQUETraitConst + crate::quality::QualityBaseTrait { fn as_raw_mut_QualityBRISQUE(&mut self) -> *mut c_void; /// Computes BRISQUE quality score for input image @@ -63,11 +63,11 @@ pub mod quality { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::quality::QualityBaseConst for QualityBRISQUE { + impl crate::quality::QualityBaseTraitConst for QualityBRISQUE { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.as_raw() } } - impl crate::quality::QualityBase for QualityBRISQUE { + impl crate::quality::QualityBaseTrait for QualityBRISQUE { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -101,7 +101,7 @@ pub mod quality { /// * model: cv::Ptr which contains a loaded BRISQUE model /// * range: cv::Mat which contains BRISQUE range data #[inline] - pub fn create_1(model: &core::Ptr, range: &core::Mat) -> Result> { + pub fn create_1(model: &core::Ptr, range: &core::Mat) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_quality_QualityBRISQUE_create_const_PtrLSVMGR_const_MatR(model.as_raw_PtrOfSVM(), range.as_raw_Mat(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -149,7 +149,7 @@ pub mod quality { boxed_cast_base! { QualityBRISQUE, core::Algorithm, cv_QualityBRISQUE_to_Algorithm } /// Constant methods for [crate::quality::QualityBase] - pub trait QualityBaseConst: core::AlgorithmTraitConst { + pub trait QualityBaseTraitConst: core::AlgorithmTraitConst { fn as_raw_QualityBase(&self) -> *const c_void; /// Returns output quality map that was generated during computation, if supported by the algorithm @@ -175,8 +175,8 @@ pub mod quality { } - /// ********************************* Quality Base Class *********************************** - pub trait QualityBase: core::AlgorithmTrait + crate::quality::QualityBaseConst { + /// Mutable methods for [crate::quality::QualityBase] + pub trait QualityBaseTrait: core::AlgorithmTrait + crate::quality::QualityBaseTraitConst { fn as_raw_mut_QualityBase(&mut self) -> *mut c_void; /// Compute quality score per channel with the per-channel score in each element of the resulting cv::Scalar. See specific algorithm for interpreting result scores @@ -204,8 +204,56 @@ pub mod quality { } + /// ********************************* Quality Base Class *********************************** + pub struct QualityBase { + ptr: *mut c_void + } + + opencv_type_boxed! { QualityBase } + + impl Drop for QualityBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_QualityBase_delete(instance: *mut c_void); } + unsafe { cv_QualityBase_delete(self.as_raw_mut_QualityBase()) }; + } + } + + unsafe impl Send for QualityBase {} + + impl core::AlgorithmTraitConst for QualityBase { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for QualityBase { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::quality::QualityBaseTraitConst for QualityBase { + #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::quality::QualityBaseTrait for QualityBase { + #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl QualityBase { + } + + boxed_cast_descendant! { QualityBase, crate::quality::QualityBRISQUE, cv_QualityBase_to_QualityBRISQUE } + + boxed_cast_descendant! { QualityBase, crate::quality::QualityGMSD, cv_QualityBase_to_QualityGMSD } + + boxed_cast_descendant! { QualityBase, crate::quality::QualityMSE, cv_QualityBase_to_QualityMSE } + + boxed_cast_descendant! { QualityBase, crate::quality::QualityPSNR, cv_QualityBase_to_QualityPSNR } + + boxed_cast_descendant! { QualityBase, crate::quality::QualitySSIM, cv_QualityBase_to_QualitySSIM } + + boxed_cast_base! { QualityBase, core::Algorithm, cv_QualityBase_to_Algorithm } + /// Constant methods for [crate::quality::QualityGMSD] - pub trait QualityGMSDTraitConst: crate::quality::QualityBaseConst { + pub trait QualityGMSDTraitConst: crate::quality::QualityBaseTraitConst { fn as_raw_QualityGMSD(&self) -> *const c_void; /// Implements Algorithm::empty() @@ -221,7 +269,7 @@ pub mod quality { } /// Mutable methods for [crate::quality::QualityGMSD] - pub trait QualityGMSDTrait: crate::quality::QualityBase + crate::quality::QualityGMSDTraitConst { + pub trait QualityGMSDTrait: crate::quality::QualityBaseTrait + crate::quality::QualityGMSDTraitConst { fn as_raw_mut_QualityGMSD(&mut self) -> *mut c_void; /// Compute GMSD @@ -277,11 +325,11 @@ pub mod quality { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::quality::QualityBaseConst for QualityGMSD { + impl crate::quality::QualityBaseTraitConst for QualityGMSD { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.as_raw() } } - impl crate::quality::QualityBase for QualityGMSD { + impl crate::quality::QualityBaseTrait for QualityGMSD { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -332,7 +380,7 @@ pub mod quality { boxed_cast_base! { QualityGMSD, core::Algorithm, cv_QualityGMSD_to_Algorithm } /// Constant methods for [crate::quality::QualityMSE] - pub trait QualityMSETraitConst: crate::quality::QualityBaseConst { + pub trait QualityMSETraitConst: crate::quality::QualityBaseTraitConst { fn as_raw_QualityMSE(&self) -> *const c_void; /// Implements Algorithm::empty() @@ -348,7 +396,7 @@ pub mod quality { } /// Mutable methods for [crate::quality::QualityMSE] - pub trait QualityMSETrait: crate::quality::QualityBase + crate::quality::QualityMSETraitConst { + pub trait QualityMSETrait: crate::quality::QualityBaseTrait + crate::quality::QualityMSETraitConst { fn as_raw_mut_QualityMSE(&mut self) -> *mut c_void; /// Computes MSE for reference images supplied in class constructor and provided comparison images @@ -403,11 +451,11 @@ pub mod quality { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::quality::QualityBaseConst for QualityMSE { + impl crate::quality::QualityBaseTraitConst for QualityMSE { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.as_raw() } } - impl crate::quality::QualityBase for QualityMSE { + impl crate::quality::QualityBaseTrait for QualityMSE { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -458,7 +506,7 @@ pub mod quality { boxed_cast_base! { QualityMSE, core::Algorithm, cv_QualityMSE_to_Algorithm } /// Constant methods for [crate::quality::QualityPSNR] - pub trait QualityPSNRTraitConst: crate::quality::QualityBaseConst { + pub trait QualityPSNRTraitConst: crate::quality::QualityBaseTraitConst { fn as_raw_QualityPSNR(&self) -> *const c_void; /// Implements Algorithm::empty() @@ -484,7 +532,7 @@ pub mod quality { } /// Mutable methods for [crate::quality::QualityPSNR] - pub trait QualityPSNRTrait: crate::quality::QualityBase + crate::quality::QualityPSNRTraitConst { + pub trait QualityPSNRTrait: crate::quality::QualityBaseTrait + crate::quality::QualityPSNRTraitConst { fn as_raw_mut_QualityPSNR(&mut self) -> *mut c_void; /// Compute the PSNR @@ -551,11 +599,11 @@ pub mod quality { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::quality::QualityBaseConst for QualityPSNR { + impl crate::quality::QualityBaseTraitConst for QualityPSNR { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.as_raw() } } - impl crate::quality::QualityBase for QualityPSNR { + impl crate::quality::QualityBaseTrait for QualityPSNR { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -615,7 +663,7 @@ pub mod quality { boxed_cast_base! { QualityPSNR, core::Algorithm, cv_QualityPSNR_to_Algorithm } /// Constant methods for [crate::quality::QualitySSIM] - pub trait QualitySSIMTraitConst: crate::quality::QualityBaseConst { + pub trait QualitySSIMTraitConst: crate::quality::QualityBaseTraitConst { fn as_raw_QualitySSIM(&self) -> *const c_void; /// Implements Algorithm::empty() @@ -631,7 +679,7 @@ pub mod quality { } /// Mutable methods for [crate::quality::QualitySSIM] - pub trait QualitySSIMTrait: crate::quality::QualityBase + crate::quality::QualitySSIMTraitConst { + pub trait QualitySSIMTrait: crate::quality::QualityBaseTrait + crate::quality::QualitySSIMTraitConst { fn as_raw_mut_QualitySSIM(&mut self) -> *mut c_void; /// Computes SSIM @@ -686,11 +734,11 @@ pub mod quality { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::quality::QualityBaseConst for QualitySSIM { + impl crate::quality::QualityBaseTraitConst for QualitySSIM { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.as_raw() } } - impl crate::quality::QualityBase for QualitySSIM { + impl crate::quality::QualityBaseTrait for QualitySSIM { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.as_raw_mut() } } diff --git a/docs/rapid.rs b/docs/rapid.rs index bc658cf15..99780188b 100644 --- a/docs/rapid.rs +++ b/docs/rapid.rs @@ -4,7 +4,7 @@ pub mod rapid { //! implements "RAPID-a video rate object tracker" [harris1990rapid](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_harris1990rapid) with the dynamic control point extraction of [drummond2002real](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_drummond2002real) use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::TrackerConst, super::Tracker, super::RapidConst, super::Rapid, super::OLSTrackerConst, super::OLSTracker, super::GOSTrackerConst, super::GOSTracker }; + pub use { super::TrackerTraitConst, super::TrackerTrait, super::RapidTraitConst, super::RapidTrait, super::OLSTrackerTraitConst, super::OLSTrackerTrait, super::GOSTrackerTraitConst, super::GOSTrackerTrait }; } /// Collect corresponding 2d and 3d points based on correspondencies and mask @@ -203,98 +203,230 @@ pub mod rapid { } /// Constant methods for [crate::rapid::GOSTracker] - pub trait GOSTrackerConst: crate::rapid::TrackerConst { + pub trait GOSTrackerTraitConst: crate::rapid::TrackerTraitConst { fn as_raw_GOSTracker(&self) -> *const c_void; } - /// implements "Global optimal searching for textureless 3D object tracking" [wang2015global](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_wang2015global) - pub trait GOSTracker: crate::rapid::GOSTrackerConst + crate::rapid::Tracker { + /// Mutable methods for [crate::rapid::GOSTracker] + pub trait GOSTrackerTrait: crate::rapid::GOSTrackerTraitConst + crate::rapid::TrackerTrait { fn as_raw_mut_GOSTracker(&mut self) -> *mut c_void; } - impl dyn GOSTracker + '_ { + /// implements "Global optimal searching for textureless 3D object tracking" [wang2015global](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_wang2015global) + pub struct GOSTracker { + ptr: *mut c_void + } + + opencv_type_boxed! { GOSTracker } + + impl Drop for GOSTracker { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GOSTracker_delete(instance: *mut c_void); } + unsafe { cv_GOSTracker_delete(self.as_raw_mut_GOSTracker()) }; + } + } + + unsafe impl Send for GOSTracker {} + + impl core::AlgorithmTraitConst for GOSTracker { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GOSTracker { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::rapid::TrackerTraitConst for GOSTracker { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rapid::TrackerTrait for GOSTracker { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::rapid::GOSTrackerTraitConst for GOSTracker { + #[inline] fn as_raw_GOSTracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rapid::GOSTrackerTrait for GOSTracker { + #[inline] fn as_raw_mut_GOSTracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GOSTracker { /// ## C++ default parameters /// * hist_bins: 4 /// * sobel_thesh: 10 #[inline] - pub fn create(pts3d: &dyn core::ToInputArray, tris: &dyn core::ToInputArray, hist_bins: i32, sobel_thesh: u8) -> Result> { + pub fn create(pts3d: &dyn core::ToInputArray, tris: &dyn core::ToInputArray, hist_bins: i32, sobel_thesh: u8) -> Result> { extern_container_arg!(pts3d); extern_container_arg!(tris); return_send!(via ocvrs_return); unsafe { sys::cv_rapid_GOSTracker_create_const__InputArrayR_const__InputArrayR_int_unsigned_char(pts3d.as_raw__InputArray(), tris.as_raw__InputArray(), hist_bins, sobel_thesh, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { GOSTracker, core::Algorithm, cv_GOSTracker_to_Algorithm } + /// Constant methods for [crate::rapid::OLSTracker] - pub trait OLSTrackerConst: crate::rapid::TrackerConst { + pub trait OLSTrackerTraitConst: crate::rapid::TrackerTraitConst { fn as_raw_OLSTracker(&self) -> *const c_void; } + /// Mutable methods for [crate::rapid::OLSTracker] + pub trait OLSTrackerTrait: crate::rapid::OLSTrackerTraitConst + crate::rapid::TrackerTrait { + fn as_raw_mut_OLSTracker(&mut self) -> *mut c_void; + + } + /// implements "Optimal local searching for fast and robust textureless 3D object tracking in highly /// cluttered backgrounds" [seo2013optimal](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_seo2013optimal) - pub trait OLSTracker: crate::rapid::OLSTrackerConst + crate::rapid::Tracker { - fn as_raw_mut_OLSTracker(&mut self) -> *mut c_void; + pub struct OLSTracker { + ptr: *mut c_void + } + + opencv_type_boxed! { OLSTracker } + + impl Drop for OLSTracker { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_OLSTracker_delete(instance: *mut c_void); } + unsafe { cv_OLSTracker_delete(self.as_raw_mut_OLSTracker()) }; + } + } + + unsafe impl Send for OLSTracker {} + impl core::AlgorithmTraitConst for OLSTracker { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } } - impl dyn OLSTracker + '_ { + impl core::AlgorithmTrait for OLSTracker { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::rapid::TrackerTraitConst for OLSTracker { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rapid::TrackerTrait for OLSTracker { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::rapid::OLSTrackerTraitConst for OLSTracker { + #[inline] fn as_raw_OLSTracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rapid::OLSTrackerTrait for OLSTracker { + #[inline] fn as_raw_mut_OLSTracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl OLSTracker { /// ## C++ default parameters /// * hist_bins: 8 /// * sobel_thesh: 10 #[inline] - pub fn create(pts3d: &dyn core::ToInputArray, tris: &dyn core::ToInputArray, hist_bins: i32, sobel_thesh: u8) -> Result> { + pub fn create(pts3d: &dyn core::ToInputArray, tris: &dyn core::ToInputArray, hist_bins: i32, sobel_thesh: u8) -> Result> { extern_container_arg!(pts3d); extern_container_arg!(tris); return_send!(via ocvrs_return); unsafe { sys::cv_rapid_OLSTracker_create_const__InputArrayR_const__InputArrayR_int_unsigned_char(pts3d.as_raw__InputArray(), tris.as_raw__InputArray(), hist_bins, sobel_thesh, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { OLSTracker, core::Algorithm, cv_OLSTracker_to_Algorithm } + /// Constant methods for [crate::rapid::Rapid] - pub trait RapidConst: crate::rapid::TrackerConst { + pub trait RapidTraitConst: crate::rapid::TrackerTraitConst { fn as_raw_Rapid(&self) -> *const c_void; } - /// wrapper around [rapid] function for uniform access - pub trait Rapid: crate::rapid::RapidConst + crate::rapid::Tracker { + /// Mutable methods for [crate::rapid::Rapid] + pub trait RapidTrait: crate::rapid::RapidTraitConst + crate::rapid::TrackerTrait { fn as_raw_mut_Rapid(&mut self) -> *mut c_void; } - impl dyn Rapid + '_ { + /// wrapper around [rapid] function for uniform access + pub struct Rapid { + ptr: *mut c_void + } + + opencv_type_boxed! { Rapid } + + impl Drop for Rapid { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Rapid_delete(instance: *mut c_void); } + unsafe { cv_Rapid_delete(self.as_raw_mut_Rapid()) }; + } + } + + unsafe impl Send for Rapid {} + + impl core::AlgorithmTraitConst for Rapid { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Rapid { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::rapid::TrackerTraitConst for Rapid { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rapid::TrackerTrait for Rapid { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::rapid::RapidTraitConst for Rapid { + #[inline] fn as_raw_Rapid(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rapid::RapidTrait for Rapid { + #[inline] fn as_raw_mut_Rapid(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Rapid { #[inline] - pub fn create(pts3d: &dyn core::ToInputArray, tris: &dyn core::ToInputArray) -> Result> { + pub fn create(pts3d: &dyn core::ToInputArray, tris: &dyn core::ToInputArray) -> Result> { extern_container_arg!(pts3d); extern_container_arg!(tris); return_send!(via ocvrs_return); unsafe { sys::cv_rapid_Rapid_create_const__InputArrayR_const__InputArrayR(pts3d.as_raw__InputArray(), tris.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { Rapid, core::Algorithm, cv_Rapid_to_Algorithm } + /// Constant methods for [crate::rapid::Tracker] - pub trait TrackerConst: core::AlgorithmTraitConst { + pub trait TrackerTraitConst: core::AlgorithmTraitConst { fn as_raw_Tracker(&self) -> *const c_void; } - /// Abstract base class for stateful silhouette trackers - pub trait Tracker: core::AlgorithmTrait + crate::rapid::TrackerConst { + /// Mutable methods for [crate::rapid::Tracker] + pub trait TrackerTrait: core::AlgorithmTrait + crate::rapid::TrackerTraitConst { fn as_raw_mut_Tracker(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -322,4 +454,42 @@ pub mod rapid { } } + + /// Abstract base class for stateful silhouette trackers + pub struct Tracker { + ptr: *mut c_void + } + + opencv_type_boxed! { Tracker } + + impl Drop for Tracker { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Tracker_delete(instance: *mut c_void); } + unsafe { cv_Tracker_delete(self.as_raw_mut_Tracker()) }; + } + } + + unsafe impl Send for Tracker {} + + impl core::AlgorithmTraitConst for Tracker { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Tracker { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::rapid::TrackerTraitConst for Tracker { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rapid::TrackerTrait for Tracker { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Tracker { + } + + boxed_cast_base! { Tracker, core::Algorithm, cv_Tracker_to_Algorithm } } diff --git a/docs/rgbd.rs b/docs/rgbd.rs index a3aa97e59..b4ab3680f 100644 --- a/docs/rgbd.rs +++ b/docs/rgbd.rs @@ -4,7 +4,7 @@ pub mod rgbd { //! [kinfu_icp] use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::Linemod_TemplateTraitConst, super::Linemod_TemplateTrait, super::Linemod_QuantizedPyramidConst, super::Linemod_QuantizedPyramid, super::Linemod_ModalityConst, super::Linemod_Modality, super::Linemod_ColorGradientTraitConst, super::Linemod_ColorGradientTrait, super::Linemod_DepthNormalTraitConst, super::Linemod_DepthNormalTrait, super::Linemod_MatchTraitConst, super::Linemod_MatchTrait, super::Linemod_DetectorTraitConst, super::Linemod_DetectorTrait, super::RgbdNormalsTraitConst, super::RgbdNormalsTrait, super::DepthCleanerTraitConst, super::DepthCleanerTrait, super::RgbdPlaneTraitConst, super::RgbdPlaneTrait, super::RgbdFrameTraitConst, super::RgbdFrameTrait, super::OdometryFrameTraitConst, super::OdometryFrameTrait, super::OdometryConst, super::Odometry, super::RgbdOdometryTraitConst, super::RgbdOdometryTrait, super::ICPOdometryTraitConst, super::ICPOdometryTrait, super::RgbdICPOdometryTraitConst, super::RgbdICPOdometryTrait, super::FastICPOdometryTraitConst, super::FastICPOdometryTrait, super::Kinfu_VolumeConst, super::Kinfu_Volume, super::Kinfu_VolumeParamsTraitConst, super::Kinfu_VolumeParamsTrait, super::Kinfu_ParamsTraitConst, super::Kinfu_ParamsTrait, super::Kinfu_KinFuConst, super::Kinfu_KinFu, super::Dynafu_DynaFuConst, super::Dynafu_DynaFu, super::ParamsTraitConst, super::ParamsTrait, super::LargeKinfuConst, super::LargeKinfu, super::Kinfu_Detail_PoseGraphConst, super::Kinfu_Detail_PoseGraph, super::ColoredKinfu_ParamsTraitConst, super::ColoredKinfu_ParamsTrait, super::ColoredKinfu_ColoredKinFuConst, super::ColoredKinfu_ColoredKinFu }; + pub use { super::Linemod_TemplateTraitConst, super::Linemod_TemplateTrait, super::Linemod_QuantizedPyramidTraitConst, super::Linemod_QuantizedPyramidTrait, super::Linemod_ModalityTraitConst, super::Linemod_ModalityTrait, super::Linemod_ColorGradientTraitConst, super::Linemod_ColorGradientTrait, super::Linemod_DepthNormalTraitConst, super::Linemod_DepthNormalTrait, super::Linemod_MatchTraitConst, super::Linemod_MatchTrait, super::Linemod_DetectorTraitConst, super::Linemod_DetectorTrait, super::RgbdNormalsTraitConst, super::RgbdNormalsTrait, super::DepthCleanerTraitConst, super::DepthCleanerTrait, super::RgbdPlaneTraitConst, super::RgbdPlaneTrait, super::RgbdFrameTraitConst, super::RgbdFrameTrait, super::OdometryFrameTraitConst, super::OdometryFrameTrait, super::OdometryTraitConst, super::OdometryTrait, super::RgbdOdometryTraitConst, super::RgbdOdometryTrait, super::ICPOdometryTraitConst, super::ICPOdometryTrait, super::RgbdICPOdometryTraitConst, super::RgbdICPOdometryTrait, super::FastICPOdometryTraitConst, super::FastICPOdometryTrait, super::Kinfu_VolumeTraitConst, super::Kinfu_VolumeTrait, super::Kinfu_VolumeParamsTraitConst, super::Kinfu_VolumeParamsTrait, super::Kinfu_ParamsTraitConst, super::Kinfu_ParamsTrait, super::Kinfu_KinFuTraitConst, super::Kinfu_KinFuTrait, super::Dynafu_DynaFuTraitConst, super::Dynafu_DynaFuTrait, super::ParamsTraitConst, super::ParamsTrait, super::LargeKinfuTraitConst, super::LargeKinfuTrait, super::Kinfu_Detail_PoseGraphTraitConst, super::Kinfu_Detail_PoseGraphTrait, super::ColoredKinfu_ParamsTraitConst, super::ColoredKinfu_ParamsTrait, super::ColoredKinfu_ColoredKinFuTraitConst, super::ColoredKinfu_ColoredKinFuTrait }; } pub const DepthCleaner_DEPTH_CLEANER_NIL: i32 = 0; @@ -63,12 +63,12 @@ pub mod rgbd { /// Backwards compatibility for old versions pub type Dynafu_Params = crate::rgbd::Kinfu_Params; #[inline] - pub fn make_volume(_volume_type: crate::rgbd::Kinfu_VolumeType, _voxel_size: f32, _pose: core::Matx44f, _raycast_step_factor: f32, _trunc_dist: f32, _max_weight: i32, _truncate_threshold: f32, _resolution: core::Vec3i) -> Result> { + pub fn make_volume(_volume_type: crate::rgbd::Kinfu_VolumeType, _voxel_size: f32, _pose: core::Matx44f, _raycast_step_factor: f32, _trunc_dist: f32, _max_weight: i32, _truncate_threshold: f32, _resolution: core::Vec3i) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_kinfu_makeVolume_VolumeType_float_Matx44f_float_float_int_float_Vec3i(_volume_type, _voxel_size, _pose.opencv_as_extern(), _raycast_step_factor, _trunc_dist, _max_weight, _truncate_threshold, _resolution.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -318,7 +318,7 @@ pub mod rgbd { } /// Constant methods for [crate::rgbd::ColoredKinfu_ColoredKinFu] - pub trait ColoredKinfu_ColoredKinFuConst { + pub trait ColoredKinfu_ColoredKinFuTraitConst { fn as_raw_ColoredKinfu_ColoredKinFu(&self) -> *const c_void; /// Get current parameters @@ -435,30 +435,8 @@ pub mod rgbd { } - /// KinectFusion implementation - /// - /// This class implements a 3d reconstruction algorithm described in - /// [kinectfusion](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_kinectfusion) paper. - /// - /// It takes a sequence of depth images taken from depth sensor - /// (or any depth images source such as stereo camera matching algorithm or even raymarching renderer). - /// The output can be obtained as a vector of points and their normals - /// or can be Phong-rendered from given camera pose. - /// - /// An internal representation of a model is a voxel cuboid that keeps TSDF values - /// which are a sort of distances to the surface (for details read the [kinectfusion](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_kinectfusion) article about TSDF). - /// There is no interface to that representation yet. - /// - /// KinFu uses OpenCL acceleration automatically if available. - /// To enable or disable it explicitly use cv::setUseOptimized() or cv::ocl::setUseOpenCL(). - /// - /// This implementation is based on [kinfu-remake](https://github.com/Nerei/kinfu_remake). - /// - /// Note that the KinectFusion algorithm was patented and its use may be restricted by - /// the list of patents mentioned in README.md file in this module directory. - /// - /// That's why you need to set the OPENCV_ENABLE_NONFREE option in CMake to use KinectFusion. - pub trait ColoredKinfu_ColoredKinFu: crate::rgbd::ColoredKinfu_ColoredKinFuConst { + /// Mutable methods for [crate::rgbd::ColoredKinfu_ColoredKinFu] + pub trait ColoredKinfu_ColoredKinFuTrait: crate::rgbd::ColoredKinfu_ColoredKinFuTraitConst { fn as_raw_mut_ColoredKinfu_ColoredKinFu(&mut self) -> *mut c_void; /// Resets the algorithm @@ -493,18 +471,66 @@ pub mod rgbd { } - impl dyn ColoredKinfu_ColoredKinFu + '_ { + /// KinectFusion implementation + /// + /// This class implements a 3d reconstruction algorithm described in + /// [kinectfusion](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_kinectfusion) paper. + /// + /// It takes a sequence of depth images taken from depth sensor + /// (or any depth images source such as stereo camera matching algorithm or even raymarching renderer). + /// The output can be obtained as a vector of points and their normals + /// or can be Phong-rendered from given camera pose. + /// + /// An internal representation of a model is a voxel cuboid that keeps TSDF values + /// which are a sort of distances to the surface (for details read the [kinectfusion](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_kinectfusion) article about TSDF). + /// There is no interface to that representation yet. + /// + /// KinFu uses OpenCL acceleration automatically if available. + /// To enable or disable it explicitly use cv::setUseOptimized() or cv::ocl::setUseOpenCL(). + /// + /// This implementation is based on [kinfu-remake](https://github.com/Nerei/kinfu_remake). + /// + /// Note that the KinectFusion algorithm was patented and its use may be restricted by + /// the list of patents mentioned in README.md file in this module directory. + /// + /// That's why you need to set the OPENCV_ENABLE_NONFREE option in CMake to use KinectFusion. + pub struct ColoredKinfu_ColoredKinFu { + ptr: *mut c_void + } + + opencv_type_boxed! { ColoredKinfu_ColoredKinFu } + + impl Drop for ColoredKinfu_ColoredKinFu { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ColoredKinfu_ColoredKinFu_delete(instance: *mut c_void); } + unsafe { cv_ColoredKinfu_ColoredKinFu_delete(self.as_raw_mut_ColoredKinfu_ColoredKinFu()) }; + } + } + + unsafe impl Send for ColoredKinfu_ColoredKinFu {} + + impl crate::rgbd::ColoredKinfu_ColoredKinFuTraitConst for ColoredKinfu_ColoredKinFu { + #[inline] fn as_raw_ColoredKinfu_ColoredKinFu(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::ColoredKinfu_ColoredKinFuTrait for ColoredKinfu_ColoredKinFu { + #[inline] fn as_raw_mut_ColoredKinfu_ColoredKinFu(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ColoredKinfu_ColoredKinFu { #[inline] - pub fn create(_params: &core::Ptr) -> Result> { + pub fn create(_params: &core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_colored_kinfu_ColoredKinFu_create_const_PtrLParamsGR(_params.as_raw_PtrOfColoredKinfu_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::rgbd::ColoredKinfu_Params] pub trait ColoredKinfu_ParamsTraitConst { fn as_raw_ColoredKinfu_Params(&self) -> *const c_void; @@ -1017,7 +1043,7 @@ pub mod rgbd { } /// Constant methods for [crate::rgbd::Dynafu_DynaFu] - pub trait Dynafu_DynaFuConst { + pub trait Dynafu_DynaFuTraitConst { fn as_raw_Dynafu_DynaFu(&self) -> *const c_void; /// Get current parameters @@ -1136,7 +1162,8 @@ pub mod rgbd { } - pub trait Dynafu_DynaFu: crate::rgbd::Dynafu_DynaFuConst { + /// Mutable methods for [crate::rgbd::Dynafu_DynaFu] + pub trait Dynafu_DynaFuTrait: crate::rgbd::Dynafu_DynaFuTraitConst { fn as_raw_mut_Dynafu_DynaFu(&mut self) -> *mut c_void; /// Resets the algorithm @@ -1186,18 +1213,43 @@ pub mod rgbd { } - impl dyn Dynafu_DynaFu + '_ { + pub struct Dynafu_DynaFu { + ptr: *mut c_void + } + + opencv_type_boxed! { Dynafu_DynaFu } + + impl Drop for Dynafu_DynaFu { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Dynafu_DynaFu_delete(instance: *mut c_void); } + unsafe { cv_Dynafu_DynaFu_delete(self.as_raw_mut_Dynafu_DynaFu()) }; + } + } + + unsafe impl Send for Dynafu_DynaFu {} + + impl crate::rgbd::Dynafu_DynaFuTraitConst for Dynafu_DynaFu { + #[inline] fn as_raw_Dynafu_DynaFu(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::Dynafu_DynaFuTrait for Dynafu_DynaFu { + #[inline] fn as_raw_mut_Dynafu_DynaFu(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Dynafu_DynaFu { #[inline] - pub fn create(_params: &core::Ptr) -> Result> { + pub fn create(_params: &core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_dynafu_DynaFu_create_const_PtrLParamsGR(_params.as_raw_PtrOfKinfu_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq)] pub struct Kinfu_Intr { @@ -1334,7 +1386,7 @@ pub mod rgbd { } /// Constant methods for [crate::rgbd::Kinfu_KinFu] - pub trait Kinfu_KinFuConst { + pub trait Kinfu_KinFuTraitConst { fn as_raw_Kinfu_KinFu(&self) -> *const c_void; /// Get current parameters @@ -1446,30 +1498,8 @@ pub mod rgbd { } - /// KinectFusion implementation - /// - /// This class implements a 3d reconstruction algorithm described in - /// [kinectfusion](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_kinectfusion) paper. - /// - /// It takes a sequence of depth images taken from depth sensor - /// (or any depth images source such as stereo camera matching algorithm or even raymarching renderer). - /// The output can be obtained as a vector of points and their normals - /// or can be Phong-rendered from given camera pose. - /// - /// An internal representation of a model is a voxel cuboid that keeps TSDF values - /// which are a sort of distances to the surface (for details read the [kinectfusion](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_kinectfusion) article about TSDF). - /// There is no interface to that representation yet. - /// - /// KinFu uses OpenCL acceleration automatically if available. - /// To enable or disable it explicitly use cv::setUseOptimized() or cv::ocl::setUseOpenCL(). - /// - /// This implementation is based on [kinfu-remake](https://github.com/Nerei/kinfu_remake). - /// - /// Note that the KinectFusion algorithm was patented and its use may be restricted by - /// the list of patents mentioned in README.md file in this module directory. - /// - /// That's why you need to set the OPENCV_ENABLE_NONFREE option in CMake to use KinectFusion. - pub trait Kinfu_KinFu: crate::rgbd::Kinfu_KinFuConst { + /// Mutable methods for [crate::rgbd::Kinfu_KinFu] + pub trait Kinfu_KinFuTrait: crate::rgbd::Kinfu_KinFuTraitConst { fn as_raw_mut_Kinfu_KinFu(&mut self) -> *mut c_void; /// Resets the algorithm @@ -1505,18 +1535,66 @@ pub mod rgbd { } - impl dyn Kinfu_KinFu + '_ { + /// KinectFusion implementation + /// + /// This class implements a 3d reconstruction algorithm described in + /// [kinectfusion](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_kinectfusion) paper. + /// + /// It takes a sequence of depth images taken from depth sensor + /// (or any depth images source such as stereo camera matching algorithm or even raymarching renderer). + /// The output can be obtained as a vector of points and their normals + /// or can be Phong-rendered from given camera pose. + /// + /// An internal representation of a model is a voxel cuboid that keeps TSDF values + /// which are a sort of distances to the surface (for details read the [kinectfusion](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_kinectfusion) article about TSDF). + /// There is no interface to that representation yet. + /// + /// KinFu uses OpenCL acceleration automatically if available. + /// To enable or disable it explicitly use cv::setUseOptimized() or cv::ocl::setUseOpenCL(). + /// + /// This implementation is based on [kinfu-remake](https://github.com/Nerei/kinfu_remake). + /// + /// Note that the KinectFusion algorithm was patented and its use may be restricted by + /// the list of patents mentioned in README.md file in this module directory. + /// + /// That's why you need to set the OPENCV_ENABLE_NONFREE option in CMake to use KinectFusion. + pub struct Kinfu_KinFu { + ptr: *mut c_void + } + + opencv_type_boxed! { Kinfu_KinFu } + + impl Drop for Kinfu_KinFu { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Kinfu_KinFu_delete(instance: *mut c_void); } + unsafe { cv_Kinfu_KinFu_delete(self.as_raw_mut_Kinfu_KinFu()) }; + } + } + + unsafe impl Send for Kinfu_KinFu {} + + impl crate::rgbd::Kinfu_KinFuTraitConst for Kinfu_KinFu { + #[inline] fn as_raw_Kinfu_KinFu(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::Kinfu_KinFuTrait for Kinfu_KinFu { + #[inline] fn as_raw_mut_Kinfu_KinFu(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Kinfu_KinFu { #[inline] - pub fn create(_params: &core::Ptr) -> Result> { + pub fn create(_params: &core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_kinfu_KinFu_create_const_PtrLParamsGR(_params.as_raw_PtrOfKinfu_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::rgbd::Kinfu_Params] pub trait Kinfu_ParamsTraitConst { fn as_raw_Kinfu_Params(&self) -> *const c_void; @@ -2015,7 +2093,7 @@ pub mod rgbd { } /// Constant methods for [crate::rgbd::Kinfu_Volume] - pub trait Kinfu_VolumeConst { + pub trait Kinfu_VolumeTraitConst { fn as_raw_Kinfu_Volume(&self) -> *const c_void; #[inline] @@ -2103,7 +2181,8 @@ pub mod rgbd { } - pub trait Kinfu_Volume: crate::rgbd::Kinfu_VolumeConst { + /// Mutable methods for [crate::rgbd::Kinfu_Volume] + pub trait Kinfu_VolumeTrait: crate::rgbd::Kinfu_VolumeTraitConst { fn as_raw_mut_Kinfu_Volume(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -2142,6 +2221,33 @@ pub mod rgbd { } + pub struct Kinfu_Volume { + ptr: *mut c_void + } + + opencv_type_boxed! { Kinfu_Volume } + + impl Drop for Kinfu_Volume { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Kinfu_Volume_delete(instance: *mut c_void); } + unsafe { cv_Kinfu_Volume_delete(self.as_raw_mut_Kinfu_Volume()) }; + } + } + + unsafe impl Send for Kinfu_Volume {} + + impl crate::rgbd::Kinfu_VolumeTraitConst for Kinfu_Volume { + #[inline] fn as_raw_Kinfu_Volume(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::Kinfu_VolumeTrait for Kinfu_Volume { + #[inline] fn as_raw_mut_Kinfu_Volume(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Kinfu_Volume { + } + /// Constant methods for [crate::rgbd::Kinfu_VolumeParams] pub trait Kinfu_VolumeParamsTraitConst { fn as_raw_Kinfu_VolumeParams(&self) -> *const c_void; @@ -2363,7 +2469,7 @@ pub mod rgbd { } /// Constant methods for [crate::rgbd::Kinfu_Detail_PoseGraph] - pub trait Kinfu_Detail_PoseGraphConst { + pub trait Kinfu_Detail_PoseGraphTraitConst { fn as_raw_Kinfu_Detail_PoseGraph(&self) -> *const c_void; #[inline] @@ -2459,7 +2565,8 @@ pub mod rgbd { } - pub trait Kinfu_Detail_PoseGraph: crate::rgbd::Kinfu_Detail_PoseGraphConst { + /// Mutable methods for [crate::rgbd::Kinfu_Detail_PoseGraph] + pub trait Kinfu_Detail_PoseGraphTrait: crate::rgbd::Kinfu_Detail_PoseGraphTraitConst { fn as_raw_mut_Kinfu_Detail_PoseGraph(&mut self) -> *mut c_void; #[inline] @@ -2504,20 +2611,45 @@ pub mod rgbd { } - impl dyn Kinfu_Detail_PoseGraph + '_ { + pub struct Kinfu_Detail_PoseGraph { + ptr: *mut c_void + } + + opencv_type_boxed! { Kinfu_Detail_PoseGraph } + + impl Drop for Kinfu_Detail_PoseGraph { #[inline] - pub fn create() -> Result> { + fn drop(&mut self) { + extern "C" { fn cv_Kinfu_Detail_PoseGraph_delete(instance: *mut c_void); } + unsafe { cv_Kinfu_Detail_PoseGraph_delete(self.as_raw_mut_Kinfu_Detail_PoseGraph()) }; + } + } + + unsafe impl Send for Kinfu_Detail_PoseGraph {} + + impl crate::rgbd::Kinfu_Detail_PoseGraphTraitConst for Kinfu_Detail_PoseGraph { + #[inline] fn as_raw_Kinfu_Detail_PoseGraph(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::Kinfu_Detail_PoseGraphTrait for Kinfu_Detail_PoseGraph { + #[inline] fn as_raw_mut_Kinfu_Detail_PoseGraph(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Kinfu_Detail_PoseGraph { + #[inline] + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_kinfu_detail_PoseGraph_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::rgbd::LargeKinfu] - pub trait LargeKinfuConst { + pub trait LargeKinfuTraitConst { fn as_raw_LargeKinfu(&self) -> *const c_void; #[inline] @@ -2593,6 +2725,31 @@ pub mod rgbd { } + /// Mutable methods for [crate::rgbd::LargeKinfu] + pub trait LargeKinfuTrait: crate::rgbd::LargeKinfuTraitConst { + fn as_raw_mut_LargeKinfu(&mut self) -> *mut c_void; + + #[inline] + fn reset(&mut self) -> Result<()> { + return_send!(via ocvrs_return); + unsafe { sys::cv_large_kinfu_LargeKinfu_reset(self.as_raw_mut_LargeKinfu(), ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + #[inline] + fn update(&mut self, depth: &dyn core::ToInputArray) -> Result { + extern_container_arg!(depth); + return_send!(via ocvrs_return); + unsafe { sys::cv_large_kinfu_LargeKinfu_update_const__InputArrayR(self.as_raw_mut_LargeKinfu(), depth.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// Large Scale Dense Depth Fusion implementation /// /// This class implements a 3d reconstruction algorithm for larger environments using @@ -2622,42 +2779,43 @@ pub mod rgbd { /// This implementation is inspired from Kintinuous, InfiniTAM and other SOTA algorithms /// /// You need to set the OPENCV_ENABLE_NONFREE option in CMake to use KinectFusion. - pub trait LargeKinfu: crate::rgbd::LargeKinfuConst { - fn as_raw_mut_LargeKinfu(&mut self) -> *mut c_void; + pub struct LargeKinfu { + ptr: *mut c_void + } + opencv_type_boxed! { LargeKinfu } + + impl Drop for LargeKinfu { #[inline] - fn reset(&mut self) -> Result<()> { - return_send!(via ocvrs_return); - unsafe { sys::cv_large_kinfu_LargeKinfu_reset(self.as_raw_mut_LargeKinfu(), ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) - } - - #[inline] - fn update(&mut self, depth: &dyn core::ToInputArray) -> Result { - extern_container_arg!(depth); - return_send!(via ocvrs_return); - unsafe { sys::cv_large_kinfu_LargeKinfu_update_const__InputArrayR(self.as_raw_mut_LargeKinfu(), depth.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_LargeKinfu_delete(instance: *mut c_void); } + unsafe { cv_LargeKinfu_delete(self.as_raw_mut_LargeKinfu()) }; } - } - impl dyn LargeKinfu + '_ { + unsafe impl Send for LargeKinfu {} + + impl crate::rgbd::LargeKinfuTraitConst for LargeKinfu { + #[inline] fn as_raw_LargeKinfu(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::LargeKinfuTrait for LargeKinfu { + #[inline] fn as_raw_mut_LargeKinfu(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LargeKinfu { #[inline] - pub fn create(_params: &core::Ptr) -> Result> { + pub fn create(_params: &core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_large_kinfu_LargeKinfu_create_const_PtrLParamsGR(_params.as_raw_PtrOfParams(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::rgbd::Params] pub trait ParamsTraitConst { fn as_raw_Params(&self) -> *const c_void; @@ -2967,7 +3125,7 @@ pub mod rgbd { } /// Constant methods for [crate::rgbd::Linemod_ColorGradient] - pub trait Linemod_ColorGradientTraitConst: crate::rgbd::Linemod_ModalityConst { + pub trait Linemod_ColorGradientTraitConst: crate::rgbd::Linemod_ModalityTraitConst { fn as_raw_Linemod_ColorGradient(&self) -> *const c_void; #[inline] @@ -3010,7 +3168,7 @@ pub mod rgbd { } /// Mutable methods for [crate::rgbd::Linemod_ColorGradient] - pub trait Linemod_ColorGradientTrait: crate::rgbd::Linemod_ColorGradientTraitConst + crate::rgbd::Linemod_Modality { + pub trait Linemod_ColorGradientTrait: crate::rgbd::Linemod_ColorGradientTraitConst + crate::rgbd::Linemod_ModalityTrait { fn as_raw_mut_Linemod_ColorGradient(&mut self) -> *mut c_void; #[inline] @@ -3059,11 +3217,11 @@ pub mod rgbd { unsafe impl Send for Linemod_ColorGradient {} - impl crate::rgbd::Linemod_ModalityConst for Linemod_ColorGradient { + impl crate::rgbd::Linemod_ModalityTraitConst for Linemod_ColorGradient { #[inline] fn as_raw_Linemod_Modality(&self) -> *const c_void { self.as_raw() } } - impl crate::rgbd::Linemod_Modality for Linemod_ColorGradient { + impl crate::rgbd::Linemod_ModalityTrait for Linemod_ColorGradient { #[inline] fn as_raw_mut_Linemod_Modality(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3116,7 +3274,7 @@ pub mod rgbd { } /// Constant methods for [crate::rgbd::Linemod_DepthNormal] - pub trait Linemod_DepthNormalTraitConst: crate::rgbd::Linemod_ModalityConst { + pub trait Linemod_DepthNormalTraitConst: crate::rgbd::Linemod_ModalityTraitConst { fn as_raw_Linemod_DepthNormal(&self) -> *const c_void; #[inline] @@ -3165,7 +3323,7 @@ pub mod rgbd { } /// Mutable methods for [crate::rgbd::Linemod_DepthNormal] - pub trait Linemod_DepthNormalTrait: crate::rgbd::Linemod_DepthNormalTraitConst + crate::rgbd::Linemod_Modality { + pub trait Linemod_DepthNormalTrait: crate::rgbd::Linemod_DepthNormalTraitConst + crate::rgbd::Linemod_ModalityTrait { fn as_raw_mut_Linemod_DepthNormal(&mut self) -> *mut c_void; #[inline] @@ -3220,11 +3378,11 @@ pub mod rgbd { unsafe impl Send for Linemod_DepthNormal {} - impl crate::rgbd::Linemod_ModalityConst for Linemod_DepthNormal { + impl crate::rgbd::Linemod_ModalityTraitConst for Linemod_DepthNormal { #[inline] fn as_raw_Linemod_Modality(&self) -> *const c_void { self.as_raw() } } - impl crate::rgbd::Linemod_Modality for Linemod_DepthNormal { + impl crate::rgbd::Linemod_ModalityTrait for Linemod_DepthNormal { #[inline] fn as_raw_mut_Linemod_Modality(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3315,12 +3473,12 @@ pub mod rgbd { /// You are not permitted to add/remove modalities, but you may dynamic_cast them to /// tweak parameters. #[inline] - fn get_modalities(&self) -> Result>> { + fn get_modalities(&self) -> Result>> { return_send!(via ocvrs_return); unsafe { sys::cv_linemod_Detector_getModalities_const(self.as_raw_Linemod_Detector(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Vector::>::opencv_from_extern(ret) }; + let ret = unsafe { core::Vector::>::opencv_from_extern(ret) }; Ok(ret) } @@ -3546,7 +3704,7 @@ pub mod rgbd { /// \param T_pyramid Value of the sampling step T at each pyramid level. The /// number of pyramid levels is T_pyramid.size(). #[inline] - pub fn new(modalities: &core::Vector>, t_pyramid: &core::Vector) -> Result { + pub fn new(modalities: &core::Vector>, t_pyramid: &core::Vector) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_linemod_Detector_Detector_const_vectorLPtrLModalityGGR_const_vectorLintGR(modalities.as_raw_VectorOfPtrOfLinemod_Modality(), t_pyramid.as_raw_VectorOfi32(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3761,7 +3919,7 @@ pub mod rgbd { } /// Constant methods for [crate::rgbd::Linemod_Modality] - pub trait Linemod_ModalityConst { + pub trait Linemod_ModalityTraitConst { fn as_raw_Linemod_Modality(&self) -> *const c_void; /// \brief Form a quantized image pyramid from a source image. @@ -3773,12 +3931,12 @@ pub mod rgbd { /// ## C++ default parameters /// * mask: Mat() #[inline] - fn process(&self, src: &core::Mat, mask: &core::Mat) -> Result> { + fn process(&self, src: &core::Mat, mask: &core::Mat) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_linemod_Modality_process_const_const_MatR_const_MatR(self.as_raw_Linemod_Modality(), src.as_raw_Mat(), mask.as_raw_Mat(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3803,10 +3961,8 @@ pub mod rgbd { } - /// \brief Interface for modalities that plug into the LINE template matching representation. - /// - /// \todo Max response, to allow optimization of summing (255/MAX) features as uint8 - pub trait Linemod_Modality: crate::rgbd::Linemod_ModalityConst { + /// Mutable methods for [crate::rgbd::Linemod_Modality] + pub trait Linemod_ModalityTrait: crate::rgbd::Linemod_ModalityTraitConst { fn as_raw_mut_Linemod_Modality(&mut self) -> *mut c_void; #[inline] @@ -3820,37 +3976,69 @@ pub mod rgbd { } - impl dyn Linemod_Modality + '_ { + /// \brief Interface for modalities that plug into the LINE template matching representation. + /// + /// \todo Max response, to allow optimization of summing (255/MAX) features as uint8 + pub struct Linemod_Modality { + ptr: *mut c_void + } + + opencv_type_boxed! { Linemod_Modality } + + impl Drop for Linemod_Modality { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Linemod_Modality_delete(instance: *mut c_void); } + unsafe { cv_Linemod_Modality_delete(self.as_raw_mut_Linemod_Modality()) }; + } + } + + unsafe impl Send for Linemod_Modality {} + + impl crate::rgbd::Linemod_ModalityTraitConst for Linemod_Modality { + #[inline] fn as_raw_Linemod_Modality(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::Linemod_ModalityTrait for Linemod_Modality { + #[inline] fn as_raw_mut_Linemod_Modality(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Linemod_Modality { /// \brief Create modality by name. /// /// The following modality types are supported: /// - "ColorGradient" /// - "DepthNormal" #[inline] - pub fn create(modality_type: &str) -> Result> { + pub fn create(modality_type: &str) -> Result> { extern_container_arg!(modality_type); return_send!(via ocvrs_return); unsafe { sys::cv_linemod_Modality_create_const_StringR(modality_type.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// \brief Load a modality from file. #[inline] - pub fn create_1(fn_: &core::FileNode) -> Result> { + pub fn create_1(fn_: &core::FileNode) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_linemod_Modality_create_const_FileNodeR(fn_.as_raw_FileNode(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_descendant! { Linemod_Modality, crate::rgbd::Linemod_ColorGradient, cv_Linemod_Modality_to_Linemod_ColorGradient } + + boxed_cast_descendant! { Linemod_Modality, crate::rgbd::Linemod_DepthNormal, cv_Linemod_Modality_to_Linemod_DepthNormal } + /// Constant methods for [crate::rgbd::Linemod_QuantizedPyramid] - pub trait Linemod_QuantizedPyramidConst { + pub trait Linemod_QuantizedPyramidTraitConst { fn as_raw_Linemod_QuantizedPyramid(&self) -> *const c_void; /// \brief Compute quantized image at current pyramid level for online detection. @@ -3880,8 +4068,8 @@ pub mod rgbd { } - /// \brief Represents a modality operating over an image pyramid. - pub trait Linemod_QuantizedPyramid: crate::rgbd::Linemod_QuantizedPyramidConst { + /// Mutable methods for [crate::rgbd::Linemod_QuantizedPyramid] + pub trait Linemod_QuantizedPyramidTrait: crate::rgbd::Linemod_QuantizedPyramidTraitConst { fn as_raw_mut_Linemod_QuantizedPyramid(&mut self) -> *mut c_void; /// \brief Go to the next pyramid level. @@ -3898,6 +4086,34 @@ pub mod rgbd { } + /// \brief Represents a modality operating over an image pyramid. + pub struct Linemod_QuantizedPyramid { + ptr: *mut c_void + } + + opencv_type_boxed! { Linemod_QuantizedPyramid } + + impl Drop for Linemod_QuantizedPyramid { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Linemod_QuantizedPyramid_delete(instance: *mut c_void); } + unsafe { cv_Linemod_QuantizedPyramid_delete(self.as_raw_mut_Linemod_QuantizedPyramid()) }; + } + } + + unsafe impl Send for Linemod_QuantizedPyramid {} + + impl crate::rgbd::Linemod_QuantizedPyramidTraitConst for Linemod_QuantizedPyramid { + #[inline] fn as_raw_Linemod_QuantizedPyramid(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::Linemod_QuantizedPyramidTrait for Linemod_QuantizedPyramid { + #[inline] fn as_raw_mut_Linemod_QuantizedPyramid(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Linemod_QuantizedPyramid { + } + /// Constant methods for [crate::rgbd::Linemod_Template] pub trait Linemod_TemplateTraitConst { fn as_raw_Linemod_Template(&self) -> *const c_void; @@ -4198,7 +4414,7 @@ pub mod rgbd { boxed_cast_base! { DepthCleaner, core::Algorithm, cv_DepthCleaner_to_Algorithm } /// Constant methods for [crate::rgbd::FastICPOdometry] - pub trait FastICPOdometryTraitConst: crate::rgbd::OdometryConst { + pub trait FastICPOdometryTraitConst: crate::rgbd::OdometryTraitConst { fn as_raw_FastICPOdometry(&self) -> *const c_void; #[inline] @@ -4287,7 +4503,7 @@ pub mod rgbd { } /// Mutable methods for [crate::rgbd::FastICPOdometry] - pub trait FastICPOdometryTrait: crate::rgbd::FastICPOdometryTraitConst + crate::rgbd::Odometry { + pub trait FastICPOdometryTrait: crate::rgbd::FastICPOdometryTraitConst + crate::rgbd::OdometryTrait { fn as_raw_mut_FastICPOdometry(&mut self) -> *mut c_void; #[inline] @@ -4398,11 +4614,11 @@ pub mod rgbd { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::rgbd::OdometryConst for FastICPOdometry { + impl crate::rgbd::OdometryTraitConst for FastICPOdometry { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.as_raw() } } - impl crate::rgbd::Odometry for FastICPOdometry { + impl crate::rgbd::OdometryTrait for FastICPOdometry { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4476,7 +4692,7 @@ pub mod rgbd { boxed_cast_base! { FastICPOdometry, core::Algorithm, cv_FastICPOdometry_to_Algorithm } /// Constant methods for [crate::rgbd::ICPOdometry] - pub trait ICPOdometryTraitConst: crate::rgbd::OdometryConst { + pub trait ICPOdometryTraitConst: crate::rgbd::OdometryTraitConst { fn as_raw_ICPOdometry(&self) -> *const c_void; #[inline] @@ -4584,7 +4800,7 @@ pub mod rgbd { } /// Mutable methods for [crate::rgbd::ICPOdometry] - pub trait ICPOdometryTrait: crate::rgbd::ICPOdometryTraitConst + crate::rgbd::Odometry { + pub trait ICPOdometryTrait: crate::rgbd::ICPOdometryTraitConst + crate::rgbd::OdometryTrait { fn as_raw_mut_ICPOdometry(&mut self) -> *mut c_void; #[inline] @@ -4696,11 +4912,11 @@ pub mod rgbd { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::rgbd::OdometryConst for ICPOdometry { + impl crate::rgbd::OdometryTraitConst for ICPOdometry { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.as_raw() } } - impl crate::rgbd::Odometry for ICPOdometry { + impl crate::rgbd::OdometryTrait for ICPOdometry { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4774,7 +4990,7 @@ pub mod rgbd { boxed_cast_base! { ICPOdometry, core::Algorithm, cv_ICPOdometry_to_Algorithm } /// Constant methods for [crate::rgbd::Odometry] - pub trait OdometryConst: core::AlgorithmTraitConst { + pub trait OdometryTraitConst: core::AlgorithmTraitConst { fn as_raw_Odometry(&self) -> *const c_void; /// Method to compute a transformation from the source frame to the destination one. @@ -4863,8 +5079,8 @@ pub mod rgbd { } - /// Base class for computation of odometry. - pub trait Odometry: core::AlgorithmTrait + crate::rgbd::OdometryConst { + /// Mutable methods for [crate::rgbd::Odometry] + pub trait OdometryTrait: core::AlgorithmTrait + crate::rgbd::OdometryTraitConst { fn as_raw_mut_Odometry(&mut self) -> *mut c_void; /// ## See also @@ -4891,7 +5107,40 @@ pub mod rgbd { } - impl dyn Odometry + '_ { + /// Base class for computation of odometry. + pub struct Odometry { + ptr: *mut c_void + } + + opencv_type_boxed! { Odometry } + + impl Drop for Odometry { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Odometry_delete(instance: *mut c_void); } + unsafe { cv_Odometry_delete(self.as_raw_mut_Odometry()) }; + } + } + + unsafe impl Send for Odometry {} + + impl core::AlgorithmTraitConst for Odometry { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Odometry { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::rgbd::OdometryTraitConst for Odometry { + #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.as_raw() } + } + + impl crate::rgbd::OdometryTrait for Odometry { + #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Odometry { #[inline] pub fn default_min_depth() -> Result { return_send!(via ocvrs_return); @@ -4947,17 +5196,28 @@ pub mod rgbd { } #[inline] - pub fn create(odometry_type: &str) -> Result> { + pub fn create(odometry_type: &str) -> Result> { extern_container_arg!(odometry_type); return_send!(via ocvrs_return); unsafe { sys::cv_rgbd_Odometry_create_const_StringR(odometry_type.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_descendant! { Odometry, crate::rgbd::FastICPOdometry, cv_Odometry_to_FastICPOdometry } + + boxed_cast_descendant! { Odometry, crate::rgbd::ICPOdometry, cv_Odometry_to_ICPOdometry } + + boxed_cast_descendant! { Odometry, crate::rgbd::RgbdICPOdometry, cv_Odometry_to_RgbdICPOdometry } + + boxed_cast_descendant! { Odometry, crate::rgbd::RgbdOdometry, cv_Odometry_to_RgbdOdometry } + + boxed_cast_base! { Odometry, core::Algorithm, cv_Odometry_to_Algorithm } + /// Constant methods for [crate::rgbd::OdometryFrame] pub trait OdometryFrameTraitConst: crate::rgbd::RgbdFrameTraitConst { fn as_raw_OdometryFrame(&self) -> *const c_void; @@ -5341,7 +5601,7 @@ pub mod rgbd { boxed_cast_descendant! { RgbdFrame, crate::rgbd::OdometryFrame, cv_RgbdFrame_to_OdometryFrame } /// Constant methods for [crate::rgbd::RgbdICPOdometry] - pub trait RgbdICPOdometryTraitConst: crate::rgbd::OdometryConst { + pub trait RgbdICPOdometryTraitConst: crate::rgbd::OdometryTraitConst { fn as_raw_RgbdICPOdometry(&self) -> *const c_void; #[inline] @@ -5459,7 +5719,7 @@ pub mod rgbd { } /// Mutable methods for [crate::rgbd::RgbdICPOdometry] - pub trait RgbdICPOdometryTrait: crate::rgbd::Odometry + crate::rgbd::RgbdICPOdometryTraitConst { + pub trait RgbdICPOdometryTrait: crate::rgbd::OdometryTrait + crate::rgbd::RgbdICPOdometryTraitConst { fn as_raw_mut_RgbdICPOdometry(&mut self) -> *mut c_void; #[inline] @@ -5579,11 +5839,11 @@ pub mod rgbd { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::rgbd::OdometryConst for RgbdICPOdometry { + impl crate::rgbd::OdometryTraitConst for RgbdICPOdometry { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.as_raw() } } - impl crate::rgbd::Odometry for RgbdICPOdometry { + impl crate::rgbd::OdometryTrait for RgbdICPOdometry { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -5901,7 +6161,7 @@ pub mod rgbd { boxed_cast_base! { RgbdNormals, core::Algorithm, cv_RgbdNormals_to_Algorithm } /// Constant methods for [crate::rgbd::RgbdOdometry] - pub trait RgbdOdometryTraitConst: crate::rgbd::OdometryConst { + pub trait RgbdOdometryTraitConst: crate::rgbd::OdometryTraitConst { fn as_raw_RgbdOdometry(&self) -> *const c_void; #[inline] @@ -6009,7 +6269,7 @@ pub mod rgbd { } /// Mutable methods for [crate::rgbd::RgbdOdometry] - pub trait RgbdOdometryTrait: crate::rgbd::Odometry + crate::rgbd::RgbdOdometryTraitConst { + pub trait RgbdOdometryTrait: crate::rgbd::OdometryTrait + crate::rgbd::RgbdOdometryTraitConst { fn as_raw_mut_RgbdOdometry(&mut self) -> *mut c_void; #[inline] @@ -6130,11 +6390,11 @@ pub mod rgbd { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::rgbd::OdometryConst for RgbdOdometry { + impl crate::rgbd::OdometryTraitConst for RgbdOdometry { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.as_raw() } } - impl crate::rgbd::Odometry for RgbdOdometry { + impl crate::rgbd::OdometryTrait for RgbdOdometry { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.as_raw_mut() } } diff --git a/docs/saliency.rs b/docs/saliency.rs index 233da1cc1..3b5bd0d53 100644 --- a/docs/saliency.rs +++ b/docs/saliency.rs @@ -34,23 +34,71 @@ pub mod saliency { //! Note: This API has been designed with PlantUML. If you modify this API please change UML. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::SaliencyConst, super::Saliency, super::StaticSaliencyConst, super::StaticSaliency, super::MotionSaliencyConst, super::MotionSaliency, super::ObjectnessConst, super::Objectness, super::StaticSaliencySpectralResidualTraitConst, super::StaticSaliencySpectralResidualTrait, super::StaticSaliencyFineGrainedTraitConst, super::StaticSaliencyFineGrainedTrait, super::MotionSaliencyBinWangApr2014TraitConst, super::MotionSaliencyBinWangApr2014Trait, super::ObjectnessBINGTraitConst, super::ObjectnessBINGTrait }; + pub use { super::SaliencyTraitConst, super::SaliencyTrait, super::StaticSaliencyTraitConst, super::StaticSaliencyTrait, super::MotionSaliencyTraitConst, super::MotionSaliencyTrait, super::ObjectnessTraitConst, super::ObjectnessTrait, super::StaticSaliencySpectralResidualTraitConst, super::StaticSaliencySpectralResidualTrait, super::StaticSaliencyFineGrainedTraitConst, super::StaticSaliencyFineGrainedTrait, super::MotionSaliencyBinWangApr2014TraitConst, super::MotionSaliencyBinWangApr2014Trait, super::ObjectnessBINGTraitConst, super::ObjectnessBINGTrait }; } /// Constant methods for [crate::saliency::MotionSaliency] - pub trait MotionSaliencyConst: crate::saliency::SaliencyConst { + pub trait MotionSaliencyTraitConst: crate::saliency::SaliencyTraitConst { fn as_raw_MotionSaliency(&self) -> *const c_void; } - /// ********************************* Motion Saliency Base Class *********************************** - pub trait MotionSaliency: crate::saliency::MotionSaliencyConst + crate::saliency::Saliency { + /// Mutable methods for [crate::saliency::MotionSaliency] + pub trait MotionSaliencyTrait: crate::saliency::MotionSaliencyTraitConst + crate::saliency::SaliencyTrait { fn as_raw_mut_MotionSaliency(&mut self) -> *mut c_void; } + /// ********************************* Motion Saliency Base Class *********************************** + pub struct MotionSaliency { + ptr: *mut c_void + } + + opencv_type_boxed! { MotionSaliency } + + impl Drop for MotionSaliency { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MotionSaliency_delete(instance: *mut c_void); } + unsafe { cv_MotionSaliency_delete(self.as_raw_mut_MotionSaliency()) }; + } + } + + unsafe impl Send for MotionSaliency {} + + impl core::AlgorithmTraitConst for MotionSaliency { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MotionSaliency { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::saliency::SaliencyTraitConst for MotionSaliency { + #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.as_raw() } + } + + impl crate::saliency::SaliencyTrait for MotionSaliency { + #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::saliency::MotionSaliencyTraitConst for MotionSaliency { + #[inline] fn as_raw_MotionSaliency(&self) -> *const c_void { self.as_raw() } + } + + impl crate::saliency::MotionSaliencyTrait for MotionSaliency { + #[inline] fn as_raw_mut_MotionSaliency(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MotionSaliency { + } + + boxed_cast_descendant! { MotionSaliency, crate::saliency::MotionSaliencyBinWangApr2014, cv_MotionSaliency_to_MotionSaliencyBinWangApr2014 } + + boxed_cast_base! { MotionSaliency, core::Algorithm, cv_MotionSaliency_to_Algorithm } + /// Constant methods for [crate::saliency::MotionSaliencyBinWangApr2014] - pub trait MotionSaliencyBinWangApr2014TraitConst: crate::saliency::MotionSaliencyConst { + pub trait MotionSaliencyBinWangApr2014TraitConst: crate::saliency::MotionSaliencyTraitConst { fn as_raw_MotionSaliencyBinWangApr2014(&self) -> *const c_void; #[inline] @@ -74,7 +122,7 @@ pub mod saliency { } /// Mutable methods for [crate::saliency::MotionSaliencyBinWangApr2014] - pub trait MotionSaliencyBinWangApr2014Trait: crate::saliency::MotionSaliency + crate::saliency::MotionSaliencyBinWangApr2014TraitConst { + pub trait MotionSaliencyBinWangApr2014Trait: crate::saliency::MotionSaliencyBinWangApr2014TraitConst + crate::saliency::MotionSaliencyTrait { fn as_raw_mut_MotionSaliencyBinWangApr2014(&mut self) -> *mut c_void; #[inline] @@ -165,19 +213,19 @@ pub mod saliency { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::saliency::MotionSaliencyConst for MotionSaliencyBinWangApr2014 { + impl crate::saliency::MotionSaliencyTraitConst for MotionSaliencyBinWangApr2014 { #[inline] fn as_raw_MotionSaliency(&self) -> *const c_void { self.as_raw() } } - impl crate::saliency::MotionSaliency for MotionSaliencyBinWangApr2014 { + impl crate::saliency::MotionSaliencyTrait for MotionSaliencyBinWangApr2014 { #[inline] fn as_raw_mut_MotionSaliency(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::saliency::SaliencyConst for MotionSaliencyBinWangApr2014 { + impl crate::saliency::SaliencyTraitConst for MotionSaliencyBinWangApr2014 { #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.as_raw() } } - impl crate::saliency::Saliency for MotionSaliencyBinWangApr2014 { + impl crate::saliency::SaliencyTrait for MotionSaliencyBinWangApr2014 { #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -215,19 +263,67 @@ pub mod saliency { boxed_cast_base! { MotionSaliencyBinWangApr2014, core::Algorithm, cv_MotionSaliencyBinWangApr2014_to_Algorithm } /// Constant methods for [crate::saliency::Objectness] - pub trait ObjectnessConst: crate::saliency::SaliencyConst { + pub trait ObjectnessTraitConst: crate::saliency::SaliencyTraitConst { fn as_raw_Objectness(&self) -> *const c_void; } - /// ********************************* Objectness Base Class *********************************** - pub trait Objectness: crate::saliency::ObjectnessConst + crate::saliency::Saliency { + /// Mutable methods for [crate::saliency::Objectness] + pub trait ObjectnessTrait: crate::saliency::ObjectnessTraitConst + crate::saliency::SaliencyTrait { fn as_raw_mut_Objectness(&mut self) -> *mut c_void; } + /// ********************************* Objectness Base Class *********************************** + pub struct Objectness { + ptr: *mut c_void + } + + opencv_type_boxed! { Objectness } + + impl Drop for Objectness { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Objectness_delete(instance: *mut c_void); } + unsafe { cv_Objectness_delete(self.as_raw_mut_Objectness()) }; + } + } + + unsafe impl Send for Objectness {} + + impl core::AlgorithmTraitConst for Objectness { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Objectness { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::saliency::SaliencyTraitConst for Objectness { + #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.as_raw() } + } + + impl crate::saliency::SaliencyTrait for Objectness { + #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::saliency::ObjectnessTraitConst for Objectness { + #[inline] fn as_raw_Objectness(&self) -> *const c_void { self.as_raw() } + } + + impl crate::saliency::ObjectnessTrait for Objectness { + #[inline] fn as_raw_mut_Objectness(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Objectness { + } + + boxed_cast_descendant! { Objectness, crate::saliency::ObjectnessBING, cv_Objectness_to_ObjectnessBING } + + boxed_cast_base! { Objectness, core::Algorithm, cv_Objectness_to_Algorithm } + /// Constant methods for [crate::saliency::ObjectnessBING] - pub trait ObjectnessBINGTraitConst: crate::saliency::ObjectnessConst { + pub trait ObjectnessBINGTraitConst: crate::saliency::ObjectnessTraitConst { fn as_raw_ObjectnessBING(&self) -> *const c_void; #[inline] @@ -269,7 +365,7 @@ pub mod saliency { } /// Mutable methods for [crate::saliency::ObjectnessBING] - pub trait ObjectnessBINGTrait: crate::saliency::Objectness + crate::saliency::ObjectnessBINGTraitConst { + pub trait ObjectnessBINGTrait: crate::saliency::ObjectnessBINGTraitConst + crate::saliency::ObjectnessTrait { fn as_raw_mut_ObjectnessBING(&mut self) -> *mut c_void; #[inline] @@ -392,19 +488,19 @@ pub mod saliency { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::saliency::ObjectnessConst for ObjectnessBING { + impl crate::saliency::ObjectnessTraitConst for ObjectnessBING { #[inline] fn as_raw_Objectness(&self) -> *const c_void { self.as_raw() } } - impl crate::saliency::Objectness for ObjectnessBING { + impl crate::saliency::ObjectnessTrait for ObjectnessBING { #[inline] fn as_raw_mut_Objectness(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::saliency::SaliencyConst for ObjectnessBING { + impl crate::saliency::SaliencyTraitConst for ObjectnessBING { #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.as_raw() } } - impl crate::saliency::Saliency for ObjectnessBING { + impl crate::saliency::SaliencyTrait for ObjectnessBING { #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -442,13 +538,13 @@ pub mod saliency { boxed_cast_base! { ObjectnessBING, core::Algorithm, cv_ObjectnessBING_to_Algorithm } /// Constant methods for [crate::saliency::Saliency] - pub trait SaliencyConst: core::AlgorithmTraitConst { + pub trait SaliencyTraitConst: core::AlgorithmTraitConst { fn as_raw_Saliency(&self) -> *const c_void; } - /// ********************************* Saliency Base Class *********************************** - pub trait Saliency: core::AlgorithmTrait + crate::saliency::SaliencyConst { + /// Mutable methods for [crate::saliency::Saliency] + pub trait SaliencyTrait: core::AlgorithmTrait + crate::saliency::SaliencyTraitConst { fn as_raw_mut_Saliency(&mut self) -> *mut c_void; /// \brief Compute the saliency @@ -468,14 +564,52 @@ pub mod saliency { } + /// ********************************* Saliency Base Class *********************************** + pub struct Saliency { + ptr: *mut c_void + } + + opencv_type_boxed! { Saliency } + + impl Drop for Saliency { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Saliency_delete(instance: *mut c_void); } + unsafe { cv_Saliency_delete(self.as_raw_mut_Saliency()) }; + } + } + + unsafe impl Send for Saliency {} + + impl core::AlgorithmTraitConst for Saliency { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Saliency { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::saliency::SaliencyTraitConst for Saliency { + #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.as_raw() } + } + + impl crate::saliency::SaliencyTrait for Saliency { + #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Saliency { + } + + boxed_cast_base! { Saliency, core::Algorithm, cv_Saliency_to_Algorithm } + /// Constant methods for [crate::saliency::StaticSaliency] - pub trait StaticSaliencyConst: crate::saliency::SaliencyConst { + pub trait StaticSaliencyTraitConst: crate::saliency::SaliencyTraitConst { fn as_raw_StaticSaliency(&self) -> *const c_void; } - /// ********************************* Static Saliency Base Class *********************************** - pub trait StaticSaliency: crate::saliency::Saliency + crate::saliency::StaticSaliencyConst { + /// Mutable methods for [crate::saliency::StaticSaliency] + pub trait StaticSaliencyTrait: crate::saliency::SaliencyTrait + crate::saliency::StaticSaliencyTraitConst { fn as_raw_mut_StaticSaliency(&mut self) -> *mut c_void; /// This function perform a binary map of given saliency map. This is obtained in this @@ -506,14 +640,64 @@ pub mod saliency { } + /// ********************************* Static Saliency Base Class *********************************** + pub struct StaticSaliency { + ptr: *mut c_void + } + + opencv_type_boxed! { StaticSaliency } + + impl Drop for StaticSaliency { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_StaticSaliency_delete(instance: *mut c_void); } + unsafe { cv_StaticSaliency_delete(self.as_raw_mut_StaticSaliency()) }; + } + } + + unsafe impl Send for StaticSaliency {} + + impl core::AlgorithmTraitConst for StaticSaliency { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for StaticSaliency { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::saliency::SaliencyTraitConst for StaticSaliency { + #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.as_raw() } + } + + impl crate::saliency::SaliencyTrait for StaticSaliency { + #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::saliency::StaticSaliencyTraitConst for StaticSaliency { + #[inline] fn as_raw_StaticSaliency(&self) -> *const c_void { self.as_raw() } + } + + impl crate::saliency::StaticSaliencyTrait for StaticSaliency { + #[inline] fn as_raw_mut_StaticSaliency(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StaticSaliency { + } + + boxed_cast_descendant! { StaticSaliency, crate::saliency::StaticSaliencyFineGrained, cv_StaticSaliency_to_StaticSaliencyFineGrained } + + boxed_cast_descendant! { StaticSaliency, crate::saliency::StaticSaliencySpectralResidual, cv_StaticSaliency_to_StaticSaliencySpectralResidual } + + boxed_cast_base! { StaticSaliency, core::Algorithm, cv_StaticSaliency_to_Algorithm } + /// Constant methods for [crate::saliency::StaticSaliencyFineGrained] - pub trait StaticSaliencyFineGrainedTraitConst: crate::saliency::StaticSaliencyConst { + pub trait StaticSaliencyFineGrainedTraitConst: crate::saliency::StaticSaliencyTraitConst { fn as_raw_StaticSaliencyFineGrained(&self) -> *const c_void; } /// Mutable methods for [crate::saliency::StaticSaliencyFineGrained] - pub trait StaticSaliencyFineGrainedTrait: crate::saliency::StaticSaliency + crate::saliency::StaticSaliencyFineGrainedTraitConst { + pub trait StaticSaliencyFineGrainedTrait: crate::saliency::StaticSaliencyFineGrainedTraitConst + crate::saliency::StaticSaliencyTrait { fn as_raw_mut_StaticSaliencyFineGrained(&mut self) -> *mut c_void; #[inline] @@ -557,19 +741,19 @@ pub mod saliency { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::saliency::SaliencyConst for StaticSaliencyFineGrained { + impl crate::saliency::SaliencyTraitConst for StaticSaliencyFineGrained { #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.as_raw() } } - impl crate::saliency::Saliency for StaticSaliencyFineGrained { + impl crate::saliency::SaliencyTrait for StaticSaliencyFineGrained { #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::saliency::StaticSaliencyConst for StaticSaliencyFineGrained { + impl crate::saliency::StaticSaliencyTraitConst for StaticSaliencyFineGrained { #[inline] fn as_raw_StaticSaliency(&self) -> *const c_void { self.as_raw() } } - impl crate::saliency::StaticSaliency for StaticSaliencyFineGrained { + impl crate::saliency::StaticSaliencyTrait for StaticSaliencyFineGrained { #[inline] fn as_raw_mut_StaticSaliency(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -607,7 +791,7 @@ pub mod saliency { boxed_cast_base! { StaticSaliencyFineGrained, core::Algorithm, cv_StaticSaliencyFineGrained_to_Algorithm } /// Constant methods for [crate::saliency::StaticSaliencySpectralResidual] - pub trait StaticSaliencySpectralResidualTraitConst: crate::saliency::StaticSaliencyConst { + pub trait StaticSaliencySpectralResidualTraitConst: crate::saliency::StaticSaliencyTraitConst { fn as_raw_StaticSaliencySpectralResidual(&self) -> *const c_void; #[inline] @@ -640,7 +824,7 @@ pub mod saliency { } /// Mutable methods for [crate::saliency::StaticSaliencySpectralResidual] - pub trait StaticSaliencySpectralResidualTrait: crate::saliency::StaticSaliency + crate::saliency::StaticSaliencySpectralResidualTraitConst { + pub trait StaticSaliencySpectralResidualTrait: crate::saliency::StaticSaliencySpectralResidualTraitConst + crate::saliency::StaticSaliencyTrait { fn as_raw_mut_StaticSaliencySpectralResidual(&mut self) -> *mut c_void; #[inline] @@ -713,19 +897,19 @@ pub mod saliency { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::saliency::SaliencyConst for StaticSaliencySpectralResidual { + impl crate::saliency::SaliencyTraitConst for StaticSaliencySpectralResidual { #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.as_raw() } } - impl crate::saliency::Saliency for StaticSaliencySpectralResidual { + impl crate::saliency::SaliencyTrait for StaticSaliencySpectralResidual { #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::saliency::StaticSaliencyConst for StaticSaliencySpectralResidual { + impl crate::saliency::StaticSaliencyTraitConst for StaticSaliencySpectralResidual { #[inline] fn as_raw_StaticSaliency(&self) -> *const c_void { self.as_raw() } } - impl crate::saliency::StaticSaliency for StaticSaliencySpectralResidual { + impl crate::saliency::StaticSaliencyTrait for StaticSaliencySpectralResidual { #[inline] fn as_raw_mut_StaticSaliency(&mut self) -> *mut c_void { self.as_raw_mut() } } diff --git a/docs/sfm.rs b/docs/sfm.rs index 87a3ae979..7c768933a 100644 --- a/docs/sfm.rs +++ b/docs/sfm.rs @@ -55,7 +55,7 @@ pub mod sfm { //! Check installation instructions in the following tutorial: [tutorial_sfm_installation] use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::BaseSFMConst, super::BaseSFM, super::SFMLibmvEuclideanReconstructionConst, super::SFMLibmvEuclideanReconstruction }; + pub use { super::BaseSFMTraitConst, super::BaseSFMTrait, super::SFMLibmvEuclideanReconstructionTraitConst, super::SFMLibmvEuclideanReconstructionTrait }; } pub const SFM_DISTORTION_MODEL_DIVISION: i32 = 1; @@ -757,7 +757,7 @@ pub mod sfm { } /// Constant methods for [crate::sfm::BaseSFM] - pub trait BaseSFMConst { + pub trait BaseSFMTraitConst { fn as_raw_BaseSFM(&self) -> *const c_void; #[inline] @@ -781,8 +781,8 @@ pub mod sfm { } - /// base class BaseSFM declares a common API that would be used in a typical scene reconstruction scenario - pub trait BaseSFM: crate::sfm::BaseSFMConst { + /// Mutable methods for [crate::sfm::BaseSFM] + pub trait BaseSFMTrait: crate::sfm::BaseSFMTraitConst { fn as_raw_mut_BaseSFM(&mut self) -> *mut c_void; #[inline] @@ -872,8 +872,36 @@ pub mod sfm { } + /// base class BaseSFM declares a common API that would be used in a typical scene reconstruction scenario + pub struct BaseSFM { + ptr: *mut c_void + } + + opencv_type_boxed! { BaseSFM } + + impl Drop for BaseSFM { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BaseSFM_delete(instance: *mut c_void); } + unsafe { cv_BaseSFM_delete(self.as_raw_mut_BaseSFM()) }; + } + } + + unsafe impl Send for BaseSFM {} + + impl crate::sfm::BaseSFMTraitConst for BaseSFM { + #[inline] fn as_raw_BaseSFM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::sfm::BaseSFMTrait for BaseSFM { + #[inline] fn as_raw_mut_BaseSFM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BaseSFM { + } + /// Constant methods for [crate::sfm::SFMLibmvEuclideanReconstruction] - pub trait SFMLibmvEuclideanReconstructionConst: crate::sfm::BaseSFMConst { + pub trait SFMLibmvEuclideanReconstructionTraitConst: crate::sfm::BaseSFMTraitConst { fn as_raw_SFMLibmvEuclideanReconstruction(&self) -> *const c_void; /// Returns the computed reprojection error. @@ -899,8 +927,8 @@ pub mod sfm { } - /// SFMLibmvEuclideanReconstruction class provides an interface with the Libmv Structure From Motion pipeline. - pub trait SFMLibmvEuclideanReconstruction: crate::sfm::BaseSFM + crate::sfm::SFMLibmvEuclideanReconstructionConst { + /// Mutable methods for [crate::sfm::SFMLibmvEuclideanReconstruction] + pub trait SFMLibmvEuclideanReconstructionTrait: crate::sfm::BaseSFMTrait + crate::sfm::SFMLibmvEuclideanReconstructionTraitConst { fn as_raw_mut_SFMLibmvEuclideanReconstruction(&mut self) -> *mut c_void; /// Calls the pipeline in order to perform Eclidean reconstruction. @@ -1043,23 +1071,57 @@ pub mod sfm { } - impl dyn SFMLibmvEuclideanReconstruction + '_ { + /// SFMLibmvEuclideanReconstruction class provides an interface with the Libmv Structure From Motion pipeline. + pub struct SFMLibmvEuclideanReconstruction { + ptr: *mut c_void + } + + opencv_type_boxed! { SFMLibmvEuclideanReconstruction } + + impl Drop for SFMLibmvEuclideanReconstruction { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SFMLibmvEuclideanReconstruction_delete(instance: *mut c_void); } + unsafe { cv_SFMLibmvEuclideanReconstruction_delete(self.as_raw_mut_SFMLibmvEuclideanReconstruction()) }; + } + } + + unsafe impl Send for SFMLibmvEuclideanReconstruction {} + + impl crate::sfm::BaseSFMTraitConst for SFMLibmvEuclideanReconstruction { + #[inline] fn as_raw_BaseSFM(&self) -> *const c_void { self.as_raw() } + } + + impl crate::sfm::BaseSFMTrait for SFMLibmvEuclideanReconstruction { + #[inline] fn as_raw_mut_BaseSFM(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::sfm::SFMLibmvEuclideanReconstructionTraitConst for SFMLibmvEuclideanReconstruction { + #[inline] fn as_raw_SFMLibmvEuclideanReconstruction(&self) -> *const c_void { self.as_raw() } + } + + impl crate::sfm::SFMLibmvEuclideanReconstructionTrait for SFMLibmvEuclideanReconstruction { + #[inline] fn as_raw_mut_SFMLibmvEuclideanReconstruction(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SFMLibmvEuclideanReconstruction { /// Creates an instance of the SFMLibmvEuclideanReconstruction class. Initializes Libmv. /// /// ## C++ default parameters /// * camera_instrinsic_options: libmv_CameraIntrinsicsOptions() /// * reconstruction_options: libmv_ReconstructionOptions() #[inline] - pub fn create(camera_instrinsic_options: crate::sfm::libmv_CameraIntrinsicsOptions, reconstruction_options: crate::sfm::libmv_ReconstructionOptions) -> Result> { + pub fn create(camera_instrinsic_options: crate::sfm::libmv_CameraIntrinsicsOptions, reconstruction_options: crate::sfm::libmv_ReconstructionOptions) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_sfm_SFMLibmvEuclideanReconstruction_create_const_libmv_CameraIntrinsicsOptionsR_const_libmv_ReconstructionOptionsR(&camera_instrinsic_options, &reconstruction_options, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Data structure describing the camera model and its parameters. /// ## Parameters /// * _distortion_model: Type of camera model. diff --git a/docs/shape.rs b/docs/shape.rs index 399a2ab1b..fb6a3cd5d 100644 --- a/docs/shape.rs +++ b/docs/shape.rs @@ -2,7 +2,7 @@ pub mod shape { //! # Shape Distance and Matching use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::ShapeTransformerConst, super::ShapeTransformer, super::ThinPlateSplineShapeTransformerConst, super::ThinPlateSplineShapeTransformer, super::AffineTransformerConst, super::AffineTransformer, super::HistogramCostExtractorConst, super::HistogramCostExtractor, super::NormHistogramCostExtractorConst, super::NormHistogramCostExtractor, super::EMDHistogramCostExtractorConst, super::EMDHistogramCostExtractor, super::ChiHistogramCostExtractorConst, super::ChiHistogramCostExtractor, super::EMDL1HistogramCostExtractorConst, super::EMDL1HistogramCostExtractor, super::ShapeDistanceExtractorConst, super::ShapeDistanceExtractor, super::ShapeContextDistanceExtractorConst, super::ShapeContextDistanceExtractor, super::HausdorffDistanceExtractorConst, super::HausdorffDistanceExtractor }; + pub use { super::ShapeTransformerTraitConst, super::ShapeTransformerTrait, super::ThinPlateSplineShapeTransformerTraitConst, super::ThinPlateSplineShapeTransformerTrait, super::AffineTransformerTraitConst, super::AffineTransformerTrait, super::HistogramCostExtractorTraitConst, super::HistogramCostExtractorTrait, super::NormHistogramCostExtractorTraitConst, super::NormHistogramCostExtractorTrait, super::EMDHistogramCostExtractorTraitConst, super::EMDHistogramCostExtractorTrait, super::ChiHistogramCostExtractorTraitConst, super::ChiHistogramCostExtractorTrait, super::EMDL1HistogramCostExtractorTraitConst, super::EMDL1HistogramCostExtractorTrait, super::ShapeDistanceExtractorTraitConst, super::ShapeDistanceExtractorTrait, super::ShapeContextDistanceExtractorTraitConst, super::ShapeContextDistanceExtractorTrait, super::HausdorffDistanceExtractorTraitConst, super::HausdorffDistanceExtractorTrait }; } /// Computes the "minimal work" distance between two weighted point configurations base on the papers @@ -27,12 +27,12 @@ pub mod shape { /// Complete constructor #[inline] - pub fn create_affine_transformer(full_affine: bool) -> Result> { + pub fn create_affine_transformer(full_affine: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createAffineTransformer_bool(full_affine, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -40,12 +40,12 @@ pub mod shape { /// * n_dummies: 25 /// * default_cost: 0.2f #[inline] - pub fn create_chi_histogram_cost_extractor(n_dummies: i32, default_cost: f32) -> Result> { + pub fn create_chi_histogram_cost_extractor(n_dummies: i32, default_cost: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createChiHistogramCostExtractor_int_float(n_dummies, default_cost, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -54,12 +54,12 @@ pub mod shape { /// * n_dummies: 25 /// * default_cost: 0.2f #[inline] - pub fn create_emd_histogram_cost_extractor(flag: i32, n_dummies: i32, default_cost: f32) -> Result> { + pub fn create_emd_histogram_cost_extractor(flag: i32, n_dummies: i32, default_cost: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createEMDHistogramCostExtractor_int_int_float(flag, n_dummies, default_cost, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -67,12 +67,12 @@ pub mod shape { /// * n_dummies: 25 /// * default_cost: 0.2f #[inline] - pub fn create_emdl1_histogram_cost_extractor(n_dummies: i32, default_cost: f32) -> Result> { + pub fn create_emdl1_histogram_cost_extractor(n_dummies: i32, default_cost: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createEMDL1HistogramCostExtractor_int_float(n_dummies, default_cost, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -80,12 +80,12 @@ pub mod shape { /// * distance_flag: cv::NORM_L2 /// * rank_prop: 0.6f #[inline] - pub fn create_hausdorff_distance_extractor(distance_flag: i32, rank_prop: f32) -> Result> { + pub fn create_hausdorff_distance_extractor(distance_flag: i32, rank_prop: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createHausdorffDistanceExtractor_int_float(distance_flag, rank_prop, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -94,12 +94,12 @@ pub mod shape { /// * n_dummies: 25 /// * default_cost: 0.2f #[inline] - pub fn create_norm_histogram_cost_extractor(flag: i32, n_dummies: i32, default_cost: f32) -> Result> { + pub fn create_norm_histogram_cost_extractor(flag: i32, n_dummies: i32, default_cost: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createNormHistogramCostExtractor_int_int_float(flag, n_dummies, default_cost, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -112,12 +112,12 @@ pub mod shape { /// * comparer: createChiHistogramCostExtractor() /// * transformer: createThinPlateSplineShapeTransformer() #[inline] - pub fn create_shape_context_distance_extractor(n_angular_bins: i32, n_radial_bins: i32, inner_radius: f32, outer_radius: f32, iterations: i32, comparer: &core::Ptr, transformer: &core::Ptr) -> Result> { + pub fn create_shape_context_distance_extractor(n_angular_bins: i32, n_radial_bins: i32, inner_radius: f32, outer_radius: f32, iterations: i32, comparer: &core::Ptr, transformer: &core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createShapeContextDistanceExtractor_int_int_float_float_int_const_PtrLHistogramCostExtractorGR_const_PtrLShapeTransformerGR(n_angular_bins, n_radial_bins, inner_radius, outer_radius, iterations, comparer.as_raw_PtrOfHistogramCostExtractor(), transformer.as_raw_PtrOfShapeTransformer(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -126,17 +126,17 @@ pub mod shape { /// ## C++ default parameters /// * regularization_parameter: 0 #[inline] - pub fn create_thin_plate_spline_shape_transformer(regularization_parameter: f64) -> Result> { + pub fn create_thin_plate_spline_shape_transformer(regularization_parameter: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createThinPlateSplineShapeTransformer_double(regularization_parameter, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Constant methods for [crate::shape::AffineTransformer] - pub trait AffineTransformerConst: crate::shape::ShapeTransformerConst { + pub trait AffineTransformerTraitConst: crate::shape::ShapeTransformerTraitConst { fn as_raw_AffineTransformer(&self) -> *const c_void; #[inline] @@ -150,8 +150,8 @@ pub mod shape { } - /// Wrapper class for the OpenCV Affine Transformation algorithm. : - pub trait AffineTransformer: crate::shape::AffineTransformerConst + crate::shape::ShapeTransformer { + /// Mutable methods for [crate::shape::AffineTransformer] + pub trait AffineTransformerTrait: crate::shape::AffineTransformerTraitConst + crate::shape::ShapeTransformerTrait { fn as_raw_mut_AffineTransformer(&mut self) -> *mut c_void; #[inline] @@ -165,20 +165,112 @@ pub mod shape { } + /// Wrapper class for the OpenCV Affine Transformation algorithm. : + pub struct AffineTransformer { + ptr: *mut c_void + } + + opencv_type_boxed! { AffineTransformer } + + impl Drop for AffineTransformer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_AffineTransformer_delete(instance: *mut c_void); } + unsafe { cv_AffineTransformer_delete(self.as_raw_mut_AffineTransformer()) }; + } + } + + unsafe impl Send for AffineTransformer {} + + impl core::AlgorithmTraitConst for AffineTransformer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for AffineTransformer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ShapeTransformerTraitConst for AffineTransformer { + #[inline] fn as_raw_ShapeTransformer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ShapeTransformerTrait for AffineTransformer { + #[inline] fn as_raw_mut_ShapeTransformer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::AffineTransformerTraitConst for AffineTransformer { + #[inline] fn as_raw_AffineTransformer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::AffineTransformerTrait for AffineTransformer { + #[inline] fn as_raw_mut_AffineTransformer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl AffineTransformer { + } + + boxed_cast_base! { AffineTransformer, core::Algorithm, cv_AffineTransformer_to_Algorithm } + /// Constant methods for [crate::shape::ChiHistogramCostExtractor] - pub trait ChiHistogramCostExtractorConst: crate::shape::HistogramCostExtractorConst { + pub trait ChiHistogramCostExtractorTraitConst: crate::shape::HistogramCostExtractorTraitConst { fn as_raw_ChiHistogramCostExtractor(&self) -> *const c_void; } - /// An Chi based cost extraction. : - pub trait ChiHistogramCostExtractor: crate::shape::ChiHistogramCostExtractorConst + crate::shape::HistogramCostExtractor { + /// Mutable methods for [crate::shape::ChiHistogramCostExtractor] + pub trait ChiHistogramCostExtractorTrait: crate::shape::ChiHistogramCostExtractorTraitConst + crate::shape::HistogramCostExtractorTrait { fn as_raw_mut_ChiHistogramCostExtractor(&mut self) -> *mut c_void; } + /// An Chi based cost extraction. : + pub struct ChiHistogramCostExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { ChiHistogramCostExtractor } + + impl Drop for ChiHistogramCostExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ChiHistogramCostExtractor_delete(instance: *mut c_void); } + unsafe { cv_ChiHistogramCostExtractor_delete(self.as_raw_mut_ChiHistogramCostExtractor()) }; + } + } + + unsafe impl Send for ChiHistogramCostExtractor {} + + impl core::AlgorithmTraitConst for ChiHistogramCostExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ChiHistogramCostExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::HistogramCostExtractorTraitConst for ChiHistogramCostExtractor { + #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::HistogramCostExtractorTrait for ChiHistogramCostExtractor { + #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ChiHistogramCostExtractorTraitConst for ChiHistogramCostExtractor { + #[inline] fn as_raw_ChiHistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ChiHistogramCostExtractorTrait for ChiHistogramCostExtractor { + #[inline] fn as_raw_mut_ChiHistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ChiHistogramCostExtractor { + } + + boxed_cast_base! { ChiHistogramCostExtractor, core::Algorithm, cv_ChiHistogramCostExtractor_to_Algorithm } + /// Constant methods for [crate::shape::EMDHistogramCostExtractor] - pub trait EMDHistogramCostExtractorConst: crate::shape::HistogramCostExtractorConst { + pub trait EMDHistogramCostExtractorTraitConst: crate::shape::HistogramCostExtractorTraitConst { fn as_raw_EMDHistogramCostExtractor(&self) -> *const c_void; #[inline] @@ -192,8 +284,8 @@ pub mod shape { } - /// An EMD based cost extraction. : - pub trait EMDHistogramCostExtractor: crate::shape::EMDHistogramCostExtractorConst + crate::shape::HistogramCostExtractor { + /// Mutable methods for [crate::shape::EMDHistogramCostExtractor] + pub trait EMDHistogramCostExtractorTrait: crate::shape::EMDHistogramCostExtractorTraitConst + crate::shape::HistogramCostExtractorTrait { fn as_raw_mut_EMDHistogramCostExtractor(&mut self) -> *mut c_void; #[inline] @@ -207,20 +299,112 @@ pub mod shape { } + /// An EMD based cost extraction. : + pub struct EMDHistogramCostExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { EMDHistogramCostExtractor } + + impl Drop for EMDHistogramCostExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_EMDHistogramCostExtractor_delete(instance: *mut c_void); } + unsafe { cv_EMDHistogramCostExtractor_delete(self.as_raw_mut_EMDHistogramCostExtractor()) }; + } + } + + unsafe impl Send for EMDHistogramCostExtractor {} + + impl core::AlgorithmTraitConst for EMDHistogramCostExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for EMDHistogramCostExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::HistogramCostExtractorTraitConst for EMDHistogramCostExtractor { + #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::HistogramCostExtractorTrait for EMDHistogramCostExtractor { + #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::EMDHistogramCostExtractorTraitConst for EMDHistogramCostExtractor { + #[inline] fn as_raw_EMDHistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::EMDHistogramCostExtractorTrait for EMDHistogramCostExtractor { + #[inline] fn as_raw_mut_EMDHistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl EMDHistogramCostExtractor { + } + + boxed_cast_base! { EMDHistogramCostExtractor, core::Algorithm, cv_EMDHistogramCostExtractor_to_Algorithm } + /// Constant methods for [crate::shape::EMDL1HistogramCostExtractor] - pub trait EMDL1HistogramCostExtractorConst: crate::shape::HistogramCostExtractorConst { + pub trait EMDL1HistogramCostExtractorTraitConst: crate::shape::HistogramCostExtractorTraitConst { fn as_raw_EMDL1HistogramCostExtractor(&self) -> *const c_void; } - /// An EMD-L1 based cost extraction. : - pub trait EMDL1HistogramCostExtractor: crate::shape::EMDL1HistogramCostExtractorConst + crate::shape::HistogramCostExtractor { + /// Mutable methods for [crate::shape::EMDL1HistogramCostExtractor] + pub trait EMDL1HistogramCostExtractorTrait: crate::shape::EMDL1HistogramCostExtractorTraitConst + crate::shape::HistogramCostExtractorTrait { fn as_raw_mut_EMDL1HistogramCostExtractor(&mut self) -> *mut c_void; } + /// An EMD-L1 based cost extraction. : + pub struct EMDL1HistogramCostExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { EMDL1HistogramCostExtractor } + + impl Drop for EMDL1HistogramCostExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_EMDL1HistogramCostExtractor_delete(instance: *mut c_void); } + unsafe { cv_EMDL1HistogramCostExtractor_delete(self.as_raw_mut_EMDL1HistogramCostExtractor()) }; + } + } + + unsafe impl Send for EMDL1HistogramCostExtractor {} + + impl core::AlgorithmTraitConst for EMDL1HistogramCostExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for EMDL1HistogramCostExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::HistogramCostExtractorTraitConst for EMDL1HistogramCostExtractor { + #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::HistogramCostExtractorTrait for EMDL1HistogramCostExtractor { + #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::EMDL1HistogramCostExtractorTraitConst for EMDL1HistogramCostExtractor { + #[inline] fn as_raw_EMDL1HistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::EMDL1HistogramCostExtractorTrait for EMDL1HistogramCostExtractor { + #[inline] fn as_raw_mut_EMDL1HistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl EMDL1HistogramCostExtractor { + } + + boxed_cast_base! { EMDL1HistogramCostExtractor, core::Algorithm, cv_EMDL1HistogramCostExtractor_to_Algorithm } + /// Constant methods for [crate::shape::HausdorffDistanceExtractor] - pub trait HausdorffDistanceExtractorConst: crate::shape::ShapeDistanceExtractorConst { + pub trait HausdorffDistanceExtractorTraitConst: crate::shape::ShapeDistanceExtractorTraitConst { fn as_raw_HausdorffDistanceExtractor(&self) -> *const c_void; #[inline] @@ -243,14 +427,8 @@ pub mod shape { } - /// ******************************************************************************** - /// / - /// / - /// A simple Hausdorff distance measure between shapes defined by contours - /// - /// according to the paper "Comparing Images using the Hausdorff distance." by D.P. Huttenlocher, G.A. - /// Klanderman, and W.J. Rucklidge. (PAMI 1993). : - pub trait HausdorffDistanceExtractor: crate::shape::HausdorffDistanceExtractorConst + crate::shape::ShapeDistanceExtractor { + /// Mutable methods for [crate::shape::HausdorffDistanceExtractor] + pub trait HausdorffDistanceExtractorTrait: crate::shape::HausdorffDistanceExtractorTraitConst + crate::shape::ShapeDistanceExtractorTrait { fn as_raw_mut_HausdorffDistanceExtractor(&mut self) -> *mut c_void; /// Set the norm used to compute the Hausdorff value between two shapes. It can be L1 or L2 norm. @@ -284,8 +462,60 @@ pub mod shape { } + /// ******************************************************************************** + /// / + /// / + /// A simple Hausdorff distance measure between shapes defined by contours + /// + /// according to the paper "Comparing Images using the Hausdorff distance." by D.P. Huttenlocher, G.A. + /// Klanderman, and W.J. Rucklidge. (PAMI 1993). : + pub struct HausdorffDistanceExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { HausdorffDistanceExtractor } + + impl Drop for HausdorffDistanceExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_HausdorffDistanceExtractor_delete(instance: *mut c_void); } + unsafe { cv_HausdorffDistanceExtractor_delete(self.as_raw_mut_HausdorffDistanceExtractor()) }; + } + } + + unsafe impl Send for HausdorffDistanceExtractor {} + + impl core::AlgorithmTraitConst for HausdorffDistanceExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for HausdorffDistanceExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ShapeDistanceExtractorTraitConst for HausdorffDistanceExtractor { + #[inline] fn as_raw_ShapeDistanceExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ShapeDistanceExtractorTrait for HausdorffDistanceExtractor { + #[inline] fn as_raw_mut_ShapeDistanceExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::HausdorffDistanceExtractorTraitConst for HausdorffDistanceExtractor { + #[inline] fn as_raw_HausdorffDistanceExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::HausdorffDistanceExtractorTrait for HausdorffDistanceExtractor { + #[inline] fn as_raw_mut_HausdorffDistanceExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl HausdorffDistanceExtractor { + } + + boxed_cast_base! { HausdorffDistanceExtractor, core::Algorithm, cv_HausdorffDistanceExtractor_to_Algorithm } + /// Constant methods for [crate::shape::HistogramCostExtractor] - pub trait HistogramCostExtractorConst: core::AlgorithmTraitConst { + pub trait HistogramCostExtractorTraitConst: core::AlgorithmTraitConst { fn as_raw_HistogramCostExtractor(&self) -> *const c_void; #[inline] @@ -308,8 +538,8 @@ pub mod shape { } - /// Abstract base class for histogram cost algorithms. - pub trait HistogramCostExtractor: core::AlgorithmTrait + crate::shape::HistogramCostExtractorConst { + /// Mutable methods for [crate::shape::HistogramCostExtractor] + pub trait HistogramCostExtractorTrait: core::AlgorithmTrait + crate::shape::HistogramCostExtractorTraitConst { fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void; #[inline] @@ -344,8 +574,46 @@ pub mod shape { } + /// Abstract base class for histogram cost algorithms. + pub struct HistogramCostExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { HistogramCostExtractor } + + impl Drop for HistogramCostExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_HistogramCostExtractor_delete(instance: *mut c_void); } + unsafe { cv_HistogramCostExtractor_delete(self.as_raw_mut_HistogramCostExtractor()) }; + } + } + + unsafe impl Send for HistogramCostExtractor {} + + impl core::AlgorithmTraitConst for HistogramCostExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for HistogramCostExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::HistogramCostExtractorTraitConst for HistogramCostExtractor { + #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::HistogramCostExtractorTrait for HistogramCostExtractor { + #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl HistogramCostExtractor { + } + + boxed_cast_base! { HistogramCostExtractor, core::Algorithm, cv_HistogramCostExtractor_to_Algorithm } + /// Constant methods for [crate::shape::NormHistogramCostExtractor] - pub trait NormHistogramCostExtractorConst: crate::shape::HistogramCostExtractorConst { + pub trait NormHistogramCostExtractorTraitConst: crate::shape::HistogramCostExtractorTraitConst { fn as_raw_NormHistogramCostExtractor(&self) -> *const c_void; #[inline] @@ -359,8 +627,8 @@ pub mod shape { } - /// A norm based cost extraction. : - pub trait NormHistogramCostExtractor: crate::shape::HistogramCostExtractor + crate::shape::NormHistogramCostExtractorConst { + /// Mutable methods for [crate::shape::NormHistogramCostExtractor] + pub trait NormHistogramCostExtractorTrait: crate::shape::HistogramCostExtractorTrait + crate::shape::NormHistogramCostExtractorTraitConst { fn as_raw_mut_NormHistogramCostExtractor(&mut self) -> *mut c_void; #[inline] @@ -374,8 +642,54 @@ pub mod shape { } + /// A norm based cost extraction. : + pub struct NormHistogramCostExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { NormHistogramCostExtractor } + + impl Drop for NormHistogramCostExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_NormHistogramCostExtractor_delete(instance: *mut c_void); } + unsafe { cv_NormHistogramCostExtractor_delete(self.as_raw_mut_NormHistogramCostExtractor()) }; + } + } + + unsafe impl Send for NormHistogramCostExtractor {} + + impl core::AlgorithmTraitConst for NormHistogramCostExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for NormHistogramCostExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::HistogramCostExtractorTraitConst for NormHistogramCostExtractor { + #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::HistogramCostExtractorTrait for NormHistogramCostExtractor { + #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::NormHistogramCostExtractorTraitConst for NormHistogramCostExtractor { + #[inline] fn as_raw_NormHistogramCostExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::NormHistogramCostExtractorTrait for NormHistogramCostExtractor { + #[inline] fn as_raw_mut_NormHistogramCostExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl NormHistogramCostExtractor { + } + + boxed_cast_base! { NormHistogramCostExtractor, core::Algorithm, cv_NormHistogramCostExtractor_to_Algorithm } + /// Constant methods for [crate::shape::ShapeContextDistanceExtractor] - pub trait ShapeContextDistanceExtractorConst: crate::shape::ShapeDistanceExtractorConst { + pub trait ShapeContextDistanceExtractorTraitConst: crate::shape::ShapeDistanceExtractorTraitConst { fn as_raw_ShapeContextDistanceExtractor(&self) -> *const c_void; #[inline] @@ -471,12 +785,12 @@ pub mod shape { } #[inline] - fn get_cost_extractor(&self) -> Result> { + fn get_cost_extractor(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ShapeContextDistanceExtractor_getCostExtractor_const(self.as_raw_ShapeContextDistanceExtractor(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -490,26 +804,19 @@ pub mod shape { } #[inline] - fn get_transform_algorithm(&self) -> Result> { + fn get_transform_algorithm(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ShapeContextDistanceExtractor_getTransformAlgorithm_const(self.as_raw_ShapeContextDistanceExtractor(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } - /// ******************************************************************************** - /// / - /// / - /// Implementation of the Shape Context descriptor and matching algorithm - /// - /// proposed by Belongie et al. in "Shape Matching and Object Recognition Using Shape Contexts" (PAMI - /// 2002). This implementation is packaged in a generic scheme, in order to allow you the - /// implementation of the common variations of the original pipeline. - pub trait ShapeContextDistanceExtractor: crate::shape::ShapeContextDistanceExtractorConst + crate::shape::ShapeDistanceExtractor { + /// Mutable methods for [crate::shape::ShapeContextDistanceExtractor] + pub trait ShapeContextDistanceExtractorTrait: crate::shape::ShapeContextDistanceExtractorTraitConst + crate::shape::ShapeDistanceExtractorTrait { fn as_raw_mut_ShapeContextDistanceExtractor(&mut self) -> *mut c_void; /// Establish the number of angular bins for the Shape Context Descriptor used in the shape matching @@ -657,7 +964,7 @@ pub mod shape { /// * comparer: Smart pointer to a HistogramCostExtractor, an algorithm that defines the cost /// matrix between descriptors. #[inline] - fn set_cost_extractor(&mut self, mut comparer: core::Ptr) -> Result<()> { + fn set_cost_extractor(&mut self, mut comparer: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_ShapeContextDistanceExtractor_setCostExtractor_PtrLHistogramCostExtractorG(self.as_raw_mut_ShapeContextDistanceExtractor(), comparer.as_raw_mut_PtrOfHistogramCostExtractor(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -684,7 +991,7 @@ pub mod shape { /// * transformer: Smart pointer to a ShapeTransformer, an algorithm that defines the aligning /// transformation. #[inline] - fn set_transform_algorithm(&mut self, mut transformer: core::Ptr) -> Result<()> { + fn set_transform_algorithm(&mut self, mut transformer: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_ShapeContextDistanceExtractor_setTransformAlgorithm_PtrLShapeTransformerG(self.as_raw_mut_ShapeContextDistanceExtractor(), transformer.as_raw_mut_PtrOfShapeTransformer(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -694,17 +1001,67 @@ pub mod shape { } + /// ******************************************************************************** + /// / + /// / + /// Implementation of the Shape Context descriptor and matching algorithm + /// + /// proposed by Belongie et al. in "Shape Matching and Object Recognition Using Shape Contexts" (PAMI + /// 2002). This implementation is packaged in a generic scheme, in order to allow you the + /// implementation of the common variations of the original pipeline. + pub struct ShapeContextDistanceExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { ShapeContextDistanceExtractor } + + impl Drop for ShapeContextDistanceExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ShapeContextDistanceExtractor_delete(instance: *mut c_void); } + unsafe { cv_ShapeContextDistanceExtractor_delete(self.as_raw_mut_ShapeContextDistanceExtractor()) }; + } + } + + unsafe impl Send for ShapeContextDistanceExtractor {} + + impl core::AlgorithmTraitConst for ShapeContextDistanceExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ShapeContextDistanceExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ShapeDistanceExtractorTraitConst for ShapeContextDistanceExtractor { + #[inline] fn as_raw_ShapeDistanceExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ShapeDistanceExtractorTrait for ShapeContextDistanceExtractor { + #[inline] fn as_raw_mut_ShapeDistanceExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ShapeContextDistanceExtractorTraitConst for ShapeContextDistanceExtractor { + #[inline] fn as_raw_ShapeContextDistanceExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ShapeContextDistanceExtractorTrait for ShapeContextDistanceExtractor { + #[inline] fn as_raw_mut_ShapeContextDistanceExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ShapeContextDistanceExtractor { + } + + boxed_cast_base! { ShapeContextDistanceExtractor, core::Algorithm, cv_ShapeContextDistanceExtractor_to_Algorithm } + /// Constant methods for [crate::shape::ShapeDistanceExtractor] - pub trait ShapeDistanceExtractorConst: core::AlgorithmTraitConst { + pub trait ShapeDistanceExtractorTraitConst: core::AlgorithmTraitConst { fn as_raw_ShapeDistanceExtractor(&self) -> *const c_void; } - /// @example modules/shape/samples/shape_example.cpp - /// An example using shape distance algorithm - /// - /// Abstract base class for shape distance algorithms. - pub trait ShapeDistanceExtractor: core::AlgorithmTrait + crate::shape::ShapeDistanceExtractorConst { + /// Mutable methods for [crate::shape::ShapeDistanceExtractor] + pub trait ShapeDistanceExtractorTrait: core::AlgorithmTrait + crate::shape::ShapeDistanceExtractorTraitConst { fn as_raw_mut_ShapeDistanceExtractor(&mut self) -> *mut c_void; /// Compute the shape distance between two shapes defined by its contours. @@ -725,8 +1082,49 @@ pub mod shape { } + /// @example modules/shape/samples/shape_example.cpp + /// An example using shape distance algorithm + /// + /// Abstract base class for shape distance algorithms. + pub struct ShapeDistanceExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { ShapeDistanceExtractor } + + impl Drop for ShapeDistanceExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ShapeDistanceExtractor_delete(instance: *mut c_void); } + unsafe { cv_ShapeDistanceExtractor_delete(self.as_raw_mut_ShapeDistanceExtractor()) }; + } + } + + unsafe impl Send for ShapeDistanceExtractor {} + + impl core::AlgorithmTraitConst for ShapeDistanceExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ShapeDistanceExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ShapeDistanceExtractorTraitConst for ShapeDistanceExtractor { + #[inline] fn as_raw_ShapeDistanceExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ShapeDistanceExtractorTrait for ShapeDistanceExtractor { + #[inline] fn as_raw_mut_ShapeDistanceExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ShapeDistanceExtractor { + } + + boxed_cast_base! { ShapeDistanceExtractor, core::Algorithm, cv_ShapeDistanceExtractor_to_Algorithm } + /// Constant methods for [crate::shape::ShapeTransformer] - pub trait ShapeTransformerConst: core::AlgorithmTraitConst { + pub trait ShapeTransformerTraitConst: core::AlgorithmTraitConst { fn as_raw_ShapeTransformer(&self) -> *const c_void; /// Apply a transformation, given a pre-estimated transformation parameters, to an Image. @@ -755,8 +1153,8 @@ pub mod shape { } - /// Abstract base class for shape transformation algorithms. - pub trait ShapeTransformer: core::AlgorithmTrait + crate::shape::ShapeTransformerConst { + /// Mutable methods for [crate::shape::ShapeTransformer] + pub trait ShapeTransformerTrait: core::AlgorithmTrait + crate::shape::ShapeTransformerTraitConst { fn as_raw_mut_ShapeTransformer(&mut self) -> *mut c_void; /// Estimate the transformation parameters of the current transformer algorithm, based on point matches. @@ -797,8 +1195,46 @@ pub mod shape { } + /// Abstract base class for shape transformation algorithms. + pub struct ShapeTransformer { + ptr: *mut c_void + } + + opencv_type_boxed! { ShapeTransformer } + + impl Drop for ShapeTransformer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ShapeTransformer_delete(instance: *mut c_void); } + unsafe { cv_ShapeTransformer_delete(self.as_raw_mut_ShapeTransformer()) }; + } + } + + unsafe impl Send for ShapeTransformer {} + + impl core::AlgorithmTraitConst for ShapeTransformer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ShapeTransformer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ShapeTransformerTraitConst for ShapeTransformer { + #[inline] fn as_raw_ShapeTransformer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ShapeTransformerTrait for ShapeTransformer { + #[inline] fn as_raw_mut_ShapeTransformer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ShapeTransformer { + } + + boxed_cast_base! { ShapeTransformer, core::Algorithm, cv_ShapeTransformer_to_Algorithm } + /// Constant methods for [crate::shape::ThinPlateSplineShapeTransformer] - pub trait ThinPlateSplineShapeTransformerConst: crate::shape::ShapeTransformerConst { + pub trait ThinPlateSplineShapeTransformerTraitConst: crate::shape::ShapeTransformerTraitConst { fn as_raw_ThinPlateSplineShapeTransformer(&self) -> *const c_void; #[inline] @@ -812,11 +1248,8 @@ pub mod shape { } - /// Definition of the transformation - /// - /// occupied in the paper "Principal Warps: Thin-Plate Splines and Decomposition of Deformations", by - /// F.L. Bookstein (PAMI 1989). : - pub trait ThinPlateSplineShapeTransformer: crate::shape::ShapeTransformer + crate::shape::ThinPlateSplineShapeTransformerConst { + /// Mutable methods for [crate::shape::ThinPlateSplineShapeTransformer] + pub trait ThinPlateSplineShapeTransformerTrait: crate::shape::ShapeTransformerTrait + crate::shape::ThinPlateSplineShapeTransformerTraitConst { fn as_raw_mut_ThinPlateSplineShapeTransformer(&mut self) -> *mut c_void; /// Set the regularization parameter for relaxing the exact interpolation requirements of the TPS @@ -834,4 +1267,53 @@ pub mod shape { } } + + /// Definition of the transformation + /// + /// occupied in the paper "Principal Warps: Thin-Plate Splines and Decomposition of Deformations", by + /// F.L. Bookstein (PAMI 1989). : + pub struct ThinPlateSplineShapeTransformer { + ptr: *mut c_void + } + + opencv_type_boxed! { ThinPlateSplineShapeTransformer } + + impl Drop for ThinPlateSplineShapeTransformer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ThinPlateSplineShapeTransformer_delete(instance: *mut c_void); } + unsafe { cv_ThinPlateSplineShapeTransformer_delete(self.as_raw_mut_ThinPlateSplineShapeTransformer()) }; + } + } + + unsafe impl Send for ThinPlateSplineShapeTransformer {} + + impl core::AlgorithmTraitConst for ThinPlateSplineShapeTransformer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ThinPlateSplineShapeTransformer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ShapeTransformerTraitConst for ThinPlateSplineShapeTransformer { + #[inline] fn as_raw_ShapeTransformer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ShapeTransformerTrait for ThinPlateSplineShapeTransformer { + #[inline] fn as_raw_mut_ShapeTransformer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::shape::ThinPlateSplineShapeTransformerTraitConst for ThinPlateSplineShapeTransformer { + #[inline] fn as_raw_ThinPlateSplineShapeTransformer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::shape::ThinPlateSplineShapeTransformerTrait for ThinPlateSplineShapeTransformer { + #[inline] fn as_raw_mut_ThinPlateSplineShapeTransformer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ThinPlateSplineShapeTransformer { + } + + boxed_cast_base! { ThinPlateSplineShapeTransformer, core::Algorithm, cv_ThinPlateSplineShapeTransformer_to_Algorithm } } diff --git a/docs/stereo.rs b/docs/stereo.rs index 3fd516e5e..3ccfd6b43 100644 --- a/docs/stereo.rs +++ b/docs/stereo.rs @@ -2,7 +2,7 @@ pub mod stereo { //! # Stereo Correspondance Algorithms use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::QuasiDenseStereoConst, super::QuasiDenseStereo }; + pub use { super::QuasiDenseStereoTraitConst, super::QuasiDenseStereoTrait }; } pub const CV_CS_CENSUS: i32 = 2; @@ -169,7 +169,7 @@ pub mod stereo { } /// Constant methods for [crate::stereo::QuasiDenseStereo] - pub trait QuasiDenseStereoConst { + pub trait QuasiDenseStereoTraitConst { fn as_raw_QuasiDenseStereo(&self) -> *const c_void; #[inline] @@ -182,28 +182,8 @@ pub mod stereo { } - /// Class containing the methods needed for Quasi Dense Stereo computation. - /// - /// This module contains the code to perform quasi dense stereo matching. - /// The method initially starts with a sparse 3D reconstruction based on feature matching across a - /// stereo image pair and subsequently propagates the structure into neighboring image regions. - /// To obtain initial seed correspondences, the algorithm locates Shi and Tomashi features in the - /// left image of the stereo pair and then tracks them using pyramidal Lucas-Kanade in the right image. - /// To densify the sparse correspondences, the algorithm computes the zero-mean normalized - /// cross-correlation (ZNCC) in small patches around every seed pair and uses it as a quality metric - /// for each match. In this code, we introduce a custom structure to store the location and ZNCC value - /// of correspondences called "Match". Seed Matches are stored in a priority queue sorted according to - /// their ZNCC value, allowing for the best quality Match to be readily available. The algorithm pops - /// Matches and uses them to extract new matches around them. This is done by considering a small - /// neighboring area around each Seed and retrieving correspondences above a certain texture threshold - /// that are not previously computed. New matches are stored in the seed priority queue and used as seeds. - /// The propagation process ends when no additional matches can be retrieved. - /// ## See also - /// This code represents the work presented in [Stoyanov2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Stoyanov2010). - /// If this code is useful for your work please cite [Stoyanov2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Stoyanov2010). - /// - /// Also the original growing scheme idea is described in [Lhuillier2000](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Lhuillier2000) - pub trait QuasiDenseStereo: crate::stereo::QuasiDenseStereoConst { + /// Mutable methods for [crate::stereo::QuasiDenseStereo] + pub trait QuasiDenseStereoTrait: crate::stereo::QuasiDenseStereoTraitConst { fn as_raw_mut_QuasiDenseStereo(&mut self) -> *mut c_void; #[inline] @@ -349,18 +329,64 @@ pub mod stereo { } - impl dyn QuasiDenseStereo + '_ { + /// Class containing the methods needed for Quasi Dense Stereo computation. + /// + /// This module contains the code to perform quasi dense stereo matching. + /// The method initially starts with a sparse 3D reconstruction based on feature matching across a + /// stereo image pair and subsequently propagates the structure into neighboring image regions. + /// To obtain initial seed correspondences, the algorithm locates Shi and Tomashi features in the + /// left image of the stereo pair and then tracks them using pyramidal Lucas-Kanade in the right image. + /// To densify the sparse correspondences, the algorithm computes the zero-mean normalized + /// cross-correlation (ZNCC) in small patches around every seed pair and uses it as a quality metric + /// for each match. In this code, we introduce a custom structure to store the location and ZNCC value + /// of correspondences called "Match". Seed Matches are stored in a priority queue sorted according to + /// their ZNCC value, allowing for the best quality Match to be readily available. The algorithm pops + /// Matches and uses them to extract new matches around them. This is done by considering a small + /// neighboring area around each Seed and retrieving correspondences above a certain texture threshold + /// that are not previously computed. New matches are stored in the seed priority queue and used as seeds. + /// The propagation process ends when no additional matches can be retrieved. + /// ## See also + /// This code represents the work presented in [Stoyanov2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Stoyanov2010). + /// If this code is useful for your work please cite [Stoyanov2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Stoyanov2010). + /// + /// Also the original growing scheme idea is described in [Lhuillier2000](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Lhuillier2000) + pub struct QuasiDenseStereo { + ptr: *mut c_void + } + + opencv_type_boxed! { QuasiDenseStereo } + + impl Drop for QuasiDenseStereo { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_QuasiDenseStereo_delete(instance: *mut c_void); } + unsafe { cv_QuasiDenseStereo_delete(self.as_raw_mut_QuasiDenseStereo()) }; + } + } + + unsafe impl Send for QuasiDenseStereo {} + + impl crate::stereo::QuasiDenseStereoTraitConst for QuasiDenseStereo { + #[inline] fn as_raw_QuasiDenseStereo(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stereo::QuasiDenseStereoTrait for QuasiDenseStereo { + #[inline] fn as_raw_mut_QuasiDenseStereo(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl QuasiDenseStereo { /// ## C++ default parameters /// * param_filepath: cv::String() #[inline] - pub fn create(mono_img_size: core::Size, param_filepath: &str) -> Result> { + pub fn create(mono_img_size: core::Size, param_filepath: &str) -> Result> { extern_container_arg!(mut param_filepath); return_send!(via ocvrs_return); unsafe { sys::cv_stereo_QuasiDenseStereo_create_Size_String(mono_img_size.opencv_as_extern(), param_filepath.opencv_as_extern_mut(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } +} diff --git a/docs/stitching.rs b/docs/stitching.rs index c17469730..eec89779e 100644 --- a/docs/stitching.rs +++ b/docs/stitching.rs @@ -41,7 +41,7 @@ pub mod stitching { //! # Image Blenders use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::Detail_RotationWarperConst, super::Detail_RotationWarper, super::Detail_ProjectorBaseTraitConst, super::Detail_ProjectorBaseTrait, super::Detail_PlaneProjectorTraitConst, super::Detail_PlaneProjectorTrait, super::Detail_PlaneWarperTraitConst, super::Detail_PlaneWarperTrait, super::Detail_AffineWarperTraitConst, super::Detail_AffineWarperTrait, super::Detail_SphericalProjectorTraitConst, super::Detail_SphericalProjectorTrait, super::Detail_SphericalWarperTraitConst, super::Detail_SphericalWarperTrait, super::Detail_CylindricalProjectorTraitConst, super::Detail_CylindricalProjectorTrait, super::Detail_CylindricalWarperTraitConst, super::Detail_CylindricalWarperTrait, super::Detail_FisheyeProjectorTraitConst, super::Detail_FisheyeProjectorTrait, super::Detail_FisheyeWarperTraitConst, super::Detail_FisheyeWarperTrait, super::Detail_StereographicProjectorTraitConst, super::Detail_StereographicProjectorTrait, super::Detail_StereographicWarperTraitConst, super::Detail_StereographicWarperTrait, super::Detail_CompressedRectilinearProjectorTraitConst, super::Detail_CompressedRectilinearProjectorTrait, super::Detail_CompressedRectilinearWarperTraitConst, super::Detail_CompressedRectilinearWarperTrait, super::Detail_CompressedRectilinearPortraitProjectorTraitConst, super::Detail_CompressedRectilinearPortraitProjectorTrait, super::Detail_CompressedRectilinearPortraitWarperTraitConst, super::Detail_CompressedRectilinearPortraitWarperTrait, super::Detail_PaniniProjectorTraitConst, super::Detail_PaniniProjectorTrait, super::Detail_PaniniWarperTraitConst, super::Detail_PaniniWarperTrait, super::Detail_PaniniPortraitProjectorTraitConst, super::Detail_PaniniPortraitProjectorTrait, super::Detail_PaniniPortraitWarperTraitConst, super::Detail_PaniniPortraitWarperTrait, super::Detail_MercatorProjectorTraitConst, super::Detail_MercatorProjectorTrait, super::Detail_MercatorWarperTraitConst, super::Detail_MercatorWarperTrait, super::Detail_TransverseMercatorProjectorTraitConst, super::Detail_TransverseMercatorProjectorTrait, super::Detail_TransverseMercatorWarperTraitConst, super::Detail_TransverseMercatorWarperTrait, super::Detail_PlaneWarperGpuTraitConst, super::Detail_PlaneWarperGpuTrait, super::Detail_SphericalWarperGpuTraitConst, super::Detail_SphericalWarperGpuTrait, super::Detail_CylindricalWarperGpuTraitConst, super::Detail_CylindricalWarperGpuTrait, super::Detail_SphericalPortraitProjectorTraitConst, super::Detail_SphericalPortraitProjectorTrait, super::Detail_SphericalPortraitWarperTraitConst, super::Detail_SphericalPortraitWarperTrait, super::Detail_CylindricalPortraitProjectorTraitConst, super::Detail_CylindricalPortraitProjectorTrait, super::Detail_CylindricalPortraitWarperTraitConst, super::Detail_CylindricalPortraitWarperTrait, super::Detail_PlanePortraitProjectorTraitConst, super::Detail_PlanePortraitProjectorTrait, super::Detail_PlanePortraitWarperTraitConst, super::Detail_PlanePortraitWarperTrait, super::PyRotationWarperTraitConst, super::PyRotationWarperTrait, super::WarperCreatorConst, super::WarperCreator, super::PlaneWarperTraitConst, super::PlaneWarperTrait, super::AffineWarperTraitConst, super::AffineWarperTrait, super::CylindricalWarperTraitConst, super::CylindricalWarperTrait, super::SphericalWarperTraitConst, super::SphericalWarperTrait, super::FisheyeWarperTraitConst, super::FisheyeWarperTrait, super::StereographicWarperTraitConst, super::StereographicWarperTrait, super::CompressedRectilinearWarperTraitConst, super::CompressedRectilinearWarperTrait, super::CompressedRectilinearPortraitWarperTraitConst, super::CompressedRectilinearPortraitWarperTrait, super::PaniniWarperTraitConst, super::PaniniWarperTrait, super::PaniniPortraitWarperTraitConst, super::PaniniPortraitWarperTrait, super::MercatorWarperTraitConst, super::MercatorWarperTrait, super::TransverseMercatorWarperTraitConst, super::TransverseMercatorWarperTrait, super::PlaneWarperGpuTraitConst, super::PlaneWarperGpuTrait, super::CylindricalWarperGpuTraitConst, super::CylindricalWarperGpuTrait, super::SphericalWarperGpuTraitConst, super::SphericalWarperGpuTrait, super::Detail_ImageFeaturesTraitConst, super::Detail_ImageFeaturesTrait, super::Detail_MatchesInfoTraitConst, super::Detail_MatchesInfoTrait, super::Detail_FeaturesMatcherConst, super::Detail_FeaturesMatcher, super::Detail_BestOf2NearestMatcherTraitConst, super::Detail_BestOf2NearestMatcherTrait, super::Detail_BestOf2NearestRangeMatcherTraitConst, super::Detail_BestOf2NearestRangeMatcherTrait, super::Detail_AffineBestOf2NearestMatcherTraitConst, super::Detail_AffineBestOf2NearestMatcherTrait, super::Detail_DisjointSetsTraitConst, super::Detail_DisjointSetsTrait, super::Detail_GraphEdgeTraitConst, super::Detail_GraphEdgeTrait, super::Detail_GraphTraitConst, super::Detail_GraphTrait, super::Detail_CameraParamsTraitConst, super::Detail_CameraParamsTrait, super::Detail_EstimatorConst, super::Detail_Estimator, super::Detail_HomographyBasedEstimatorTraitConst, super::Detail_HomographyBasedEstimatorTrait, super::Detail_AffineBasedEstimatorTraitConst, super::Detail_AffineBasedEstimatorTrait, super::Detail_BundleAdjusterBaseConst, super::Detail_BundleAdjusterBase, super::Detail_NoBundleAdjusterTraitConst, super::Detail_NoBundleAdjusterTrait, super::Detail_BundleAdjusterReprojTraitConst, super::Detail_BundleAdjusterReprojTrait, super::Detail_BundleAdjusterRayTraitConst, super::Detail_BundleAdjusterRayTrait, super::Detail_BundleAdjusterAffineTraitConst, super::Detail_BundleAdjusterAffineTrait, super::Detail_BundleAdjusterAffinePartialTraitConst, super::Detail_BundleAdjusterAffinePartialTrait, super::Detail_ExposureCompensatorConst, super::Detail_ExposureCompensator, super::Detail_NoExposureCompensatorTraitConst, super::Detail_NoExposureCompensatorTrait, super::Detail_GainCompensatorTraitConst, super::Detail_GainCompensatorTrait, super::Detail_ChannelsCompensatorTraitConst, super::Detail_ChannelsCompensatorTrait, super::Detail_BlocksCompensatorConst, super::Detail_BlocksCompensator, super::Detail_BlocksGainCompensatorTraitConst, super::Detail_BlocksGainCompensatorTrait, super::Detail_BlocksChannelsCompensatorTraitConst, super::Detail_BlocksChannelsCompensatorTrait, super::Detail_SeamFinderConst, super::Detail_SeamFinder, super::Detail_NoSeamFinderTraitConst, super::Detail_NoSeamFinderTrait, super::Detail_PairwiseSeamFinderConst, super::Detail_PairwiseSeamFinder, super::Detail_VoronoiSeamFinderTraitConst, super::Detail_VoronoiSeamFinderTrait, super::Detail_DpSeamFinderTraitConst, super::Detail_DpSeamFinderTrait, super::Detail_GraphCutSeamFinderBaseTraitConst, super::Detail_GraphCutSeamFinderBaseTrait, super::Detail_GraphCutSeamFinderTraitConst, super::Detail_GraphCutSeamFinderTrait, super::Detail_GraphCutSeamFinderGpuTraitConst, super::Detail_GraphCutSeamFinderGpuTrait, super::Detail_BlenderTraitConst, super::Detail_BlenderTrait, super::Detail_FeatherBlenderTraitConst, super::Detail_FeatherBlenderTrait, super::Detail_MultiBandBlenderTraitConst, super::Detail_MultiBandBlenderTrait, super::StitcherTraitConst, super::StitcherTrait }; + pub use { super::Detail_RotationWarperTraitConst, super::Detail_RotationWarperTrait, super::Detail_ProjectorBaseTraitConst, super::Detail_ProjectorBaseTrait, super::Detail_PlaneProjectorTraitConst, super::Detail_PlaneProjectorTrait, super::Detail_PlaneWarperTraitConst, super::Detail_PlaneWarperTrait, super::Detail_AffineWarperTraitConst, super::Detail_AffineWarperTrait, super::Detail_SphericalProjectorTraitConst, super::Detail_SphericalProjectorTrait, super::Detail_SphericalWarperTraitConst, super::Detail_SphericalWarperTrait, super::Detail_CylindricalProjectorTraitConst, super::Detail_CylindricalProjectorTrait, super::Detail_CylindricalWarperTraitConst, super::Detail_CylindricalWarperTrait, super::Detail_FisheyeProjectorTraitConst, super::Detail_FisheyeProjectorTrait, super::Detail_FisheyeWarperTraitConst, super::Detail_FisheyeWarperTrait, super::Detail_StereographicProjectorTraitConst, super::Detail_StereographicProjectorTrait, super::Detail_StereographicWarperTraitConst, super::Detail_StereographicWarperTrait, super::Detail_CompressedRectilinearProjectorTraitConst, super::Detail_CompressedRectilinearProjectorTrait, super::Detail_CompressedRectilinearWarperTraitConst, super::Detail_CompressedRectilinearWarperTrait, super::Detail_CompressedRectilinearPortraitProjectorTraitConst, super::Detail_CompressedRectilinearPortraitProjectorTrait, super::Detail_CompressedRectilinearPortraitWarperTraitConst, super::Detail_CompressedRectilinearPortraitWarperTrait, super::Detail_PaniniProjectorTraitConst, super::Detail_PaniniProjectorTrait, super::Detail_PaniniWarperTraitConst, super::Detail_PaniniWarperTrait, super::Detail_PaniniPortraitProjectorTraitConst, super::Detail_PaniniPortraitProjectorTrait, super::Detail_PaniniPortraitWarperTraitConst, super::Detail_PaniniPortraitWarperTrait, super::Detail_MercatorProjectorTraitConst, super::Detail_MercatorProjectorTrait, super::Detail_MercatorWarperTraitConst, super::Detail_MercatorWarperTrait, super::Detail_TransverseMercatorProjectorTraitConst, super::Detail_TransverseMercatorProjectorTrait, super::Detail_TransverseMercatorWarperTraitConst, super::Detail_TransverseMercatorWarperTrait, super::Detail_PlaneWarperGpuTraitConst, super::Detail_PlaneWarperGpuTrait, super::Detail_SphericalWarperGpuTraitConst, super::Detail_SphericalWarperGpuTrait, super::Detail_CylindricalWarperGpuTraitConst, super::Detail_CylindricalWarperGpuTrait, super::Detail_SphericalPortraitProjectorTraitConst, super::Detail_SphericalPortraitProjectorTrait, super::Detail_SphericalPortraitWarperTraitConst, super::Detail_SphericalPortraitWarperTrait, super::Detail_CylindricalPortraitProjectorTraitConst, super::Detail_CylindricalPortraitProjectorTrait, super::Detail_CylindricalPortraitWarperTraitConst, super::Detail_CylindricalPortraitWarperTrait, super::Detail_PlanePortraitProjectorTraitConst, super::Detail_PlanePortraitProjectorTrait, super::Detail_PlanePortraitWarperTraitConst, super::Detail_PlanePortraitWarperTrait, super::PyRotationWarperTraitConst, super::PyRotationWarperTrait, super::WarperCreatorTraitConst, super::WarperCreatorTrait, super::PlaneWarperTraitConst, super::PlaneWarperTrait, super::AffineWarperTraitConst, super::AffineWarperTrait, super::CylindricalWarperTraitConst, super::CylindricalWarperTrait, super::SphericalWarperTraitConst, super::SphericalWarperTrait, super::FisheyeWarperTraitConst, super::FisheyeWarperTrait, super::StereographicWarperTraitConst, super::StereographicWarperTrait, super::CompressedRectilinearWarperTraitConst, super::CompressedRectilinearWarperTrait, super::CompressedRectilinearPortraitWarperTraitConst, super::CompressedRectilinearPortraitWarperTrait, super::PaniniWarperTraitConst, super::PaniniWarperTrait, super::PaniniPortraitWarperTraitConst, super::PaniniPortraitWarperTrait, super::MercatorWarperTraitConst, super::MercatorWarperTrait, super::TransverseMercatorWarperTraitConst, super::TransverseMercatorWarperTrait, super::PlaneWarperGpuTraitConst, super::PlaneWarperGpuTrait, super::CylindricalWarperGpuTraitConst, super::CylindricalWarperGpuTrait, super::SphericalWarperGpuTraitConst, super::SphericalWarperGpuTrait, super::Detail_ImageFeaturesTraitConst, super::Detail_ImageFeaturesTrait, super::Detail_MatchesInfoTraitConst, super::Detail_MatchesInfoTrait, super::Detail_FeaturesMatcherTraitConst, super::Detail_FeaturesMatcherTrait, super::Detail_BestOf2NearestMatcherTraitConst, super::Detail_BestOf2NearestMatcherTrait, super::Detail_BestOf2NearestRangeMatcherTraitConst, super::Detail_BestOf2NearestRangeMatcherTrait, super::Detail_AffineBestOf2NearestMatcherTraitConst, super::Detail_AffineBestOf2NearestMatcherTrait, super::Detail_DisjointSetsTraitConst, super::Detail_DisjointSetsTrait, super::Detail_GraphEdgeTraitConst, super::Detail_GraphEdgeTrait, super::Detail_GraphTraitConst, super::Detail_GraphTrait, super::Detail_CameraParamsTraitConst, super::Detail_CameraParamsTrait, super::Detail_EstimatorTraitConst, super::Detail_EstimatorTrait, super::Detail_HomographyBasedEstimatorTraitConst, super::Detail_HomographyBasedEstimatorTrait, super::Detail_AffineBasedEstimatorTraitConst, super::Detail_AffineBasedEstimatorTrait, super::Detail_BundleAdjusterBaseTraitConst, super::Detail_BundleAdjusterBaseTrait, super::Detail_NoBundleAdjusterTraitConst, super::Detail_NoBundleAdjusterTrait, super::Detail_BundleAdjusterReprojTraitConst, super::Detail_BundleAdjusterReprojTrait, super::Detail_BundleAdjusterRayTraitConst, super::Detail_BundleAdjusterRayTrait, super::Detail_BundleAdjusterAffineTraitConst, super::Detail_BundleAdjusterAffineTrait, super::Detail_BundleAdjusterAffinePartialTraitConst, super::Detail_BundleAdjusterAffinePartialTrait, super::Detail_ExposureCompensatorTraitConst, super::Detail_ExposureCompensatorTrait, super::Detail_NoExposureCompensatorTraitConst, super::Detail_NoExposureCompensatorTrait, super::Detail_GainCompensatorTraitConst, super::Detail_GainCompensatorTrait, super::Detail_ChannelsCompensatorTraitConst, super::Detail_ChannelsCompensatorTrait, super::Detail_BlocksCompensatorTraitConst, super::Detail_BlocksCompensatorTrait, super::Detail_BlocksGainCompensatorTraitConst, super::Detail_BlocksGainCompensatorTrait, super::Detail_BlocksChannelsCompensatorTraitConst, super::Detail_BlocksChannelsCompensatorTrait, super::Detail_SeamFinderTraitConst, super::Detail_SeamFinderTrait, super::Detail_NoSeamFinderTraitConst, super::Detail_NoSeamFinderTrait, super::Detail_PairwiseSeamFinderTraitConst, super::Detail_PairwiseSeamFinderTrait, super::Detail_VoronoiSeamFinderTraitConst, super::Detail_VoronoiSeamFinderTrait, super::Detail_DpSeamFinderTraitConst, super::Detail_DpSeamFinderTrait, super::Detail_GraphCutSeamFinderBaseTraitConst, super::Detail_GraphCutSeamFinderBaseTrait, super::Detail_GraphCutSeamFinderTraitConst, super::Detail_GraphCutSeamFinderTrait, super::Detail_GraphCutSeamFinderGpuTraitConst, super::Detail_GraphCutSeamFinderGpuTrait, super::Detail_BlenderTraitConst, super::Detail_BlenderTrait, super::Detail_FeatherBlenderTraitConst, super::Detail_FeatherBlenderTrait, super::Detail_MultiBandBlenderTraitConst, super::Detail_MultiBandBlenderTrait, super::StitcherTraitConst, super::StitcherTrait }; } pub const Detail_Blender_FEATHER: i32 = 1; @@ -360,23 +360,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::AffineWarper] - pub trait AffineWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait AffineWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_AffineWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_AffineWarper_create_const_float(self.as_raw_AffineWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::AffineWarper] - pub trait AffineWarperTrait: crate::stitching::AffineWarperTraitConst + crate::stitching::WarperCreator { + pub trait AffineWarperTrait: crate::stitching::AffineWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_AffineWarper(&mut self) -> *mut c_void; } @@ -400,11 +400,11 @@ pub mod stitching { unsafe impl Send for AffineWarper {} - impl crate::stitching::WarperCreatorConst for AffineWarper { + impl crate::stitching::WarperCreatorTraitConst for AffineWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for AffineWarper { + impl crate::stitching::WarperCreatorTrait for AffineWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -420,23 +420,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::CompressedRectilinearPortraitWarper] - pub trait CompressedRectilinearPortraitWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait CompressedRectilinearPortraitWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_CompressedRectilinearPortraitWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_CompressedRectilinearPortraitWarper_create_const_float(self.as_raw_CompressedRectilinearPortraitWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::CompressedRectilinearPortraitWarper] - pub trait CompressedRectilinearPortraitWarperTrait: crate::stitching::CompressedRectilinearPortraitWarperTraitConst + crate::stitching::WarperCreator { + pub trait CompressedRectilinearPortraitWarperTrait: crate::stitching::CompressedRectilinearPortraitWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_CompressedRectilinearPortraitWarper(&mut self) -> *mut c_void; } @@ -457,11 +457,11 @@ pub mod stitching { unsafe impl Send for CompressedRectilinearPortraitWarper {} - impl crate::stitching::WarperCreatorConst for CompressedRectilinearPortraitWarper { + impl crate::stitching::WarperCreatorTraitConst for CompressedRectilinearPortraitWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for CompressedRectilinearPortraitWarper { + impl crate::stitching::WarperCreatorTrait for CompressedRectilinearPortraitWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -490,23 +490,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::CompressedRectilinearWarper] - pub trait CompressedRectilinearWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait CompressedRectilinearWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_CompressedRectilinearWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_CompressedRectilinearWarper_create_const_float(self.as_raw_CompressedRectilinearWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::CompressedRectilinearWarper] - pub trait CompressedRectilinearWarperTrait: crate::stitching::CompressedRectilinearWarperTraitConst + crate::stitching::WarperCreator { + pub trait CompressedRectilinearWarperTrait: crate::stitching::CompressedRectilinearWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_CompressedRectilinearWarper(&mut self) -> *mut c_void; } @@ -527,11 +527,11 @@ pub mod stitching { unsafe impl Send for CompressedRectilinearWarper {} - impl crate::stitching::WarperCreatorConst for CompressedRectilinearWarper { + impl crate::stitching::WarperCreatorTraitConst for CompressedRectilinearWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for CompressedRectilinearWarper { + impl crate::stitching::WarperCreatorTrait for CompressedRectilinearWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -560,23 +560,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::CylindricalWarper] - pub trait CylindricalWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait CylindricalWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_CylindricalWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_CylindricalWarper_create_const_float(self.as_raw_CylindricalWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::CylindricalWarper] - pub trait CylindricalWarperTrait: crate::stitching::CylindricalWarperTraitConst + crate::stitching::WarperCreator { + pub trait CylindricalWarperTrait: crate::stitching::CylindricalWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_CylindricalWarper(&mut self) -> *mut c_void; } @@ -600,11 +600,11 @@ pub mod stitching { unsafe impl Send for CylindricalWarper {} - impl crate::stitching::WarperCreatorConst for CylindricalWarper { + impl crate::stitching::WarperCreatorTraitConst for CylindricalWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for CylindricalWarper { + impl crate::stitching::WarperCreatorTrait for CylindricalWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -620,23 +620,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::CylindricalWarperGpu] - pub trait CylindricalWarperGpuTraitConst: crate::stitching::WarperCreatorConst { + pub trait CylindricalWarperGpuTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_CylindricalWarperGpu(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_CylindricalWarperGpu_create_const_float(self.as_raw_CylindricalWarperGpu(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::CylindricalWarperGpu] - pub trait CylindricalWarperGpuTrait: crate::stitching::CylindricalWarperGpuTraitConst + crate::stitching::WarperCreator { + pub trait CylindricalWarperGpuTrait: crate::stitching::CylindricalWarperGpuTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_CylindricalWarperGpu(&mut self) -> *mut c_void; } @@ -657,11 +657,11 @@ pub mod stitching { unsafe impl Send for CylindricalWarperGpu {} - impl crate::stitching::WarperCreatorConst for CylindricalWarperGpu { + impl crate::stitching::WarperCreatorTraitConst for CylindricalWarperGpu { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for CylindricalWarperGpu { + impl crate::stitching::WarperCreatorTrait for CylindricalWarperGpu { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -677,23 +677,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::FisheyeWarper] - pub trait FisheyeWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait FisheyeWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_FisheyeWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_FisheyeWarper_create_const_float(self.as_raw_FisheyeWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::FisheyeWarper] - pub trait FisheyeWarperTrait: crate::stitching::FisheyeWarperTraitConst + crate::stitching::WarperCreator { + pub trait FisheyeWarperTrait: crate::stitching::FisheyeWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_FisheyeWarper(&mut self) -> *mut c_void; } @@ -714,11 +714,11 @@ pub mod stitching { unsafe impl Send for FisheyeWarper {} - impl crate::stitching::WarperCreatorConst for FisheyeWarper { + impl crate::stitching::WarperCreatorTraitConst for FisheyeWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for FisheyeWarper { + impl crate::stitching::WarperCreatorTrait for FisheyeWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -734,23 +734,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::MercatorWarper] - pub trait MercatorWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait MercatorWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_MercatorWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_MercatorWarper_create_const_float(self.as_raw_MercatorWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::MercatorWarper] - pub trait MercatorWarperTrait: crate::stitching::MercatorWarperTraitConst + crate::stitching::WarperCreator { + pub trait MercatorWarperTrait: crate::stitching::MercatorWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_MercatorWarper(&mut self) -> *mut c_void; } @@ -771,11 +771,11 @@ pub mod stitching { unsafe impl Send for MercatorWarper {} - impl crate::stitching::WarperCreatorConst for MercatorWarper { + impl crate::stitching::WarperCreatorTraitConst for MercatorWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for MercatorWarper { + impl crate::stitching::WarperCreatorTrait for MercatorWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -791,23 +791,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::PaniniPortraitWarper] - pub trait PaniniPortraitWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait PaniniPortraitWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_PaniniPortraitWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_PaniniPortraitWarper_create_const_float(self.as_raw_PaniniPortraitWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::PaniniPortraitWarper] - pub trait PaniniPortraitWarperTrait: crate::stitching::PaniniPortraitWarperTraitConst + crate::stitching::WarperCreator { + pub trait PaniniPortraitWarperTrait: crate::stitching::PaniniPortraitWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_PaniniPortraitWarper(&mut self) -> *mut c_void; } @@ -828,11 +828,11 @@ pub mod stitching { unsafe impl Send for PaniniPortraitWarper {} - impl crate::stitching::WarperCreatorConst for PaniniPortraitWarper { + impl crate::stitching::WarperCreatorTraitConst for PaniniPortraitWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for PaniniPortraitWarper { + impl crate::stitching::WarperCreatorTrait for PaniniPortraitWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -861,23 +861,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::PaniniWarper] - pub trait PaniniWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait PaniniWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_PaniniWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_PaniniWarper_create_const_float(self.as_raw_PaniniWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::PaniniWarper] - pub trait PaniniWarperTrait: crate::stitching::PaniniWarperTraitConst + crate::stitching::WarperCreator { + pub trait PaniniWarperTrait: crate::stitching::PaniniWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_PaniniWarper(&mut self) -> *mut c_void; } @@ -898,11 +898,11 @@ pub mod stitching { unsafe impl Send for PaniniWarper {} - impl crate::stitching::WarperCreatorConst for PaniniWarper { + impl crate::stitching::WarperCreatorTraitConst for PaniniWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for PaniniWarper { + impl crate::stitching::WarperCreatorTrait for PaniniWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -931,23 +931,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::PlaneWarper] - pub trait PlaneWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait PlaneWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_PlaneWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_PlaneWarper_create_const_float(self.as_raw_PlaneWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::PlaneWarper] - pub trait PlaneWarperTrait: crate::stitching::PlaneWarperTraitConst + crate::stitching::WarperCreator { + pub trait PlaneWarperTrait: crate::stitching::PlaneWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_PlaneWarper(&mut self) -> *mut c_void; } @@ -971,11 +971,11 @@ pub mod stitching { unsafe impl Send for PlaneWarper {} - impl crate::stitching::WarperCreatorConst for PlaneWarper { + impl crate::stitching::WarperCreatorTraitConst for PlaneWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for PlaneWarper { + impl crate::stitching::WarperCreatorTrait for PlaneWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -991,23 +991,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::PlaneWarperGpu] - pub trait PlaneWarperGpuTraitConst: crate::stitching::WarperCreatorConst { + pub trait PlaneWarperGpuTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_PlaneWarperGpu(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_PlaneWarperGpu_create_const_float(self.as_raw_PlaneWarperGpu(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::PlaneWarperGpu] - pub trait PlaneWarperGpuTrait: crate::stitching::PlaneWarperGpuTraitConst + crate::stitching::WarperCreator { + pub trait PlaneWarperGpuTrait: crate::stitching::PlaneWarperGpuTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_PlaneWarperGpu(&mut self) -> *mut c_void; } @@ -1028,11 +1028,11 @@ pub mod stitching { unsafe impl Send for PlaneWarperGpu {} - impl crate::stitching::WarperCreatorConst for PlaneWarperGpu { + impl crate::stitching::WarperCreatorTraitConst for PlaneWarperGpu { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for PlaneWarperGpu { + impl crate::stitching::WarperCreatorTrait for PlaneWarperGpu { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1243,23 +1243,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::SphericalWarper] - pub trait SphericalWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait SphericalWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_SphericalWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_SphericalWarper_create_const_float(self.as_raw_SphericalWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::SphericalWarper] - pub trait SphericalWarperTrait: crate::stitching::SphericalWarperTraitConst + crate::stitching::WarperCreator { + pub trait SphericalWarperTrait: crate::stitching::SphericalWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_SphericalWarper(&mut self) -> *mut c_void; } @@ -1281,11 +1281,11 @@ pub mod stitching { unsafe impl Send for SphericalWarper {} - impl crate::stitching::WarperCreatorConst for SphericalWarper { + impl crate::stitching::WarperCreatorTraitConst for SphericalWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for SphericalWarper { + impl crate::stitching::WarperCreatorTrait for SphericalWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1301,23 +1301,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::SphericalWarperGpu] - pub trait SphericalWarperGpuTraitConst: crate::stitching::WarperCreatorConst { + pub trait SphericalWarperGpuTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_SphericalWarperGpu(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_SphericalWarperGpu_create_const_float(self.as_raw_SphericalWarperGpu(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::SphericalWarperGpu] - pub trait SphericalWarperGpuTrait: crate::stitching::SphericalWarperGpuTraitConst + crate::stitching::WarperCreator { + pub trait SphericalWarperGpuTrait: crate::stitching::SphericalWarperGpuTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_SphericalWarperGpu(&mut self) -> *mut c_void; } @@ -1338,11 +1338,11 @@ pub mod stitching { unsafe impl Send for SphericalWarperGpu {} - impl crate::stitching::WarperCreatorConst for SphericalWarperGpu { + impl crate::stitching::WarperCreatorTraitConst for SphericalWarperGpu { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for SphericalWarperGpu { + impl crate::stitching::WarperCreatorTrait for SphericalWarperGpu { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1358,23 +1358,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::StereographicWarper] - pub trait StereographicWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait StereographicWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_StereographicWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_StereographicWarper_create_const_float(self.as_raw_StereographicWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::StereographicWarper] - pub trait StereographicWarperTrait: crate::stitching::StereographicWarperTraitConst + crate::stitching::WarperCreator { + pub trait StereographicWarperTrait: crate::stitching::StereographicWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_StereographicWarper(&mut self) -> *mut c_void; } @@ -1395,11 +1395,11 @@ pub mod stitching { unsafe impl Send for StereographicWarper {} - impl crate::stitching::WarperCreatorConst for StereographicWarper { + impl crate::stitching::WarperCreatorTraitConst for StereographicWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for StereographicWarper { + impl crate::stitching::WarperCreatorTrait for StereographicWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1492,12 +1492,12 @@ pub mod stitching { } #[inline] - fn features_matcher(&self) -> Result> { + fn features_matcher(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_featuresMatcher_const(self.as_raw_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1512,52 +1512,52 @@ pub mod stitching { } #[inline] - fn bundle_adjuster(&self) -> Result> { + fn bundle_adjuster(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_bundleAdjuster_const(self.as_raw_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn estimator(&self) -> Result> { + fn estimator(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_estimator_const(self.as_raw_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn warper(&self) -> Result> { + fn warper(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_warper_const(self.as_raw_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn exposure_compensator(&self) -> Result> { + fn exposure_compensator(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_exposureCompensator_const(self.as_raw_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn seam_finder(&self) -> Result> { + fn seam_finder(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_seamFinder_const(self.as_raw_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1706,17 +1706,17 @@ pub mod stitching { } #[inline] - fn features_matcher_1(&mut self) -> Result> { + fn features_matcher_1(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_featuresMatcher(self.as_raw_mut_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn set_features_matcher(&mut self, mut features_matcher: core::Ptr) -> Result<()> { + fn set_features_matcher(&mut self, mut features_matcher: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_setFeaturesMatcher_PtrLFeaturesMatcherG(self.as_raw_mut_Stitcher(), features_matcher.as_raw_mut_PtrOfDetail_FeaturesMatcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1734,17 +1734,17 @@ pub mod stitching { } #[inline] - fn bundle_adjuster_1(&mut self) -> Result> { + fn bundle_adjuster_1(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_bundleAdjuster(self.as_raw_mut_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn set_bundle_adjuster(&mut self, mut bundle_adjuster: core::Ptr) -> Result<()> { + fn set_bundle_adjuster(&mut self, mut bundle_adjuster: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_setBundleAdjuster_PtrLBundleAdjusterBaseG(self.as_raw_mut_Stitcher(), bundle_adjuster.as_raw_mut_PtrOfDetail_BundleAdjusterBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1753,17 +1753,17 @@ pub mod stitching { } #[inline] - fn estimator_1(&mut self) -> Result> { + fn estimator_1(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_estimator(self.as_raw_mut_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn set_estimator(&mut self, mut estimator: core::Ptr) -> Result<()> { + fn set_estimator(&mut self, mut estimator: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_setEstimator_PtrLEstimatorG(self.as_raw_mut_Stitcher(), estimator.as_raw_mut_PtrOfDetail_Estimator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1772,17 +1772,17 @@ pub mod stitching { } #[inline] - fn warper_1(&mut self) -> Result> { + fn warper_1(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_warper(self.as_raw_mut_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn set_warper(&mut self, mut creator: core::Ptr) -> Result<()> { + fn set_warper(&mut self, mut creator: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_setWarper_PtrLWarperCreatorG(self.as_raw_mut_Stitcher(), creator.as_raw_mut_PtrOfWarperCreator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1791,17 +1791,17 @@ pub mod stitching { } #[inline] - fn exposure_compensator_1(&mut self) -> Result> { + fn exposure_compensator_1(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_exposureCompensator(self.as_raw_mut_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn set_exposure_compensator(&mut self, mut exposure_comp: core::Ptr) -> Result<()> { + fn set_exposure_compensator(&mut self, mut exposure_comp: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_setExposureCompensator_PtrLExposureCompensatorG(self.as_raw_mut_Stitcher(), exposure_comp.as_raw_mut_PtrOfDetail_ExposureCompensator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1810,17 +1810,17 @@ pub mod stitching { } #[inline] - fn seam_finder_1(&mut self) -> Result> { + fn seam_finder_1(&mut self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_seamFinder(self.as_raw_mut_Stitcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn set_seam_finder(&mut self, mut seam_finder: core::Ptr) -> Result<()> { + fn set_seam_finder(&mut self, mut seam_finder: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_Stitcher_setSeamFinder_PtrLSeamFinderG(self.as_raw_mut_Stitcher(), seam_finder.as_raw_mut_PtrOfDetail_SeamFinder(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -2068,23 +2068,23 @@ pub mod stitching { } /// Constant methods for [crate::stitching::TransverseMercatorWarper] - pub trait TransverseMercatorWarperTraitConst: crate::stitching::WarperCreatorConst { + pub trait TransverseMercatorWarperTraitConst: crate::stitching::WarperCreatorTraitConst { fn as_raw_TransverseMercatorWarper(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_TransverseMercatorWarper_create_const_float(self.as_raw_TransverseMercatorWarper(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::stitching::TransverseMercatorWarper] - pub trait TransverseMercatorWarperTrait: crate::stitching::TransverseMercatorWarperTraitConst + crate::stitching::WarperCreator { + pub trait TransverseMercatorWarperTrait: crate::stitching::TransverseMercatorWarperTraitConst + crate::stitching::WarperCreatorTrait { fn as_raw_mut_TransverseMercatorWarper(&mut self) -> *mut c_void; } @@ -2105,11 +2105,11 @@ pub mod stitching { unsafe impl Send for TransverseMercatorWarper {} - impl crate::stitching::WarperCreatorConst for TransverseMercatorWarper { + impl crate::stitching::WarperCreatorTraitConst for TransverseMercatorWarper { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::WarperCreator for TransverseMercatorWarper { + impl crate::stitching::WarperCreatorTrait for TransverseMercatorWarper { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2125,35 +2125,93 @@ pub mod stitching { } /// Constant methods for [crate::stitching::WarperCreator] - pub trait WarperCreatorConst { + pub trait WarperCreatorTraitConst { fn as_raw_WarperCreator(&self) -> *const c_void; #[inline] - fn create(&self, scale: f32) -> Result> { + fn create(&self, scale: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_WarperCreator_create_const_float(self.as_raw_WarperCreator(), scale, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } - /// Image warper factories base class. - pub trait WarperCreator: crate::stitching::WarperCreatorConst { + /// Mutable methods for [crate::stitching::WarperCreator] + pub trait WarperCreatorTrait: crate::stitching::WarperCreatorTraitConst { fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void; } + /// Image warper factories base class. + pub struct WarperCreator { + ptr: *mut c_void + } + + opencv_type_boxed! { WarperCreator } + + impl Drop for WarperCreator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_WarperCreator_delete(instance: *mut c_void); } + unsafe { cv_WarperCreator_delete(self.as_raw_mut_WarperCreator()) }; + } + } + + unsafe impl Send for WarperCreator {} + + impl crate::stitching::WarperCreatorTraitConst for WarperCreator { + #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::WarperCreatorTrait for WarperCreator { + #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl WarperCreator { + } + + boxed_cast_descendant! { WarperCreator, crate::stitching::AffineWarper, cv_WarperCreator_to_AffineWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::CompressedRectilinearPortraitWarper, cv_WarperCreator_to_CompressedRectilinearPortraitWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::CompressedRectilinearWarper, cv_WarperCreator_to_CompressedRectilinearWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::CylindricalWarper, cv_WarperCreator_to_CylindricalWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::CylindricalWarperGpu, cv_WarperCreator_to_CylindricalWarperGpu } + + boxed_cast_descendant! { WarperCreator, crate::stitching::FisheyeWarper, cv_WarperCreator_to_FisheyeWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::MercatorWarper, cv_WarperCreator_to_MercatorWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::PaniniPortraitWarper, cv_WarperCreator_to_PaniniPortraitWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::PaniniWarper, cv_WarperCreator_to_PaniniWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::PlaneWarper, cv_WarperCreator_to_PlaneWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::PlaneWarperGpu, cv_WarperCreator_to_PlaneWarperGpu } + + boxed_cast_descendant! { WarperCreator, crate::stitching::SphericalWarper, cv_WarperCreator_to_SphericalWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::SphericalWarperGpu, cv_WarperCreator_to_SphericalWarperGpu } + + boxed_cast_descendant! { WarperCreator, crate::stitching::StereographicWarper, cv_WarperCreator_to_StereographicWarper } + + boxed_cast_descendant! { WarperCreator, crate::stitching::TransverseMercatorWarper, cv_WarperCreator_to_TransverseMercatorWarper } + /// Constant methods for [crate::stitching::Detail_AffineBasedEstimator] - pub trait Detail_AffineBasedEstimatorTraitConst: crate::stitching::Detail_EstimatorConst { + pub trait Detail_AffineBasedEstimatorTraitConst: crate::stitching::Detail_EstimatorTraitConst { fn as_raw_Detail_AffineBasedEstimator(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_AffineBasedEstimator] - pub trait Detail_AffineBasedEstimatorTrait: crate::stitching::Detail_AffineBasedEstimatorTraitConst + crate::stitching::Detail_Estimator { + pub trait Detail_AffineBasedEstimatorTrait: crate::stitching::Detail_AffineBasedEstimatorTraitConst + crate::stitching::Detail_EstimatorTrait { fn as_raw_mut_Detail_AffineBasedEstimator(&mut self) -> *mut c_void; } @@ -2180,11 +2238,11 @@ pub mod stitching { unsafe impl Send for Detail_AffineBasedEstimator {} - impl crate::stitching::Detail_EstimatorConst for Detail_AffineBasedEstimator { + impl crate::stitching::Detail_EstimatorTraitConst for Detail_AffineBasedEstimator { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_Estimator for Detail_AffineBasedEstimator { + impl crate::stitching::Detail_EstimatorTrait for Detail_AffineBasedEstimator { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2253,11 +2311,11 @@ pub mod stitching { #[inline] fn as_raw_mut_Detail_BestOf2NearestMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_FeaturesMatcherConst for Detail_AffineBestOf2NearestMatcher { + impl crate::stitching::Detail_FeaturesMatcherTraitConst for Detail_AffineBestOf2NearestMatcher { #[inline] fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_FeaturesMatcher for Detail_AffineBestOf2NearestMatcher { + impl crate::stitching::Detail_FeaturesMatcherTrait for Detail_AffineBestOf2NearestMatcher { #[inline] fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2444,11 +2502,11 @@ pub mod stitching { #[inline] fn as_raw_mut_Detail_PlaneWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_RotationWarperConst for Detail_AffineWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_AffineWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_AffineWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_AffineWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2483,13 +2541,13 @@ pub mod stitching { boxed_cast_base! { Detail_AffineWarper, crate::stitching::Detail_PlaneWarper, cv_Detail_AffineWarper_to_Detail_PlaneWarper } /// Constant methods for [crate::stitching::Detail_BestOf2NearestMatcher] - pub trait Detail_BestOf2NearestMatcherTraitConst: crate::stitching::Detail_FeaturesMatcherConst { + pub trait Detail_BestOf2NearestMatcherTraitConst: crate::stitching::Detail_FeaturesMatcherTraitConst { fn as_raw_Detail_BestOf2NearestMatcher(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_BestOf2NearestMatcher] - pub trait Detail_BestOf2NearestMatcherTrait: crate::stitching::Detail_BestOf2NearestMatcherTraitConst + crate::stitching::Detail_FeaturesMatcher { + pub trait Detail_BestOf2NearestMatcherTrait: crate::stitching::Detail_BestOf2NearestMatcherTraitConst + crate::stitching::Detail_FeaturesMatcherTrait { fn as_raw_mut_Detail_BestOf2NearestMatcher(&mut self) -> *mut c_void; #[inline] @@ -2523,11 +2581,11 @@ pub mod stitching { unsafe impl Send for Detail_BestOf2NearestMatcher {} - impl crate::stitching::Detail_FeaturesMatcherConst for Detail_BestOf2NearestMatcher { + impl crate::stitching::Detail_FeaturesMatcherTraitConst for Detail_BestOf2NearestMatcher { #[inline] fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_FeaturesMatcher for Detail_BestOf2NearestMatcher { + impl crate::stitching::Detail_FeaturesMatcherTrait for Detail_BestOf2NearestMatcher { #[inline] fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2626,11 +2684,11 @@ pub mod stitching { #[inline] fn as_raw_mut_Detail_BestOf2NearestMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_FeaturesMatcherConst for Detail_BestOf2NearestRangeMatcher { + impl crate::stitching::Detail_FeaturesMatcherTraitConst for Detail_BestOf2NearestRangeMatcher { #[inline] fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_FeaturesMatcher for Detail_BestOf2NearestRangeMatcher { + impl crate::stitching::Detail_FeaturesMatcherTrait for Detail_BestOf2NearestRangeMatcher { #[inline] fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2785,13 +2843,13 @@ pub mod stitching { boxed_cast_descendant! { Detail_Blender, crate::stitching::Detail_MultiBandBlender, cv_Detail_Blender_to_Detail_MultiBandBlender } /// Constant methods for [crate::stitching::Detail_BlocksChannelsCompensator] - pub trait Detail_BlocksChannelsCompensatorTraitConst: crate::stitching::Detail_BlocksCompensatorConst { + pub trait Detail_BlocksChannelsCompensatorTraitConst: crate::stitching::Detail_BlocksCompensatorTraitConst { fn as_raw_Detail_BlocksChannelsCompensator(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_BlocksChannelsCompensator] - pub trait Detail_BlocksChannelsCompensatorTrait: crate::stitching::Detail_BlocksChannelsCompensatorTraitConst + crate::stitching::Detail_BlocksCompensator { + pub trait Detail_BlocksChannelsCompensatorTrait: crate::stitching::Detail_BlocksChannelsCompensatorTraitConst + crate::stitching::Detail_BlocksCompensatorTrait { fn as_raw_mut_Detail_BlocksChannelsCompensator(&mut self) -> *mut c_void; #[inline] @@ -2823,19 +2881,19 @@ pub mod stitching { unsafe impl Send for Detail_BlocksChannelsCompensator {} - impl crate::stitching::Detail_BlocksCompensatorConst for Detail_BlocksChannelsCompensator { + impl crate::stitching::Detail_BlocksCompensatorTraitConst for Detail_BlocksChannelsCompensator { #[inline] fn as_raw_Detail_BlocksCompensator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_BlocksCompensator for Detail_BlocksChannelsCompensator { + impl crate::stitching::Detail_BlocksCompensatorTrait for Detail_BlocksChannelsCompensator { #[inline] fn as_raw_mut_Detail_BlocksCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_ExposureCompensatorConst for Detail_BlocksChannelsCompensator { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for Detail_BlocksChannelsCompensator { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for Detail_BlocksChannelsCompensator { + impl crate::stitching::Detail_ExposureCompensatorTrait for Detail_BlocksChannelsCompensator { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2865,7 +2923,7 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_BlocksCompensator] - pub trait Detail_BlocksCompensatorConst: crate::stitching::Detail_ExposureCompensatorConst { + pub trait Detail_BlocksCompensatorTraitConst: crate::stitching::Detail_ExposureCompensatorTraitConst { fn as_raw_Detail_BlocksCompensator(&self) -> *const c_void; #[inline] @@ -2897,8 +2955,8 @@ pub mod stitching { } - /// Exposure compensator which tries to remove exposure related artifacts by adjusting image blocks. - pub trait Detail_BlocksCompensator: crate::stitching::Detail_BlocksCompensatorConst + crate::stitching::Detail_ExposureCompensator { + /// Mutable methods for [crate::stitching::Detail_BlocksCompensator] + pub trait Detail_BlocksCompensatorTrait: crate::stitching::Detail_BlocksCompensatorTraitConst + crate::stitching::Detail_ExposureCompensatorTrait { fn as_raw_mut_Detail_BlocksCompensator(&mut self) -> *mut c_void; #[inline] @@ -2986,14 +3044,54 @@ pub mod stitching { } + /// Exposure compensator which tries to remove exposure related artifacts by adjusting image blocks. + pub struct Detail_BlocksCompensator { + ptr: *mut c_void + } + + opencv_type_boxed! { Detail_BlocksCompensator } + + impl Drop for Detail_BlocksCompensator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Detail_BlocksCompensator_delete(instance: *mut c_void); } + unsafe { cv_Detail_BlocksCompensator_delete(self.as_raw_mut_Detail_BlocksCompensator()) }; + } + } + + unsafe impl Send for Detail_BlocksCompensator {} + + impl crate::stitching::Detail_ExposureCompensatorTraitConst for Detail_BlocksCompensator { + #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_ExposureCompensatorTrait for Detail_BlocksCompensator { + #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::stitching::Detail_BlocksCompensatorTraitConst for Detail_BlocksCompensator { + #[inline] fn as_raw_Detail_BlocksCompensator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_BlocksCompensatorTrait for Detail_BlocksCompensator { + #[inline] fn as_raw_mut_Detail_BlocksCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Detail_BlocksCompensator { + } + + boxed_cast_descendant! { Detail_BlocksCompensator, crate::stitching::Detail_BlocksChannelsCompensator, cv_Detail_BlocksCompensator_to_Detail_BlocksChannelsCompensator } + + boxed_cast_descendant! { Detail_BlocksCompensator, crate::stitching::Detail_BlocksGainCompensator, cv_Detail_BlocksCompensator_to_Detail_BlocksGainCompensator } + /// Constant methods for [crate::stitching::Detail_BlocksGainCompensator] - pub trait Detail_BlocksGainCompensatorTraitConst: crate::stitching::Detail_BlocksCompensatorConst { + pub trait Detail_BlocksGainCompensatorTraitConst: crate::stitching::Detail_BlocksCompensatorTraitConst { fn as_raw_Detail_BlocksGainCompensator(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_BlocksGainCompensator] - pub trait Detail_BlocksGainCompensatorTrait: crate::stitching::Detail_BlocksCompensator + crate::stitching::Detail_BlocksGainCompensatorTraitConst { + pub trait Detail_BlocksGainCompensatorTrait: crate::stitching::Detail_BlocksCompensatorTrait + crate::stitching::Detail_BlocksGainCompensatorTraitConst { fn as_raw_mut_Detail_BlocksGainCompensator(&mut self) -> *mut c_void; #[inline] @@ -3054,19 +3152,19 @@ pub mod stitching { unsafe impl Send for Detail_BlocksGainCompensator {} - impl crate::stitching::Detail_BlocksCompensatorConst for Detail_BlocksGainCompensator { + impl crate::stitching::Detail_BlocksCompensatorTraitConst for Detail_BlocksGainCompensator { #[inline] fn as_raw_Detail_BlocksCompensator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_BlocksCompensator for Detail_BlocksGainCompensator { + impl crate::stitching::Detail_BlocksCompensatorTrait for Detail_BlocksGainCompensator { #[inline] fn as_raw_mut_Detail_BlocksCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_ExposureCompensatorConst for Detail_BlocksGainCompensator { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for Detail_BlocksGainCompensator { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for Detail_BlocksGainCompensator { + impl crate::stitching::Detail_ExposureCompensatorTrait for Detail_BlocksGainCompensator { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3105,13 +3203,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_BundleAdjusterAffine] - pub trait Detail_BundleAdjusterAffineTraitConst: crate::stitching::Detail_BundleAdjusterBaseConst { + pub trait Detail_BundleAdjusterAffineTraitConst: crate::stitching::Detail_BundleAdjusterBaseTraitConst { fn as_raw_Detail_BundleAdjusterAffine(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_BundleAdjusterAffine] - pub trait Detail_BundleAdjusterAffineTrait: crate::stitching::Detail_BundleAdjusterAffineTraitConst + crate::stitching::Detail_BundleAdjusterBase { + pub trait Detail_BundleAdjusterAffineTrait: crate::stitching::Detail_BundleAdjusterAffineTraitConst + crate::stitching::Detail_BundleAdjusterBaseTrait { fn as_raw_mut_Detail_BundleAdjusterAffine(&mut self) -> *mut c_void; } @@ -3140,19 +3238,19 @@ pub mod stitching { unsafe impl Send for Detail_BundleAdjusterAffine {} - impl crate::stitching::Detail_BundleAdjusterBaseConst for Detail_BundleAdjusterAffine { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for Detail_BundleAdjusterAffine { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for Detail_BundleAdjusterAffine { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for Detail_BundleAdjusterAffine { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for Detail_BundleAdjusterAffine { + impl crate::stitching::Detail_EstimatorTraitConst for Detail_BundleAdjusterAffine { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_Estimator for Detail_BundleAdjusterAffine { + impl crate::stitching::Detail_EstimatorTrait for Detail_BundleAdjusterAffine { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3178,13 +3276,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_BundleAdjusterAffinePartial] - pub trait Detail_BundleAdjusterAffinePartialTraitConst: crate::stitching::Detail_BundleAdjusterBaseConst { + pub trait Detail_BundleAdjusterAffinePartialTraitConst: crate::stitching::Detail_BundleAdjusterBaseTraitConst { fn as_raw_Detail_BundleAdjusterAffinePartial(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_BundleAdjusterAffinePartial] - pub trait Detail_BundleAdjusterAffinePartialTrait: crate::stitching::Detail_BundleAdjusterAffinePartialTraitConst + crate::stitching::Detail_BundleAdjusterBase { + pub trait Detail_BundleAdjusterAffinePartialTrait: crate::stitching::Detail_BundleAdjusterAffinePartialTraitConst + crate::stitching::Detail_BundleAdjusterBaseTrait { fn as_raw_mut_Detail_BundleAdjusterAffinePartial(&mut self) -> *mut c_void; } @@ -3213,19 +3311,19 @@ pub mod stitching { unsafe impl Send for Detail_BundleAdjusterAffinePartial {} - impl crate::stitching::Detail_BundleAdjusterBaseConst for Detail_BundleAdjusterAffinePartial { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for Detail_BundleAdjusterAffinePartial { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for Detail_BundleAdjusterAffinePartial { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for Detail_BundleAdjusterAffinePartial { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for Detail_BundleAdjusterAffinePartial { + impl crate::stitching::Detail_EstimatorTraitConst for Detail_BundleAdjusterAffinePartial { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_Estimator for Detail_BundleAdjusterAffinePartial { + impl crate::stitching::Detail_EstimatorTrait for Detail_BundleAdjusterAffinePartial { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3251,7 +3349,7 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_BundleAdjusterBase] - pub trait Detail_BundleAdjusterBaseConst: crate::stitching::Detail_EstimatorConst { + pub trait Detail_BundleAdjusterBaseTraitConst: crate::stitching::Detail_EstimatorTraitConst { fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void; #[inline] @@ -3275,8 +3373,8 @@ pub mod stitching { } - /// Base class for all camera parameters refinement methods. - pub trait Detail_BundleAdjusterBase: crate::stitching::Detail_BundleAdjusterBaseConst + crate::stitching::Detail_Estimator { + /// Mutable methods for [crate::stitching::Detail_BundleAdjusterBase] + pub trait Detail_BundleAdjusterBaseTrait: crate::stitching::Detail_BundleAdjusterBaseTraitConst + crate::stitching::Detail_EstimatorTrait { fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void; #[inline] @@ -3317,14 +3415,60 @@ pub mod stitching { } + /// Base class for all camera parameters refinement methods. + pub struct Detail_BundleAdjusterBase { + ptr: *mut c_void + } + + opencv_type_boxed! { Detail_BundleAdjusterBase } + + impl Drop for Detail_BundleAdjusterBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Detail_BundleAdjusterBase_delete(instance: *mut c_void); } + unsafe { cv_Detail_BundleAdjusterBase_delete(self.as_raw_mut_Detail_BundleAdjusterBase()) }; + } + } + + unsafe impl Send for Detail_BundleAdjusterBase {} + + impl crate::stitching::Detail_EstimatorTraitConst for Detail_BundleAdjusterBase { + #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_EstimatorTrait for Detail_BundleAdjusterBase { + #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for Detail_BundleAdjusterBase { + #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_BundleAdjusterBaseTrait for Detail_BundleAdjusterBase { + #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Detail_BundleAdjusterBase { + } + + boxed_cast_descendant! { Detail_BundleAdjusterBase, crate::stitching::Detail_BundleAdjusterAffine, cv_Detail_BundleAdjusterBase_to_Detail_BundleAdjusterAffine } + + boxed_cast_descendant! { Detail_BundleAdjusterBase, crate::stitching::Detail_BundleAdjusterAffinePartial, cv_Detail_BundleAdjusterBase_to_Detail_BundleAdjusterAffinePartial } + + boxed_cast_descendant! { Detail_BundleAdjusterBase, crate::stitching::Detail_BundleAdjusterRay, cv_Detail_BundleAdjusterBase_to_Detail_BundleAdjusterRay } + + boxed_cast_descendant! { Detail_BundleAdjusterBase, crate::stitching::Detail_BundleAdjusterReproj, cv_Detail_BundleAdjusterBase_to_Detail_BundleAdjusterReproj } + + boxed_cast_descendant! { Detail_BundleAdjusterBase, crate::stitching::Detail_NoBundleAdjuster, cv_Detail_BundleAdjusterBase_to_Detail_NoBundleAdjuster } + /// Constant methods for [crate::stitching::Detail_BundleAdjusterRay] - pub trait Detail_BundleAdjusterRayTraitConst: crate::stitching::Detail_BundleAdjusterBaseConst { + pub trait Detail_BundleAdjusterRayTraitConst: crate::stitching::Detail_BundleAdjusterBaseTraitConst { fn as_raw_Detail_BundleAdjusterRay(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_BundleAdjusterRay] - pub trait Detail_BundleAdjusterRayTrait: crate::stitching::Detail_BundleAdjusterBase + crate::stitching::Detail_BundleAdjusterRayTraitConst { + pub trait Detail_BundleAdjusterRayTrait: crate::stitching::Detail_BundleAdjusterBaseTrait + crate::stitching::Detail_BundleAdjusterRayTraitConst { fn as_raw_mut_Detail_BundleAdjusterRay(&mut self) -> *mut c_void; } @@ -3349,19 +3493,19 @@ pub mod stitching { unsafe impl Send for Detail_BundleAdjusterRay {} - impl crate::stitching::Detail_BundleAdjusterBaseConst for Detail_BundleAdjusterRay { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for Detail_BundleAdjusterRay { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for Detail_BundleAdjusterRay { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for Detail_BundleAdjusterRay { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for Detail_BundleAdjusterRay { + impl crate::stitching::Detail_EstimatorTraitConst for Detail_BundleAdjusterRay { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_Estimator for Detail_BundleAdjusterRay { + impl crate::stitching::Detail_EstimatorTrait for Detail_BundleAdjusterRay { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3387,13 +3531,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_BundleAdjusterReproj] - pub trait Detail_BundleAdjusterReprojTraitConst: crate::stitching::Detail_BundleAdjusterBaseConst { + pub trait Detail_BundleAdjusterReprojTraitConst: crate::stitching::Detail_BundleAdjusterBaseTraitConst { fn as_raw_Detail_BundleAdjusterReproj(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_BundleAdjusterReproj] - pub trait Detail_BundleAdjusterReprojTrait: crate::stitching::Detail_BundleAdjusterBase + crate::stitching::Detail_BundleAdjusterReprojTraitConst { + pub trait Detail_BundleAdjusterReprojTrait: crate::stitching::Detail_BundleAdjusterBaseTrait + crate::stitching::Detail_BundleAdjusterReprojTraitConst { fn as_raw_mut_Detail_BundleAdjusterReproj(&mut self) -> *mut c_void; } @@ -3419,19 +3563,19 @@ pub mod stitching { unsafe impl Send for Detail_BundleAdjusterReproj {} - impl crate::stitching::Detail_BundleAdjusterBaseConst for Detail_BundleAdjusterReproj { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for Detail_BundleAdjusterReproj { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for Detail_BundleAdjusterReproj { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for Detail_BundleAdjusterReproj { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for Detail_BundleAdjusterReproj { + impl crate::stitching::Detail_EstimatorTraitConst for Detail_BundleAdjusterReproj { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_Estimator for Detail_BundleAdjusterReproj { + impl crate::stitching::Detail_EstimatorTrait for Detail_BundleAdjusterReproj { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3612,7 +3756,7 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_ChannelsCompensator] - pub trait Detail_ChannelsCompensatorTraitConst: crate::stitching::Detail_ExposureCompensatorConst { + pub trait Detail_ChannelsCompensatorTraitConst: crate::stitching::Detail_ExposureCompensatorTraitConst { fn as_raw_Detail_ChannelsCompensator(&self) -> *const c_void; #[inline] @@ -3637,7 +3781,7 @@ pub mod stitching { } /// Mutable methods for [crate::stitching::Detail_ChannelsCompensator] - pub trait Detail_ChannelsCompensatorTrait: crate::stitching::Detail_ChannelsCompensatorTraitConst + crate::stitching::Detail_ExposureCompensator { + pub trait Detail_ChannelsCompensatorTrait: crate::stitching::Detail_ChannelsCompensatorTraitConst + crate::stitching::Detail_ExposureCompensatorTrait { fn as_raw_mut_Detail_ChannelsCompensator(&mut self) -> *mut c_void; #[inline] @@ -3725,11 +3869,11 @@ pub mod stitching { unsafe impl Send for Detail_ChannelsCompensator {} - impl crate::stitching::Detail_ExposureCompensatorConst for Detail_ChannelsCompensator { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for Detail_ChannelsCompensator { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for Detail_ChannelsCompensator { + impl crate::stitching::Detail_ExposureCompensatorTrait for Detail_ChannelsCompensator { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3875,11 +4019,11 @@ pub mod stitching { unsafe impl Send for Detail_CompressedRectilinearPortraitWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_CompressedRectilinearPortraitWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_CompressedRectilinearPortraitWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_CompressedRectilinearPortraitWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_CompressedRectilinearPortraitWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4026,11 +4170,11 @@ pub mod stitching { unsafe impl Send for Detail_CompressedRectilinearWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_CompressedRectilinearWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_CompressedRectilinearWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_CompressedRectilinearWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_CompressedRectilinearWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4153,11 +4297,11 @@ pub mod stitching { unsafe impl Send for Detail_CylindricalPortraitWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_CylindricalPortraitWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_CylindricalPortraitWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_CylindricalPortraitWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_CylindricalPortraitWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4304,11 +4448,11 @@ pub mod stitching { unsafe impl Send for Detail_CylindricalWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_CylindricalWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_CylindricalWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_CylindricalWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_CylindricalWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4423,11 +4567,11 @@ pub mod stitching { #[inline] fn as_raw_mut_Detail_CylindricalWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_RotationWarperConst for Detail_CylindricalWarperGpu { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_CylindricalWarperGpu { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_CylindricalWarperGpu { + impl crate::stitching::Detail_RotationWarperTrait for Detail_CylindricalWarperGpu { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4559,7 +4703,7 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_DpSeamFinder] - pub trait Detail_DpSeamFinderTraitConst: crate::stitching::Detail_SeamFinderConst { + pub trait Detail_DpSeamFinderTraitConst: crate::stitching::Detail_SeamFinderTraitConst { fn as_raw_Detail_DpSeamFinder(&self) -> *const c_void; #[inline] @@ -4574,7 +4718,7 @@ pub mod stitching { } /// Mutable methods for [crate::stitching::Detail_DpSeamFinder] - pub trait Detail_DpSeamFinderTrait: crate::stitching::Detail_DpSeamFinderTraitConst + crate::stitching::Detail_SeamFinder { + pub trait Detail_DpSeamFinderTrait: crate::stitching::Detail_DpSeamFinderTraitConst + crate::stitching::Detail_SeamFinderTrait { fn as_raw_mut_Detail_DpSeamFinder(&mut self) -> *mut c_void; #[inline] @@ -4623,11 +4767,11 @@ pub mod stitching { unsafe impl Send for Detail_DpSeamFinder {} - impl crate::stitching::Detail_SeamFinderConst for Detail_DpSeamFinder { + impl crate::stitching::Detail_SeamFinderTraitConst for Detail_DpSeamFinder { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_SeamFinder for Detail_DpSeamFinder { + impl crate::stitching::Detail_SeamFinderTrait for Detail_DpSeamFinder { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4666,20 +4810,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_Estimator] - pub trait Detail_EstimatorConst { + pub trait Detail_EstimatorTraitConst { fn as_raw_Detail_Estimator(&self) -> *const c_void; } - /// Rotation estimator base class. - /// - /// It takes features of all images, pairwise matches between all images and estimates rotations of all - /// cameras. - /// - /// - /// Note: The coordinate system origin is implementation-dependent, but you can always normalize the - /// rotations in respect to the first camera, for instance. : - pub trait Detail_Estimator: crate::stitching::Detail_EstimatorConst { + /// Mutable methods for [crate::stitching::Detail_Estimator] + pub trait Detail_EstimatorTrait: crate::stitching::Detail_EstimatorTraitConst { fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void; /// Estimates camera parameters. @@ -4701,14 +4838,53 @@ pub mod stitching { } + /// Rotation estimator base class. + /// + /// It takes features of all images, pairwise matches between all images and estimates rotations of all + /// cameras. + /// + /// + /// Note: The coordinate system origin is implementation-dependent, but you can always normalize the + /// rotations in respect to the first camera, for instance. : + pub struct Detail_Estimator { + ptr: *mut c_void + } + + opencv_type_boxed! { Detail_Estimator } + + impl Drop for Detail_Estimator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Detail_Estimator_delete(instance: *mut c_void); } + unsafe { cv_Detail_Estimator_delete(self.as_raw_mut_Detail_Estimator()) }; + } + } + + unsafe impl Send for Detail_Estimator {} + + impl crate::stitching::Detail_EstimatorTraitConst for Detail_Estimator { + #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_EstimatorTrait for Detail_Estimator { + #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Detail_Estimator { + } + + boxed_cast_descendant! { Detail_Estimator, crate::stitching::Detail_AffineBasedEstimator, cv_Detail_Estimator_to_Detail_AffineBasedEstimator } + + boxed_cast_descendant! { Detail_Estimator, crate::stitching::Detail_HomographyBasedEstimator, cv_Detail_Estimator_to_Detail_HomographyBasedEstimator } + /// Constant methods for [crate::stitching::Detail_ExposureCompensator] - pub trait Detail_ExposureCompensatorConst { + pub trait Detail_ExposureCompensatorTraitConst { fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void; } - /// Base class for all exposure compensators. - pub trait Detail_ExposureCompensator: crate::stitching::Detail_ExposureCompensatorConst { + /// Mutable methods for [crate::stitching::Detail_ExposureCompensator] + pub trait Detail_ExposureCompensatorTrait: crate::stitching::Detail_ExposureCompensatorTraitConst { fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void; /// ## Parameters @@ -4797,18 +4973,50 @@ pub mod stitching { } - impl dyn Detail_ExposureCompensator + '_ { + /// Base class for all exposure compensators. + pub struct Detail_ExposureCompensator { + ptr: *mut c_void + } + + opencv_type_boxed! { Detail_ExposureCompensator } + + impl Drop for Detail_ExposureCompensator { #[inline] - pub fn create_default(typ: i32) -> Result> { + fn drop(&mut self) { + extern "C" { fn cv_Detail_ExposureCompensator_delete(instance: *mut c_void); } + unsafe { cv_Detail_ExposureCompensator_delete(self.as_raw_mut_Detail_ExposureCompensator()) }; + } + } + + unsafe impl Send for Detail_ExposureCompensator {} + + impl crate::stitching::Detail_ExposureCompensatorTraitConst for Detail_ExposureCompensator { + #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_ExposureCompensatorTrait for Detail_ExposureCompensator { + #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Detail_ExposureCompensator { + #[inline] + pub fn create_default(typ: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_detail_ExposureCompensator_createDefault_int(typ, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_descendant! { Detail_ExposureCompensator, crate::stitching::Detail_ChannelsCompensator, cv_Detail_ExposureCompensator_to_Detail_ChannelsCompensator } + + boxed_cast_descendant! { Detail_ExposureCompensator, crate::stitching::Detail_GainCompensator, cv_Detail_ExposureCompensator_to_Detail_GainCompensator } + + boxed_cast_descendant! { Detail_ExposureCompensator, crate::stitching::Detail_NoExposureCompensator, cv_Detail_ExposureCompensator_to_Detail_NoExposureCompensator } + /// Constant methods for [crate::stitching::Detail_FeatherBlender] pub trait Detail_FeatherBlenderTraitConst: crate::stitching::Detail_BlenderTraitConst { fn as_raw_Detail_FeatherBlender(&self) -> *const c_void; @@ -4932,7 +5140,7 @@ pub mod stitching { boxed_cast_base! { Detail_FeatherBlender, crate::stitching::Detail_Blender, cv_Detail_FeatherBlender_to_Detail_Blender } /// Constant methods for [crate::stitching::Detail_FeaturesMatcher] - pub trait Detail_FeaturesMatcherConst { + pub trait Detail_FeaturesMatcherTraitConst { fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void; /// ## Returns @@ -4948,8 +5156,8 @@ pub mod stitching { } - /// Feature matchers base class. - pub trait Detail_FeaturesMatcher: crate::stitching::Detail_FeaturesMatcherConst { + /// Mutable methods for [crate::stitching::Detail_FeaturesMatcher] + pub trait Detail_FeaturesMatcherTrait: crate::stitching::Detail_FeaturesMatcherTraitConst { fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void; /// Performs images matching. @@ -5011,6 +5219,36 @@ pub mod stitching { } + /// Feature matchers base class. + pub struct Detail_FeaturesMatcher { + ptr: *mut c_void + } + + opencv_type_boxed! { Detail_FeaturesMatcher } + + impl Drop for Detail_FeaturesMatcher { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Detail_FeaturesMatcher_delete(instance: *mut c_void); } + unsafe { cv_Detail_FeaturesMatcher_delete(self.as_raw_mut_Detail_FeaturesMatcher()) }; + } + } + + unsafe impl Send for Detail_FeaturesMatcher {} + + impl crate::stitching::Detail_FeaturesMatcherTraitConst for Detail_FeaturesMatcher { + #[inline] fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_FeaturesMatcherTrait for Detail_FeaturesMatcher { + #[inline] fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Detail_FeaturesMatcher { + } + + boxed_cast_descendant! { Detail_FeaturesMatcher, crate::stitching::Detail_BestOf2NearestMatcher, cv_Detail_FeaturesMatcher_to_Detail_BestOf2NearestMatcher } + /// Constant methods for [crate::stitching::Detail_FisheyeProjector] pub trait Detail_FisheyeProjectorTraitConst: crate::stitching::Detail_ProjectorBaseTraitConst { fn as_raw_Detail_FisheyeProjector(&self) -> *const c_void; @@ -5106,11 +5344,11 @@ pub mod stitching { unsafe impl Send for Detail_FisheyeWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_FisheyeWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_FisheyeWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_FisheyeWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_FisheyeWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -5136,7 +5374,7 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_GainCompensator] - pub trait Detail_GainCompensatorTraitConst: crate::stitching::Detail_ExposureCompensatorConst { + pub trait Detail_GainCompensatorTraitConst: crate::stitching::Detail_ExposureCompensatorTraitConst { fn as_raw_Detail_GainCompensator(&self) -> *const c_void; #[inline] @@ -5161,7 +5399,7 @@ pub mod stitching { } /// Mutable methods for [crate::stitching::Detail_GainCompensator] - pub trait Detail_GainCompensatorTrait: crate::stitching::Detail_ExposureCompensator + crate::stitching::Detail_GainCompensatorTraitConst { + pub trait Detail_GainCompensatorTrait: crate::stitching::Detail_ExposureCompensatorTrait + crate::stitching::Detail_GainCompensatorTraitConst { fn as_raw_mut_Detail_GainCompensator(&mut self) -> *mut c_void; #[inline] @@ -5267,11 +5505,11 @@ pub mod stitching { unsafe impl Send for Detail_GainCompensator {} - impl crate::stitching::Detail_ExposureCompensatorConst for Detail_GainCompensator { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for Detail_GainCompensator { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for Detail_GainCompensator { + impl crate::stitching::Detail_ExposureCompensatorTrait for Detail_GainCompensator { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -5385,13 +5623,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_GraphCutSeamFinder] - pub trait Detail_GraphCutSeamFinderTraitConst: crate::stitching::Detail_GraphCutSeamFinderBaseTraitConst + crate::stitching::Detail_SeamFinderConst { + pub trait Detail_GraphCutSeamFinderTraitConst: crate::stitching::Detail_GraphCutSeamFinderBaseTraitConst + crate::stitching::Detail_SeamFinderTraitConst { fn as_raw_Detail_GraphCutSeamFinder(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_GraphCutSeamFinder] - pub trait Detail_GraphCutSeamFinderTrait: crate::stitching::Detail_GraphCutSeamFinderBaseTrait + crate::stitching::Detail_GraphCutSeamFinderTraitConst + crate::stitching::Detail_SeamFinder { + pub trait Detail_GraphCutSeamFinderTrait: crate::stitching::Detail_GraphCutSeamFinderBaseTrait + crate::stitching::Detail_GraphCutSeamFinderTraitConst + crate::stitching::Detail_SeamFinderTrait { fn as_raw_mut_Detail_GraphCutSeamFinder(&mut self) -> *mut c_void; #[inline] @@ -5430,11 +5668,11 @@ pub mod stitching { #[inline] fn as_raw_mut_Detail_GraphCutSeamFinderBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_SeamFinderConst for Detail_GraphCutSeamFinder { + impl crate::stitching::Detail_SeamFinderTraitConst for Detail_GraphCutSeamFinder { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_SeamFinder for Detail_GraphCutSeamFinder { + impl crate::stitching::Detail_SeamFinderTrait for Detail_GraphCutSeamFinder { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -5520,13 +5758,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_GraphCutSeamFinderGpu] - pub trait Detail_GraphCutSeamFinderGpuTraitConst: crate::stitching::Detail_GraphCutSeamFinderBaseTraitConst + crate::stitching::Detail_PairwiseSeamFinderConst { + pub trait Detail_GraphCutSeamFinderGpuTraitConst: crate::stitching::Detail_GraphCutSeamFinderBaseTraitConst + crate::stitching::Detail_PairwiseSeamFinderTraitConst { fn as_raw_Detail_GraphCutSeamFinderGpu(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_GraphCutSeamFinderGpu] - pub trait Detail_GraphCutSeamFinderGpuTrait: crate::stitching::Detail_GraphCutSeamFinderBaseTrait + crate::stitching::Detail_GraphCutSeamFinderGpuTraitConst + crate::stitching::Detail_PairwiseSeamFinder { + pub trait Detail_GraphCutSeamFinderGpuTrait: crate::stitching::Detail_GraphCutSeamFinderBaseTrait + crate::stitching::Detail_GraphCutSeamFinderGpuTraitConst + crate::stitching::Detail_PairwiseSeamFinderTrait { fn as_raw_mut_Detail_GraphCutSeamFinderGpu(&mut self) -> *mut c_void; #[inline] @@ -5573,19 +5811,19 @@ pub mod stitching { #[inline] fn as_raw_mut_Detail_GraphCutSeamFinderBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_PairwiseSeamFinderConst for Detail_GraphCutSeamFinderGpu { + impl crate::stitching::Detail_PairwiseSeamFinderTraitConst for Detail_GraphCutSeamFinderGpu { #[inline] fn as_raw_Detail_PairwiseSeamFinder(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_PairwiseSeamFinder for Detail_GraphCutSeamFinderGpu { + impl crate::stitching::Detail_PairwiseSeamFinderTrait for Detail_GraphCutSeamFinderGpu { #[inline] fn as_raw_mut_Detail_PairwiseSeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_SeamFinderConst for Detail_GraphCutSeamFinderGpu { + impl crate::stitching::Detail_SeamFinderTraitConst for Detail_GraphCutSeamFinderGpu { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_SeamFinder for Detail_GraphCutSeamFinderGpu { + impl crate::stitching::Detail_SeamFinderTrait for Detail_GraphCutSeamFinderGpu { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -5720,13 +5958,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_HomographyBasedEstimator] - pub trait Detail_HomographyBasedEstimatorTraitConst: crate::stitching::Detail_EstimatorConst { + pub trait Detail_HomographyBasedEstimatorTraitConst: crate::stitching::Detail_EstimatorTraitConst { fn as_raw_Detail_HomographyBasedEstimator(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_HomographyBasedEstimator] - pub trait Detail_HomographyBasedEstimatorTrait: crate::stitching::Detail_Estimator + crate::stitching::Detail_HomographyBasedEstimatorTraitConst { + pub trait Detail_HomographyBasedEstimatorTrait: crate::stitching::Detail_EstimatorTrait + crate::stitching::Detail_HomographyBasedEstimatorTraitConst { fn as_raw_mut_Detail_HomographyBasedEstimator(&mut self) -> *mut c_void; } @@ -5748,11 +5986,11 @@ pub mod stitching { unsafe impl Send for Detail_HomographyBasedEstimator {} - impl crate::stitching::Detail_EstimatorConst for Detail_HomographyBasedEstimator { + impl crate::stitching::Detail_EstimatorTraitConst for Detail_HomographyBasedEstimator { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_Estimator for Detail_HomographyBasedEstimator { + impl crate::stitching::Detail_EstimatorTrait for Detail_HomographyBasedEstimator { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -6187,11 +6425,11 @@ pub mod stitching { unsafe impl Send for Detail_MercatorWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_MercatorWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_MercatorWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_MercatorWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_MercatorWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -6330,13 +6568,13 @@ pub mod stitching { boxed_cast_base! { Detail_MultiBandBlender, crate::stitching::Detail_Blender, cv_Detail_MultiBandBlender_to_Detail_Blender } /// Constant methods for [crate::stitching::Detail_NoBundleAdjuster] - pub trait Detail_NoBundleAdjusterTraitConst: crate::stitching::Detail_BundleAdjusterBaseConst { + pub trait Detail_NoBundleAdjusterTraitConst: crate::stitching::Detail_BundleAdjusterBaseTraitConst { fn as_raw_Detail_NoBundleAdjuster(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_NoBundleAdjuster] - pub trait Detail_NoBundleAdjusterTrait: crate::stitching::Detail_BundleAdjusterBase + crate::stitching::Detail_NoBundleAdjusterTraitConst { + pub trait Detail_NoBundleAdjusterTrait: crate::stitching::Detail_BundleAdjusterBaseTrait + crate::stitching::Detail_NoBundleAdjusterTraitConst { fn as_raw_mut_Detail_NoBundleAdjuster(&mut self) -> *mut c_void; } @@ -6358,19 +6596,19 @@ pub mod stitching { unsafe impl Send for Detail_NoBundleAdjuster {} - impl crate::stitching::Detail_BundleAdjusterBaseConst for Detail_NoBundleAdjuster { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for Detail_NoBundleAdjuster { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for Detail_NoBundleAdjuster { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for Detail_NoBundleAdjuster { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for Detail_NoBundleAdjuster { + impl crate::stitching::Detail_EstimatorTraitConst for Detail_NoBundleAdjuster { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_Estimator for Detail_NoBundleAdjuster { + impl crate::stitching::Detail_EstimatorTrait for Detail_NoBundleAdjuster { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -6396,13 +6634,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_NoExposureCompensator] - pub trait Detail_NoExposureCompensatorTraitConst: crate::stitching::Detail_ExposureCompensatorConst { + pub trait Detail_NoExposureCompensatorTraitConst: crate::stitching::Detail_ExposureCompensatorTraitConst { fn as_raw_Detail_NoExposureCompensator(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_NoExposureCompensator] - pub trait Detail_NoExposureCompensatorTrait: crate::stitching::Detail_ExposureCompensator + crate::stitching::Detail_NoExposureCompensatorTraitConst { + pub trait Detail_NoExposureCompensatorTrait: crate::stitching::Detail_ExposureCompensatorTrait + crate::stitching::Detail_NoExposureCompensatorTraitConst { fn as_raw_mut_Detail_NoExposureCompensator(&mut self) -> *mut c_void; #[inline] @@ -6462,11 +6700,11 @@ pub mod stitching { unsafe impl Send for Detail_NoExposureCompensator {} - impl crate::stitching::Detail_ExposureCompensatorConst for Detail_NoExposureCompensator { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for Detail_NoExposureCompensator { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for Detail_NoExposureCompensator { + impl crate::stitching::Detail_ExposureCompensatorTrait for Detail_NoExposureCompensator { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -6482,13 +6720,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_NoSeamFinder] - pub trait Detail_NoSeamFinderTraitConst: crate::stitching::Detail_SeamFinderConst { + pub trait Detail_NoSeamFinderTraitConst: crate::stitching::Detail_SeamFinderTraitConst { fn as_raw_Detail_NoSeamFinder(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_NoSeamFinder] - pub trait Detail_NoSeamFinderTrait: crate::stitching::Detail_NoSeamFinderTraitConst + crate::stitching::Detail_SeamFinder { + pub trait Detail_NoSeamFinderTrait: crate::stitching::Detail_NoSeamFinderTraitConst + crate::stitching::Detail_SeamFinderTrait { fn as_raw_mut_Detail_NoSeamFinder(&mut self) -> *mut c_void; #[inline] @@ -6519,11 +6757,11 @@ pub mod stitching { unsafe impl Send for Detail_NoSeamFinder {} - impl crate::stitching::Detail_SeamFinderConst for Detail_NoSeamFinder { + impl crate::stitching::Detail_SeamFinderTraitConst for Detail_NoSeamFinder { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_SeamFinder for Detail_NoSeamFinder { + impl crate::stitching::Detail_SeamFinderTrait for Detail_NoSeamFinder { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -6539,13 +6777,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_PairwiseSeamFinder] - pub trait Detail_PairwiseSeamFinderConst: crate::stitching::Detail_SeamFinderConst { + pub trait Detail_PairwiseSeamFinderTraitConst: crate::stitching::Detail_SeamFinderTraitConst { fn as_raw_Detail_PairwiseSeamFinder(&self) -> *const c_void; } - /// Base class for all pairwise seam estimators. - pub trait Detail_PairwiseSeamFinder: crate::stitching::Detail_PairwiseSeamFinderConst + crate::stitching::Detail_SeamFinder { + /// Mutable methods for [crate::stitching::Detail_PairwiseSeamFinder] + pub trait Detail_PairwiseSeamFinderTrait: crate::stitching::Detail_PairwiseSeamFinderTraitConst + crate::stitching::Detail_SeamFinderTrait { fn as_raw_mut_Detail_PairwiseSeamFinder(&mut self) -> *mut c_void; #[inline] @@ -6559,6 +6797,46 @@ pub mod stitching { } + /// Base class for all pairwise seam estimators. + pub struct Detail_PairwiseSeamFinder { + ptr: *mut c_void + } + + opencv_type_boxed! { Detail_PairwiseSeamFinder } + + impl Drop for Detail_PairwiseSeamFinder { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Detail_PairwiseSeamFinder_delete(instance: *mut c_void); } + unsafe { cv_Detail_PairwiseSeamFinder_delete(self.as_raw_mut_Detail_PairwiseSeamFinder()) }; + } + } + + unsafe impl Send for Detail_PairwiseSeamFinder {} + + impl crate::stitching::Detail_SeamFinderTraitConst for Detail_PairwiseSeamFinder { + #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_SeamFinderTrait for Detail_PairwiseSeamFinder { + #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::stitching::Detail_PairwiseSeamFinderTraitConst for Detail_PairwiseSeamFinder { + #[inline] fn as_raw_Detail_PairwiseSeamFinder(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_PairwiseSeamFinderTrait for Detail_PairwiseSeamFinder { + #[inline] fn as_raw_mut_Detail_PairwiseSeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Detail_PairwiseSeamFinder { + } + + boxed_cast_descendant! { Detail_PairwiseSeamFinder, crate::stitching::Detail_GraphCutSeamFinderGpu, cv_Detail_PairwiseSeamFinder_to_Detail_GraphCutSeamFinderGpu } + + boxed_cast_descendant! { Detail_PairwiseSeamFinder, crate::stitching::Detail_VoronoiSeamFinder, cv_Detail_PairwiseSeamFinder_to_Detail_VoronoiSeamFinder } + /// Constant methods for [crate::stitching::Detail_PaniniPortraitProjector] pub trait Detail_PaniniPortraitProjectorTraitConst: crate::stitching::Detail_ProjectorBaseTraitConst { fn as_raw_Detail_PaniniPortraitProjector(&self) -> *const c_void; @@ -6678,11 +6956,11 @@ pub mod stitching { unsafe impl Send for Detail_PaniniPortraitWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_PaniniPortraitWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_PaniniPortraitWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_PaniniPortraitWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_PaniniPortraitWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -6829,11 +7107,11 @@ pub mod stitching { unsafe impl Send for Detail_PaniniWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_PaniniWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_PaniniWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_PaniniWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_PaniniWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -6956,11 +7234,11 @@ pub mod stitching { unsafe impl Send for Detail_PlanePortraitWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_PlanePortraitWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_PlanePortraitWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_PlanePortraitWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_PlanePortraitWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -7204,11 +7482,11 @@ pub mod stitching { unsafe impl Send for Detail_PlaneWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_PlaneWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_PlaneWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_PlaneWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_PlaneWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -7380,11 +7658,11 @@ pub mod stitching { #[inline] fn as_raw_mut_Detail_PlaneWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_RotationWarperConst for Detail_PlaneWarperGpu { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_PlaneWarperGpu { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_PlaneWarperGpu { + impl crate::stitching::Detail_RotationWarperTrait for Detail_PlaneWarperGpu { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -7538,7 +7816,7 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_RotationWarper] - pub trait Detail_RotationWarperConst { + pub trait Detail_RotationWarperTraitConst { fn as_raw_Detail_RotationWarper(&self) -> *const c_void; #[inline] @@ -7552,8 +7830,8 @@ pub mod stitching { } - /// Rotation-only model image warper interface. - pub trait Detail_RotationWarper: crate::stitching::Detail_RotationWarperConst { + /// Mutable methods for [crate::stitching::Detail_RotationWarper] + pub trait Detail_RotationWarperTrait: crate::stitching::Detail_RotationWarperTraitConst { fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void; /// Projects the image point. @@ -7684,14 +7962,42 @@ pub mod stitching { } + /// Rotation-only model image warper interface. + pub struct Detail_RotationWarper { + ptr: *mut c_void + } + + opencv_type_boxed! { Detail_RotationWarper } + + impl Drop for Detail_RotationWarper { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Detail_RotationWarper_delete(instance: *mut c_void); } + unsafe { cv_Detail_RotationWarper_delete(self.as_raw_mut_Detail_RotationWarper()) }; + } + } + + unsafe impl Send for Detail_RotationWarper {} + + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_RotationWarper { + #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_RotationWarperTrait for Detail_RotationWarper { + #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Detail_RotationWarper { + } + /// Constant methods for [crate::stitching::Detail_SeamFinder] - pub trait Detail_SeamFinderConst { + pub trait Detail_SeamFinderTraitConst { fn as_raw_Detail_SeamFinder(&self) -> *const c_void; } - /// Base class for a seam estimator. - pub trait Detail_SeamFinder: crate::stitching::Detail_SeamFinderConst { + /// Mutable methods for [crate::stitching::Detail_SeamFinder] + pub trait Detail_SeamFinderTrait: crate::stitching::Detail_SeamFinderTraitConst { fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void; /// Estimates seams. @@ -7711,18 +8017,50 @@ pub mod stitching { } - impl dyn Detail_SeamFinder + '_ { + /// Base class for a seam estimator. + pub struct Detail_SeamFinder { + ptr: *mut c_void + } + + opencv_type_boxed! { Detail_SeamFinder } + + impl Drop for Detail_SeamFinder { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Detail_SeamFinder_delete(instance: *mut c_void); } + unsafe { cv_Detail_SeamFinder_delete(self.as_raw_mut_Detail_SeamFinder()) }; + } + } + + unsafe impl Send for Detail_SeamFinder {} + + impl crate::stitching::Detail_SeamFinderTraitConst for Detail_SeamFinder { + #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.as_raw() } + } + + impl crate::stitching::Detail_SeamFinderTrait for Detail_SeamFinder { + #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Detail_SeamFinder { #[inline] - pub fn create_default(typ: i32) -> Result> { + pub fn create_default(typ: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_detail_SeamFinder_createDefault_int(typ, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_descendant! { Detail_SeamFinder, crate::stitching::Detail_DpSeamFinder, cv_Detail_SeamFinder_to_Detail_DpSeamFinder } + + boxed_cast_descendant! { Detail_SeamFinder, crate::stitching::Detail_GraphCutSeamFinder, cv_Detail_SeamFinder_to_Detail_GraphCutSeamFinder } + + boxed_cast_descendant! { Detail_SeamFinder, crate::stitching::Detail_NoSeamFinder, cv_Detail_SeamFinder_to_Detail_NoSeamFinder } + /// Constant methods for [crate::stitching::Detail_SphericalPortraitProjector] pub trait Detail_SphericalPortraitProjectorTraitConst: crate::stitching::Detail_ProjectorBaseTraitConst { fn as_raw_Detail_SphericalPortraitProjector(&self) -> *const c_void; @@ -7818,11 +8156,11 @@ pub mod stitching { unsafe impl Send for Detail_SphericalPortraitWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_SphericalPortraitWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_SphericalPortraitWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_SphericalPortraitWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_SphericalPortraitWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -7994,11 +8332,11 @@ pub mod stitching { unsafe impl Send for Detail_SphericalWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_SphericalWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_SphericalWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_SphericalWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_SphericalWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -8106,11 +8444,11 @@ pub mod stitching { unsafe impl Send for Detail_SphericalWarperGpu {} - impl crate::stitching::Detail_RotationWarperConst for Detail_SphericalWarperGpu { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_SphericalWarperGpu { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_SphericalWarperGpu { + impl crate::stitching::Detail_RotationWarperTrait for Detail_SphericalWarperGpu { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -8240,11 +8578,11 @@ pub mod stitching { unsafe impl Send for Detail_StereographicWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_StereographicWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_StereographicWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_StereographicWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_StereographicWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -8364,11 +8702,11 @@ pub mod stitching { unsafe impl Send for Detail_TransverseMercatorWarper {} - impl crate::stitching::Detail_RotationWarperConst for Detail_TransverseMercatorWarper { + impl crate::stitching::Detail_RotationWarperTraitConst for Detail_TransverseMercatorWarper { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_RotationWarper for Detail_TransverseMercatorWarper { + impl crate::stitching::Detail_RotationWarperTrait for Detail_TransverseMercatorWarper { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -8394,13 +8732,13 @@ pub mod stitching { } /// Constant methods for [crate::stitching::Detail_VoronoiSeamFinder] - pub trait Detail_VoronoiSeamFinderTraitConst: crate::stitching::Detail_PairwiseSeamFinderConst { + pub trait Detail_VoronoiSeamFinderTraitConst: crate::stitching::Detail_PairwiseSeamFinderTraitConst { fn as_raw_Detail_VoronoiSeamFinder(&self) -> *const c_void; } /// Mutable methods for [crate::stitching::Detail_VoronoiSeamFinder] - pub trait Detail_VoronoiSeamFinderTrait: crate::stitching::Detail_PairwiseSeamFinder + crate::stitching::Detail_VoronoiSeamFinderTraitConst { + pub trait Detail_VoronoiSeamFinderTrait: crate::stitching::Detail_PairwiseSeamFinderTrait + crate::stitching::Detail_VoronoiSeamFinderTraitConst { fn as_raw_mut_Detail_VoronoiSeamFinder(&mut self) -> *mut c_void; #[inline] @@ -8440,19 +8778,19 @@ pub mod stitching { unsafe impl Send for Detail_VoronoiSeamFinder {} - impl crate::stitching::Detail_PairwiseSeamFinderConst for Detail_VoronoiSeamFinder { + impl crate::stitching::Detail_PairwiseSeamFinderTraitConst for Detail_VoronoiSeamFinder { #[inline] fn as_raw_Detail_PairwiseSeamFinder(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_PairwiseSeamFinder for Detail_VoronoiSeamFinder { + impl crate::stitching::Detail_PairwiseSeamFinderTrait for Detail_VoronoiSeamFinder { #[inline] fn as_raw_mut_Detail_PairwiseSeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::stitching::Detail_SeamFinderConst for Detail_VoronoiSeamFinder { + impl crate::stitching::Detail_SeamFinderTraitConst for Detail_VoronoiSeamFinder { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.as_raw() } } - impl crate::stitching::Detail_SeamFinder for Detail_VoronoiSeamFinder { + impl crate::stitching::Detail_SeamFinderTrait for Detail_VoronoiSeamFinder { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.as_raw_mut() } } diff --git a/docs/structured_light.rs b/docs/structured_light.rs index f65dbde86..746a79d02 100644 --- a/docs/structured_light.rs +++ b/docs/structured_light.rs @@ -18,7 +18,7 @@ pub mod structured_light { //! For more details, see [tutorial_structured_light]. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::StructuredLightPatternConst, super::StructuredLightPattern, super::GrayCodePattern_ParamsTraitConst, super::GrayCodePattern_ParamsTrait, super::GrayCodePatternConst, super::GrayCodePattern, super::SinusoidalPattern_ParamsTraitConst, super::SinusoidalPattern_ParamsTrait, super::SinusoidalPatternConst, super::SinusoidalPattern }; + pub use { super::StructuredLightPatternTraitConst, super::StructuredLightPatternTrait, super::GrayCodePattern_ParamsTraitConst, super::GrayCodePattern_ParamsTrait, super::GrayCodePatternTraitConst, super::GrayCodePatternTrait, super::SinusoidalPattern_ParamsTraitConst, super::SinusoidalPattern_ParamsTrait, super::SinusoidalPatternTraitConst, super::SinusoidalPatternTrait }; } /// Kyriakos Herakleous, Charalambos Poullis. "3DUNDERWORLD-SLS: An Open-Source Structured-Light Scanning System for Rapid Geometry Acquisition", arXiv preprint arXiv:1406.6595 (2014). @@ -27,7 +27,7 @@ pub mod structured_light { pub const FTP: i32 = 0; pub const PSP: i32 = 1; /// Constant methods for [crate::structured_light::GrayCodePattern] - pub trait GrayCodePatternConst: crate::structured_light::StructuredLightPatternConst { + pub trait GrayCodePatternTraitConst: crate::structured_light::StructuredLightPatternTraitConst { fn as_raw_GrayCodePattern(&self) -> *const c_void; /// Get the number of pattern images needed for the graycode pattern. @@ -85,20 +85,8 @@ pub mod structured_light { } - /// Class implementing the Gray-code pattern, based on [UNDERWORLD](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_UNDERWORLD). - /// - /// The generation of the pattern images is performed with Gray encoding using the traditional white and black colors. - /// - /// The information about the two image axes x, y is encoded separately into two different pattern sequences. - /// A projector P with resolution (P_res_x, P_res_y) will result in Ncols = log 2 (P_res_x) encoded pattern images representing the columns, and - /// in Nrows = log 2 (P_res_y) encoded pattern images representing the rows. - /// For example a projector with resolution 1024x768 will result in Ncols = 10 and Nrows = 10. - /// - /// However, the generated pattern sequence consists of both regular color and color-inverted images: inverted pattern images are images - /// with the same structure as the original but with inverted colors. - /// This provides an effective method for easily determining the intensity value of each pixel when it is lit (highest value) and - /// when it is not lit (lowest value). So for a a projector with resolution 1024x768, the number of pattern images will be Ncols * 2 + Nrows * 2 = 40. - pub trait GrayCodePattern: crate::structured_light::GrayCodePatternConst + crate::structured_light::StructuredLightPattern { + /// Mutable methods for [crate::structured_light::GrayCodePattern] + pub trait GrayCodePatternTrait: crate::structured_light::GrayCodePatternTraitConst + crate::structured_light::StructuredLightPatternTrait { fn as_raw_mut_GrayCodePattern(&mut self) -> *mut c_void; /// Sets the value for white threshold, needed for decoding. @@ -133,7 +121,60 @@ pub mod structured_light { } - impl dyn GrayCodePattern + '_ { + /// Class implementing the Gray-code pattern, based on [UNDERWORLD](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_UNDERWORLD). + /// + /// The generation of the pattern images is performed with Gray encoding using the traditional white and black colors. + /// + /// The information about the two image axes x, y is encoded separately into two different pattern sequences. + /// A projector P with resolution (P_res_x, P_res_y) will result in Ncols = log 2 (P_res_x) encoded pattern images representing the columns, and + /// in Nrows = log 2 (P_res_y) encoded pattern images representing the rows. + /// For example a projector with resolution 1024x768 will result in Ncols = 10 and Nrows = 10. + /// + /// However, the generated pattern sequence consists of both regular color and color-inverted images: inverted pattern images are images + /// with the same structure as the original but with inverted colors. + /// This provides an effective method for easily determining the intensity value of each pixel when it is lit (highest value) and + /// when it is not lit (lowest value). So for a a projector with resolution 1024x768, the number of pattern images will be Ncols * 2 + Nrows * 2 = 40. + pub struct GrayCodePattern { + ptr: *mut c_void + } + + opencv_type_boxed! { GrayCodePattern } + + impl Drop for GrayCodePattern { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GrayCodePattern_delete(instance: *mut c_void); } + unsafe { cv_GrayCodePattern_delete(self.as_raw_mut_GrayCodePattern()) }; + } + } + + unsafe impl Send for GrayCodePattern {} + + impl core::AlgorithmTraitConst for GrayCodePattern { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GrayCodePattern { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::structured_light::StructuredLightPatternTraitConst for GrayCodePattern { + #[inline] fn as_raw_StructuredLightPattern(&self) -> *const c_void { self.as_raw() } + } + + impl crate::structured_light::StructuredLightPatternTrait for GrayCodePattern { + #[inline] fn as_raw_mut_StructuredLightPattern(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::structured_light::GrayCodePatternTraitConst for GrayCodePattern { + #[inline] fn as_raw_GrayCodePattern(&self) -> *const c_void { self.as_raw() } + } + + impl crate::structured_light::GrayCodePatternTrait for GrayCodePattern { + #[inline] fn as_raw_mut_GrayCodePattern(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GrayCodePattern { /// Constructor /// ## Parameters /// * parameters: GrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector. @@ -141,26 +182,29 @@ pub mod structured_light { /// ## C++ default parameters /// * parameters: GrayCodePattern::Params() #[inline] - pub fn create(parameters: &crate::structured_light::GrayCodePattern_Params) -> Result> { + pub fn create(parameters: &crate::structured_light::GrayCodePattern_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_structured_light_GrayCodePattern_create_const_ParamsR(parameters.as_raw_GrayCodePattern_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_1(width: i32, height: i32) -> Result> { + pub fn create_1(width: i32, height: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_structured_light_GrayCodePattern_create_int_int(width, height, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { GrayCodePattern, core::Algorithm, cv_GrayCodePattern_to_Algorithm } + /// Constant methods for [crate::structured_light::GrayCodePattern_Params] pub trait GrayCodePattern_ParamsTraitConst { fn as_raw_GrayCodePattern_Params(&self) -> *const c_void; @@ -239,16 +283,13 @@ pub mod structured_light { } /// Constant methods for [crate::structured_light::SinusoidalPattern] - pub trait SinusoidalPatternConst: crate::structured_light::StructuredLightPatternConst { + pub trait SinusoidalPatternTraitConst: crate::structured_light::StructuredLightPatternTraitConst { fn as_raw_SinusoidalPattern(&self) -> *const c_void; } - /// Class implementing Fourier transform profilometry (FTP) , phase-shifting profilometry (PSP) - /// and Fourier-assisted phase-shifting profilometry (FAPS) based on [faps](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_faps). - /// - /// This class generates sinusoidal patterns that can be used with FTP, PSP and FAPS. - pub trait SinusoidalPattern: crate::structured_light::SinusoidalPatternConst + crate::structured_light::StructuredLightPattern { + /// Mutable methods for [crate::structured_light::SinusoidalPattern] + pub trait SinusoidalPatternTrait: crate::structured_light::SinusoidalPatternTraitConst + crate::structured_light::StructuredLightPatternTrait { fn as_raw_mut_SinusoidalPattern(&mut self) -> *mut c_void; /// Compute a wrapped phase map from sinusoidal patterns. @@ -331,7 +372,51 @@ pub mod structured_light { } - impl dyn SinusoidalPattern + '_ { + /// Class implementing Fourier transform profilometry (FTP) , phase-shifting profilometry (PSP) + /// and Fourier-assisted phase-shifting profilometry (FAPS) based on [faps](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_faps). + /// + /// This class generates sinusoidal patterns that can be used with FTP, PSP and FAPS. + pub struct SinusoidalPattern { + ptr: *mut c_void + } + + opencv_type_boxed! { SinusoidalPattern } + + impl Drop for SinusoidalPattern { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SinusoidalPattern_delete(instance: *mut c_void); } + unsafe { cv_SinusoidalPattern_delete(self.as_raw_mut_SinusoidalPattern()) }; + } + } + + unsafe impl Send for SinusoidalPattern {} + + impl core::AlgorithmTraitConst for SinusoidalPattern { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SinusoidalPattern { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::structured_light::StructuredLightPatternTraitConst for SinusoidalPattern { + #[inline] fn as_raw_StructuredLightPattern(&self) -> *const c_void { self.as_raw() } + } + + impl crate::structured_light::StructuredLightPatternTrait for SinusoidalPattern { + #[inline] fn as_raw_mut_StructuredLightPattern(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::structured_light::SinusoidalPatternTraitConst for SinusoidalPattern { + #[inline] fn as_raw_SinusoidalPattern(&self) -> *const c_void { self.as_raw() } + } + + impl crate::structured_light::SinusoidalPatternTrait for SinusoidalPattern { + #[inline] fn as_raw_mut_SinusoidalPattern(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SinusoidalPattern { /// Constructor. /// ## Parameters /// * parameters: SinusoidalPattern parameters SinusoidalPattern::Params: width, height of the projector and patterns parameters. @@ -339,16 +424,19 @@ pub mod structured_light { /// ## C++ default parameters /// * parameters: makePtr() #[inline] - pub fn create(mut parameters: core::Ptr) -> Result> { + pub fn create(mut parameters: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_structured_light_SinusoidalPattern_create_PtrLParamsG(parameters.as_raw_mut_PtrOfSinusoidalPattern_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { SinusoidalPattern, core::Algorithm, cv_SinusoidalPattern_to_Algorithm } + /// Constant methods for [crate::structured_light::SinusoidalPattern_Params] pub trait SinusoidalPattern_ParamsTraitConst { fn as_raw_SinusoidalPattern_Params(&self) -> *const c_void; @@ -518,7 +606,7 @@ pub mod structured_light { } /// Constant methods for [crate::structured_light::StructuredLightPattern] - pub trait StructuredLightPatternConst: core::AlgorithmTraitConst { + pub trait StructuredLightPatternTraitConst: core::AlgorithmTraitConst { fn as_raw_StructuredLightPattern(&self) -> *const c_void; /// Decodes the structured light pattern, generating a disparity map @@ -550,8 +638,8 @@ pub mod structured_light { } - /// Abstract base class for generating and decoding structured light patterns. - pub trait StructuredLightPattern: core::AlgorithmTrait + crate::structured_light::StructuredLightPatternConst { + /// Mutable methods for [crate::structured_light::StructuredLightPattern] + pub trait StructuredLightPatternTrait: core::AlgorithmTrait + crate::structured_light::StructuredLightPatternTraitConst { fn as_raw_mut_StructuredLightPattern(&mut self) -> *mut c_void; /// Generates the structured light pattern to project. @@ -569,4 +657,42 @@ pub mod structured_light { } } + + /// Abstract base class for generating and decoding structured light patterns. + pub struct StructuredLightPattern { + ptr: *mut c_void + } + + opencv_type_boxed! { StructuredLightPattern } + + impl Drop for StructuredLightPattern { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_StructuredLightPattern_delete(instance: *mut c_void); } + unsafe { cv_StructuredLightPattern_delete(self.as_raw_mut_StructuredLightPattern()) }; + } + } + + unsafe impl Send for StructuredLightPattern {} + + impl core::AlgorithmTraitConst for StructuredLightPattern { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for StructuredLightPattern { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::structured_light::StructuredLightPatternTraitConst for StructuredLightPattern { + #[inline] fn as_raw_StructuredLightPattern(&self) -> *const c_void { self.as_raw() } + } + + impl crate::structured_light::StructuredLightPatternTrait for StructuredLightPattern { + #[inline] fn as_raw_mut_StructuredLightPattern(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StructuredLightPattern { + } + + boxed_cast_base! { StructuredLightPattern, core::Algorithm, cv_StructuredLightPattern_to_Algorithm } } diff --git a/docs/superres.rs b/docs/superres.rs index 519e944ef..cc21246d7 100644 --- a/docs/superres.rs +++ b/docs/superres.rs @@ -6,110 +6,110 @@ pub mod superres { //! the papers [Farsiu03](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Farsiu03) and [Mitzel09](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Mitzel09) . use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::Superres_DenseOpticalFlowExtConst, super::Superres_DenseOpticalFlowExt, super::Superres_FarnebackOpticalFlowConst, super::Superres_FarnebackOpticalFlow, super::Superres_DualTVL1OpticalFlowConst, super::Superres_DualTVL1OpticalFlow, super::Superres_BroxOpticalFlowConst, super::Superres_BroxOpticalFlow, super::Superres_PyrLKOpticalFlowConst, super::Superres_PyrLKOpticalFlow, super::Superres_FrameSourceConst, super::Superres_FrameSource, super::Superres_SuperResolutionConst, super::Superres_SuperResolution }; + pub use { super::Superres_DenseOpticalFlowExtTraitConst, super::Superres_DenseOpticalFlowExtTrait, super::Superres_FarnebackOpticalFlowTraitConst, super::Superres_FarnebackOpticalFlowTrait, super::Superres_DualTVL1OpticalFlowTraitConst, super::Superres_DualTVL1OpticalFlowTrait, super::Superres_BroxOpticalFlowTraitConst, super::Superres_BroxOpticalFlowTrait, super::Superres_PyrLKOpticalFlowTraitConst, super::Superres_PyrLKOpticalFlowTrait, super::Superres_FrameSourceTraitConst, super::Superres_FrameSourceTrait, super::Superres_SuperResolutionTraitConst, super::Superres_SuperResolutionTrait }; } /// ## C++ default parameters /// * device_id: 0 #[inline] - pub fn create_frame_source_camera(device_id: i32) -> Result> { + pub fn create_frame_source_camera(device_id: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createFrameSource_Camera_int(device_id, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_frame_source_empty() -> Result> { + pub fn create_frame_source_empty() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createFrameSource_Empty(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_frame_source_video_cuda(file_name: &str) -> Result> { + pub fn create_frame_source_video_cuda(file_name: &str) -> Result> { extern_container_arg!(file_name); return_send!(via ocvrs_return); unsafe { sys::cv_superres_createFrameSource_Video_CUDA_const_StringR(file_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_frame_source_video(file_name: &str) -> Result> { + pub fn create_frame_source_video(file_name: &str) -> Result> { extern_container_arg!(file_name); return_send!(via ocvrs_return); unsafe { sys::cv_superres_createFrameSource_Video_const_StringR(file_name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_opt_flow_brox_cuda() -> Result> { + pub fn create_opt_flow_brox_cuda() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createOptFlow_Brox_CUDA(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_opt_flow_dual_tvl1() -> Result> { + pub fn create_opt_flow_dual_tvl1() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createOptFlow_DualTVL1(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_opt_flow_dual_tvl1_cuda() -> Result> { + pub fn create_opt_flow_dual_tvl1_cuda() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createOptFlow_DualTVL1_CUDA(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_opt_flow_farneback() -> Result> { + pub fn create_opt_flow_farneback() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createOptFlow_Farneback(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_opt_flow_farneback_cuda() -> Result> { + pub fn create_opt_flow_farneback_cuda() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createOptFlow_Farneback_CUDA(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_opt_flow_pyr_lk_cuda() -> Result> { + pub fn create_opt_flow_pyr_lk_cuda() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createOptFlow_PyrLK_CUDA(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -132,27 +132,27 @@ pub mod superres { /// * **int temporalAreaRadius** Radius of the temporal search area. /// * **Ptr\ opticalFlow** Dense optical flow algorithm. #[inline] - pub fn create_super_resolution_btvl1() -> Result> { + pub fn create_super_resolution_btvl1() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createSuperResolution_BTVL1(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - pub fn create_super_resolution_btvl1_cuda() -> Result> { + pub fn create_super_resolution_btvl1_cuda() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_createSuperResolution_BTVL1_CUDA(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Constant methods for [crate::superres::Superres_BroxOpticalFlow] - pub trait Superres_BroxOpticalFlowConst: crate::superres::Superres_DenseOpticalFlowExtConst { + pub trait Superres_BroxOpticalFlowTraitConst: crate::superres::Superres_DenseOpticalFlowExtTraitConst { fn as_raw_Superres_BroxOpticalFlow(&self) -> *const c_void; /// Flow smoothness @@ -229,7 +229,8 @@ pub mod superres { } - pub trait Superres_BroxOpticalFlow: crate::superres::Superres_BroxOpticalFlowConst + crate::superres::Superres_DenseOpticalFlowExt { + /// Mutable methods for [crate::superres::Superres_BroxOpticalFlow] + pub trait Superres_BroxOpticalFlowTrait: crate::superres::Superres_BroxOpticalFlowTraitConst + crate::superres::Superres_DenseOpticalFlowExtTrait { fn as_raw_mut_Superres_BroxOpticalFlow(&mut self) -> *mut c_void; /// Flow smoothness @@ -306,13 +307,59 @@ pub mod superres { } + pub struct Superres_BroxOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { Superres_BroxOpticalFlow } + + impl Drop for Superres_BroxOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Superres_BroxOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_Superres_BroxOpticalFlow_delete(self.as_raw_mut_Superres_BroxOpticalFlow()) }; + } + } + + unsafe impl Send for Superres_BroxOpticalFlow {} + + impl core::AlgorithmTraitConst for Superres_BroxOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Superres_BroxOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for Superres_BroxOpticalFlow { + #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTrait for Superres_BroxOpticalFlow { + #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_BroxOpticalFlowTraitConst for Superres_BroxOpticalFlow { + #[inline] fn as_raw_Superres_BroxOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_BroxOpticalFlowTrait for Superres_BroxOpticalFlow { + #[inline] fn as_raw_mut_Superres_BroxOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Superres_BroxOpticalFlow { + } + + boxed_cast_base! { Superres_BroxOpticalFlow, core::Algorithm, cv_Superres_BroxOpticalFlow_to_Algorithm } + /// Constant methods for [crate::superres::Superres_DenseOpticalFlowExt] - pub trait Superres_DenseOpticalFlowExtConst: core::AlgorithmTraitConst { + pub trait Superres_DenseOpticalFlowExtTraitConst: core::AlgorithmTraitConst { fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void; } - pub trait Superres_DenseOpticalFlowExt: core::AlgorithmTrait + crate::superres::Superres_DenseOpticalFlowExtConst { + /// Mutable methods for [crate::superres::Superres_DenseOpticalFlowExt] + pub trait Superres_DenseOpticalFlowExtTrait: core::AlgorithmTrait + crate::superres::Superres_DenseOpticalFlowExtTraitConst { fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -341,8 +388,45 @@ pub mod superres { } + pub struct Superres_DenseOpticalFlowExt { + ptr: *mut c_void + } + + opencv_type_boxed! { Superres_DenseOpticalFlowExt } + + impl Drop for Superres_DenseOpticalFlowExt { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Superres_DenseOpticalFlowExt_delete(instance: *mut c_void); } + unsafe { cv_Superres_DenseOpticalFlowExt_delete(self.as_raw_mut_Superres_DenseOpticalFlowExt()) }; + } + } + + unsafe impl Send for Superres_DenseOpticalFlowExt {} + + impl core::AlgorithmTraitConst for Superres_DenseOpticalFlowExt { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Superres_DenseOpticalFlowExt { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for Superres_DenseOpticalFlowExt { + #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTrait for Superres_DenseOpticalFlowExt { + #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Superres_DenseOpticalFlowExt { + } + + boxed_cast_base! { Superres_DenseOpticalFlowExt, core::Algorithm, cv_Superres_DenseOpticalFlowExt_to_Algorithm } + /// Constant methods for [crate::superres::Superres_DualTVL1OpticalFlow] - pub trait Superres_DualTVL1OpticalFlowConst: crate::superres::Superres_DenseOpticalFlowExtConst { + pub trait Superres_DualTVL1OpticalFlowTraitConst: crate::superres::Superres_DenseOpticalFlowExtTraitConst { fn as_raw_Superres_DualTVL1OpticalFlow(&self) -> *const c_void; /// ## See also @@ -435,7 +519,8 @@ pub mod superres { } - pub trait Superres_DualTVL1OpticalFlow: crate::superres::Superres_DenseOpticalFlowExt + crate::superres::Superres_DualTVL1OpticalFlowConst { + /// Mutable methods for [crate::superres::Superres_DualTVL1OpticalFlow] + pub trait Superres_DualTVL1OpticalFlowTrait: crate::superres::Superres_DenseOpticalFlowExtTrait + crate::superres::Superres_DualTVL1OpticalFlowTraitConst { fn as_raw_mut_Superres_DualTVL1OpticalFlow(&mut self) -> *mut c_void; /// ## See also @@ -528,8 +613,53 @@ pub mod superres { } + pub struct Superres_DualTVL1OpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { Superres_DualTVL1OpticalFlow } + + impl Drop for Superres_DualTVL1OpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Superres_DualTVL1OpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_Superres_DualTVL1OpticalFlow_delete(self.as_raw_mut_Superres_DualTVL1OpticalFlow()) }; + } + } + + unsafe impl Send for Superres_DualTVL1OpticalFlow {} + + impl core::AlgorithmTraitConst for Superres_DualTVL1OpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Superres_DualTVL1OpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for Superres_DualTVL1OpticalFlow { + #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTrait for Superres_DualTVL1OpticalFlow { + #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_DualTVL1OpticalFlowTraitConst for Superres_DualTVL1OpticalFlow { + #[inline] fn as_raw_Superres_DualTVL1OpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_DualTVL1OpticalFlowTrait for Superres_DualTVL1OpticalFlow { + #[inline] fn as_raw_mut_Superres_DualTVL1OpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Superres_DualTVL1OpticalFlow { + } + + boxed_cast_base! { Superres_DualTVL1OpticalFlow, core::Algorithm, cv_Superres_DualTVL1OpticalFlow_to_Algorithm } + /// Constant methods for [crate::superres::Superres_FarnebackOpticalFlow] - pub trait Superres_FarnebackOpticalFlowConst: crate::superres::Superres_DenseOpticalFlowExtConst { + pub trait Superres_FarnebackOpticalFlowTraitConst: crate::superres::Superres_DenseOpticalFlowExtTraitConst { fn as_raw_Superres_FarnebackOpticalFlow(&self) -> *const c_void; /// ## See also @@ -611,7 +741,8 @@ pub mod superres { } - pub trait Superres_FarnebackOpticalFlow: crate::superres::Superres_DenseOpticalFlowExt + crate::superres::Superres_FarnebackOpticalFlowConst { + /// Mutable methods for [crate::superres::Superres_FarnebackOpticalFlow] + pub trait Superres_FarnebackOpticalFlowTrait: crate::superres::Superres_DenseOpticalFlowExtTrait + crate::superres::Superres_FarnebackOpticalFlowTraitConst { fn as_raw_mut_Superres_FarnebackOpticalFlow(&mut self) -> *mut c_void; /// ## See also @@ -693,13 +824,59 @@ pub mod superres { } + pub struct Superres_FarnebackOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { Superres_FarnebackOpticalFlow } + + impl Drop for Superres_FarnebackOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Superres_FarnebackOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_Superres_FarnebackOpticalFlow_delete(self.as_raw_mut_Superres_FarnebackOpticalFlow()) }; + } + } + + unsafe impl Send for Superres_FarnebackOpticalFlow {} + + impl core::AlgorithmTraitConst for Superres_FarnebackOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Superres_FarnebackOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for Superres_FarnebackOpticalFlow { + #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTrait for Superres_FarnebackOpticalFlow { + #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_FarnebackOpticalFlowTraitConst for Superres_FarnebackOpticalFlow { + #[inline] fn as_raw_Superres_FarnebackOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_FarnebackOpticalFlowTrait for Superres_FarnebackOpticalFlow { + #[inline] fn as_raw_mut_Superres_FarnebackOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Superres_FarnebackOpticalFlow { + } + + boxed_cast_base! { Superres_FarnebackOpticalFlow, core::Algorithm, cv_Superres_FarnebackOpticalFlow_to_Algorithm } + /// Constant methods for [crate::superres::Superres_FrameSource] - pub trait Superres_FrameSourceConst { + pub trait Superres_FrameSourceTraitConst { fn as_raw_Superres_FrameSource(&self) -> *const c_void; } - pub trait Superres_FrameSource: crate::superres::Superres_FrameSourceConst { + /// Mutable methods for [crate::superres::Superres_FrameSource] + pub trait Superres_FrameSourceTrait: crate::superres::Superres_FrameSourceTraitConst { fn as_raw_mut_Superres_FrameSource(&mut self) -> *mut c_void; #[inline] @@ -723,8 +900,35 @@ pub mod superres { } + pub struct Superres_FrameSource { + ptr: *mut c_void + } + + opencv_type_boxed! { Superres_FrameSource } + + impl Drop for Superres_FrameSource { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Superres_FrameSource_delete(instance: *mut c_void); } + unsafe { cv_Superres_FrameSource_delete(self.as_raw_mut_Superres_FrameSource()) }; + } + } + + unsafe impl Send for Superres_FrameSource {} + + impl crate::superres::Superres_FrameSourceTraitConst for Superres_FrameSource { + #[inline] fn as_raw_Superres_FrameSource(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_FrameSourceTrait for Superres_FrameSource { + #[inline] fn as_raw_mut_Superres_FrameSource(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Superres_FrameSource { + } + /// Constant methods for [crate::superres::Superres_PyrLKOpticalFlow] - pub trait Superres_PyrLKOpticalFlowConst: crate::superres::Superres_DenseOpticalFlowExtConst { + pub trait Superres_PyrLKOpticalFlowTraitConst: crate::superres::Superres_DenseOpticalFlowExtTraitConst { fn as_raw_Superres_PyrLKOpticalFlow(&self) -> *const c_void; /// ## See also @@ -762,7 +966,8 @@ pub mod superres { } - pub trait Superres_PyrLKOpticalFlow: crate::superres::Superres_DenseOpticalFlowExt + crate::superres::Superres_PyrLKOpticalFlowConst { + /// Mutable methods for [crate::superres::Superres_PyrLKOpticalFlow] + pub trait Superres_PyrLKOpticalFlowTrait: crate::superres::Superres_DenseOpticalFlowExtTrait + crate::superres::Superres_PyrLKOpticalFlowTraitConst { fn as_raw_mut_Superres_PyrLKOpticalFlow(&mut self) -> *mut c_void; /// ## See also @@ -800,8 +1005,53 @@ pub mod superres { } + pub struct Superres_PyrLKOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { Superres_PyrLKOpticalFlow } + + impl Drop for Superres_PyrLKOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Superres_PyrLKOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_Superres_PyrLKOpticalFlow_delete(self.as_raw_mut_Superres_PyrLKOpticalFlow()) }; + } + } + + unsafe impl Send for Superres_PyrLKOpticalFlow {} + + impl core::AlgorithmTraitConst for Superres_PyrLKOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Superres_PyrLKOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for Superres_PyrLKOpticalFlow { + #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_DenseOpticalFlowExtTrait for Superres_PyrLKOpticalFlow { + #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_PyrLKOpticalFlowTraitConst for Superres_PyrLKOpticalFlow { + #[inline] fn as_raw_Superres_PyrLKOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_PyrLKOpticalFlowTrait for Superres_PyrLKOpticalFlow { + #[inline] fn as_raw_mut_Superres_PyrLKOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Superres_PyrLKOpticalFlow { + } + + boxed_cast_base! { Superres_PyrLKOpticalFlow, core::Algorithm, cv_Superres_PyrLKOpticalFlow_to_Algorithm } + /// Constant methods for [crate::superres::Superres_SuperResolution] - pub trait Superres_SuperResolutionConst: core::AlgorithmTraitConst + crate::superres::Superres_FrameSourceConst { + pub trait Superres_SuperResolutionTraitConst: core::AlgorithmTraitConst + crate::superres::Superres_FrameSourceTraitConst { fn as_raw_Superres_SuperResolution(&self) -> *const c_void; /// Scale factor @@ -916,22 +1166,19 @@ pub mod superres { /// ## See also /// setOpticalFlow #[inline] - fn get_optical_flow(&self) -> Result> { + fn get_optical_flow(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_SuperResolution_getOpticalFlow_const(self.as_raw_Superres_SuperResolution(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } - /// Base class for Super Resolution algorithms. - /// - /// The class is only used to define the common interface for the whole family of Super Resolution - /// algorithms. - pub trait Superres_SuperResolution: core::AlgorithmTrait + crate::superres::Superres_FrameSource + crate::superres::Superres_SuperResolutionConst { + /// Mutable methods for [crate::superres::Superres_SuperResolution] + pub trait Superres_SuperResolutionTrait: core::AlgorithmTrait + crate::superres::Superres_FrameSourceTrait + crate::superres::Superres_SuperResolutionTraitConst { fn as_raw_mut_Superres_SuperResolution(&mut self) -> *mut c_void; /// Set input frame source for Super Resolution algorithm. @@ -939,7 +1186,7 @@ pub mod superres { /// ## Parameters /// * frameSource: Input frame source #[inline] - fn set_input(&mut self, frame_source: &core::Ptr) -> Result<()> { + fn set_input(&mut self, frame_source: &core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_SuperResolution_setInput_const_PtrLFrameSourceGR(self.as_raw_mut_Superres_SuperResolution(), frame_source.as_raw_PtrOfSuperres_FrameSource(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1092,7 +1339,7 @@ pub mod superres { /// ## See also /// setOpticalFlow getOpticalFlow #[inline] - fn set_optical_flow(&mut self, val: &core::Ptr) -> Result<()> { + fn set_optical_flow(&mut self, val: &core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_superres_SuperResolution_setOpticalFlow_const_PtrLDenseOpticalFlowExtGR(self.as_raw_mut_Superres_SuperResolution(), val.as_raw_PtrOfSuperres_DenseOpticalFlowExt(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1101,4 +1348,53 @@ pub mod superres { } } + + /// Base class for Super Resolution algorithms. + /// + /// The class is only used to define the common interface for the whole family of Super Resolution + /// algorithms. + pub struct Superres_SuperResolution { + ptr: *mut c_void + } + + opencv_type_boxed! { Superres_SuperResolution } + + impl Drop for Superres_SuperResolution { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Superres_SuperResolution_delete(instance: *mut c_void); } + unsafe { cv_Superres_SuperResolution_delete(self.as_raw_mut_Superres_SuperResolution()) }; + } + } + + unsafe impl Send for Superres_SuperResolution {} + + impl core::AlgorithmTraitConst for Superres_SuperResolution { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for Superres_SuperResolution { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_FrameSourceTraitConst for Superres_SuperResolution { + #[inline] fn as_raw_Superres_FrameSource(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_FrameSourceTrait for Superres_SuperResolution { + #[inline] fn as_raw_mut_Superres_FrameSource(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::superres::Superres_SuperResolutionTraitConst for Superres_SuperResolution { + #[inline] fn as_raw_Superres_SuperResolution(&self) -> *const c_void { self.as_raw() } + } + + impl crate::superres::Superres_SuperResolutionTrait for Superres_SuperResolution { + #[inline] fn as_raw_mut_Superres_SuperResolution(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Superres_SuperResolution { + } + + boxed_cast_base! { Superres_SuperResolution, core::Algorithm, cv_Superres_SuperResolution_to_Algorithm } } diff --git a/docs/text.rs b/docs/text.rs index 3bf0baf75..3185f710d 100644 --- a/docs/text.rs +++ b/docs/text.rs @@ -52,7 +52,7 @@ pub mod text { //! # Scene Text Recognition use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::ERStatTraitConst, super::ERStatTrait, super::ERFilter_CallbackConst, super::ERFilter_Callback, super::ERFilterConst, super::ERFilter, super::BaseOCRConst, super::BaseOCR, super::OCRTesseractConst, super::OCRTesseract, super::OCRHMMDecoder_ClassifierCallbackTraitConst, super::OCRHMMDecoder_ClassifierCallbackTrait, super::OCRHMMDecoderTraitConst, super::OCRHMMDecoderTrait, super::OCRBeamSearchDecoder_ClassifierCallbackTraitConst, super::OCRBeamSearchDecoder_ClassifierCallbackTrait, super::OCRBeamSearchDecoderTraitConst, super::OCRBeamSearchDecoderTrait, super::OCRHolisticWordRecognizerConst, super::OCRHolisticWordRecognizer, super::TextDetectorConst, super::TextDetector, super::TextDetectorCNNConst, super::TextDetectorCNN }; + pub use { super::ERStatTraitConst, super::ERStatTrait, super::ERFilter_CallbackTraitConst, super::ERFilter_CallbackTrait, super::ERFilterTraitConst, super::ERFilterTrait, super::BaseOCRTraitConst, super::BaseOCRTrait, super::OCRTesseractTraitConst, super::OCRTesseractTrait, super::OCRHMMDecoder_ClassifierCallbackTraitConst, super::OCRHMMDecoder_ClassifierCallbackTrait, super::OCRHMMDecoderTraitConst, super::OCRHMMDecoderTrait, super::OCRBeamSearchDecoder_ClassifierCallbackTraitConst, super::OCRBeamSearchDecoder_ClassifierCallbackTrait, super::OCRBeamSearchDecoderTraitConst, super::OCRBeamSearchDecoderTrait, super::OCRHolisticWordRecognizerTraitConst, super::OCRHolisticWordRecognizerTrait, super::TextDetectorTraitConst, super::TextDetectorTrait, super::TextDetectorCNNTraitConst, super::TextDetectorCNNTrait }; } pub const ERFILTER_NM_IHSGrad: i32 = 1; @@ -258,12 +258,12 @@ pub mod text { /// * non_max_suppression: true /// * min_probability_diff: (float)0.1 #[inline] - pub fn create_er_filter_nm1(cb: &core::Ptr, threshold_delta: i32, min_area: f32, max_area: f32, min_probability: f32, non_max_suppression: bool, min_probability_diff: f32) -> Result> { + pub fn create_er_filter_nm1(cb: &core::Ptr, threshold_delta: i32, min_area: f32, max_area: f32, min_probability: f32, non_max_suppression: bool, min_probability_diff: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_text_createERFilterNM1_const_PtrLCallbackGR_int_float_float_float_bool_float(cb.as_raw_PtrOfERFilter_Callback(), threshold_delta, min_area, max_area, min_probability, non_max_suppression, min_probability_diff, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -301,13 +301,13 @@ pub mod text { /// * non_max_suppression: true /// * min_probability_diff: (float)0.1 #[inline] - pub fn create_er_filter_nm1_from_file(filename: &str, threshold_delta: i32, min_area: f32, max_area: f32, min_probability: f32, non_max_suppression: bool, min_probability_diff: f32) -> Result> { + pub fn create_er_filter_nm1_from_file(filename: &str, threshold_delta: i32, min_area: f32, max_area: f32, min_probability: f32, non_max_suppression: bool, min_probability_diff: f32) -> Result> { extern_container_arg!(filename); return_send!(via ocvrs_return); unsafe { sys::cv_text_createERFilterNM1_const_StringR_int_float_float_float_bool_float(filename.opencv_as_extern(), threshold_delta, min_area, max_area, min_probability, non_max_suppression, min_probability_diff, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -326,12 +326,12 @@ pub mod text { /// ## C++ default parameters /// * min_probability: (float)0.3 #[inline] - pub fn create_er_filter_nm2(cb: &core::Ptr, min_probability: f32) -> Result> { + pub fn create_er_filter_nm2(cb: &core::Ptr, min_probability: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_text_createERFilterNM2_const_PtrLCallbackGR_float(cb.as_raw_PtrOfERFilter_Callback(), min_probability, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -355,13 +355,13 @@ pub mod text { /// ## C++ default parameters /// * min_probability: (float)0.3 #[inline] - pub fn create_er_filter_nm2_from_file(filename: &str, min_probability: f32) -> Result> { + pub fn create_er_filter_nm2_from_file(filename: &str, min_probability: f32) -> Result> { extern_container_arg!(filename); return_send!(via ocvrs_return); unsafe { sys::cv_text_createERFilterNM2_const_StringR_float(filename.opencv_as_extern(), min_probability, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -418,7 +418,7 @@ pub mod text { /// * filename: String() /// * min_probability: (float)0.5 #[inline] - pub fn detect_regions_from_file(image: &dyn core::ToInputArray, er_filter1: &core::Ptr, er_filter2: &core::Ptr, groups_rects: &mut core::Vector, method: i32, filename: &str, min_probability: f32) -> Result<()> { + pub fn detect_regions_from_file(image: &dyn core::ToInputArray, er_filter1: &core::Ptr, er_filter2: &core::Ptr, groups_rects: &mut core::Vector, method: i32, filename: &str, min_probability: f32) -> Result<()> { extern_container_arg!(image); extern_container_arg!(filename); return_send!(via ocvrs_return); @@ -429,7 +429,7 @@ pub mod text { } #[inline] - pub fn detect_regions(image: &dyn core::ToInputArray, er_filter1: &core::Ptr, er_filter2: &core::Ptr, regions: &mut core::Vector>) -> Result<()> { + pub fn detect_regions(image: &dyn core::ToInputArray, er_filter1: &core::Ptr, er_filter2: &core::Ptr, regions: &mut core::Vector>) -> Result<()> { extern_container_arg!(image); return_send!(via ocvrs_return); unsafe { sys::cv_text_detectRegions_const__InputArrayR_const_PtrLERFilterGR_const_PtrLERFilterGR_vectorLvectorLPointGGR(image.as_raw__InputArray(), er_filter1.as_raw_PtrOfERFilter(), er_filter2.as_raw_PtrOfERFilter(), regions.as_raw_mut_VectorOfVectorOfPoint(), ocvrs_return.as_mut_ptr()) }; @@ -524,13 +524,13 @@ pub mod text { /// /// returns a pointer to ERFilter::Callback. #[inline] - pub fn load_classifier_nm1(filename: &str) -> Result> { + pub fn load_classifier_nm1(filename: &str) -> Result> { extern_container_arg!(filename); return_send!(via ocvrs_return); unsafe { sys::cv_text_loadClassifierNM1_const_StringR(filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -541,13 +541,13 @@ pub mod text { /// /// returns a pointer to ERFilter::Callback. #[inline] - pub fn load_classifier_nm2(filename: &str) -> Result> { + pub fn load_classifier_nm2(filename: &str) -> Result> { extern_container_arg!(filename); return_send!(via ocvrs_return); unsafe { sys::cv_text_loadClassifierNM2_const_StringR(filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -639,12 +639,13 @@ pub mod text { } /// Constant methods for [crate::text::BaseOCR] - pub trait BaseOCRConst { + pub trait BaseOCRTraitConst { fn as_raw_BaseOCR(&self) -> *const c_void; } - pub trait BaseOCR: crate::text::BaseOCRConst { + /// Mutable methods for [crate::text::BaseOCR] + pub trait BaseOCRTrait: crate::text::BaseOCRTraitConst { fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -681,8 +682,39 @@ pub mod text { } + pub struct BaseOCR { + ptr: *mut c_void + } + + opencv_type_boxed! { BaseOCR } + + impl Drop for BaseOCR { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BaseOCR_delete(instance: *mut c_void); } + unsafe { cv_BaseOCR_delete(self.as_raw_mut_BaseOCR()) }; + } + } + + unsafe impl Send for BaseOCR {} + + impl crate::text::BaseOCRTraitConst for BaseOCR { + #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::BaseOCRTrait for BaseOCR { + #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BaseOCR { + } + + boxed_cast_descendant! { BaseOCR, crate::text::OCRBeamSearchDecoder, cv_BaseOCR_to_OCRBeamSearchDecoder } + + boxed_cast_descendant! { BaseOCR, crate::text::OCRHMMDecoder, cv_BaseOCR_to_OCRHMMDecoder } + /// Constant methods for [crate::text::ERFilter] - pub trait ERFilterConst: core::AlgorithmTraitConst { + pub trait ERFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_ERFilter(&self) -> *const c_void; #[inline] @@ -696,10 +728,8 @@ pub mod text { } - /// Base class for 1st and 2nd stages of Neumann and Matas scene text detection algorithm [Neumann12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Neumann12). : - /// - /// Extracts the component tree (if needed) and filter the extremal regions (ER's) by using a given classifier. - pub trait ERFilter: core::AlgorithmTrait + crate::text::ERFilterConst { + /// Mutable methods for [crate::text::ERFilter] + pub trait ERFilterTrait: core::AlgorithmTrait + crate::text::ERFilterTraitConst { fn as_raw_mut_ERFilter(&mut self) -> *mut c_void; /// The key method of ERFilter algorithm. @@ -727,7 +757,7 @@ pub mod text { /// set/get methods to set the algorithm properties, #[inline] - fn set_callback(&mut self, cb: &core::Ptr) -> Result<()> { + fn set_callback(&mut self, cb: &core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_text_ERFilter_setCallback_const_PtrLCallbackGR(self.as_raw_mut_ERFilter(), cb.as_raw_PtrOfERFilter_Callback(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -791,17 +821,54 @@ pub mod text { } + /// Base class for 1st and 2nd stages of Neumann and Matas scene text detection algorithm [Neumann12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Neumann12). : + /// + /// Extracts the component tree (if needed) and filter the extremal regions (ER's) by using a given classifier. + pub struct ERFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { ERFilter } + + impl Drop for ERFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ERFilter_delete(instance: *mut c_void); } + unsafe { cv_ERFilter_delete(self.as_raw_mut_ERFilter()) }; + } + } + + unsafe impl Send for ERFilter {} + + impl core::AlgorithmTraitConst for ERFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ERFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::text::ERFilterTraitConst for ERFilter { + #[inline] fn as_raw_ERFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::ERFilterTrait for ERFilter { + #[inline] fn as_raw_mut_ERFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ERFilter { + } + + boxed_cast_base! { ERFilter, core::Algorithm, cv_ERFilter_to_Algorithm } + /// Constant methods for [crate::text::ERFilter_Callback] - pub trait ERFilter_CallbackConst { + pub trait ERFilter_CallbackTraitConst { fn as_raw_ERFilter_Callback(&self) -> *const c_void; } - /// Callback with the classifier is made a class. - /// - /// By doing it we hide SVM, Boost etc. Developers can provide their own classifiers to the - /// ERFilter algorithm. - pub trait ERFilter_Callback: crate::text::ERFilter_CallbackConst { + /// Mutable methods for [crate::text::ERFilter_Callback] + pub trait ERFilter_CallbackTrait: crate::text::ERFilter_CallbackTraitConst { fn as_raw_mut_ERFilter_Callback(&mut self) -> *mut c_void; /// The classifier must return probability measure for the region. @@ -819,6 +886,37 @@ pub mod text { } + /// Callback with the classifier is made a class. + /// + /// By doing it we hide SVM, Boost etc. Developers can provide their own classifiers to the + /// ERFilter algorithm. + pub struct ERFilter_Callback { + ptr: *mut c_void + } + + opencv_type_boxed! { ERFilter_Callback } + + impl Drop for ERFilter_Callback { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ERFilter_Callback_delete(instance: *mut c_void); } + unsafe { cv_ERFilter_Callback_delete(self.as_raw_mut_ERFilter_Callback()) }; + } + } + + unsafe impl Send for ERFilter_Callback {} + + impl crate::text::ERFilter_CallbackTraitConst for ERFilter_Callback { + #[inline] fn as_raw_ERFilter_Callback(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::ERFilter_CallbackTrait for ERFilter_Callback { + #[inline] fn as_raw_mut_ERFilter_Callback(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ERFilter_Callback { + } + /// Constant methods for [crate::text::ERStat] pub trait ERStatTraitConst { fn as_raw_ERStat(&self) -> *const c_void; @@ -1137,13 +1235,13 @@ pub mod text { } /// Constant methods for [crate::text::OCRBeamSearchDecoder] - pub trait OCRBeamSearchDecoderTraitConst: crate::text::BaseOCRConst { + pub trait OCRBeamSearchDecoderTraitConst: crate::text::BaseOCRTraitConst { fn as_raw_OCRBeamSearchDecoder(&self) -> *const c_void; } /// Mutable methods for [crate::text::OCRBeamSearchDecoder] - pub trait OCRBeamSearchDecoderTrait: crate::text::BaseOCR + crate::text::OCRBeamSearchDecoderTraitConst { + pub trait OCRBeamSearchDecoderTrait: crate::text::BaseOCRTrait + crate::text::OCRBeamSearchDecoderTraitConst { fn as_raw_mut_OCRBeamSearchDecoder(&mut self) -> *mut c_void; /// Recognize text using Beam Search. @@ -1252,11 +1350,11 @@ pub mod text { unsafe impl Send for OCRBeamSearchDecoder {} - impl crate::text::BaseOCRConst for OCRBeamSearchDecoder { + impl crate::text::BaseOCRTraitConst for OCRBeamSearchDecoder { #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.as_raw() } } - impl crate::text::BaseOCR for OCRBeamSearchDecoder { + impl crate::text::BaseOCRTrait for OCRBeamSearchDecoder { #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1430,13 +1528,13 @@ pub mod text { } /// Constant methods for [crate::text::OCRHMMDecoder] - pub trait OCRHMMDecoderTraitConst: crate::text::BaseOCRConst { + pub trait OCRHMMDecoderTraitConst: crate::text::BaseOCRTraitConst { fn as_raw_OCRHMMDecoder(&self) -> *const c_void; } /// Mutable methods for [crate::text::OCRHMMDecoder] - pub trait OCRHMMDecoderTrait: crate::text::BaseOCR + crate::text::OCRHMMDecoderTraitConst { + pub trait OCRHMMDecoderTrait: crate::text::BaseOCRTrait + crate::text::OCRHMMDecoderTraitConst { fn as_raw_mut_OCRHMMDecoder(&mut self) -> *mut c_void; /// Recognize text using HMM. @@ -1569,11 +1667,11 @@ pub mod text { unsafe impl Send for OCRHMMDecoder {} - impl crate::text::BaseOCRConst for OCRHMMDecoder { + impl crate::text::BaseOCRTraitConst for OCRHMMDecoder { #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.as_raw() } } - impl crate::text::BaseOCR for OCRHMMDecoder { + impl crate::text::BaseOCRTrait for OCRHMMDecoder { #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1724,19 +1822,13 @@ pub mod text { } /// Constant methods for [crate::text::OCRHolisticWordRecognizer] - pub trait OCRHolisticWordRecognizerConst: crate::text::BaseOCRConst { + pub trait OCRHolisticWordRecognizerTraitConst: crate::text::BaseOCRTraitConst { fn as_raw_OCRHolisticWordRecognizer(&self) -> *const c_void; } - /// OCRHolisticWordRecognizer class provides the functionallity of segmented wordspotting. - /// Given a predefined vocabulary , a DictNet is employed to select the most probable - /// word given an input image. - /// - /// DictNet is described in detail in: - /// Max Jaderberg et al.: Reading Text in the Wild with Convolutional Neural Networks, IJCV 2015 - /// - pub trait OCRHolisticWordRecognizer: crate::text::BaseOCR + crate::text::OCRHolisticWordRecognizerConst { + /// Mutable methods for [crate::text::OCRHolisticWordRecognizer] + pub trait OCRHolisticWordRecognizerTrait: crate::text::BaseOCRTrait + crate::text::OCRHolisticWordRecognizerTraitConst { fn as_raw_mut_OCRHolisticWordRecognizer(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -1797,10 +1889,49 @@ pub mod text { } - impl dyn OCRHolisticWordRecognizer + '_ { + /// OCRHolisticWordRecognizer class provides the functionallity of segmented wordspotting. + /// Given a predefined vocabulary , a DictNet is employed to select the most probable + /// word given an input image. + /// + /// DictNet is described in detail in: + /// Max Jaderberg et al.: Reading Text in the Wild with Convolutional Neural Networks, IJCV 2015 + /// + pub struct OCRHolisticWordRecognizer { + ptr: *mut c_void + } + + opencv_type_boxed! { OCRHolisticWordRecognizer } + + impl Drop for OCRHolisticWordRecognizer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_OCRHolisticWordRecognizer_delete(instance: *mut c_void); } + unsafe { cv_OCRHolisticWordRecognizer_delete(self.as_raw_mut_OCRHolisticWordRecognizer()) }; + } + } + + unsafe impl Send for OCRHolisticWordRecognizer {} + + impl crate::text::BaseOCRTraitConst for OCRHolisticWordRecognizer { + #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::BaseOCRTrait for OCRHolisticWordRecognizer { + #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::text::OCRHolisticWordRecognizerTraitConst for OCRHolisticWordRecognizer { + #[inline] fn as_raw_OCRHolisticWordRecognizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::OCRHolisticWordRecognizerTrait for OCRHolisticWordRecognizer { + #[inline] fn as_raw_mut_OCRHolisticWordRecognizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl OCRHolisticWordRecognizer { /// Creates an instance of the OCRHolisticWordRecognizer class. #[inline] - pub fn create(arch_filename: &str, weights_filename: &str, words_filename: &str) -> Result> { + pub fn create(arch_filename: &str, weights_filename: &str, words_filename: &str) -> Result> { extern_container_arg!(arch_filename); extern_container_arg!(weights_filename); extern_container_arg!(words_filename); @@ -1808,30 +1939,20 @@ pub mod text { unsafe { sys::cv_text_OCRHolisticWordRecognizer_create_const_stringR_const_stringR_const_stringR(arch_filename.opencv_as_extern(), weights_filename.opencv_as_extern(), words_filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::text::OCRTesseract] - pub trait OCRTesseractConst: crate::text::BaseOCRConst { + pub trait OCRTesseractTraitConst: crate::text::BaseOCRTraitConst { fn as_raw_OCRTesseract(&self) -> *const c_void; } - /// OCRTesseract class provides an interface with the tesseract-ocr API (v3.02.02) in C++. - /// - /// Notice that it is compiled only when tesseract-ocr is correctly installed. - /// - /// - /// Note: - /// * (C++) An example of OCRTesseract recognition combined with scene text detection can be found - /// at the end_to_end_recognition demo: - /// - /// * (C++) Another example of OCRTesseract recognition combined with scene text detection can be - /// found at the webcam_demo: - /// - pub trait OCRTesseract: crate::text::BaseOCR + crate::text::OCRTesseractConst { + /// Mutable methods for [crate::text::OCRTesseract] + pub trait OCRTesseractTrait: crate::text::BaseOCRTrait + crate::text::OCRTesseractTraitConst { fn as_raw_mut_OCRTesseract(&mut self) -> *mut c_void; /// Recognize text using the tesseract-ocr API. @@ -1922,7 +2043,51 @@ pub mod text { } - impl dyn OCRTesseract + '_ { + /// OCRTesseract class provides an interface with the tesseract-ocr API (v3.02.02) in C++. + /// + /// Notice that it is compiled only when tesseract-ocr is correctly installed. + /// + /// + /// Note: + /// * (C++) An example of OCRTesseract recognition combined with scene text detection can be found + /// at the end_to_end_recognition demo: + /// + /// * (C++) Another example of OCRTesseract recognition combined with scene text detection can be + /// found at the webcam_demo: + /// + pub struct OCRTesseract { + ptr: *mut c_void + } + + opencv_type_boxed! { OCRTesseract } + + impl Drop for OCRTesseract { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_OCRTesseract_delete(instance: *mut c_void); } + unsafe { cv_OCRTesseract_delete(self.as_raw_mut_OCRTesseract()) }; + } + } + + unsafe impl Send for OCRTesseract {} + + impl crate::text::BaseOCRTraitConst for OCRTesseract { + #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::BaseOCRTrait for OCRTesseract { + #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::text::OCRTesseractTraitConst for OCRTesseract { + #[inline] fn as_raw_OCRTesseract(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::OCRTesseractTrait for OCRTesseract { + #[inline] fn as_raw_mut_OCRTesseract(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl OCRTesseract { /// Creates an instance of the OCRTesseract class. Initializes Tesseract. /// /// ## Parameters @@ -1945,7 +2110,7 @@ pub mod text { /// * oem: OEM_DEFAULT /// * psmode: PSM_AUTO #[inline] - pub fn create(datapath: &str, language: &str, char_whitelist: &str, oem: i32, psmode: i32) -> Result> { + pub fn create(datapath: &str, language: &str, char_whitelist: &str, oem: i32, psmode: i32) -> Result> { extern_container_arg!(datapath); extern_container_arg!(language); extern_container_arg!(char_whitelist); @@ -1953,19 +2118,20 @@ pub mod text { unsafe { sys::cv_text_OCRTesseract_create_const_charX_const_charX_const_charX_int_int(datapath.opencv_as_extern(), language.opencv_as_extern(), char_whitelist.opencv_as_extern(), oem, psmode, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::text::TextDetector] - pub trait TextDetectorConst { + pub trait TextDetectorTraitConst { fn as_raw_TextDetector(&self) -> *const c_void; } - /// An abstract class providing interface for text detection algorithms - pub trait TextDetector: crate::text::TextDetectorConst { + /// Mutable methods for [crate::text::TextDetector] + pub trait TextDetectorTrait: crate::text::TextDetectorTraitConst { fn as_raw_mut_TextDetector(&mut self) -> *mut c_void; /// Method that provides a quick and simple interface to detect text inside an image @@ -1986,19 +2152,42 @@ pub mod text { } + /// An abstract class providing interface for text detection algorithms + pub struct TextDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { TextDetector } + + impl Drop for TextDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TextDetector_delete(instance: *mut c_void); } + unsafe { cv_TextDetector_delete(self.as_raw_mut_TextDetector()) }; + } + } + + unsafe impl Send for TextDetector {} + + impl crate::text::TextDetectorTraitConst for TextDetector { + #[inline] fn as_raw_TextDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::TextDetectorTrait for TextDetector { + #[inline] fn as_raw_mut_TextDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TextDetector { + } + /// Constant methods for [crate::text::TextDetectorCNN] - pub trait TextDetectorCNNConst: crate::text::TextDetectorConst { + pub trait TextDetectorCNNTraitConst: crate::text::TextDetectorTraitConst { fn as_raw_TextDetectorCNN(&self) -> *const c_void; } - /// TextDetectorCNN class provides the functionallity of text bounding box detection. - /// This class is representing to find bounding boxes of text words given an input image. - /// This class uses OpenCV dnn module to load pre-trained model described in [LiaoSBWL17](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LiaoSBWL17). - /// The original repository with the modified SSD Caffe version: . - /// Model can be downloaded from [DropBox](https://www.dropbox.com/s/g8pjzv2de9gty8g/TextBoxes_icdar13.caffemodel?dl=0). - /// Modified .prototxt file with the model description can be found in `opencv_contrib/modules/text/samples/textbox.prototxt`. - pub trait TextDetectorCNN: crate::text::TextDetector + crate::text::TextDetectorCNNConst { + /// Mutable methods for [crate::text::TextDetectorCNN] + pub trait TextDetectorCNNTrait: crate::text::TextDetectorCNNTraitConst + crate::text::TextDetectorTrait { fn as_raw_mut_TextDetectorCNN(&mut self) -> *mut c_void; /// This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. @@ -2019,7 +2208,45 @@ pub mod text { } - impl dyn TextDetectorCNN + '_ { + /// TextDetectorCNN class provides the functionallity of text bounding box detection. + /// This class is representing to find bounding boxes of text words given an input image. + /// This class uses OpenCV dnn module to load pre-trained model described in [LiaoSBWL17](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LiaoSBWL17). + /// The original repository with the modified SSD Caffe version: . + /// Model can be downloaded from [DropBox](https://www.dropbox.com/s/g8pjzv2de9gty8g/TextBoxes_icdar13.caffemodel?dl=0). + /// Modified .prototxt file with the model description can be found in `opencv_contrib/modules/text/samples/textbox.prototxt`. + pub struct TextDetectorCNN { + ptr: *mut c_void + } + + opencv_type_boxed! { TextDetectorCNN } + + impl Drop for TextDetectorCNN { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TextDetectorCNN_delete(instance: *mut c_void); } + unsafe { cv_TextDetectorCNN_delete(self.as_raw_mut_TextDetectorCNN()) }; + } + } + + unsafe impl Send for TextDetectorCNN {} + + impl crate::text::TextDetectorTraitConst for TextDetectorCNN { + #[inline] fn as_raw_TextDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::TextDetectorTrait for TextDetectorCNN { + #[inline] fn as_raw_mut_TextDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::text::TextDetectorCNNTraitConst for TextDetectorCNN { + #[inline] fn as_raw_TextDetectorCNN(&self) -> *const c_void { self.as_raw() } + } + + impl crate::text::TextDetectorCNNTrait for TextDetectorCNN { + #[inline] fn as_raw_mut_TextDetectorCNN(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TextDetectorCNN { /// Creates an instance of the TextDetectorCNN class using the provided parameters. /// /// ## Parameters @@ -2028,14 +2255,14 @@ pub mod text { /// * detectionSizes: a list of sizes for multiscale detection. The values`[(300,300),(700,500),(700,300),(700,700),(1600,1600)]` are /// recommended in [LiaoSBWL17](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LiaoSBWL17) to achieve the best quality. #[inline] - pub fn create_with_sizes(model_arch_filename: &str, model_weights_filename: &str, mut detection_sizes: core::Vector) -> Result> { + pub fn create_with_sizes(model_arch_filename: &str, model_weights_filename: &str, mut detection_sizes: core::Vector) -> Result> { extern_container_arg!(model_arch_filename); extern_container_arg!(model_weights_filename); return_send!(via ocvrs_return); unsafe { sys::cv_text_TextDetectorCNN_create_const_StringR_const_StringR_vectorLSizeG(model_arch_filename.opencv_as_extern(), model_weights_filename.opencv_as_extern(), detection_sizes.as_raw_mut_VectorOfSize(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2049,15 +2276,16 @@ pub mod text { /// /// ## Overloaded parameters #[inline] - pub fn create(model_arch_filename: &str, model_weights_filename: &str) -> Result> { + pub fn create(model_arch_filename: &str, model_weights_filename: &str) -> Result> { extern_container_arg!(model_arch_filename); extern_container_arg!(model_weights_filename); return_send!(via ocvrs_return); unsafe { sys::cv_text_TextDetectorCNN_create_const_StringR_const_StringR(model_arch_filename.opencv_as_extern(), model_weights_filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } +} diff --git a/docs/tracking.rs b/docs/tracking.rs index f44ad7346..7627cd213 100644 --- a/docs/tracking.rs +++ b/docs/tracking.rs @@ -4,7 +4,7 @@ pub mod tracking { //! # Legacy Tracking API use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::TrackerCSRT_ParamsTraitConst, super::TrackerCSRT_ParamsTrait, super::TrackerCSRTConst, super::TrackerCSRT, super::TrackerKCFConst, super::TrackerKCF }; + pub use { super::TrackerCSRT_ParamsTraitConst, super::TrackerCSRT_ParamsTrait, super::TrackerCSRTTraitConst, super::TrackerCSRTTrait, super::TrackerKCFTraitConst, super::TrackerKCFTrait }; } pub const TrackerKCF_CN: i32 = 2; @@ -26,15 +26,13 @@ pub mod tracking { pub type TrackerKCF_FeatureExtractorCallbackFN = Option ()>; /// Constant methods for [crate::tracking::TrackerCSRT] - pub trait TrackerCSRTConst: crate::video::TrackerConst { + pub trait TrackerCSRTTraitConst: crate::video::TrackerTraitConst { fn as_raw_TrackerCSRT(&self) -> *const c_void; } - /// the CSRT tracker - /// - /// The implementation is based on [Lukezic_IJCV2018](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Lukezic_IJCV2018) Discriminative Correlation Filter with Channel and Spatial Reliability - pub trait TrackerCSRT: crate::tracking::TrackerCSRTConst + crate::video::Tracker { + /// Mutable methods for [crate::tracking::TrackerCSRT] + pub trait TrackerCSRTTrait: crate::tracking::TrackerCSRTTraitConst + crate::video::TrackerTrait { fn as_raw_mut_TrackerCSRT(&mut self) -> *mut c_void; #[inline] @@ -49,7 +47,42 @@ pub mod tracking { } - impl dyn TrackerCSRT + '_ { + /// the CSRT tracker + /// + /// The implementation is based on [Lukezic_IJCV2018](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Lukezic_IJCV2018) Discriminative Correlation Filter with Channel and Spatial Reliability + pub struct TrackerCSRT { + ptr: *mut c_void + } + + opencv_type_boxed! { TrackerCSRT } + + impl Drop for TrackerCSRT { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TrackerCSRT_delete(instance: *mut c_void); } + unsafe { cv_TrackerCSRT_delete(self.as_raw_mut_TrackerCSRT()) }; + } + } + + unsafe impl Send for TrackerCSRT {} + + impl crate::video::TrackerTraitConst for TrackerCSRT { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerTrait for TrackerCSRT { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::tracking::TrackerCSRTTraitConst for TrackerCSRT { + #[inline] fn as_raw_TrackerCSRT(&self) -> *const c_void { self.as_raw() } + } + + impl crate::tracking::TrackerCSRTTrait for TrackerCSRT { + #[inline] fn as_raw_mut_TrackerCSRT(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TrackerCSRT { /// Create CSRT tracker instance /// ## Parameters /// * parameters: CSRT parameters TrackerCSRT::Params @@ -57,16 +90,17 @@ pub mod tracking { /// ## C++ default parameters /// * parameters: TrackerCSRT::Params() #[inline] - pub fn create(parameters: &crate::tracking::TrackerCSRT_Params) -> Result> { + pub fn create(parameters: &crate::tracking::TrackerCSRT_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_tracking_TrackerCSRT_create_const_ParamsR(parameters.as_raw_TrackerCSRT_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::tracking::TrackerCSRT_Params] pub trait TrackerCSRT_ParamsTraitConst { fn as_raw_TrackerCSRT_Params(&self) -> *const c_void; @@ -455,19 +489,13 @@ pub mod tracking { } /// Constant methods for [crate::tracking::TrackerKCF] - pub trait TrackerKCFConst: crate::video::TrackerConst { + pub trait TrackerKCFTraitConst: crate::video::TrackerTraitConst { fn as_raw_TrackerKCF(&self) -> *const c_void; } - /// the KCF (Kernelized Correlation Filter) tracker - /// - /// * KCF is a novel tracking framework that utilizes properties of circulant matrix to enhance the processing speed. - /// * This tracking method is an implementation of [KCF_ECCV](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KCF_ECCV) which is extended to KCF with color-names features ([KCF_CN](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KCF_CN)). - /// * The original paper of KCF is available at - /// * as well as the matlab implementation. For more information about KCF with color-names features, please refer to - /// * . - pub trait TrackerKCF: crate::tracking::TrackerKCFConst + crate::video::Tracker { + /// Mutable methods for [crate::tracking::TrackerKCF] + pub trait TrackerKCFTrait: crate::tracking::TrackerKCFTraitConst + crate::video::TrackerTrait { fn as_raw_mut_TrackerKCF(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -483,7 +511,46 @@ pub mod tracking { } - impl dyn TrackerKCF + '_ { + /// the KCF (Kernelized Correlation Filter) tracker + /// + /// * KCF is a novel tracking framework that utilizes properties of circulant matrix to enhance the processing speed. + /// * This tracking method is an implementation of [KCF_ECCV](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KCF_ECCV) which is extended to KCF with color-names features ([KCF_CN](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KCF_CN)). + /// * The original paper of KCF is available at + /// * as well as the matlab implementation. For more information about KCF with color-names features, please refer to + /// * . + pub struct TrackerKCF { + ptr: *mut c_void + } + + opencv_type_boxed! { TrackerKCF } + + impl Drop for TrackerKCF { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TrackerKCF_delete(instance: *mut c_void); } + unsafe { cv_TrackerKCF_delete(self.as_raw_mut_TrackerKCF()) }; + } + } + + unsafe impl Send for TrackerKCF {} + + impl crate::video::TrackerTraitConst for TrackerKCF { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerTrait for TrackerKCF { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::tracking::TrackerKCFTraitConst for TrackerKCF { + #[inline] fn as_raw_TrackerKCF(&self) -> *const c_void { self.as_raw() } + } + + impl crate::tracking::TrackerKCFTrait for TrackerKCF { + #[inline] fn as_raw_mut_TrackerKCF(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TrackerKCF { /// Create KCF tracker instance /// ## Parameters /// * parameters: KCF parameters TrackerKCF::Params @@ -491,16 +558,17 @@ pub mod tracking { /// ## C++ default parameters /// * parameters: TrackerKCF::Params() #[inline] - pub fn create(parameters: crate::tracking::TrackerKCF_Params) -> Result> { + pub fn create(parameters: crate::tracking::TrackerKCF_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_tracking_TrackerKCF_create_const_ParamsR(¶meters, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq)] pub struct TrackerKCF_Params { diff --git a/docs/types.rs b/docs/types.rs index 1071f5f5c..170025251 100644 --- a/docs/types.rs +++ b/docs/types.rs @@ -61,178 +61,178 @@ pub use barcode_types::*; mod bgsegm_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfBackgroundSubtractorCNT = core::Ptr; + pub type PtrOfBackgroundSubtractorCNT = core::Ptr; - ptr_extern! { dyn crate::bgsegm::BackgroundSubtractorCNT, + ptr_extern! { crate::bgsegm::BackgroundSubtractorCNT, cv_PtrOfBackgroundSubtractorCNT_delete, cv_PtrOfBackgroundSubtractorCNT_get_inner_ptr, cv_PtrOfBackgroundSubtractorCNT_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBackgroundSubtractorCNT(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBackgroundSubtractorCNT(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::bgsegm::BackgroundSubtractorCNTConst for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorCNTTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractorCNT(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::bgsegm::BackgroundSubtractorCNT for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorCNTTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractorCNT(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBackgroundSubtractorGMG = core::Ptr; + pub type PtrOfBackgroundSubtractorGMG = core::Ptr; - ptr_extern! { dyn crate::bgsegm::BackgroundSubtractorGMG, + ptr_extern! { crate::bgsegm::BackgroundSubtractorGMG, cv_PtrOfBackgroundSubtractorGMG_delete, cv_PtrOfBackgroundSubtractorGMG_get_inner_ptr, cv_PtrOfBackgroundSubtractorGMG_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBackgroundSubtractorGMG(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBackgroundSubtractorGMG(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::bgsegm::BackgroundSubtractorGMGConst for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorGMGTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractorGMG(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::bgsegm::BackgroundSubtractorGMG for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorGMGTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractorGMG(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBackgroundSubtractorGSOC = core::Ptr; + pub type PtrOfBackgroundSubtractorGSOC = core::Ptr; - ptr_extern! { dyn crate::bgsegm::BackgroundSubtractorGSOC, + ptr_extern! { crate::bgsegm::BackgroundSubtractorGSOC, cv_PtrOfBackgroundSubtractorGSOC_delete, cv_PtrOfBackgroundSubtractorGSOC_get_inner_ptr, cv_PtrOfBackgroundSubtractorGSOC_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBackgroundSubtractorGSOC(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBackgroundSubtractorGSOC(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::bgsegm::BackgroundSubtractorGSOCConst for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorGSOCTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractorGSOC(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::bgsegm::BackgroundSubtractorGSOC for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorGSOCTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractorGSOC(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBackgroundSubtractorLSBP = core::Ptr; + pub type PtrOfBackgroundSubtractorLSBP = core::Ptr; - ptr_extern! { dyn crate::bgsegm::BackgroundSubtractorLSBP, + ptr_extern! { crate::bgsegm::BackgroundSubtractorLSBP, cv_PtrOfBackgroundSubtractorLSBP_delete, cv_PtrOfBackgroundSubtractorLSBP_get_inner_ptr, cv_PtrOfBackgroundSubtractorLSBP_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBackgroundSubtractorLSBP(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBackgroundSubtractorLSBP(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::bgsegm::BackgroundSubtractorLSBPConst for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorLSBPTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractorLSBP(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::bgsegm::BackgroundSubtractorLSBP for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorLSBPTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractorLSBP(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBackgroundSubtractorMOG = core::Ptr; + pub type PtrOfBackgroundSubtractorMOG = core::Ptr; - ptr_extern! { dyn crate::bgsegm::BackgroundSubtractorMOG, + ptr_extern! { crate::bgsegm::BackgroundSubtractorMOG, cv_PtrOfBackgroundSubtractorMOG_delete, cv_PtrOfBackgroundSubtractorMOG_get_inner_ptr, cv_PtrOfBackgroundSubtractorMOG_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBackgroundSubtractorMOG(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBackgroundSubtractorMOG(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::bgsegm::BackgroundSubtractorMOGConst for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorMOGTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractorMOG(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::bgsegm::BackgroundSubtractorMOG for core::Ptr { + impl crate::bgsegm::BackgroundSubtractorMOGTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractorMOG(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -273,84 +273,84 @@ pub use bgsegm_types::*; mod bioinspired_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfRetina = core::Ptr; + pub type PtrOfRetina = core::Ptr; - ptr_extern! { dyn crate::bioinspired::Retina, + ptr_extern! { crate::bioinspired::Retina, cv_PtrOfRetina_delete, cv_PtrOfRetina_get_inner_ptr, cv_PtrOfRetina_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRetina(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRetina(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::bioinspired::RetinaConst for core::Ptr { + impl crate::bioinspired::RetinaTraitConst for core::Ptr { #[inline] fn as_raw_Retina(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::bioinspired::Retina for core::Ptr { + impl crate::bioinspired::RetinaTrait for core::Ptr { #[inline] fn as_raw_mut_Retina(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfRetinaFastToneMapping = core::Ptr; + pub type PtrOfRetinaFastToneMapping = core::Ptr; - ptr_extern! { dyn crate::bioinspired::RetinaFastToneMapping, + ptr_extern! { crate::bioinspired::RetinaFastToneMapping, cv_PtrOfRetinaFastToneMapping_delete, cv_PtrOfRetinaFastToneMapping_get_inner_ptr, cv_PtrOfRetinaFastToneMapping_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRetinaFastToneMapping(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRetinaFastToneMapping(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::bioinspired::RetinaFastToneMappingConst for core::Ptr { + impl crate::bioinspired::RetinaFastToneMappingTraitConst for core::Ptr { #[inline] fn as_raw_RetinaFastToneMapping(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::bioinspired::RetinaFastToneMapping for core::Ptr { + impl crate::bioinspired::RetinaFastToneMappingTrait for core::Ptr { #[inline] fn as_raw_mut_RetinaFastToneMapping(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTransientAreasSegmentationModule = core::Ptr; + pub type PtrOfTransientAreasSegmentationModule = core::Ptr; - ptr_extern! { dyn crate::bioinspired::TransientAreasSegmentationModule, + ptr_extern! { crate::bioinspired::TransientAreasSegmentationModule, cv_PtrOfTransientAreasSegmentationModule_delete, cv_PtrOfTransientAreasSegmentationModule_get_inner_ptr, cv_PtrOfTransientAreasSegmentationModule_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTransientAreasSegmentationModule(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTransientAreasSegmentationModule(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::bioinspired::TransientAreasSegmentationModuleConst for core::Ptr { + impl crate::bioinspired::TransientAreasSegmentationModuleTraitConst for core::Ptr { #[inline] fn as_raw_TransientAreasSegmentationModule(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::bioinspired::TransientAreasSegmentationModule for core::Ptr { + impl crate::bioinspired::TransientAreasSegmentationModuleTrait for core::Ptr { #[inline] fn as_raw_mut_TransientAreasSegmentationModule(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -362,146 +362,146 @@ pub use bioinspired_types::*; mod calib3d_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfLMSolver = core::Ptr; + pub type PtrOfLMSolver = core::Ptr; - ptr_extern! { dyn crate::calib3d::LMSolver, + ptr_extern! { crate::calib3d::LMSolver, cv_PtrOfLMSolver_delete, cv_PtrOfLMSolver_get_inner_ptr, cv_PtrOfLMSolver_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLMSolver(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLMSolver(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::calib3d::LMSolverConst for core::Ptr { + impl crate::calib3d::LMSolverTraitConst for core::Ptr { #[inline] fn as_raw_LMSolver(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::LMSolver for core::Ptr { + impl crate::calib3d::LMSolverTrait for core::Ptr { #[inline] fn as_raw_mut_LMSolver(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLMSolver_Callback = core::Ptr; + pub type PtrOfLMSolver_Callback = core::Ptr; - ptr_extern! { dyn crate::calib3d::LMSolver_Callback, + ptr_extern! { crate::calib3d::LMSolver_Callback, cv_PtrOfLMSolver_Callback_delete, cv_PtrOfLMSolver_Callback_get_inner_ptr, cv_PtrOfLMSolver_Callback_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLMSolver_Callback(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLMSolver_Callback(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::calib3d::LMSolver_CallbackConst for core::Ptr { + impl crate::calib3d::LMSolver_CallbackTraitConst for core::Ptr { #[inline] fn as_raw_LMSolver_Callback(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::LMSolver_Callback for core::Ptr { + impl crate::calib3d::LMSolver_CallbackTrait for core::Ptr { #[inline] fn as_raw_mut_LMSolver_Callback(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfStereoBM = core::Ptr; + pub type PtrOfStereoBM = core::Ptr; - ptr_extern! { dyn crate::calib3d::StereoBM, + ptr_extern! { crate::calib3d::StereoBM, cv_PtrOfStereoBM_delete, cv_PtrOfStereoBM_get_inner_ptr, cv_PtrOfStereoBM_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfStereoBM(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfStereoBM(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::calib3d::StereoBMConst for core::Ptr { + impl crate::calib3d::StereoBMTraitConst for core::Ptr { #[inline] fn as_raw_StereoBM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoBM for core::Ptr { + impl crate::calib3d::StereoBMTrait for core::Ptr { #[inline] fn as_raw_mut_StereoBM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::calib3d::StereoMatcherConst for core::Ptr { + impl crate::calib3d::StereoMatcherTraitConst for core::Ptr { #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoMatcher for core::Ptr { + impl crate::calib3d::StereoMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfStereoMatcher = core::Ptr; + pub type PtrOfStereoMatcher = core::Ptr; - ptr_extern! { dyn crate::calib3d::StereoMatcher, + ptr_extern! { crate::calib3d::StereoMatcher, cv_PtrOfStereoMatcher_delete, cv_PtrOfStereoMatcher_get_inner_ptr, cv_PtrOfStereoMatcher_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfStereoMatcher(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfStereoMatcher(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::calib3d::StereoMatcherConst for core::Ptr { + impl crate::calib3d::StereoMatcherTraitConst for core::Ptr { #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoMatcher for core::Ptr { + impl crate::calib3d::StereoMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfStereoSGBM = core::Ptr; + pub type PtrOfStereoSGBM = core::Ptr; - ptr_extern! { dyn crate::calib3d::StereoSGBM, + ptr_extern! { crate::calib3d::StereoSGBM, cv_PtrOfStereoSGBM_delete, cv_PtrOfStereoSGBM_get_inner_ptr, cv_PtrOfStereoSGBM_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfStereoSGBM(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfStereoSGBM(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::calib3d::StereoSGBMConst for core::Ptr { + impl crate::calib3d::StereoSGBMTraitConst for core::Ptr { #[inline] fn as_raw_StereoSGBM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoSGBM for core::Ptr { + impl crate::calib3d::StereoSGBMTrait for core::Ptr { #[inline] fn as_raw_mut_StereoSGBM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::calib3d::StereoMatcherConst for core::Ptr { + impl crate::calib3d::StereoMatcherTraitConst for core::Ptr { #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoMatcher for core::Ptr { + impl crate::calib3d::StereoMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -513,89 +513,73 @@ pub use calib3d_types::*; mod core_types { use crate::{mod_prelude::*, core, types, sys}; - impl core::GpuMat_AllocatorConst for types::AbstractRefMut<'static, dyn core::GpuMat_Allocator> { - #[inline] fn as_raw_GpuMat_Allocator(&self) -> extern_send!(Self) { self.as_raw() } - } - - impl core::GpuMat_Allocator for types::AbstractRefMut<'static, dyn core::GpuMat_Allocator> { - #[inline] fn as_raw_mut_GpuMat_Allocator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } - } - - impl core::MatOpConst for types::AbstractRefMut<'static, dyn core::MatOp> { - #[inline] fn as_raw_MatOp(&self) -> extern_send!(Self) { self.as_raw() } - } - - impl core::MatOp for types::AbstractRefMut<'static, dyn core::MatOp> { - #[inline] fn as_raw_mut_MatOp(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } - } - - pub type PtrOfConjGradSolver = core::Ptr; + pub type PtrOfConjGradSolver = core::Ptr; - ptr_extern! { dyn core::ConjGradSolver, + ptr_extern! { core::ConjGradSolver, cv_PtrOfConjGradSolver_delete, cv_PtrOfConjGradSolver_get_inner_ptr, cv_PtrOfConjGradSolver_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfConjGradSolver(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfConjGradSolver(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl core::ConjGradSolverConst for core::Ptr { + impl core::ConjGradSolverTraitConst for core::Ptr { #[inline] fn as_raw_ConjGradSolver(&self) -> *const c_void { self.inner_as_raw() } } - impl core::ConjGradSolver for core::Ptr { + impl core::ConjGradSolverTrait for core::Ptr { #[inline] fn as_raw_mut_ConjGradSolver(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::MinProblemSolverConst for core::Ptr { + impl core::MinProblemSolverTraitConst for core::Ptr { #[inline] fn as_raw_MinProblemSolver(&self) -> *const c_void { self.inner_as_raw() } } - impl core::MinProblemSolver for core::Ptr { + impl core::MinProblemSolverTrait for core::Ptr { #[inline] fn as_raw_mut_MinProblemSolver(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDownhillSolver = core::Ptr; + pub type PtrOfDownhillSolver = core::Ptr; - ptr_extern! { dyn core::DownhillSolver, + ptr_extern! { core::DownhillSolver, cv_PtrOfDownhillSolver_delete, cv_PtrOfDownhillSolver_get_inner_ptr, cv_PtrOfDownhillSolver_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDownhillSolver(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDownhillSolver(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl core::DownhillSolverConst for core::Ptr { + impl core::DownhillSolverTraitConst for core::Ptr { #[inline] fn as_raw_DownhillSolver(&self) -> *const c_void { self.inner_as_raw() } } - impl core::DownhillSolver for core::Ptr { + impl core::DownhillSolverTrait for core::Ptr { #[inline] fn as_raw_mut_DownhillSolver(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::MinProblemSolverConst for core::Ptr { + impl core::MinProblemSolverTraitConst for core::Ptr { #[inline] fn as_raw_MinProblemSolver(&self) -> *const c_void { self.inner_as_raw() } } - impl core::MinProblemSolver for core::Ptr { + impl core::MinProblemSolverTrait for core::Ptr { #[inline] fn as_raw_mut_MinProblemSolver(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -620,79 +604,79 @@ mod core_types { #[inline] fn as_raw_mut_FileStorage(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFormatted = core::Ptr; + pub type PtrOfFormatted = core::Ptr; - ptr_extern! { dyn core::Formatted, + ptr_extern! { core::Formatted, cv_PtrOfFormatted_delete, cv_PtrOfFormatted_get_inner_ptr, cv_PtrOfFormatted_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFormatted(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFormatted(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl core::FormattedConst for core::Ptr { + impl core::FormattedTraitConst for core::Ptr { #[inline] fn as_raw_Formatted(&self) -> *const c_void { self.inner_as_raw() } } - impl core::Formatted for core::Ptr { + impl core::FormattedTrait for core::Ptr { #[inline] fn as_raw_mut_Formatted(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFormatter = core::Ptr; + pub type PtrOfFormatter = core::Ptr; - ptr_extern! { dyn core::Formatter, + ptr_extern! { core::Formatter, cv_PtrOfFormatter_delete, cv_PtrOfFormatter_get_inner_ptr, cv_PtrOfFormatter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFormatter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFormatter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl core::FormatterConst for core::Ptr { + impl core::FormatterTraitConst for core::Ptr { #[inline] fn as_raw_Formatter(&self) -> *const c_void { self.inner_as_raw() } } - impl core::Formatter for core::Ptr { + impl core::FormatterTrait for core::Ptr { #[inline] fn as_raw_mut_Formatter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfGpuMat_Allocator = core::Ptr; + pub type PtrOfGpuMat_Allocator = core::Ptr; - ptr_extern! { dyn core::GpuMat_Allocator, + ptr_extern! { core::GpuMat_Allocator, cv_PtrOfGpuMat_Allocator_delete, cv_PtrOfGpuMat_Allocator_get_inner_ptr, cv_PtrOfGpuMat_Allocator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfGpuMat_Allocator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfGpuMat_Allocator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl core::GpuMat_AllocatorConst for core::Ptr { + impl core::GpuMat_AllocatorTraitConst for core::Ptr { #[inline] fn as_raw_GpuMat_Allocator(&self) -> *const c_void { self.inner_as_raw() } } - impl core::GpuMat_Allocator for core::Ptr { + impl core::GpuMat_AllocatorTrait for core::Ptr { #[inline] fn as_raw_mut_GpuMat_Allocator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfMinProblemSolver_Function = core::Ptr; + pub type PtrOfMinProblemSolver_Function = core::Ptr; - ptr_extern! { dyn core::MinProblemSolver_Function, + ptr_extern! { core::MinProblemSolver_Function, cv_PtrOfMinProblemSolver_Function_delete, cv_PtrOfMinProblemSolver_Function_get_inner_ptr, cv_PtrOfMinProblemSolver_Function_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMinProblemSolver_Function(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMinProblemSolver_Function(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl core::MinProblemSolver_FunctionConst for core::Ptr { + impl core::MinProblemSolver_FunctionTraitConst for core::Ptr { #[inline] fn as_raw_MinProblemSolver_Function(&self) -> *const c_void { self.inner_as_raw() } } - impl core::MinProblemSolver_Function for core::Ptr { + impl core::MinProblemSolver_FunctionTrait for core::Ptr { #[inline] fn as_raw_mut_MinProblemSolver_Function(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -3329,84 +3313,84 @@ pub use core_types::*; mod cudaarithm_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfConvolution = core::Ptr; + pub type PtrOfConvolution = core::Ptr; - ptr_extern! { dyn crate::cudaarithm::Convolution, + ptr_extern! { crate::cudaarithm::Convolution, cv_PtrOfConvolution_delete, cv_PtrOfConvolution_get_inner_ptr, cv_PtrOfConvolution_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfConvolution(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfConvolution(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaarithm::ConvolutionConst for core::Ptr { + impl crate::cudaarithm::ConvolutionTraitConst for core::Ptr { #[inline] fn as_raw_Convolution(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaarithm::Convolution for core::Ptr { + impl crate::cudaarithm::ConvolutionTrait for core::Ptr { #[inline] fn as_raw_mut_Convolution(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDFT = core::Ptr; + pub type PtrOfDFT = core::Ptr; - ptr_extern! { dyn crate::cudaarithm::DFT, + ptr_extern! { crate::cudaarithm::DFT, cv_PtrOfDFT_delete, cv_PtrOfDFT_get_inner_ptr, cv_PtrOfDFT_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDFT(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDFT(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaarithm::DFTConst for core::Ptr { + impl crate::cudaarithm::DFTTraitConst for core::Ptr { #[inline] fn as_raw_DFT(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaarithm::DFT for core::Ptr { + impl crate::cudaarithm::DFTTrait for core::Ptr { #[inline] fn as_raw_mut_DFT(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLookUpTable = core::Ptr; + pub type PtrOfLookUpTable = core::Ptr; - ptr_extern! { dyn crate::cudaarithm::LookUpTable, + ptr_extern! { crate::cudaarithm::LookUpTable, cv_PtrOfLookUpTable_delete, cv_PtrOfLookUpTable_get_inner_ptr, cv_PtrOfLookUpTable_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLookUpTable(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLookUpTable(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaarithm::LookUpTableConst for core::Ptr { + impl crate::cudaarithm::LookUpTableTraitConst for core::Ptr { #[inline] fn as_raw_LookUpTable(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaarithm::LookUpTable for core::Ptr { + impl crate::cudaarithm::LookUpTableTrait for core::Ptr { #[inline] fn as_raw_mut_LookUpTable(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -3418,81 +3402,81 @@ pub use cudaarithm_types::*; mod cudabgsegm_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfCUDA_BackgroundSubtractorMOG = core::Ptr; + pub type PtrOfCUDA_BackgroundSubtractorMOG = core::Ptr; - ptr_extern! { dyn crate::cudabgsegm::CUDA_BackgroundSubtractorMOG, + ptr_extern! { crate::cudabgsegm::CUDA_BackgroundSubtractorMOG, cv_PtrOfCUDA_BackgroundSubtractorMOG_delete, cv_PtrOfCUDA_BackgroundSubtractorMOG_get_inner_ptr, cv_PtrOfCUDA_BackgroundSubtractorMOG_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_BackgroundSubtractorMOG(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_BackgroundSubtractorMOG(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOGConst for core::Ptr { + impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOGTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_BackgroundSubtractorMOG(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOG for core::Ptr { + impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOGTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_BackgroundSubtractorMOG(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_BackgroundSubtractorMOG2 = core::Ptr; + pub type PtrOfCUDA_BackgroundSubtractorMOG2 = core::Ptr; - ptr_extern! { dyn crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2, + ptr_extern! { crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2, cv_PtrOfCUDA_BackgroundSubtractorMOG2_delete, cv_PtrOfCUDA_BackgroundSubtractorMOG2_get_inner_ptr, cv_PtrOfCUDA_BackgroundSubtractorMOG2_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_BackgroundSubtractorMOG2(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_BackgroundSubtractorMOG2(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2Const for core::Ptr { + impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2TraitConst for core::Ptr { #[inline] fn as_raw_CUDA_BackgroundSubtractorMOG2(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2 for core::Ptr { + impl crate::cudabgsegm::CUDA_BackgroundSubtractorMOG2Trait for core::Ptr { #[inline] fn as_raw_mut_CUDA_BackgroundSubtractorMOG2(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorMOG2Const for core::Ptr { + impl crate::video::BackgroundSubtractorMOG2TraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractorMOG2(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractorMOG2 for core::Ptr { + impl crate::video::BackgroundSubtractorMOG2Trait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractorMOG2(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -3504,79 +3488,79 @@ pub use cudabgsegm_types::*; mod cudacodec_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfEncoderCallback = core::Ptr; + pub type PtrOfEncoderCallback = core::Ptr; - ptr_extern! { dyn crate::cudacodec::EncoderCallback, + ptr_extern! { crate::cudacodec::EncoderCallback, cv_PtrOfEncoderCallback_delete, cv_PtrOfEncoderCallback_get_inner_ptr, cv_PtrOfEncoderCallback_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfEncoderCallback(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfEncoderCallback(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudacodec::EncoderCallbackConst for core::Ptr { + impl crate::cudacodec::EncoderCallbackTraitConst for core::Ptr { #[inline] fn as_raw_EncoderCallback(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudacodec::EncoderCallback for core::Ptr { + impl crate::cudacodec::EncoderCallbackTrait for core::Ptr { #[inline] fn as_raw_mut_EncoderCallback(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfRawVideoSource = core::Ptr; + pub type PtrOfRawVideoSource = core::Ptr; - ptr_extern! { dyn crate::cudacodec::RawVideoSource, + ptr_extern! { crate::cudacodec::RawVideoSource, cv_PtrOfRawVideoSource_delete, cv_PtrOfRawVideoSource_get_inner_ptr, cv_PtrOfRawVideoSource_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRawVideoSource(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRawVideoSource(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudacodec::RawVideoSourceConst for core::Ptr { + impl crate::cudacodec::RawVideoSourceTraitConst for core::Ptr { #[inline] fn as_raw_RawVideoSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudacodec::RawVideoSource for core::Ptr { + impl crate::cudacodec::RawVideoSourceTrait for core::Ptr { #[inline] fn as_raw_mut_RawVideoSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfVideoReader = core::Ptr; + pub type PtrOfVideoReader = core::Ptr; - ptr_extern! { dyn crate::cudacodec::VideoReader, + ptr_extern! { crate::cudacodec::VideoReader, cv_PtrOfVideoReader_delete, cv_PtrOfVideoReader_get_inner_ptr, cv_PtrOfVideoReader_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfVideoReader(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfVideoReader(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudacodec::VideoReaderConst for core::Ptr { + impl crate::cudacodec::VideoReaderTraitConst for core::Ptr { #[inline] fn as_raw_VideoReader(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudacodec::VideoReader for core::Ptr { + impl crate::cudacodec::VideoReaderTrait for core::Ptr { #[inline] fn as_raw_mut_VideoReader(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfVideoWriter = core::Ptr; + pub type PtrOfVideoWriter = core::Ptr; - ptr_extern! { dyn crate::cudacodec::VideoWriter, + ptr_extern! { crate::cudacodec::VideoWriter, cv_PtrOfVideoWriter_delete, cv_PtrOfVideoWriter_get_inner_ptr, cv_PtrOfVideoWriter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfVideoWriter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfVideoWriter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudacodec::VideoWriterConst for core::Ptr { + impl crate::cudacodec::VideoWriterTraitConst for core::Ptr { #[inline] fn as_raw_VideoWriter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudacodec::VideoWriter for core::Ptr { + impl crate::cudacodec::VideoWriterTrait for core::Ptr { #[inline] fn as_raw_mut_VideoWriter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -3588,116 +3572,116 @@ pub use cudacodec_types::*; mod cudafeatures2d_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfCUDA_DescriptorMatcher = core::Ptr; + pub type PtrOfCUDA_DescriptorMatcher = core::Ptr; - ptr_extern! { dyn crate::cudafeatures2d::CUDA_DescriptorMatcher, + ptr_extern! { crate::cudafeatures2d::CUDA_DescriptorMatcher, cv_PtrOfCUDA_DescriptorMatcher_delete, cv_PtrOfCUDA_DescriptorMatcher_get_inner_ptr, cv_PtrOfCUDA_DescriptorMatcher_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_DescriptorMatcher(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_DescriptorMatcher(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudafeatures2d::CUDA_DescriptorMatcherConst for core::Ptr { + impl crate::cudafeatures2d::CUDA_DescriptorMatcherTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_DescriptorMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudafeatures2d::CUDA_DescriptorMatcher for core::Ptr { + impl crate::cudafeatures2d::CUDA_DescriptorMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_DescriptorMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_FastFeatureDetector = core::Ptr; + pub type PtrOfCUDA_FastFeatureDetector = core::Ptr; - ptr_extern! { dyn crate::cudafeatures2d::CUDA_FastFeatureDetector, + ptr_extern! { crate::cudafeatures2d::CUDA_FastFeatureDetector, cv_PtrOfCUDA_FastFeatureDetector_delete, cv_PtrOfCUDA_FastFeatureDetector_get_inner_ptr, cv_PtrOfCUDA_FastFeatureDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_FastFeatureDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_FastFeatureDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudafeatures2d::CUDA_FastFeatureDetectorConst for core::Ptr { + impl crate::cudafeatures2d::CUDA_FastFeatureDetectorTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_FastFeatureDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudafeatures2d::CUDA_FastFeatureDetector for core::Ptr { + impl crate::cudafeatures2d::CUDA_FastFeatureDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_FastFeatureDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudafeatures2d::CUDA_Feature2DAsyncConst for core::Ptr { + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_Feature2DAsync(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudafeatures2d::CUDA_Feature2DAsync for core::Ptr { + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_Feature2DAsync(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_ORB = core::Ptr; + pub type PtrOfCUDA_ORB = core::Ptr; - ptr_extern! { dyn crate::cudafeatures2d::CUDA_ORB, + ptr_extern! { crate::cudafeatures2d::CUDA_ORB, cv_PtrOfCUDA_ORB_delete, cv_PtrOfCUDA_ORB_get_inner_ptr, cv_PtrOfCUDA_ORB_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_ORB(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_ORB(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudafeatures2d::CUDA_ORBConst for core::Ptr { + impl crate::cudafeatures2d::CUDA_ORBTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_ORB(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudafeatures2d::CUDA_ORB for core::Ptr { + impl crate::cudafeatures2d::CUDA_ORBTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_ORB(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudafeatures2d::CUDA_Feature2DAsyncConst for core::Ptr { + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_Feature2DAsync(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudafeatures2d::CUDA_Feature2DAsync for core::Ptr { + impl crate::cudafeatures2d::CUDA_Feature2DAsyncTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_Feature2DAsync(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -3709,30 +3693,30 @@ pub use cudafeatures2d_types::*; mod cudafilters_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfFilter = core::Ptr; + pub type PtrOfFilter = core::Ptr; - ptr_extern! { dyn crate::cudafilters::Filter, + ptr_extern! { crate::cudafilters::Filter, cv_PtrOfFilter_delete, cv_PtrOfFilter_get_inner_ptr, cv_PtrOfFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudafilters::FilterConst for core::Ptr { + impl crate::cudafilters::FilterTraitConst for core::Ptr { #[inline] fn as_raw_Filter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudafilters::Filter for core::Ptr { + impl crate::cudafilters::FilterTrait for core::Ptr { #[inline] fn as_raw_mut_Filter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -3744,227 +3728,227 @@ pub use cudafilters_types::*; mod cudaimgproc_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfCUDA_CLAHE = core::Ptr; + pub type PtrOfCUDA_CLAHE = core::Ptr; - ptr_extern! { dyn crate::cudaimgproc::CUDA_CLAHE, + ptr_extern! { crate::cudaimgproc::CUDA_CLAHE, cv_PtrOfCUDA_CLAHE_delete, cv_PtrOfCUDA_CLAHE_get_inner_ptr, cv_PtrOfCUDA_CLAHE_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_CLAHE(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_CLAHE(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaimgproc::CUDA_CLAHEConst for core::Ptr { + impl crate::cudaimgproc::CUDA_CLAHETraitConst for core::Ptr { #[inline] fn as_raw_CUDA_CLAHE(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaimgproc::CUDA_CLAHE for core::Ptr { + impl crate::cudaimgproc::CUDA_CLAHETrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_CLAHE(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::imgproc::CLAHEConst for core::Ptr { + impl crate::imgproc::CLAHETraitConst for core::Ptr { #[inline] fn as_raw_CLAHE(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::imgproc::CLAHE for core::Ptr { + impl crate::imgproc::CLAHETrait for core::Ptr { #[inline] fn as_raw_mut_CLAHE(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_CannyEdgeDetector = core::Ptr; + pub type PtrOfCUDA_CannyEdgeDetector = core::Ptr; - ptr_extern! { dyn crate::cudaimgproc::CUDA_CannyEdgeDetector, + ptr_extern! { crate::cudaimgproc::CUDA_CannyEdgeDetector, cv_PtrOfCUDA_CannyEdgeDetector_delete, cv_PtrOfCUDA_CannyEdgeDetector_get_inner_ptr, cv_PtrOfCUDA_CannyEdgeDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_CannyEdgeDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_CannyEdgeDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaimgproc::CUDA_CannyEdgeDetectorConst for core::Ptr { + impl crate::cudaimgproc::CUDA_CannyEdgeDetectorTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_CannyEdgeDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaimgproc::CUDA_CannyEdgeDetector for core::Ptr { + impl crate::cudaimgproc::CUDA_CannyEdgeDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_CannyEdgeDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_CornernessCriteria = core::Ptr; + pub type PtrOfCUDA_CornernessCriteria = core::Ptr; - ptr_extern! { dyn crate::cudaimgproc::CUDA_CornernessCriteria, + ptr_extern! { crate::cudaimgproc::CUDA_CornernessCriteria, cv_PtrOfCUDA_CornernessCriteria_delete, cv_PtrOfCUDA_CornernessCriteria_get_inner_ptr, cv_PtrOfCUDA_CornernessCriteria_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_CornernessCriteria(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_CornernessCriteria(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaimgproc::CUDA_CornernessCriteriaConst for core::Ptr { + impl crate::cudaimgproc::CUDA_CornernessCriteriaTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_CornernessCriteria(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaimgproc::CUDA_CornernessCriteria for core::Ptr { + impl crate::cudaimgproc::CUDA_CornernessCriteriaTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_CornernessCriteria(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_CornersDetector = core::Ptr; + pub type PtrOfCUDA_CornersDetector = core::Ptr; - ptr_extern! { dyn crate::cudaimgproc::CUDA_CornersDetector, + ptr_extern! { crate::cudaimgproc::CUDA_CornersDetector, cv_PtrOfCUDA_CornersDetector_delete, cv_PtrOfCUDA_CornersDetector_get_inner_ptr, cv_PtrOfCUDA_CornersDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_CornersDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_CornersDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaimgproc::CUDA_CornersDetectorConst for core::Ptr { + impl crate::cudaimgproc::CUDA_CornersDetectorTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_CornersDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaimgproc::CUDA_CornersDetector for core::Ptr { + impl crate::cudaimgproc::CUDA_CornersDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_CornersDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_HoughCirclesDetector = core::Ptr; + pub type PtrOfCUDA_HoughCirclesDetector = core::Ptr; - ptr_extern! { dyn crate::cudaimgproc::CUDA_HoughCirclesDetector, + ptr_extern! { crate::cudaimgproc::CUDA_HoughCirclesDetector, cv_PtrOfCUDA_HoughCirclesDetector_delete, cv_PtrOfCUDA_HoughCirclesDetector_get_inner_ptr, cv_PtrOfCUDA_HoughCirclesDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_HoughCirclesDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_HoughCirclesDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaimgproc::CUDA_HoughCirclesDetectorConst for core::Ptr { + impl crate::cudaimgproc::CUDA_HoughCirclesDetectorTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_HoughCirclesDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaimgproc::CUDA_HoughCirclesDetector for core::Ptr { + impl crate::cudaimgproc::CUDA_HoughCirclesDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_HoughCirclesDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_HoughLinesDetector = core::Ptr; + pub type PtrOfCUDA_HoughLinesDetector = core::Ptr; - ptr_extern! { dyn crate::cudaimgproc::CUDA_HoughLinesDetector, + ptr_extern! { crate::cudaimgproc::CUDA_HoughLinesDetector, cv_PtrOfCUDA_HoughLinesDetector_delete, cv_PtrOfCUDA_HoughLinesDetector_get_inner_ptr, cv_PtrOfCUDA_HoughLinesDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_HoughLinesDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_HoughLinesDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaimgproc::CUDA_HoughLinesDetectorConst for core::Ptr { + impl crate::cudaimgproc::CUDA_HoughLinesDetectorTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_HoughLinesDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaimgproc::CUDA_HoughLinesDetector for core::Ptr { + impl crate::cudaimgproc::CUDA_HoughLinesDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_HoughLinesDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_HoughSegmentDetector = core::Ptr; + pub type PtrOfCUDA_HoughSegmentDetector = core::Ptr; - ptr_extern! { dyn crate::cudaimgproc::CUDA_HoughSegmentDetector, + ptr_extern! { crate::cudaimgproc::CUDA_HoughSegmentDetector, cv_PtrOfCUDA_HoughSegmentDetector_delete, cv_PtrOfCUDA_HoughSegmentDetector_get_inner_ptr, cv_PtrOfCUDA_HoughSegmentDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_HoughSegmentDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_HoughSegmentDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaimgproc::CUDA_HoughSegmentDetectorConst for core::Ptr { + impl crate::cudaimgproc::CUDA_HoughSegmentDetectorTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_HoughSegmentDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaimgproc::CUDA_HoughSegmentDetector for core::Ptr { + impl crate::cudaimgproc::CUDA_HoughSegmentDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_HoughSegmentDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_TemplateMatching = core::Ptr; + pub type PtrOfCUDA_TemplateMatching = core::Ptr; - ptr_extern! { dyn crate::cudaimgproc::CUDA_TemplateMatching, + ptr_extern! { crate::cudaimgproc::CUDA_TemplateMatching, cv_PtrOfCUDA_TemplateMatching_delete, cv_PtrOfCUDA_TemplateMatching_get_inner_ptr, cv_PtrOfCUDA_TemplateMatching_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_TemplateMatching(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_TemplateMatching(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaimgproc::CUDA_TemplateMatchingConst for core::Ptr { + impl crate::cudaimgproc::CUDA_TemplateMatchingTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_TemplateMatching(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaimgproc::CUDA_TemplateMatching for core::Ptr { + impl crate::cudaimgproc::CUDA_TemplateMatchingTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_TemplateMatching(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -3976,57 +3960,57 @@ pub use cudaimgproc_types::*; mod cudaobjdetect_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfCascadeClassifier = core::Ptr; + pub type PtrOfCUDA_CascadeClassifier = core::Ptr; - ptr_extern! { dyn crate::cudaobjdetect::CascadeClassifier, - cv_PtrOfCascadeClassifier_delete, cv_PtrOfCascadeClassifier_get_inner_ptr, cv_PtrOfCascadeClassifier_get_inner_ptr_mut + ptr_extern! { crate::cudaobjdetect::CUDA_CascadeClassifier, + cv_PtrOfCUDA_CascadeClassifier_delete, cv_PtrOfCUDA_CascadeClassifier_get_inner_ptr, cv_PtrOfCUDA_CascadeClassifier_get_inner_ptr_mut } - impl core::Ptr { - #[inline] pub fn as_raw_PtrOfCascadeClassifier(&self) -> extern_send!(Self) { self.as_raw() } - #[inline] pub fn as_raw_mut_PtrOfCascadeClassifier(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } + impl core::Ptr { + #[inline] pub fn as_raw_PtrOfCUDA_CascadeClassifier(&self) -> extern_send!(Self) { self.as_raw() } + #[inline] pub fn as_raw_mut_PtrOfCUDA_CascadeClassifier(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaobjdetect::CascadeClassifierConst for core::Ptr { - #[inline] fn as_raw_CascadeClassifier(&self) -> *const c_void { self.inner_as_raw() } + impl crate::cudaobjdetect::CUDA_CascadeClassifierTraitConst for core::Ptr { + #[inline] fn as_raw_CUDA_CascadeClassifier(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaobjdetect::CascadeClassifier for core::Ptr { - #[inline] fn as_raw_mut_CascadeClassifier(&mut self) -> *mut c_void { self.inner_as_raw_mut() } + impl crate::cudaobjdetect::CUDA_CascadeClassifierTrait for core::Ptr { + #[inline] fn as_raw_mut_CUDA_CascadeClassifier(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfHOG = core::Ptr; + pub type PtrOfCUDA_HOG = core::Ptr; - ptr_extern! { dyn crate::cudaobjdetect::HOG, - cv_PtrOfHOG_delete, cv_PtrOfHOG_get_inner_ptr, cv_PtrOfHOG_get_inner_ptr_mut + ptr_extern! { crate::cudaobjdetect::CUDA_HOG, + cv_PtrOfCUDA_HOG_delete, cv_PtrOfCUDA_HOG_get_inner_ptr, cv_PtrOfCUDA_HOG_get_inner_ptr_mut } - impl core::Ptr { - #[inline] pub fn as_raw_PtrOfHOG(&self) -> extern_send!(Self) { self.as_raw() } - #[inline] pub fn as_raw_mut_PtrOfHOG(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } + impl core::Ptr { + #[inline] pub fn as_raw_PtrOfCUDA_HOG(&self) -> extern_send!(Self) { self.as_raw() } + #[inline] pub fn as_raw_mut_PtrOfCUDA_HOG(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaobjdetect::HOGConst for core::Ptr { - #[inline] fn as_raw_HOG(&self) -> *const c_void { self.inner_as_raw() } + impl crate::cudaobjdetect::CUDA_HOGTraitConst for core::Ptr { + #[inline] fn as_raw_CUDA_HOG(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaobjdetect::HOG for core::Ptr { - #[inline] fn as_raw_mut_HOG(&mut self) -> *mut c_void { self.inner_as_raw_mut() } + impl crate::cudaobjdetect::CUDA_HOGTrait for core::Ptr { + #[inline] fn as_raw_mut_CUDA_HOG(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -4038,248 +4022,248 @@ pub use cudaobjdetect_types::*; mod cudaoptflow_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfCUDA_BroxOpticalFlow = core::Ptr; + pub type PtrOfCUDA_BroxOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::cudaoptflow::CUDA_BroxOpticalFlow, + ptr_extern! { crate::cudaoptflow::CUDA_BroxOpticalFlow, cv_PtrOfCUDA_BroxOpticalFlow_delete, cv_PtrOfCUDA_BroxOpticalFlow_get_inner_ptr, cv_PtrOfCUDA_BroxOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_BroxOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_BroxOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaoptflow::CUDA_BroxOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_BroxOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_BroxOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_BroxOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_BroxOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_BroxOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudaoptflow::CUDA_DenseOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_DenseOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_DensePyrLKOpticalFlow = core::Ptr; + pub type PtrOfCUDA_DensePyrLKOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::cudaoptflow::CUDA_DensePyrLKOpticalFlow, + ptr_extern! { crate::cudaoptflow::CUDA_DensePyrLKOpticalFlow, cv_PtrOfCUDA_DensePyrLKOpticalFlow_delete, cv_PtrOfCUDA_DensePyrLKOpticalFlow_get_inner_ptr, cv_PtrOfCUDA_DensePyrLKOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_DensePyrLKOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_DensePyrLKOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaoptflow::CUDA_DensePyrLKOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_DensePyrLKOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_DensePyrLKOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_DensePyrLKOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_DensePyrLKOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_DensePyrLKOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudaoptflow::CUDA_DenseOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_DenseOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_FarnebackOpticalFlow = core::Ptr; + pub type PtrOfCUDA_FarnebackOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::cudaoptflow::CUDA_FarnebackOpticalFlow, + ptr_extern! { crate::cudaoptflow::CUDA_FarnebackOpticalFlow, cv_PtrOfCUDA_FarnebackOpticalFlow_delete, cv_PtrOfCUDA_FarnebackOpticalFlow_get_inner_ptr, cv_PtrOfCUDA_FarnebackOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_FarnebackOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_FarnebackOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaoptflow::CUDA_FarnebackOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_FarnebackOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_FarnebackOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_FarnebackOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_FarnebackOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_FarnebackOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudaoptflow::CUDA_DenseOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_DenseOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_NvidiaOpticalFlow_1_0 = core::Ptr; + pub type PtrOfCUDA_NvidiaOpticalFlow_1_0 = core::Ptr; - ptr_extern! { dyn crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0, + ptr_extern! { crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0, cv_PtrOfCUDA_NvidiaOpticalFlow_1_0_delete, cv_PtrOfCUDA_NvidiaOpticalFlow_1_0_get_inner_ptr, cv_PtrOfCUDA_NvidiaOpticalFlow_1_0_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_NvidiaOpticalFlow_1_0(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_NvidiaOpticalFlow_1_0(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0Const for core::Ptr { + impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0TraitConst for core::Ptr { #[inline] fn as_raw_CUDA_NvidiaOpticalFlow_1_0(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0 for core::Ptr { + impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0Trait for core::Ptr { #[inline] fn as_raw_mut_CUDA_NvidiaOpticalFlow_1_0(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_NvidiaHWOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_NvidiaHWOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_NvidiaOpticalFlow_2_0 = core::Ptr; + pub type PtrOfCUDA_NvidiaOpticalFlow_2_0 = core::Ptr; - ptr_extern! { dyn crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0, + ptr_extern! { crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0, cv_PtrOfCUDA_NvidiaOpticalFlow_2_0_delete, cv_PtrOfCUDA_NvidiaOpticalFlow_2_0_get_inner_ptr, cv_PtrOfCUDA_NvidiaOpticalFlow_2_0_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_NvidiaOpticalFlow_2_0(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_NvidiaOpticalFlow_2_0(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0Const for core::Ptr { + impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0TraitConst for core::Ptr { #[inline] fn as_raw_CUDA_NvidiaOpticalFlow_2_0(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0 for core::Ptr { + impl crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0Trait for core::Ptr { #[inline] fn as_raw_mut_CUDA_NvidiaOpticalFlow_2_0(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_NvidiaHWOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_NvidiaHWOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_NvidiaHWOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_OpticalFlowDual_TVL1 = core::Ptr; + pub type PtrOfCUDA_OpticalFlowDual_TVL1 = core::Ptr; - ptr_extern! { dyn crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1, + ptr_extern! { crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1, cv_PtrOfCUDA_OpticalFlowDual_TVL1_delete, cv_PtrOfCUDA_OpticalFlowDual_TVL1_get_inner_ptr, cv_PtrOfCUDA_OpticalFlowDual_TVL1_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_OpticalFlowDual_TVL1(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_OpticalFlowDual_TVL1(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1Const for core::Ptr { + impl crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1TraitConst for core::Ptr { #[inline] fn as_raw_CUDA_OpticalFlowDual_TVL1(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1 for core::Ptr { + impl crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1Trait for core::Ptr { #[inline] fn as_raw_mut_CUDA_OpticalFlowDual_TVL1(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudaoptflow::CUDA_DenseOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_DenseOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_SparsePyrLKOpticalFlow = core::Ptr; + pub type PtrOfCUDA_SparsePyrLKOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlow, + ptr_extern! { crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlow, cv_PtrOfCUDA_SparsePyrLKOpticalFlow_delete, cv_PtrOfCUDA_SparsePyrLKOpticalFlow_get_inner_ptr, cv_PtrOfCUDA_SparsePyrLKOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_SparsePyrLKOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_SparsePyrLKOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_SparsePyrLKOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_SparsePyrLKOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudaoptflow::CUDA_SparseOpticalFlowConst for core::Ptr { + impl crate::cudaoptflow::CUDA_SparseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_SparseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudaoptflow::CUDA_SparseOpticalFlow for core::Ptr { + impl crate::cudaoptflow::CUDA_SparseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_SparseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -4291,194 +4275,194 @@ pub use cudaoptflow_types::*; mod cudastereo_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfCUDA_DisparityBilateralFilter = core::Ptr; + pub type PtrOfCUDA_DisparityBilateralFilter = core::Ptr; - ptr_extern! { dyn crate::cudastereo::CUDA_DisparityBilateralFilter, + ptr_extern! { crate::cudastereo::CUDA_DisparityBilateralFilter, cv_PtrOfCUDA_DisparityBilateralFilter_delete, cv_PtrOfCUDA_DisparityBilateralFilter_get_inner_ptr, cv_PtrOfCUDA_DisparityBilateralFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_DisparityBilateralFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_DisparityBilateralFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudastereo::CUDA_DisparityBilateralFilterConst for core::Ptr { + impl crate::cudastereo::CUDA_DisparityBilateralFilterTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_DisparityBilateralFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudastereo::CUDA_DisparityBilateralFilter for core::Ptr { + impl crate::cudastereo::CUDA_DisparityBilateralFilterTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_DisparityBilateralFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_StereoBM = core::Ptr; + pub type PtrOfCUDA_StereoBM = core::Ptr; - ptr_extern! { dyn crate::cudastereo::CUDA_StereoBM, + ptr_extern! { crate::cudastereo::CUDA_StereoBM, cv_PtrOfCUDA_StereoBM_delete, cv_PtrOfCUDA_StereoBM_get_inner_ptr, cv_PtrOfCUDA_StereoBM_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_StereoBM(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_StereoBM(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudastereo::CUDA_StereoBMConst for core::Ptr { + impl crate::cudastereo::CUDA_StereoBMTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_StereoBM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudastereo::CUDA_StereoBM for core::Ptr { + impl crate::cudastereo::CUDA_StereoBMTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_StereoBM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::calib3d::StereoBMConst for core::Ptr { + impl crate::calib3d::StereoBMTraitConst for core::Ptr { #[inline] fn as_raw_StereoBM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoBM for core::Ptr { + impl crate::calib3d::StereoBMTrait for core::Ptr { #[inline] fn as_raw_mut_StereoBM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::calib3d::StereoMatcherConst for core::Ptr { + impl crate::calib3d::StereoMatcherTraitConst for core::Ptr { #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoMatcher for core::Ptr { + impl crate::calib3d::StereoMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_StereoBeliefPropagation = core::Ptr; + pub type PtrOfCUDA_StereoBeliefPropagation = core::Ptr; - ptr_extern! { dyn crate::cudastereo::CUDA_StereoBeliefPropagation, + ptr_extern! { crate::cudastereo::CUDA_StereoBeliefPropagation, cv_PtrOfCUDA_StereoBeliefPropagation_delete, cv_PtrOfCUDA_StereoBeliefPropagation_get_inner_ptr, cv_PtrOfCUDA_StereoBeliefPropagation_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_StereoBeliefPropagation(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_StereoBeliefPropagation(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudastereo::CUDA_StereoBeliefPropagationConst for core::Ptr { + impl crate::cudastereo::CUDA_StereoBeliefPropagationTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_StereoBeliefPropagation(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudastereo::CUDA_StereoBeliefPropagation for core::Ptr { + impl crate::cudastereo::CUDA_StereoBeliefPropagationTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_StereoBeliefPropagation(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::calib3d::StereoMatcherConst for core::Ptr { + impl crate::calib3d::StereoMatcherTraitConst for core::Ptr { #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoMatcher for core::Ptr { + impl crate::calib3d::StereoMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_StereoConstantSpaceBP = core::Ptr; + pub type PtrOfCUDA_StereoConstantSpaceBP = core::Ptr; - ptr_extern! { dyn crate::cudastereo::CUDA_StereoConstantSpaceBP, + ptr_extern! { crate::cudastereo::CUDA_StereoConstantSpaceBP, cv_PtrOfCUDA_StereoConstantSpaceBP_delete, cv_PtrOfCUDA_StereoConstantSpaceBP_get_inner_ptr, cv_PtrOfCUDA_StereoConstantSpaceBP_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_StereoConstantSpaceBP(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_StereoConstantSpaceBP(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudastereo::CUDA_StereoConstantSpaceBPConst for core::Ptr { + impl crate::cudastereo::CUDA_StereoConstantSpaceBPTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_StereoConstantSpaceBP(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudastereo::CUDA_StereoConstantSpaceBP for core::Ptr { + impl crate::cudastereo::CUDA_StereoConstantSpaceBPTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_StereoConstantSpaceBP(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::calib3d::StereoMatcherConst for core::Ptr { + impl crate::calib3d::StereoMatcherTraitConst for core::Ptr { #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoMatcher for core::Ptr { + impl crate::calib3d::StereoMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::cudastereo::CUDA_StereoBeliefPropagationConst for core::Ptr { + impl crate::cudastereo::CUDA_StereoBeliefPropagationTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_StereoBeliefPropagation(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudastereo::CUDA_StereoBeliefPropagation for core::Ptr { + impl crate::cudastereo::CUDA_StereoBeliefPropagationTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_StereoBeliefPropagation(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCUDA_StereoSGM = core::Ptr; + pub type PtrOfCUDA_StereoSGM = core::Ptr; - ptr_extern! { dyn crate::cudastereo::CUDA_StereoSGM, + ptr_extern! { crate::cudastereo::CUDA_StereoSGM, cv_PtrOfCUDA_StereoSGM_delete, cv_PtrOfCUDA_StereoSGM_get_inner_ptr, cv_PtrOfCUDA_StereoSGM_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCUDA_StereoSGM(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCUDA_StereoSGM(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::cudastereo::CUDA_StereoSGMConst for core::Ptr { + impl crate::cudastereo::CUDA_StereoSGMTraitConst for core::Ptr { #[inline] fn as_raw_CUDA_StereoSGM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::cudastereo::CUDA_StereoSGM for core::Ptr { + impl crate::cudastereo::CUDA_StereoSGMTrait for core::Ptr { #[inline] fn as_raw_mut_CUDA_StereoSGM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::calib3d::StereoMatcherConst for core::Ptr { + impl crate::calib3d::StereoMatcherTraitConst for core::Ptr { #[inline] fn as_raw_StereoMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoMatcher for core::Ptr { + impl crate::calib3d::StereoMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_StereoMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::calib3d::StereoSGBMConst for core::Ptr { + impl crate::calib3d::StereoSGBMTraitConst for core::Ptr { #[inline] fn as_raw_StereoSGBM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::calib3d::StereoSGBM for core::Ptr { + impl crate::calib3d::StereoSGBMTrait for core::Ptr { #[inline] fn as_raw_mut_StereoSGBM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -5027,22 +5011,22 @@ mod dnn_types { #[inline] fn as_raw_mut_BackendNode(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBackendWrapper = core::Ptr; + pub type PtrOfBackendWrapper = core::Ptr; - ptr_extern! { dyn crate::dnn::BackendWrapper, + ptr_extern! { crate::dnn::BackendWrapper, cv_PtrOfBackendWrapper_delete, cv_PtrOfBackendWrapper_get_inner_ptr, cv_PtrOfBackendWrapper_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBackendWrapper(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBackendWrapper(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::dnn::BackendWrapperConst for core::Ptr { + impl crate::dnn::BackendWrapperTraitConst for core::Ptr { #[inline] fn as_raw_BackendWrapper(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::dnn::BackendWrapper for core::Ptr { + impl crate::dnn::BackendWrapperTrait for core::Ptr { #[inline] fn as_raw_mut_BackendWrapper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -6194,38 +6178,38 @@ mod dnn_types { #[inline] fn as_raw_mut_Layer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLSTMLayer = core::Ptr; + pub type PtrOfLSTMLayer = core::Ptr; - ptr_extern! { dyn crate::dnn::LSTMLayer, + ptr_extern! { crate::dnn::LSTMLayer, cv_PtrOfLSTMLayer_delete, cv_PtrOfLSTMLayer_get_inner_ptr, cv_PtrOfLSTMLayer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLSTMLayer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLSTMLayer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::dnn::LSTMLayerConst for core::Ptr { + impl crate::dnn::LSTMLayerTraitConst for core::Ptr { #[inline] fn as_raw_LSTMLayer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::dnn::LSTMLayer for core::Ptr { + impl crate::dnn::LSTMLayerTrait for core::Ptr { #[inline] fn as_raw_mut_LSTMLayer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::dnn::LayerTraitConst for core::Ptr { + impl crate::dnn::LayerTraitConst for core::Ptr { #[inline] fn as_raw_Layer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::dnn::LayerTrait for core::Ptr { + impl crate::dnn::LayerTrait for core::Ptr { #[inline] fn as_raw_mut_Layer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -6853,38 +6837,38 @@ mod dnn_types { #[inline] fn as_raw_mut_Layer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfRNNLayer = core::Ptr; + pub type PtrOfRNNLayer = core::Ptr; - ptr_extern! { dyn crate::dnn::RNNLayer, + ptr_extern! { crate::dnn::RNNLayer, cv_PtrOfRNNLayer_delete, cv_PtrOfRNNLayer_get_inner_ptr, cv_PtrOfRNNLayer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRNNLayer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRNNLayer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::dnn::RNNLayerConst for core::Ptr { + impl crate::dnn::RNNLayerTraitConst for core::Ptr { #[inline] fn as_raw_RNNLayer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::dnn::RNNLayer for core::Ptr { + impl crate::dnn::RNNLayerTrait for core::Ptr { #[inline] fn as_raw_mut_RNNLayer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::dnn::LayerTraitConst for core::Ptr { + impl crate::dnn::LayerTraitConst for core::Ptr { #[inline] fn as_raw_Layer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::dnn::LayerTrait for core::Ptr { + impl crate::dnn::LayerTrait for core::Ptr { #[inline] fn as_raw_mut_Layer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -8307,14 +8291,14 @@ mod dnn_types { } vector_non_copy_or_bool! { core::Ptr } - pub type VectorOfPtrOfBackendWrapper = core::Vector>; + pub type VectorOfPtrOfBackendWrapper = core::Vector>; - impl core::Vector> { + impl core::Vector> { pub fn as_raw_VectorOfPtrOfBackendWrapper(&self) -> extern_send!(Self) { self.as_raw() } pub fn as_raw_mut_VectorOfPtrOfBackendWrapper(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - vector_extern! { core::Ptr, + vector_extern! { core::Ptr, cv_VectorOfPtrOfBackendWrapper_new, cv_VectorOfPtrOfBackendWrapper_delete, cv_VectorOfPtrOfBackendWrapper_len, cv_VectorOfPtrOfBackendWrapper_is_empty, cv_VectorOfPtrOfBackendWrapper_capacity, cv_VectorOfPtrOfBackendWrapper_shrink_to_fit, @@ -8323,7 +8307,7 @@ mod dnn_types { cv_VectorOfPtrOfBackendWrapper_get, cv_VectorOfPtrOfBackendWrapper_set, cv_VectorOfPtrOfBackendWrapper_push, cv_VectorOfPtrOfBackendWrapper_insert, } - vector_non_copy_or_bool! { core::Ptr } + vector_non_copy_or_bool! { core::Ptr } pub type VectorOfPtrOfLayer = core::Vector>; @@ -8437,22 +8421,22 @@ pub use dnn_superres_types::*; mod dpm_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfDPMDetector = core::Ptr; + pub type PtrOfDPMDetector = core::Ptr; - ptr_extern! { dyn crate::dpm::DPMDetector, + ptr_extern! { crate::dpm::DPMDetector, cv_PtrOfDPMDetector_delete, cv_PtrOfDPMDetector_get_inner_ptr, cv_PtrOfDPMDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDPMDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDPMDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::dpm::DPMDetectorConst for core::Ptr { + impl crate::dpm::DPMDetectorTraitConst for core::Ptr { #[inline] fn as_raw_DPMDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::dpm::DPMDetector for core::Ptr { + impl crate::dpm::DPMDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_DPMDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -8482,345 +8466,345 @@ pub use dpm_types::*; mod face_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfBIF = core::Ptr; + pub type PtrOfBIF = core::Ptr; - ptr_extern! { dyn crate::face::BIF, + ptr_extern! { crate::face::BIF, cv_PtrOfBIF_delete, cv_PtrOfBIF_get_inner_ptr, cv_PtrOfBIF_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBIF(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBIF(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::BIFConst for core::Ptr { + impl crate::face::BIFTraitConst for core::Ptr { #[inline] fn as_raw_BIF(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::BIF for core::Ptr { + impl crate::face::BIFTrait for core::Ptr { #[inline] fn as_raw_mut_BIF(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfEigenFaceRecognizer = core::Ptr; + pub type PtrOfEigenFaceRecognizer = core::Ptr; - ptr_extern! { dyn crate::face::EigenFaceRecognizer, + ptr_extern! { crate::face::EigenFaceRecognizer, cv_PtrOfEigenFaceRecognizer_delete, cv_PtrOfEigenFaceRecognizer_get_inner_ptr, cv_PtrOfEigenFaceRecognizer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfEigenFaceRecognizer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfEigenFaceRecognizer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::EigenFaceRecognizerConst for core::Ptr { + impl crate::face::EigenFaceRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_EigenFaceRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::EigenFaceRecognizer for core::Ptr { + impl crate::face::EigenFaceRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_EigenFaceRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::BasicFaceRecognizerConst for core::Ptr { + impl crate::face::BasicFaceRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_BasicFaceRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::BasicFaceRecognizer for core::Ptr { + impl crate::face::BasicFaceRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_BasicFaceRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::FaceRecognizerConst for core::Ptr { + impl crate::face::FaceRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_FaceRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FaceRecognizer for core::Ptr { + impl crate::face::FaceRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFacemark = core::Ptr; + pub type PtrOfFacemark = core::Ptr; - ptr_extern! { dyn crate::face::Facemark, + ptr_extern! { crate::face::Facemark, cv_PtrOfFacemark_delete, cv_PtrOfFacemark_get_inner_ptr, cv_PtrOfFacemark_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFacemark(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFacemark(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::FacemarkConst for core::Ptr { + impl crate::face::FacemarkTraitConst for core::Ptr { #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::Facemark for core::Ptr { + impl crate::face::FacemarkTrait for core::Ptr { #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFacemarkAAM = core::Ptr; + pub type PtrOfFacemarkAAM = core::Ptr; - ptr_extern! { dyn crate::face::FacemarkAAM, + ptr_extern! { crate::face::FacemarkAAM, cv_PtrOfFacemarkAAM_delete, cv_PtrOfFacemarkAAM_get_inner_ptr, cv_PtrOfFacemarkAAM_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFacemarkAAM(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFacemarkAAM(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::FacemarkAAMConst for core::Ptr { + impl crate::face::FacemarkAAMTraitConst for core::Ptr { #[inline] fn as_raw_FacemarkAAM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FacemarkAAM for core::Ptr { + impl crate::face::FacemarkAAMTrait for core::Ptr { #[inline] fn as_raw_mut_FacemarkAAM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::FacemarkConst for core::Ptr { + impl crate::face::FacemarkTraitConst for core::Ptr { #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::Facemark for core::Ptr { + impl crate::face::FacemarkTrait for core::Ptr { #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::FacemarkTrainConst for core::Ptr { + impl crate::face::FacemarkTrainTraitConst for core::Ptr { #[inline] fn as_raw_FacemarkTrain(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FacemarkTrain for core::Ptr { + impl crate::face::FacemarkTrainTrait for core::Ptr { #[inline] fn as_raw_mut_FacemarkTrain(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFacemarkKazemi = core::Ptr; + pub type PtrOfFacemarkKazemi = core::Ptr; - ptr_extern! { dyn crate::face::FacemarkKazemi, + ptr_extern! { crate::face::FacemarkKazemi, cv_PtrOfFacemarkKazemi_delete, cv_PtrOfFacemarkKazemi_get_inner_ptr, cv_PtrOfFacemarkKazemi_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFacemarkKazemi(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFacemarkKazemi(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::FacemarkKazemiConst for core::Ptr { + impl crate::face::FacemarkKazemiTraitConst for core::Ptr { #[inline] fn as_raw_FacemarkKazemi(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FacemarkKazemi for core::Ptr { + impl crate::face::FacemarkKazemiTrait for core::Ptr { #[inline] fn as_raw_mut_FacemarkKazemi(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::FacemarkConst for core::Ptr { + impl crate::face::FacemarkTraitConst for core::Ptr { #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::Facemark for core::Ptr { + impl crate::face::FacemarkTrait for core::Ptr { #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFacemarkLBF = core::Ptr; + pub type PtrOfFacemarkLBF = core::Ptr; - ptr_extern! { dyn crate::face::FacemarkLBF, + ptr_extern! { crate::face::FacemarkLBF, cv_PtrOfFacemarkLBF_delete, cv_PtrOfFacemarkLBF_get_inner_ptr, cv_PtrOfFacemarkLBF_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFacemarkLBF(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFacemarkLBF(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::FacemarkLBFConst for core::Ptr { + impl crate::face::FacemarkLBFTraitConst for core::Ptr { #[inline] fn as_raw_FacemarkLBF(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FacemarkLBF for core::Ptr { + impl crate::face::FacemarkLBFTrait for core::Ptr { #[inline] fn as_raw_mut_FacemarkLBF(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::FacemarkConst for core::Ptr { + impl crate::face::FacemarkTraitConst for core::Ptr { #[inline] fn as_raw_Facemark(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::Facemark for core::Ptr { + impl crate::face::FacemarkTrait for core::Ptr { #[inline] fn as_raw_mut_Facemark(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::FacemarkTrainConst for core::Ptr { + impl crate::face::FacemarkTrainTraitConst for core::Ptr { #[inline] fn as_raw_FacemarkTrain(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FacemarkTrain for core::Ptr { + impl crate::face::FacemarkTrainTrait for core::Ptr { #[inline] fn as_raw_mut_FacemarkTrain(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFisherFaceRecognizer = core::Ptr; + pub type PtrOfFisherFaceRecognizer = core::Ptr; - ptr_extern! { dyn crate::face::FisherFaceRecognizer, + ptr_extern! { crate::face::FisherFaceRecognizer, cv_PtrOfFisherFaceRecognizer_delete, cv_PtrOfFisherFaceRecognizer_get_inner_ptr, cv_PtrOfFisherFaceRecognizer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFisherFaceRecognizer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFisherFaceRecognizer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::FisherFaceRecognizerConst for core::Ptr { + impl crate::face::FisherFaceRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_FisherFaceRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FisherFaceRecognizer for core::Ptr { + impl crate::face::FisherFaceRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_FisherFaceRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::BasicFaceRecognizerConst for core::Ptr { + impl crate::face::BasicFaceRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_BasicFaceRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::BasicFaceRecognizer for core::Ptr { + impl crate::face::BasicFaceRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_BasicFaceRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::FaceRecognizerConst for core::Ptr { + impl crate::face::FaceRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_FaceRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FaceRecognizer for core::Ptr { + impl crate::face::FaceRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLBPHFaceRecognizer = core::Ptr; + pub type PtrOfLBPHFaceRecognizer = core::Ptr; - ptr_extern! { dyn crate::face::LBPHFaceRecognizer, + ptr_extern! { crate::face::LBPHFaceRecognizer, cv_PtrOfLBPHFaceRecognizer_delete, cv_PtrOfLBPHFaceRecognizer_get_inner_ptr, cv_PtrOfLBPHFaceRecognizer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLBPHFaceRecognizer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLBPHFaceRecognizer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::LBPHFaceRecognizerConst for core::Ptr { + impl crate::face::LBPHFaceRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_LBPHFaceRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::LBPHFaceRecognizer for core::Ptr { + impl crate::face::LBPHFaceRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_LBPHFaceRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::FaceRecognizerConst for core::Ptr { + impl crate::face::FaceRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_FaceRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::FaceRecognizer for core::Ptr { + impl crate::face::FaceRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_FaceRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfMACE = core::Ptr; + pub type PtrOfMACE = core::Ptr; - ptr_extern! { dyn crate::face::MACE, + ptr_extern! { crate::face::MACE, cv_PtrOfMACE_delete, cv_PtrOfMACE_get_inner_ptr, cv_PtrOfMACE_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMACE(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMACE(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::MACEConst for core::Ptr { + impl crate::face::MACETraitConst for core::Ptr { #[inline] fn as_raw_MACE(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::MACE for core::Ptr { + impl crate::face::MACETrait for core::Ptr { #[inline] fn as_raw_mut_MACE(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfPredictCollector = core::Ptr; + pub type PtrOfPredictCollector = core::Ptr; - ptr_extern! { dyn crate::face::PredictCollector, + ptr_extern! { crate::face::PredictCollector, cv_PtrOfPredictCollector_delete, cv_PtrOfPredictCollector_get_inner_ptr, cv_PtrOfPredictCollector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfPredictCollector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfPredictCollector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::face::PredictCollectorConst for core::Ptr { + impl crate::face::PredictCollectorTraitConst for core::Ptr { #[inline] fn as_raw_PredictCollector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::PredictCollector for core::Ptr { + impl crate::face::PredictCollectorTrait for core::Ptr { #[inline] fn as_raw_mut_PredictCollector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -8845,15 +8829,15 @@ mod face_types { #[inline] fn as_raw_mut_StandardCollector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::face::PredictCollectorConst for core::Ptr { + impl crate::face::PredictCollectorTraitConst for core::Ptr { #[inline] fn as_raw_PredictCollector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::face::PredictCollector for core::Ptr { + impl crate::face::PredictCollectorTrait for core::Ptr { #[inline] fn as_raw_mut_PredictCollector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfStandardCollector, core::Ptr, cv_PtrOfStandardCollector_to_PtrOfPredictCollector } + ptr_cast_base! { PtrOfStandardCollector, core::Ptr, cv_PtrOfStandardCollector_to_PtrOfPredictCollector } pub type VectorOfFacemarkAAM_Config = core::Vector; @@ -8899,112 +8883,112 @@ pub use face_types::*; mod features2d_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfAKAZE = core::Ptr; + pub type PtrOfAKAZE = core::Ptr; - ptr_extern! { dyn crate::features2d::AKAZE, + ptr_extern! { crate::features2d::AKAZE, cv_PtrOfAKAZE_delete, cv_PtrOfAKAZE_get_inner_ptr, cv_PtrOfAKAZE_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfAKAZE(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfAKAZE(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::AKAZEConst for core::Ptr { + impl crate::features2d::AKAZETraitConst for core::Ptr { #[inline] fn as_raw_AKAZE(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::AKAZE for core::Ptr { + impl crate::features2d::AKAZETrait for core::Ptr { #[inline] fn as_raw_mut_AKAZE(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfAKAZE, core::Ptr, cv_PtrOfAKAZE_to_PtrOfFeature2D } - pub type PtrOfAffineFeature = core::Ptr; + pub type PtrOfAffineFeature = core::Ptr; - ptr_extern! { dyn crate::features2d::AffineFeature, + ptr_extern! { crate::features2d::AffineFeature, cv_PtrOfAffineFeature_delete, cv_PtrOfAffineFeature_get_inner_ptr, cv_PtrOfAffineFeature_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfAffineFeature(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfAffineFeature(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::AffineFeatureConst for core::Ptr { + impl crate::features2d::AffineFeatureTraitConst for core::Ptr { #[inline] fn as_raw_AffineFeature(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::AffineFeature for core::Ptr { + impl crate::features2d::AffineFeatureTrait for core::Ptr { #[inline] fn as_raw_mut_AffineFeature(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfAffineFeature, core::Ptr, cv_PtrOfAffineFeature_to_PtrOfFeature2D } - pub type PtrOfAgastFeatureDetector = core::Ptr; + pub type PtrOfAgastFeatureDetector = core::Ptr; - ptr_extern! { dyn crate::features2d::AgastFeatureDetector, + ptr_extern! { crate::features2d::AgastFeatureDetector, cv_PtrOfAgastFeatureDetector_delete, cv_PtrOfAgastFeatureDetector_get_inner_ptr, cv_PtrOfAgastFeatureDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfAgastFeatureDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfAgastFeatureDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::AgastFeatureDetectorConst for core::Ptr { + impl crate::features2d::AgastFeatureDetectorTraitConst for core::Ptr { #[inline] fn as_raw_AgastFeatureDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::AgastFeatureDetector for core::Ptr { + impl crate::features2d::AgastFeatureDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_AgastFeatureDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -9039,110 +9023,110 @@ mod features2d_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::DescriptorMatcherConst for core::Ptr { + impl crate::features2d::DescriptorMatcherTraitConst for core::Ptr { #[inline] fn as_raw_DescriptorMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::DescriptorMatcher for core::Ptr { + impl crate::features2d::DescriptorMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBRISK = core::Ptr; + pub type PtrOfBRISK = core::Ptr; - ptr_extern! { dyn crate::features2d::BRISK, + ptr_extern! { crate::features2d::BRISK, cv_PtrOfBRISK_delete, cv_PtrOfBRISK_get_inner_ptr, cv_PtrOfBRISK_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBRISK(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBRISK(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::BRISKConst for core::Ptr { + impl crate::features2d::BRISKTraitConst for core::Ptr { #[inline] fn as_raw_BRISK(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::BRISK for core::Ptr { + impl crate::features2d::BRISKTrait for core::Ptr { #[inline] fn as_raw_mut_BRISK(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfBRISK, core::Ptr, cv_PtrOfBRISK_to_PtrOfFeature2D } - pub type PtrOfDescriptorMatcher = core::Ptr; + pub type PtrOfDescriptorMatcher = core::Ptr; - ptr_extern! { dyn crate::features2d::DescriptorMatcher, + ptr_extern! { crate::features2d::DescriptorMatcher, cv_PtrOfDescriptorMatcher_delete, cv_PtrOfDescriptorMatcher_get_inner_ptr, cv_PtrOfDescriptorMatcher_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDescriptorMatcher(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDescriptorMatcher(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::DescriptorMatcherConst for core::Ptr { + impl crate::features2d::DescriptorMatcherTraitConst for core::Ptr { #[inline] fn as_raw_DescriptorMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::DescriptorMatcher for core::Ptr { + impl crate::features2d::DescriptorMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFastFeatureDetector = core::Ptr; + pub type PtrOfFastFeatureDetector = core::Ptr; - ptr_extern! { dyn crate::features2d::FastFeatureDetector, + ptr_extern! { crate::features2d::FastFeatureDetector, cv_PtrOfFastFeatureDetector_delete, cv_PtrOfFastFeatureDetector_get_inner_ptr, cv_PtrOfFastFeatureDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFastFeatureDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFastFeatureDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::FastFeatureDetectorConst for core::Ptr { + impl crate::features2d::FastFeatureDetectorTraitConst for core::Ptr { #[inline] fn as_raw_FastFeatureDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::FastFeatureDetector for core::Ptr { + impl crate::features2d::FastFeatureDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_FastFeatureDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -9206,231 +9190,231 @@ mod features2d_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::DescriptorMatcherConst for core::Ptr { + impl crate::features2d::DescriptorMatcherTraitConst for core::Ptr { #[inline] fn as_raw_DescriptorMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::DescriptorMatcher for core::Ptr { + impl crate::features2d::DescriptorMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfGFTTDetector = core::Ptr; + pub type PtrOfGFTTDetector = core::Ptr; - ptr_extern! { dyn crate::features2d::GFTTDetector, + ptr_extern! { crate::features2d::GFTTDetector, cv_PtrOfGFTTDetector_delete, cv_PtrOfGFTTDetector_get_inner_ptr, cv_PtrOfGFTTDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfGFTTDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfGFTTDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::GFTTDetectorConst for core::Ptr { + impl crate::features2d::GFTTDetectorTraitConst for core::Ptr { #[inline] fn as_raw_GFTTDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::GFTTDetector for core::Ptr { + impl crate::features2d::GFTTDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_GFTTDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfGFTTDetector, core::Ptr, cv_PtrOfGFTTDetector_to_PtrOfFeature2D } - pub type PtrOfKAZE = core::Ptr; + pub type PtrOfKAZE = core::Ptr; - ptr_extern! { dyn crate::features2d::KAZE, + ptr_extern! { crate::features2d::KAZE, cv_PtrOfKAZE_delete, cv_PtrOfKAZE_get_inner_ptr, cv_PtrOfKAZE_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfKAZE(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfKAZE(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::KAZEConst for core::Ptr { + impl crate::features2d::KAZETraitConst for core::Ptr { #[inline] fn as_raw_KAZE(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::KAZE for core::Ptr { + impl crate::features2d::KAZETrait for core::Ptr { #[inline] fn as_raw_mut_KAZE(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfKAZE, core::Ptr, cv_PtrOfKAZE_to_PtrOfFeature2D } - pub type PtrOfMSER = core::Ptr; + pub type PtrOfMSER = core::Ptr; - ptr_extern! { dyn crate::features2d::MSER, + ptr_extern! { crate::features2d::MSER, cv_PtrOfMSER_delete, cv_PtrOfMSER_get_inner_ptr, cv_PtrOfMSER_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMSER(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMSER(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::MSERConst for core::Ptr { + impl crate::features2d::MSERTraitConst for core::Ptr { #[inline] fn as_raw_MSER(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::MSER for core::Ptr { + impl crate::features2d::MSERTrait for core::Ptr { #[inline] fn as_raw_mut_MSER(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfMSER, core::Ptr, cv_PtrOfMSER_to_PtrOfFeature2D } - pub type PtrOfORB = core::Ptr; + pub type PtrOfORB = core::Ptr; - ptr_extern! { dyn crate::features2d::ORB, + ptr_extern! { crate::features2d::ORB, cv_PtrOfORB_delete, cv_PtrOfORB_get_inner_ptr, cv_PtrOfORB_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfORB(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfORB(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::ORBConst for core::Ptr { + impl crate::features2d::ORBTraitConst for core::Ptr { #[inline] fn as_raw_ORB(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::ORB for core::Ptr { + impl crate::features2d::ORBTrait for core::Ptr { #[inline] fn as_raw_mut_ORB(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfORB, core::Ptr, cv_PtrOfORB_to_PtrOfFeature2D } - pub type PtrOfSIFT = core::Ptr; + pub type PtrOfSIFT = core::Ptr; - ptr_extern! { dyn crate::features2d::SIFT, + ptr_extern! { crate::features2d::SIFT, cv_PtrOfSIFT_delete, cv_PtrOfSIFT_get_inner_ptr, cv_PtrOfSIFT_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSIFT(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSIFT(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::SIFTConst for core::Ptr { + impl crate::features2d::SIFTTraitConst for core::Ptr { #[inline] fn as_raw_SIFT(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::SIFT for core::Ptr { + impl crate::features2d::SIFTTrait for core::Ptr { #[inline] fn as_raw_mut_SIFT(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfSIFT, core::Ptr, cv_PtrOfSIFT_to_PtrOfFeature2D } - pub type PtrOfSimpleBlobDetector = core::Ptr; + pub type PtrOfSimpleBlobDetector = core::Ptr; - ptr_extern! { dyn crate::features2d::SimpleBlobDetector, + ptr_extern! { crate::features2d::SimpleBlobDetector, cv_PtrOfSimpleBlobDetector_delete, cv_PtrOfSimpleBlobDetector_get_inner_ptr, cv_PtrOfSimpleBlobDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSimpleBlobDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSimpleBlobDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::features2d::SimpleBlobDetectorConst for core::Ptr { + impl crate::features2d::SimpleBlobDetectorTraitConst for core::Ptr { #[inline] fn as_raw_SimpleBlobDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::SimpleBlobDetector for core::Ptr { + impl crate::features2d::SimpleBlobDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_SimpleBlobDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -9523,30 +9507,30 @@ pub use flann_types::*; mod freetype_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfFreeType2 = core::Ptr; + pub type PtrOfFreeType2 = core::Ptr; - ptr_extern! { dyn crate::freetype::FreeType2, + ptr_extern! { crate::freetype::FreeType2, cv_PtrOfFreeType2_delete, cv_PtrOfFreeType2_get_inner_ptr, cv_PtrOfFreeType2_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFreeType2(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFreeType2(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::freetype::FreeType2Const for core::Ptr { + impl crate::freetype::FreeType2TraitConst for core::Ptr { #[inline] fn as_raw_FreeType2(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::freetype::FreeType2 for core::Ptr { + impl crate::freetype::FreeType2Trait for core::Ptr { #[inline] fn as_raw_mut_FreeType2(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -9802,22 +9786,22 @@ pub use gapi_types::*; mod hdf_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfHDF5 = core::Ptr; + pub type PtrOfHDF5 = core::Ptr; - ptr_extern! { dyn crate::hdf::HDF5, + ptr_extern! { crate::hdf::HDF5, cv_PtrOfHDF5_delete, cv_PtrOfHDF5_get_inner_ptr, cv_PtrOfHDF5_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfHDF5(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfHDF5(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::hdf::HDF5Const for core::Ptr { + impl crate::hdf::HDF5TraitConst for core::Ptr { #[inline] fn as_raw_HDF5(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::hdf::HDF5 for core::Ptr { + impl crate::hdf::HDF5Trait for core::Ptr { #[inline] fn as_raw_mut_HDF5(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -9829,30 +9813,30 @@ pub use hdf_types::*; mod hfs_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfHfsSegment = core::Ptr; + pub type PtrOfHfsSegment = core::Ptr; - ptr_extern! { dyn crate::hfs::HfsSegment, + ptr_extern! { crate::hfs::HfsSegment, cv_PtrOfHfsSegment_delete, cv_PtrOfHfsSegment_get_inner_ptr, cv_PtrOfHfsSegment_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfHfsSegment(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfHfsSegment(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::hfs::HfsSegmentConst for core::Ptr { + impl crate::hfs::HfsSegmentTraitConst for core::Ptr { #[inline] fn as_raw_HfsSegment(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::hfs::HfsSegment for core::Ptr { + impl crate::hfs::HfsSegmentTrait for core::Ptr { #[inline] fn as_raw_mut_HfsSegment(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -10094,127 +10078,127 @@ pub use img_hash_types::*; mod imgproc_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfCLAHE = core::Ptr; + pub type PtrOfCLAHE = core::Ptr; - ptr_extern! { dyn crate::imgproc::CLAHE, + ptr_extern! { crate::imgproc::CLAHE, cv_PtrOfCLAHE_delete, cv_PtrOfCLAHE_get_inner_ptr, cv_PtrOfCLAHE_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCLAHE(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCLAHE(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::imgproc::CLAHEConst for core::Ptr { + impl crate::imgproc::CLAHETraitConst for core::Ptr { #[inline] fn as_raw_CLAHE(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::imgproc::CLAHE for core::Ptr { + impl crate::imgproc::CLAHETrait for core::Ptr { #[inline] fn as_raw_mut_CLAHE(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfGeneralizedHoughBallard = core::Ptr; + pub type PtrOfGeneralizedHoughBallard = core::Ptr; - ptr_extern! { dyn crate::imgproc::GeneralizedHoughBallard, + ptr_extern! { crate::imgproc::GeneralizedHoughBallard, cv_PtrOfGeneralizedHoughBallard_delete, cv_PtrOfGeneralizedHoughBallard_get_inner_ptr, cv_PtrOfGeneralizedHoughBallard_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfGeneralizedHoughBallard(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfGeneralizedHoughBallard(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::imgproc::GeneralizedHoughBallardConst for core::Ptr { + impl crate::imgproc::GeneralizedHoughBallardTraitConst for core::Ptr { #[inline] fn as_raw_GeneralizedHoughBallard(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::imgproc::GeneralizedHoughBallard for core::Ptr { + impl crate::imgproc::GeneralizedHoughBallardTrait for core::Ptr { #[inline] fn as_raw_mut_GeneralizedHoughBallard(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::imgproc::GeneralizedHoughConst for core::Ptr { + impl crate::imgproc::GeneralizedHoughTraitConst for core::Ptr { #[inline] fn as_raw_GeneralizedHough(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::imgproc::GeneralizedHough for core::Ptr { + impl crate::imgproc::GeneralizedHoughTrait for core::Ptr { #[inline] fn as_raw_mut_GeneralizedHough(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfGeneralizedHoughGuil = core::Ptr; + pub type PtrOfGeneralizedHoughGuil = core::Ptr; - ptr_extern! { dyn crate::imgproc::GeneralizedHoughGuil, + ptr_extern! { crate::imgproc::GeneralizedHoughGuil, cv_PtrOfGeneralizedHoughGuil_delete, cv_PtrOfGeneralizedHoughGuil_get_inner_ptr, cv_PtrOfGeneralizedHoughGuil_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfGeneralizedHoughGuil(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfGeneralizedHoughGuil(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::imgproc::GeneralizedHoughGuilConst for core::Ptr { + impl crate::imgproc::GeneralizedHoughGuilTraitConst for core::Ptr { #[inline] fn as_raw_GeneralizedHoughGuil(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::imgproc::GeneralizedHoughGuil for core::Ptr { + impl crate::imgproc::GeneralizedHoughGuilTrait for core::Ptr { #[inline] fn as_raw_mut_GeneralizedHoughGuil(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::imgproc::GeneralizedHoughConst for core::Ptr { + impl crate::imgproc::GeneralizedHoughTraitConst for core::Ptr { #[inline] fn as_raw_GeneralizedHough(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::imgproc::GeneralizedHough for core::Ptr { + impl crate::imgproc::GeneralizedHoughTrait for core::Ptr { #[inline] fn as_raw_mut_GeneralizedHough(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLineSegmentDetector = core::Ptr; + pub type PtrOfLineSegmentDetector = core::Ptr; - ptr_extern! { dyn crate::imgproc::LineSegmentDetector, + ptr_extern! { crate::imgproc::LineSegmentDetector, cv_PtrOfLineSegmentDetector_delete, cv_PtrOfLineSegmentDetector_get_inner_ptr, cv_PtrOfLineSegmentDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLineSegmentDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLineSegmentDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::imgproc::LineSegmentDetectorConst for core::Ptr { + impl crate::imgproc::LineSegmentDetectorTraitConst for core::Ptr { #[inline] fn as_raw_LineSegmentDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::imgproc::LineSegmentDetector for core::Ptr { + impl crate::imgproc::LineSegmentDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_LineSegmentDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -10360,68 +10344,68 @@ pub use line_descriptor_types::*; mod mcc_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfMCC_CChecker = core::Ptr; + pub type PtrOfMCC_CChecker = core::Ptr; - ptr_extern! { dyn crate::mcc::MCC_CChecker, + ptr_extern! { crate::mcc::MCC_CChecker, cv_PtrOfMCC_CChecker_delete, cv_PtrOfMCC_CChecker_get_inner_ptr, cv_PtrOfMCC_CChecker_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMCC_CChecker(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMCC_CChecker(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::mcc::MCC_CCheckerConst for core::Ptr { + impl crate::mcc::MCC_CCheckerTraitConst for core::Ptr { #[inline] fn as_raw_MCC_CChecker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::mcc::MCC_CChecker for core::Ptr { + impl crate::mcc::MCC_CCheckerTrait for core::Ptr { #[inline] fn as_raw_mut_MCC_CChecker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfMCC_CCheckerDetector = core::Ptr; + pub type PtrOfMCC_CCheckerDetector = core::Ptr; - ptr_extern! { dyn crate::mcc::MCC_CCheckerDetector, + ptr_extern! { crate::mcc::MCC_CCheckerDetector, cv_PtrOfMCC_CCheckerDetector_delete, cv_PtrOfMCC_CCheckerDetector_get_inner_ptr, cv_PtrOfMCC_CCheckerDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMCC_CCheckerDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMCC_CCheckerDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::mcc::MCC_CCheckerDetectorConst for core::Ptr { + impl crate::mcc::MCC_CCheckerDetectorTraitConst for core::Ptr { #[inline] fn as_raw_MCC_CCheckerDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::mcc::MCC_CCheckerDetector for core::Ptr { + impl crate::mcc::MCC_CCheckerDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_MCC_CCheckerDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfMCC_CCheckerDraw = core::Ptr; + pub type PtrOfMCC_CCheckerDraw = core::Ptr; - ptr_extern! { dyn crate::mcc::MCC_CCheckerDraw, + ptr_extern! { crate::mcc::MCC_CCheckerDraw, cv_PtrOfMCC_CCheckerDraw_delete, cv_PtrOfMCC_CCheckerDraw_get_inner_ptr, cv_PtrOfMCC_CCheckerDraw_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMCC_CCheckerDraw(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMCC_CCheckerDraw(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::mcc::MCC_CCheckerDrawConst for core::Ptr { + impl crate::mcc::MCC_CCheckerDrawTraitConst for core::Ptr { #[inline] fn as_raw_MCC_CCheckerDraw(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::mcc::MCC_CCheckerDraw for core::Ptr { + impl crate::mcc::MCC_CCheckerDrawTrait for core::Ptr { #[inline] fn as_raw_mut_MCC_CCheckerDraw(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -10446,14 +10430,14 @@ mod mcc_types { #[inline] fn as_raw_mut_MCC_DetectorParameters(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type VectorOfPtrOfMCC_CChecker = core::Vector>; + pub type VectorOfPtrOfMCC_CChecker = core::Vector>; - impl core::Vector> { + impl core::Vector> { pub fn as_raw_VectorOfPtrOfMCC_CChecker(&self) -> extern_send!(Self) { self.as_raw() } pub fn as_raw_mut_VectorOfPtrOfMCC_CChecker(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - vector_extern! { core::Ptr, + vector_extern! { core::Ptr, cv_VectorOfPtrOfMCC_CChecker_new, cv_VectorOfPtrOfMCC_CChecker_delete, cv_VectorOfPtrOfMCC_CChecker_len, cv_VectorOfPtrOfMCC_CChecker_is_empty, cv_VectorOfPtrOfMCC_CChecker_capacity, cv_VectorOfPtrOfMCC_CChecker_shrink_to_fit, @@ -10462,7 +10446,7 @@ mod mcc_types { cv_VectorOfPtrOfMCC_CChecker_get, cv_VectorOfPtrOfMCC_CChecker_set, cv_VectorOfPtrOfMCC_CChecker_push, cv_VectorOfPtrOfMCC_CChecker_insert, } - vector_non_copy_or_bool! { core::Ptr } + vector_non_copy_or_bool! { core::Ptr } } #[cfg(ocvrs_has_module_mcc)] @@ -10472,256 +10456,256 @@ pub use mcc_types::*; mod ml_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfANN_MLP = core::Ptr; + pub type PtrOfANN_MLP = core::Ptr; - ptr_extern! { dyn crate::ml::ANN_MLP, + ptr_extern! { crate::ml::ANN_MLP, cv_PtrOfANN_MLP_delete, cv_PtrOfANN_MLP_get_inner_ptr, cv_PtrOfANN_MLP_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfANN_MLP(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfANN_MLP(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::ANN_MLPConst for core::Ptr { + impl crate::ml::ANN_MLPTraitConst for core::Ptr { #[inline] fn as_raw_ANN_MLP(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::ANN_MLP for core::Ptr { + impl crate::ml::ANN_MLPTrait for core::Ptr { #[inline] fn as_raw_mut_ANN_MLP(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBoost = core::Ptr; + pub type PtrOfBoost = core::Ptr; - ptr_extern! { dyn crate::ml::Boost, + ptr_extern! { crate::ml::Boost, cv_PtrOfBoost_delete, cv_PtrOfBoost_get_inner_ptr, cv_PtrOfBoost_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBoost(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBoost(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::BoostConst for core::Ptr { + impl crate::ml::BoostTraitConst for core::Ptr { #[inline] fn as_raw_Boost(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::Boost for core::Ptr { + impl crate::ml::BoostTrait for core::Ptr { #[inline] fn as_raw_mut_Boost(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::DTreesConst for core::Ptr { + impl crate::ml::DTreesTraitConst for core::Ptr { #[inline] fn as_raw_DTrees(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::DTrees for core::Ptr { + impl crate::ml::DTreesTrait for core::Ptr { #[inline] fn as_raw_mut_DTrees(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDTrees = core::Ptr; + pub type PtrOfDTrees = core::Ptr; - ptr_extern! { dyn crate::ml::DTrees, + ptr_extern! { crate::ml::DTrees, cv_PtrOfDTrees_delete, cv_PtrOfDTrees_get_inner_ptr, cv_PtrOfDTrees_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDTrees(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDTrees(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::DTreesConst for core::Ptr { + impl crate::ml::DTreesTraitConst for core::Ptr { #[inline] fn as_raw_DTrees(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::DTrees for core::Ptr { + impl crate::ml::DTreesTrait for core::Ptr { #[inline] fn as_raw_mut_DTrees(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfEM = core::Ptr; + pub type PtrOfEM = core::Ptr; - ptr_extern! { dyn crate::ml::EM, + ptr_extern! { crate::ml::EM, cv_PtrOfEM_delete, cv_PtrOfEM_get_inner_ptr, cv_PtrOfEM_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfEM(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfEM(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::EMConst for core::Ptr { + impl crate::ml::EMTraitConst for core::Ptr { #[inline] fn as_raw_EM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::EM for core::Ptr { + impl crate::ml::EMTrait for core::Ptr { #[inline] fn as_raw_mut_EM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfKNearest = core::Ptr; + pub type PtrOfKNearest = core::Ptr; - ptr_extern! { dyn crate::ml::KNearest, + ptr_extern! { crate::ml::KNearest, cv_PtrOfKNearest_delete, cv_PtrOfKNearest_get_inner_ptr, cv_PtrOfKNearest_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfKNearest(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfKNearest(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::KNearestConst for core::Ptr { + impl crate::ml::KNearestTraitConst for core::Ptr { #[inline] fn as_raw_KNearest(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::KNearest for core::Ptr { + impl crate::ml::KNearestTrait for core::Ptr { #[inline] fn as_raw_mut_KNearest(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLogisticRegression = core::Ptr; + pub type PtrOfLogisticRegression = core::Ptr; - ptr_extern! { dyn crate::ml::LogisticRegression, + ptr_extern! { crate::ml::LogisticRegression, cv_PtrOfLogisticRegression_delete, cv_PtrOfLogisticRegression_get_inner_ptr, cv_PtrOfLogisticRegression_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLogisticRegression(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLogisticRegression(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::LogisticRegressionConst for core::Ptr { + impl crate::ml::LogisticRegressionTraitConst for core::Ptr { #[inline] fn as_raw_LogisticRegression(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::LogisticRegression for core::Ptr { + impl crate::ml::LogisticRegressionTrait for core::Ptr { #[inline] fn as_raw_mut_LogisticRegression(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfNormalBayesClassifier = core::Ptr; + pub type PtrOfNormalBayesClassifier = core::Ptr; - ptr_extern! { dyn crate::ml::NormalBayesClassifier, + ptr_extern! { crate::ml::NormalBayesClassifier, cv_PtrOfNormalBayesClassifier_delete, cv_PtrOfNormalBayesClassifier_get_inner_ptr, cv_PtrOfNormalBayesClassifier_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfNormalBayesClassifier(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfNormalBayesClassifier(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::NormalBayesClassifierConst for core::Ptr { + impl crate::ml::NormalBayesClassifierTraitConst for core::Ptr { #[inline] fn as_raw_NormalBayesClassifier(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::NormalBayesClassifier for core::Ptr { + impl crate::ml::NormalBayesClassifierTrait for core::Ptr { #[inline] fn as_raw_mut_NormalBayesClassifier(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -10746,162 +10730,162 @@ mod ml_types { #[inline] fn as_raw_mut_ParamGrid(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfRTrees = core::Ptr; + pub type PtrOfRTrees = core::Ptr; - ptr_extern! { dyn crate::ml::RTrees, + ptr_extern! { crate::ml::RTrees, cv_PtrOfRTrees_delete, cv_PtrOfRTrees_get_inner_ptr, cv_PtrOfRTrees_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRTrees(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRTrees(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::RTreesConst for core::Ptr { + impl crate::ml::RTreesTraitConst for core::Ptr { #[inline] fn as_raw_RTrees(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::RTrees for core::Ptr { + impl crate::ml::RTreesTrait for core::Ptr { #[inline] fn as_raw_mut_RTrees(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::DTreesConst for core::Ptr { + impl crate::ml::DTreesTraitConst for core::Ptr { #[inline] fn as_raw_DTrees(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::DTrees for core::Ptr { + impl crate::ml::DTreesTrait for core::Ptr { #[inline] fn as_raw_mut_DTrees(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSVM = core::Ptr; + pub type PtrOfSVM = core::Ptr; - ptr_extern! { dyn crate::ml::SVM, + ptr_extern! { crate::ml::SVM, cv_PtrOfSVM_delete, cv_PtrOfSVM_get_inner_ptr, cv_PtrOfSVM_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSVM(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSVM(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::SVMConst for core::Ptr { + impl crate::ml::SVMTraitConst for core::Ptr { #[inline] fn as_raw_SVM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::SVM for core::Ptr { + impl crate::ml::SVMTrait for core::Ptr { #[inline] fn as_raw_mut_SVM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSVMSGD = core::Ptr; + pub type PtrOfSVMSGD = core::Ptr; - ptr_extern! { dyn crate::ml::SVMSGD, + ptr_extern! { crate::ml::SVMSGD, cv_PtrOfSVMSGD_delete, cv_PtrOfSVMSGD_get_inner_ptr, cv_PtrOfSVMSGD_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSVMSGD(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSVMSGD(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::SVMSGDConst for core::Ptr { + impl crate::ml::SVMSGDTraitConst for core::Ptr { #[inline] fn as_raw_SVMSGD(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::SVMSGD for core::Ptr { + impl crate::ml::SVMSGDTrait for core::Ptr { #[inline] fn as_raw_mut_SVMSGD(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ml::StatModelConst for core::Ptr { + impl crate::ml::StatModelTraitConst for core::Ptr { #[inline] fn as_raw_StatModel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::StatModel for core::Ptr { + impl crate::ml::StatModelTrait for core::Ptr { #[inline] fn as_raw_mut_StatModel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSVM_Kernel = core::Ptr; + pub type PtrOfSVM_Kernel = core::Ptr; - ptr_extern! { dyn crate::ml::SVM_Kernel, + ptr_extern! { crate::ml::SVM_Kernel, cv_PtrOfSVM_Kernel_delete, cv_PtrOfSVM_Kernel_get_inner_ptr, cv_PtrOfSVM_Kernel_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSVM_Kernel(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSVM_Kernel(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::SVM_KernelConst for core::Ptr { + impl crate::ml::SVM_KernelTraitConst for core::Ptr { #[inline] fn as_raw_SVM_Kernel(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::SVM_Kernel for core::Ptr { + impl crate::ml::SVM_KernelTrait for core::Ptr { #[inline] fn as_raw_mut_SVM_Kernel(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTrainData = core::Ptr; + pub type PtrOfTrainData = core::Ptr; - ptr_extern! { dyn crate::ml::TrainData, + ptr_extern! { crate::ml::TrainData, cv_PtrOfTrainData_delete, cv_PtrOfTrainData_get_inner_ptr, cv_PtrOfTrainData_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTrainData(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTrainData(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ml::TrainDataConst for core::Ptr { + impl crate::ml::TrainDataTraitConst for core::Ptr { #[inline] fn as_raw_TrainData(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ml::TrainData for core::Ptr { + impl crate::ml::TrainDataTrait for core::Ptr { #[inline] fn as_raw_mut_TrainData(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -10949,49 +10933,49 @@ pub use ml_types::*; mod objdetect_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfBaseCascadeClassifier = core::Ptr; + pub type PtrOfBaseCascadeClassifier = core::Ptr; - ptr_extern! { dyn crate::objdetect::BaseCascadeClassifier, + ptr_extern! { crate::objdetect::BaseCascadeClassifier, cv_PtrOfBaseCascadeClassifier_delete, cv_PtrOfBaseCascadeClassifier_get_inner_ptr, cv_PtrOfBaseCascadeClassifier_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBaseCascadeClassifier(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBaseCascadeClassifier(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::objdetect::BaseCascadeClassifierConst for core::Ptr { + impl crate::objdetect::BaseCascadeClassifierTraitConst for core::Ptr { #[inline] fn as_raw_BaseCascadeClassifier(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::objdetect::BaseCascadeClassifier for core::Ptr { + impl crate::objdetect::BaseCascadeClassifierTrait for core::Ptr { #[inline] fn as_raw_mut_BaseCascadeClassifier(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBaseCascadeClassifier_MaskGenerator = core::Ptr; + pub type PtrOfBaseCascadeClassifier_MaskGenerator = core::Ptr; - ptr_extern! { dyn crate::objdetect::BaseCascadeClassifier_MaskGenerator, + ptr_extern! { crate::objdetect::BaseCascadeClassifier_MaskGenerator, cv_PtrOfBaseCascadeClassifier_MaskGenerator_delete, cv_PtrOfBaseCascadeClassifier_MaskGenerator_get_inner_ptr, cv_PtrOfBaseCascadeClassifier_MaskGenerator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBaseCascadeClassifier_MaskGenerator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBaseCascadeClassifier_MaskGenerator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::objdetect::BaseCascadeClassifier_MaskGeneratorConst for core::Ptr { + impl crate::objdetect::BaseCascadeClassifier_MaskGeneratorTraitConst for core::Ptr { #[inline] fn as_raw_BaseCascadeClassifier_MaskGenerator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::objdetect::BaseCascadeClassifier_MaskGenerator for core::Ptr { + impl crate::objdetect::BaseCascadeClassifier_MaskGeneratorTrait for core::Ptr { #[inline] fn as_raw_mut_BaseCascadeClassifier_MaskGenerator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11045,22 +11029,22 @@ mod objdetect_types { #[inline] fn as_raw_mut_Board(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDetectionBasedTracker_IDetector = core::Ptr; + pub type PtrOfDetectionBasedTracker_IDetector = core::Ptr; - ptr_extern! { dyn crate::objdetect::DetectionBasedTracker_IDetector, + ptr_extern! { crate::objdetect::DetectionBasedTracker_IDetector, cv_PtrOfDetectionBasedTracker_IDetector_delete, cv_PtrOfDetectionBasedTracker_IDetector_get_inner_ptr, cv_PtrOfDetectionBasedTracker_IDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetectionBasedTracker_IDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetectionBasedTracker_IDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::objdetect::DetectionBasedTracker_IDetectorConst for core::Ptr { + impl crate::objdetect::DetectionBasedTracker_IDetectorTraitConst for core::Ptr { #[inline] fn as_raw_DetectionBasedTracker_IDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::objdetect::DetectionBasedTracker_IDetector for core::Ptr { + impl crate::objdetect::DetectionBasedTracker_IDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_DetectionBasedTracker_IDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11106,60 +11090,60 @@ mod objdetect_types { #[inline] fn as_raw_mut_Dictionary(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFaceDetectorYN = core::Ptr; + pub type PtrOfFaceDetectorYN = core::Ptr; - ptr_extern! { dyn crate::objdetect::FaceDetectorYN, + ptr_extern! { crate::objdetect::FaceDetectorYN, cv_PtrOfFaceDetectorYN_delete, cv_PtrOfFaceDetectorYN_get_inner_ptr, cv_PtrOfFaceDetectorYN_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFaceDetectorYN(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFaceDetectorYN(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::objdetect::FaceDetectorYNConst for core::Ptr { + impl crate::objdetect::FaceDetectorYNTraitConst for core::Ptr { #[inline] fn as_raw_FaceDetectorYN(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::objdetect::FaceDetectorYN for core::Ptr { + impl crate::objdetect::FaceDetectorYNTrait for core::Ptr { #[inline] fn as_raw_mut_FaceDetectorYN(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFaceRecognizerSF = core::Ptr; + pub type PtrOfFaceRecognizerSF = core::Ptr; - ptr_extern! { dyn crate::objdetect::FaceRecognizerSF, + ptr_extern! { crate::objdetect::FaceRecognizerSF, cv_PtrOfFaceRecognizerSF_delete, cv_PtrOfFaceRecognizerSF_get_inner_ptr, cv_PtrOfFaceRecognizerSF_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFaceRecognizerSF(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFaceRecognizerSF(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::objdetect::FaceRecognizerSFConst for core::Ptr { + impl crate::objdetect::FaceRecognizerSFTraitConst for core::Ptr { #[inline] fn as_raw_FaceRecognizerSF(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::objdetect::FaceRecognizerSF for core::Ptr { + impl crate::objdetect::FaceRecognizerSFTrait for core::Ptr { #[inline] fn as_raw_mut_FaceRecognizerSF(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfQRCodeEncoder = core::Ptr; + pub type PtrOfQRCodeEncoder = core::Ptr; - ptr_extern! { dyn crate::objdetect::QRCodeEncoder, + ptr_extern! { crate::objdetect::QRCodeEncoder, cv_PtrOfQRCodeEncoder_delete, cv_PtrOfQRCodeEncoder_get_inner_ptr, cv_PtrOfQRCodeEncoder_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfQRCodeEncoder(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfQRCodeEncoder(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::objdetect::QRCodeEncoderConst for core::Ptr { + impl crate::objdetect::QRCodeEncoderTraitConst for core::Ptr { #[inline] fn as_raw_QRCodeEncoder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::objdetect::QRCodeEncoder for core::Ptr { + impl crate::objdetect::QRCodeEncoderTrait for core::Ptr { #[inline] fn as_raw_mut_QRCodeEncoder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11225,73 +11209,73 @@ pub use objdetect_types::*; mod optflow_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfDenseRLOFOpticalFlow = core::Ptr; + pub type PtrOfDenseRLOFOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::optflow::DenseRLOFOpticalFlow, + ptr_extern! { crate::optflow::DenseRLOFOpticalFlow, cv_PtrOfDenseRLOFOpticalFlow_delete, cv_PtrOfDenseRLOFOpticalFlow_get_inner_ptr, cv_PtrOfDenseRLOFOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDenseRLOFOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDenseRLOFOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::optflow::DenseRLOFOpticalFlowConst for core::Ptr { + impl crate::optflow::DenseRLOFOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DenseRLOFOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::optflow::DenseRLOFOpticalFlow for core::Ptr { + impl crate::optflow::DenseRLOFOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DenseRLOFOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::DenseOpticalFlowConst for core::Ptr { + impl crate::video::DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::DenseOpticalFlow for core::Ptr { + impl crate::video::DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDualTVL1OpticalFlow = core::Ptr; + pub type PtrOfDualTVL1OpticalFlow = core::Ptr; - ptr_extern! { dyn crate::optflow::DualTVL1OpticalFlow, + ptr_extern! { crate::optflow::DualTVL1OpticalFlow, cv_PtrOfDualTVL1OpticalFlow_delete, cv_PtrOfDualTVL1OpticalFlow_get_inner_ptr, cv_PtrOfDualTVL1OpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDualTVL1OpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDualTVL1OpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::optflow::DualTVL1OpticalFlowConst for core::Ptr { + impl crate::optflow::DualTVL1OpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DualTVL1OpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::optflow::DualTVL1OpticalFlow for core::Ptr { + impl crate::optflow::DualTVL1OpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DualTVL1OpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::DenseOpticalFlowConst for core::Ptr { + impl crate::video::DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::DenseOpticalFlow for core::Ptr { + impl crate::video::DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11387,38 +11371,38 @@ mod optflow_types { #[inline] fn as_raw_mut_RLOFOpticalFlowParameter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSparseRLOFOpticalFlow = core::Ptr; + pub type PtrOfSparseRLOFOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::optflow::SparseRLOFOpticalFlow, + ptr_extern! { crate::optflow::SparseRLOFOpticalFlow, cv_PtrOfSparseRLOFOpticalFlow_delete, cv_PtrOfSparseRLOFOpticalFlow_get_inner_ptr, cv_PtrOfSparseRLOFOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSparseRLOFOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSparseRLOFOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::optflow::SparseRLOFOpticalFlowConst for core::Ptr { + impl crate::optflow::SparseRLOFOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_SparseRLOFOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::optflow::SparseRLOFOpticalFlow for core::Ptr { + impl crate::optflow::SparseRLOFOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_SparseRLOFOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::SparseOpticalFlowConst for core::Ptr { + impl crate::video::SparseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_SparseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::SparseOpticalFlow for core::Ptr { + impl crate::video::SparseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_SparseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11448,22 +11432,22 @@ pub use optflow_types::*; mod ovis_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfWindowScene = core::Ptr; + pub type PtrOfWindowScene = core::Ptr; - ptr_extern! { dyn crate::ovis::WindowScene, + ptr_extern! { crate::ovis::WindowScene, cv_PtrOfWindowScene_delete, cv_PtrOfWindowScene_get_inner_ptr, cv_PtrOfWindowScene_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfWindowScene(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfWindowScene(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ovis::WindowSceneConst for core::Ptr { + impl crate::ovis::WindowSceneTraitConst for core::Ptr { #[inline] fn as_raw_WindowScene(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ovis::WindowScene for core::Ptr { + impl crate::ovis::WindowSceneTrait for core::Ptr { #[inline] fn as_raw_mut_WindowScene(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11475,38 +11459,38 @@ pub use ovis_types::*; mod phase_unwrapping_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfHistogramPhaseUnwrapping = core::Ptr; + pub type PtrOfHistogramPhaseUnwrapping = core::Ptr; - ptr_extern! { dyn crate::phase_unwrapping::HistogramPhaseUnwrapping, + ptr_extern! { crate::phase_unwrapping::HistogramPhaseUnwrapping, cv_PtrOfHistogramPhaseUnwrapping_delete, cv_PtrOfHistogramPhaseUnwrapping_get_inner_ptr, cv_PtrOfHistogramPhaseUnwrapping_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfHistogramPhaseUnwrapping(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfHistogramPhaseUnwrapping(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::phase_unwrapping::HistogramPhaseUnwrappingConst for core::Ptr { + impl crate::phase_unwrapping::HistogramPhaseUnwrappingTraitConst for core::Ptr { #[inline] fn as_raw_HistogramPhaseUnwrapping(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::phase_unwrapping::HistogramPhaseUnwrapping for core::Ptr { + impl crate::phase_unwrapping::HistogramPhaseUnwrappingTrait for core::Ptr { #[inline] fn as_raw_mut_HistogramPhaseUnwrapping(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::phase_unwrapping::PhaseUnwrappingConst for core::Ptr { + impl crate::phase_unwrapping::PhaseUnwrappingTraitConst for core::Ptr { #[inline] fn as_raw_PhaseUnwrapping(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::phase_unwrapping::PhaseUnwrapping for core::Ptr { + impl crate::phase_unwrapping::PhaseUnwrappingTrait for core::Ptr { #[inline] fn as_raw_mut_PhaseUnwrapping(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11518,345 +11502,345 @@ pub use phase_unwrapping_types::*; mod photo_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfAlignMTB = core::Ptr; + pub type PtrOfAlignMTB = core::Ptr; - ptr_extern! { dyn crate::photo::AlignMTB, + ptr_extern! { crate::photo::AlignMTB, cv_PtrOfAlignMTB_delete, cv_PtrOfAlignMTB_get_inner_ptr, cv_PtrOfAlignMTB_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfAlignMTB(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfAlignMTB(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::AlignMTBConst for core::Ptr { + impl crate::photo::AlignMTBTraitConst for core::Ptr { #[inline] fn as_raw_AlignMTB(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::AlignMTB for core::Ptr { + impl crate::photo::AlignMTBTrait for core::Ptr { #[inline] fn as_raw_mut_AlignMTB(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::AlignExposuresConst for core::Ptr { + impl crate::photo::AlignExposuresTraitConst for core::Ptr { #[inline] fn as_raw_AlignExposures(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::AlignExposures for core::Ptr { + impl crate::photo::AlignExposuresTrait for core::Ptr { #[inline] fn as_raw_mut_AlignExposures(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCalibrateDebevec = core::Ptr; + pub type PtrOfCalibrateDebevec = core::Ptr; - ptr_extern! { dyn crate::photo::CalibrateDebevec, + ptr_extern! { crate::photo::CalibrateDebevec, cv_PtrOfCalibrateDebevec_delete, cv_PtrOfCalibrateDebevec_get_inner_ptr, cv_PtrOfCalibrateDebevec_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCalibrateDebevec(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCalibrateDebevec(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::CalibrateDebevecConst for core::Ptr { + impl crate::photo::CalibrateDebevecTraitConst for core::Ptr { #[inline] fn as_raw_CalibrateDebevec(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::CalibrateDebevec for core::Ptr { + impl crate::photo::CalibrateDebevecTrait for core::Ptr { #[inline] fn as_raw_mut_CalibrateDebevec(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::CalibrateCRFConst for core::Ptr { + impl crate::photo::CalibrateCRFTraitConst for core::Ptr { #[inline] fn as_raw_CalibrateCRF(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::CalibrateCRF for core::Ptr { + impl crate::photo::CalibrateCRFTrait for core::Ptr { #[inline] fn as_raw_mut_CalibrateCRF(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfCalibrateRobertson = core::Ptr; + pub type PtrOfCalibrateRobertson = core::Ptr; - ptr_extern! { dyn crate::photo::CalibrateRobertson, + ptr_extern! { crate::photo::CalibrateRobertson, cv_PtrOfCalibrateRobertson_delete, cv_PtrOfCalibrateRobertson_get_inner_ptr, cv_PtrOfCalibrateRobertson_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfCalibrateRobertson(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfCalibrateRobertson(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::CalibrateRobertsonConst for core::Ptr { + impl crate::photo::CalibrateRobertsonTraitConst for core::Ptr { #[inline] fn as_raw_CalibrateRobertson(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::CalibrateRobertson for core::Ptr { + impl crate::photo::CalibrateRobertsonTrait for core::Ptr { #[inline] fn as_raw_mut_CalibrateRobertson(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::CalibrateCRFConst for core::Ptr { + impl crate::photo::CalibrateCRFTraitConst for core::Ptr { #[inline] fn as_raw_CalibrateCRF(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::CalibrateCRF for core::Ptr { + impl crate::photo::CalibrateCRFTrait for core::Ptr { #[inline] fn as_raw_mut_CalibrateCRF(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfMergeDebevec = core::Ptr; + pub type PtrOfMergeDebevec = core::Ptr; - ptr_extern! { dyn crate::photo::MergeDebevec, + ptr_extern! { crate::photo::MergeDebevec, cv_PtrOfMergeDebevec_delete, cv_PtrOfMergeDebevec_get_inner_ptr, cv_PtrOfMergeDebevec_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMergeDebevec(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMergeDebevec(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::MergeDebevecConst for core::Ptr { + impl crate::photo::MergeDebevecTraitConst for core::Ptr { #[inline] fn as_raw_MergeDebevec(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::MergeDebevec for core::Ptr { + impl crate::photo::MergeDebevecTrait for core::Ptr { #[inline] fn as_raw_mut_MergeDebevec(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::MergeExposuresConst for core::Ptr { + impl crate::photo::MergeExposuresTraitConst for core::Ptr { #[inline] fn as_raw_MergeExposures(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::MergeExposures for core::Ptr { + impl crate::photo::MergeExposuresTrait for core::Ptr { #[inline] fn as_raw_mut_MergeExposures(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfMergeMertens = core::Ptr; + pub type PtrOfMergeMertens = core::Ptr; - ptr_extern! { dyn crate::photo::MergeMertens, + ptr_extern! { crate::photo::MergeMertens, cv_PtrOfMergeMertens_delete, cv_PtrOfMergeMertens_get_inner_ptr, cv_PtrOfMergeMertens_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMergeMertens(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMergeMertens(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::MergeMertensConst for core::Ptr { + impl crate::photo::MergeMertensTraitConst for core::Ptr { #[inline] fn as_raw_MergeMertens(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::MergeMertens for core::Ptr { + impl crate::photo::MergeMertensTrait for core::Ptr { #[inline] fn as_raw_mut_MergeMertens(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::MergeExposuresConst for core::Ptr { + impl crate::photo::MergeExposuresTraitConst for core::Ptr { #[inline] fn as_raw_MergeExposures(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::MergeExposures for core::Ptr { + impl crate::photo::MergeExposuresTrait for core::Ptr { #[inline] fn as_raw_mut_MergeExposures(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfMergeRobertson = core::Ptr; + pub type PtrOfMergeRobertson = core::Ptr; - ptr_extern! { dyn crate::photo::MergeRobertson, + ptr_extern! { crate::photo::MergeRobertson, cv_PtrOfMergeRobertson_delete, cv_PtrOfMergeRobertson_get_inner_ptr, cv_PtrOfMergeRobertson_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMergeRobertson(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMergeRobertson(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::MergeRobertsonConst for core::Ptr { + impl crate::photo::MergeRobertsonTraitConst for core::Ptr { #[inline] fn as_raw_MergeRobertson(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::MergeRobertson for core::Ptr { + impl crate::photo::MergeRobertsonTrait for core::Ptr { #[inline] fn as_raw_mut_MergeRobertson(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::MergeExposuresConst for core::Ptr { + impl crate::photo::MergeExposuresTraitConst for core::Ptr { #[inline] fn as_raw_MergeExposures(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::MergeExposures for core::Ptr { + impl crate::photo::MergeExposuresTrait for core::Ptr { #[inline] fn as_raw_mut_MergeExposures(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTonemap = core::Ptr; + pub type PtrOfTonemap = core::Ptr; - ptr_extern! { dyn crate::photo::Tonemap, + ptr_extern! { crate::photo::Tonemap, cv_PtrOfTonemap_delete, cv_PtrOfTonemap_get_inner_ptr, cv_PtrOfTonemap_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTonemap(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTonemap(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::TonemapConst for core::Ptr { + impl crate::photo::TonemapTraitConst for core::Ptr { #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::Tonemap for core::Ptr { + impl crate::photo::TonemapTrait for core::Ptr { #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTonemapDrago = core::Ptr; + pub type PtrOfTonemapDrago = core::Ptr; - ptr_extern! { dyn crate::photo::TonemapDrago, + ptr_extern! { crate::photo::TonemapDrago, cv_PtrOfTonemapDrago_delete, cv_PtrOfTonemapDrago_get_inner_ptr, cv_PtrOfTonemapDrago_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTonemapDrago(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTonemapDrago(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::TonemapDragoConst for core::Ptr { + impl crate::photo::TonemapDragoTraitConst for core::Ptr { #[inline] fn as_raw_TonemapDrago(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::TonemapDrago for core::Ptr { + impl crate::photo::TonemapDragoTrait for core::Ptr { #[inline] fn as_raw_mut_TonemapDrago(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::TonemapConst for core::Ptr { + impl crate::photo::TonemapTraitConst for core::Ptr { #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::Tonemap for core::Ptr { + impl crate::photo::TonemapTrait for core::Ptr { #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTonemapMantiuk = core::Ptr; + pub type PtrOfTonemapMantiuk = core::Ptr; - ptr_extern! { dyn crate::photo::TonemapMantiuk, + ptr_extern! { crate::photo::TonemapMantiuk, cv_PtrOfTonemapMantiuk_delete, cv_PtrOfTonemapMantiuk_get_inner_ptr, cv_PtrOfTonemapMantiuk_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTonemapMantiuk(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTonemapMantiuk(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::TonemapMantiukConst for core::Ptr { + impl crate::photo::TonemapMantiukTraitConst for core::Ptr { #[inline] fn as_raw_TonemapMantiuk(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::TonemapMantiuk for core::Ptr { + impl crate::photo::TonemapMantiukTrait for core::Ptr { #[inline] fn as_raw_mut_TonemapMantiuk(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::TonemapConst for core::Ptr { + impl crate::photo::TonemapTraitConst for core::Ptr { #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::Tonemap for core::Ptr { + impl crate::photo::TonemapTrait for core::Ptr { #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTonemapReinhard = core::Ptr; + pub type PtrOfTonemapReinhard = core::Ptr; - ptr_extern! { dyn crate::photo::TonemapReinhard, + ptr_extern! { crate::photo::TonemapReinhard, cv_PtrOfTonemapReinhard_delete, cv_PtrOfTonemapReinhard_get_inner_ptr, cv_PtrOfTonemapReinhard_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTonemapReinhard(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTonemapReinhard(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::photo::TonemapReinhardConst for core::Ptr { + impl crate::photo::TonemapReinhardTraitConst for core::Ptr { #[inline] fn as_raw_TonemapReinhard(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::TonemapReinhard for core::Ptr { + impl crate::photo::TonemapReinhardTrait for core::Ptr { #[inline] fn as_raw_mut_TonemapReinhard(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::TonemapConst for core::Ptr { + impl crate::photo::TonemapTraitConst for core::Ptr { #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::Tonemap for core::Ptr { + impl crate::photo::TonemapTrait for core::Ptr { #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11868,30 +11852,30 @@ pub use photo_types::*; mod plot_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfPlot2d = core::Ptr; + pub type PtrOfPlot2d = core::Ptr; - ptr_extern! { dyn crate::plot::Plot2d, + ptr_extern! { crate::plot::Plot2d, cv_PtrOfPlot2d_delete, cv_PtrOfPlot2d_get_inner_ptr, cv_PtrOfPlot2d_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfPlot2d(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfPlot2d(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::plot::Plot2dConst for core::Ptr { + impl crate::plot::Plot2dTraitConst for core::Ptr { #[inline] fn as_raw_Plot2d(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::plot::Plot2d for core::Ptr { + impl crate::plot::Plot2dTrait for core::Ptr { #[inline] fn as_raw_mut_Plot2d(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11932,11 +11916,11 @@ mod quality_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::quality::QualityBaseConst for core::Ptr { + impl crate::quality::QualityBaseTraitConst for core::Ptr { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::quality::QualityBase for core::Ptr { + impl crate::quality::QualityBaseTrait for core::Ptr { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -11969,11 +11953,11 @@ mod quality_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::quality::QualityBaseConst for core::Ptr { + impl crate::quality::QualityBaseTraitConst for core::Ptr { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::quality::QualityBase for core::Ptr { + impl crate::quality::QualityBaseTrait for core::Ptr { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12006,11 +11990,11 @@ mod quality_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::quality::QualityBaseConst for core::Ptr { + impl crate::quality::QualityBaseTraitConst for core::Ptr { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::quality::QualityBase for core::Ptr { + impl crate::quality::QualityBaseTrait for core::Ptr { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12043,11 +12027,11 @@ mod quality_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::quality::QualityBaseConst for core::Ptr { + impl crate::quality::QualityBaseTraitConst for core::Ptr { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::quality::QualityBase for core::Ptr { + impl crate::quality::QualityBaseTrait for core::Ptr { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12080,11 +12064,11 @@ mod quality_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::quality::QualityBaseConst for core::Ptr { + impl crate::quality::QualityBaseTraitConst for core::Ptr { #[inline] fn as_raw_QualityBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::quality::QualityBase for core::Ptr { + impl crate::quality::QualityBaseTrait for core::Ptr { #[inline] fn as_raw_mut_QualityBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12096,73 +12080,73 @@ pub use quality_types::*; mod rapid_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfOLSTracker = core::Ptr; + pub type PtrOfOLSTracker = core::Ptr; - ptr_extern! { dyn crate::rapid::OLSTracker, + ptr_extern! { crate::rapid::OLSTracker, cv_PtrOfOLSTracker_delete, cv_PtrOfOLSTracker_get_inner_ptr, cv_PtrOfOLSTracker_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfOLSTracker(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfOLSTracker(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rapid::OLSTrackerConst for core::Ptr { + impl crate::rapid::OLSTrackerTraitConst for core::Ptr { #[inline] fn as_raw_OLSTracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rapid::OLSTracker for core::Ptr { + impl crate::rapid::OLSTrackerTrait for core::Ptr { #[inline] fn as_raw_mut_OLSTracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::rapid::TrackerConst for core::Ptr { + impl crate::rapid::TrackerTraitConst for core::Ptr { #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rapid::Tracker for core::Ptr { + impl crate::rapid::TrackerTrait for core::Ptr { #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfRapid = core::Ptr; + pub type PtrOfRapid = core::Ptr; - ptr_extern! { dyn crate::rapid::Rapid, + ptr_extern! { crate::rapid::Rapid, cv_PtrOfRapid_delete, cv_PtrOfRapid_get_inner_ptr, cv_PtrOfRapid_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRapid(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRapid(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rapid::RapidConst for core::Ptr { + impl crate::rapid::RapidTraitConst for core::Ptr { #[inline] fn as_raw_Rapid(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rapid::Rapid for core::Ptr { + impl crate::rapid::RapidTrait for core::Ptr { #[inline] fn as_raw_mut_Rapid(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::rapid::TrackerConst for core::Ptr { + impl crate::rapid::TrackerTraitConst for core::Ptr { #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rapid::Tracker for core::Ptr { + impl crate::rapid::TrackerTrait for core::Ptr { #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12174,22 +12158,22 @@ pub use rapid_types::*; mod rgbd_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfColoredKinfu_ColoredKinFu = core::Ptr; + pub type PtrOfColoredKinfu_ColoredKinFu = core::Ptr; - ptr_extern! { dyn crate::rgbd::ColoredKinfu_ColoredKinFu, + ptr_extern! { crate::rgbd::ColoredKinfu_ColoredKinFu, cv_PtrOfColoredKinfu_ColoredKinFu_delete, cv_PtrOfColoredKinfu_ColoredKinFu_get_inner_ptr, cv_PtrOfColoredKinfu_ColoredKinFu_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfColoredKinfu_ColoredKinFu(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfColoredKinfu_ColoredKinFu(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::ColoredKinfu_ColoredKinFuConst for core::Ptr { + impl crate::rgbd::ColoredKinfu_ColoredKinFuTraitConst for core::Ptr { #[inline] fn as_raw_ColoredKinfu_ColoredKinFu(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::ColoredKinfu_ColoredKinFu for core::Ptr { + impl crate::rgbd::ColoredKinfu_ColoredKinFuTrait for core::Ptr { #[inline] fn as_raw_mut_ColoredKinfu_ColoredKinFu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12243,22 +12227,22 @@ mod rgbd_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDynafu_DynaFu = core::Ptr; + pub type PtrOfDynafu_DynaFu = core::Ptr; - ptr_extern! { dyn crate::rgbd::Dynafu_DynaFu, + ptr_extern! { crate::rgbd::Dynafu_DynaFu, cv_PtrOfDynafu_DynaFu_delete, cv_PtrOfDynafu_DynaFu_get_inner_ptr, cv_PtrOfDynafu_DynaFu_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDynafu_DynaFu(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDynafu_DynaFu(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::Dynafu_DynaFuConst for core::Ptr { + impl crate::rgbd::Dynafu_DynaFuTraitConst for core::Ptr { #[inline] fn as_raw_Dynafu_DynaFu(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Dynafu_DynaFu for core::Ptr { + impl crate::rgbd::Dynafu_DynaFuTrait for core::Ptr { #[inline] fn as_raw_mut_Dynafu_DynaFu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12291,11 +12275,11 @@ mod rgbd_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::rgbd::OdometryConst for core::Ptr { + impl crate::rgbd::OdometryTraitConst for core::Ptr { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Odometry for core::Ptr { + impl crate::rgbd::OdometryTrait for core::Ptr { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12328,49 +12312,49 @@ mod rgbd_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::rgbd::OdometryConst for core::Ptr { + impl crate::rgbd::OdometryTraitConst for core::Ptr { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Odometry for core::Ptr { + impl crate::rgbd::OdometryTrait for core::Ptr { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfKinfu_Detail_PoseGraph = core::Ptr; + pub type PtrOfKinfu_Detail_PoseGraph = core::Ptr; - ptr_extern! { dyn crate::rgbd::Kinfu_Detail_PoseGraph, + ptr_extern! { crate::rgbd::Kinfu_Detail_PoseGraph, cv_PtrOfKinfu_Detail_PoseGraph_delete, cv_PtrOfKinfu_Detail_PoseGraph_get_inner_ptr, cv_PtrOfKinfu_Detail_PoseGraph_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfKinfu_Detail_PoseGraph(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfKinfu_Detail_PoseGraph(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::Kinfu_Detail_PoseGraphConst for core::Ptr { + impl crate::rgbd::Kinfu_Detail_PoseGraphTraitConst for core::Ptr { #[inline] fn as_raw_Kinfu_Detail_PoseGraph(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Kinfu_Detail_PoseGraph for core::Ptr { + impl crate::rgbd::Kinfu_Detail_PoseGraphTrait for core::Ptr { #[inline] fn as_raw_mut_Kinfu_Detail_PoseGraph(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfKinfu_KinFu = core::Ptr; + pub type PtrOfKinfu_KinFu = core::Ptr; - ptr_extern! { dyn crate::rgbd::Kinfu_KinFu, + ptr_extern! { crate::rgbd::Kinfu_KinFu, cv_PtrOfKinfu_KinFu_delete, cv_PtrOfKinfu_KinFu_get_inner_ptr, cv_PtrOfKinfu_KinFu_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfKinfu_KinFu(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfKinfu_KinFu(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::Kinfu_KinFuConst for core::Ptr { + impl crate::rgbd::Kinfu_KinFuTraitConst for core::Ptr { #[inline] fn as_raw_Kinfu_KinFu(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Kinfu_KinFu for core::Ptr { + impl crate::rgbd::Kinfu_KinFuTrait for core::Ptr { #[inline] fn as_raw_mut_Kinfu_KinFu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12395,22 +12379,22 @@ mod rgbd_types { #[inline] fn as_raw_mut_Kinfu_Params(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfKinfu_Volume = core::Ptr; + pub type PtrOfKinfu_Volume = core::Ptr; - ptr_extern! { dyn crate::rgbd::Kinfu_Volume, + ptr_extern! { crate::rgbd::Kinfu_Volume, cv_PtrOfKinfu_Volume_delete, cv_PtrOfKinfu_Volume_get_inner_ptr, cv_PtrOfKinfu_Volume_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfKinfu_Volume(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfKinfu_Volume(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::Kinfu_VolumeConst for core::Ptr { + impl crate::rgbd::Kinfu_VolumeTraitConst for core::Ptr { #[inline] fn as_raw_Kinfu_Volume(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Kinfu_Volume for core::Ptr { + impl crate::rgbd::Kinfu_VolumeTrait for core::Ptr { #[inline] fn as_raw_mut_Kinfu_Volume(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12435,22 +12419,22 @@ mod rgbd_types { #[inline] fn as_raw_mut_Kinfu_VolumeParams(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLargeKinfu = core::Ptr; + pub type PtrOfLargeKinfu = core::Ptr; - ptr_extern! { dyn crate::rgbd::LargeKinfu, + ptr_extern! { crate::rgbd::LargeKinfu, cv_PtrOfLargeKinfu_delete, cv_PtrOfLargeKinfu_get_inner_ptr, cv_PtrOfLargeKinfu_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLargeKinfu(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLargeKinfu(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::LargeKinfuConst for core::Ptr { + impl crate::rgbd::LargeKinfuTraitConst for core::Ptr { #[inline] fn as_raw_LargeKinfu(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::LargeKinfu for core::Ptr { + impl crate::rgbd::LargeKinfuTrait for core::Ptr { #[inline] fn as_raw_mut_LargeKinfu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12475,11 +12459,11 @@ mod rgbd_types { #[inline] fn as_raw_mut_Linemod_ColorGradient(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::rgbd::Linemod_ModalityConst for core::Ptr { + impl crate::rgbd::Linemod_ModalityTraitConst for core::Ptr { #[inline] fn as_raw_Linemod_Modality(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Linemod_Modality for core::Ptr { + impl crate::rgbd::Linemod_ModalityTrait for core::Ptr { #[inline] fn as_raw_mut_Linemod_Modality(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12504,11 +12488,11 @@ mod rgbd_types { #[inline] fn as_raw_mut_Linemod_DepthNormal(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::rgbd::Linemod_ModalityConst for core::Ptr { + impl crate::rgbd::Linemod_ModalityTraitConst for core::Ptr { #[inline] fn as_raw_Linemod_Modality(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Linemod_Modality for core::Ptr { + impl crate::rgbd::Linemod_ModalityTrait for core::Ptr { #[inline] fn as_raw_mut_Linemod_Modality(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12533,68 +12517,68 @@ mod rgbd_types { #[inline] fn as_raw_mut_Linemod_Detector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLinemod_Modality = core::Ptr; + pub type PtrOfLinemod_Modality = core::Ptr; - ptr_extern! { dyn crate::rgbd::Linemod_Modality, + ptr_extern! { crate::rgbd::Linemod_Modality, cv_PtrOfLinemod_Modality_delete, cv_PtrOfLinemod_Modality_get_inner_ptr, cv_PtrOfLinemod_Modality_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLinemod_Modality(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLinemod_Modality(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::Linemod_ModalityConst for core::Ptr { + impl crate::rgbd::Linemod_ModalityTraitConst for core::Ptr { #[inline] fn as_raw_Linemod_Modality(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Linemod_Modality for core::Ptr { + impl crate::rgbd::Linemod_ModalityTrait for core::Ptr { #[inline] fn as_raw_mut_Linemod_Modality(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLinemod_QuantizedPyramid = core::Ptr; + pub type PtrOfLinemod_QuantizedPyramid = core::Ptr; - ptr_extern! { dyn crate::rgbd::Linemod_QuantizedPyramid, + ptr_extern! { crate::rgbd::Linemod_QuantizedPyramid, cv_PtrOfLinemod_QuantizedPyramid_delete, cv_PtrOfLinemod_QuantizedPyramid_get_inner_ptr, cv_PtrOfLinemod_QuantizedPyramid_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLinemod_QuantizedPyramid(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLinemod_QuantizedPyramid(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::Linemod_QuantizedPyramidConst for core::Ptr { + impl crate::rgbd::Linemod_QuantizedPyramidTraitConst for core::Ptr { #[inline] fn as_raw_Linemod_QuantizedPyramid(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Linemod_QuantizedPyramid for core::Ptr { + impl crate::rgbd::Linemod_QuantizedPyramidTrait for core::Ptr { #[inline] fn as_raw_mut_Linemod_QuantizedPyramid(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfOdometry = core::Ptr; + pub type PtrOfOdometry = core::Ptr; - ptr_extern! { dyn crate::rgbd::Odometry, + ptr_extern! { crate::rgbd::Odometry, cv_PtrOfOdometry_delete, cv_PtrOfOdometry_get_inner_ptr, cv_PtrOfOdometry_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfOdometry(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfOdometry(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::rgbd::OdometryConst for core::Ptr { + impl crate::rgbd::OdometryTraitConst for core::Ptr { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Odometry for core::Ptr { + impl crate::rgbd::OdometryTrait for core::Ptr { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12698,11 +12682,11 @@ mod rgbd_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::rgbd::OdometryConst for core::Ptr { + impl crate::rgbd::OdometryTraitConst for core::Ptr { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Odometry for core::Ptr { + impl crate::rgbd::OdometryTrait for core::Ptr { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12764,11 +12748,11 @@ mod rgbd_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::rgbd::OdometryConst for core::Ptr { + impl crate::rgbd::OdometryTraitConst for core::Ptr { #[inline] fn as_raw_Odometry(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::rgbd::Odometry for core::Ptr { + impl crate::rgbd::OdometryTrait for core::Ptr { #[inline] fn as_raw_mut_Odometry(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12858,14 +12842,14 @@ mod rgbd_types { } vector_non_copy_or_bool! { clone crate::rgbd::Linemod_Template } - pub type VectorOfPtrOfLinemod_Modality = core::Vector>; + pub type VectorOfPtrOfLinemod_Modality = core::Vector>; - impl core::Vector> { + impl core::Vector> { pub fn as_raw_VectorOfPtrOfLinemod_Modality(&self) -> extern_send!(Self) { self.as_raw() } pub fn as_raw_mut_VectorOfPtrOfLinemod_Modality(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - vector_extern! { core::Ptr, + vector_extern! { core::Ptr, cv_VectorOfPtrOfLinemod_Modality_new, cv_VectorOfPtrOfLinemod_Modality_delete, cv_VectorOfPtrOfLinemod_Modality_len, cv_VectorOfPtrOfLinemod_Modality_is_empty, cv_VectorOfPtrOfLinemod_Modality_capacity, cv_VectorOfPtrOfLinemod_Modality_shrink_to_fit, @@ -12874,7 +12858,7 @@ mod rgbd_types { cv_VectorOfPtrOfLinemod_Modality_get, cv_VectorOfPtrOfLinemod_Modality_set, cv_VectorOfPtrOfLinemod_Modality_push, cv_VectorOfPtrOfLinemod_Modality_insert, } - vector_non_copy_or_bool! { core::Ptr } + vector_non_copy_or_bool! { core::Ptr } } #[cfg(ocvrs_has_module_rgbd)] @@ -12913,19 +12897,19 @@ mod saliency_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::saliency::MotionSaliencyConst for core::Ptr { + impl crate::saliency::MotionSaliencyTraitConst for core::Ptr { #[inline] fn as_raw_MotionSaliency(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::saliency::MotionSaliency for core::Ptr { + impl crate::saliency::MotionSaliencyTrait for core::Ptr { #[inline] fn as_raw_mut_MotionSaliency(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::saliency::SaliencyConst for core::Ptr { + impl crate::saliency::SaliencyTraitConst for core::Ptr { #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::saliency::Saliency for core::Ptr { + impl crate::saliency::SaliencyTrait for core::Ptr { #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -12958,19 +12942,19 @@ mod saliency_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::saliency::ObjectnessConst for core::Ptr { + impl crate::saliency::ObjectnessTraitConst for core::Ptr { #[inline] fn as_raw_Objectness(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::saliency::Objectness for core::Ptr { + impl crate::saliency::ObjectnessTrait for core::Ptr { #[inline] fn as_raw_mut_Objectness(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::saliency::SaliencyConst for core::Ptr { + impl crate::saliency::SaliencyTraitConst for core::Ptr { #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::saliency::Saliency for core::Ptr { + impl crate::saliency::SaliencyTrait for core::Ptr { #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -13003,19 +12987,19 @@ mod saliency_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::saliency::SaliencyConst for core::Ptr { + impl crate::saliency::SaliencyTraitConst for core::Ptr { #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::saliency::Saliency for core::Ptr { + impl crate::saliency::SaliencyTrait for core::Ptr { #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::saliency::StaticSaliencyConst for core::Ptr { + impl crate::saliency::StaticSaliencyTraitConst for core::Ptr { #[inline] fn as_raw_StaticSaliency(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::saliency::StaticSaliency for core::Ptr { + impl crate::saliency::StaticSaliencyTrait for core::Ptr { #[inline] fn as_raw_mut_StaticSaliency(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -13048,19 +13032,19 @@ mod saliency_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::saliency::SaliencyConst for core::Ptr { + impl crate::saliency::SaliencyTraitConst for core::Ptr { #[inline] fn as_raw_Saliency(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::saliency::Saliency for core::Ptr { + impl crate::saliency::SaliencyTrait for core::Ptr { #[inline] fn as_raw_mut_Saliency(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::saliency::StaticSaliencyConst for core::Ptr { + impl crate::saliency::StaticSaliencyTraitConst for core::Ptr { #[inline] fn as_raw_StaticSaliency(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::saliency::StaticSaliency for core::Ptr { + impl crate::saliency::StaticSaliencyTrait for core::Ptr { #[inline] fn as_raw_mut_StaticSaliency(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -13072,30 +13056,30 @@ pub use saliency_types::*; mod sfm_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfSFMLibmvEuclideanReconstruction = core::Ptr; + pub type PtrOfSFMLibmvEuclideanReconstruction = core::Ptr; - ptr_extern! { dyn crate::sfm::SFMLibmvEuclideanReconstruction, + ptr_extern! { crate::sfm::SFMLibmvEuclideanReconstruction, cv_PtrOfSFMLibmvEuclideanReconstruction_delete, cv_PtrOfSFMLibmvEuclideanReconstruction_get_inner_ptr, cv_PtrOfSFMLibmvEuclideanReconstruction_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSFMLibmvEuclideanReconstruction(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSFMLibmvEuclideanReconstruction(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::sfm::SFMLibmvEuclideanReconstructionConst for core::Ptr { + impl crate::sfm::SFMLibmvEuclideanReconstructionTraitConst for core::Ptr { #[inline] fn as_raw_SFMLibmvEuclideanReconstruction(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::sfm::SFMLibmvEuclideanReconstruction for core::Ptr { + impl crate::sfm::SFMLibmvEuclideanReconstructionTrait for core::Ptr { #[inline] fn as_raw_mut_SFMLibmvEuclideanReconstruction(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::sfm::BaseSFMConst for core::Ptr { + impl crate::sfm::BaseSFMTraitConst for core::Ptr { #[inline] fn as_raw_BaseSFM(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::sfm::BaseSFM for core::Ptr { + impl crate::sfm::BaseSFMTrait for core::Ptr { #[inline] fn as_raw_mut_BaseSFM(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -13107,351 +13091,351 @@ pub use sfm_types::*; mod shape_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfAffineTransformer = core::Ptr; + pub type PtrOfAffineTransformer = core::Ptr; - ptr_extern! { dyn crate::shape::AffineTransformer, + ptr_extern! { crate::shape::AffineTransformer, cv_PtrOfAffineTransformer_delete, cv_PtrOfAffineTransformer_get_inner_ptr, cv_PtrOfAffineTransformer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfAffineTransformer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfAffineTransformer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::AffineTransformerConst for core::Ptr { + impl crate::shape::AffineTransformerTraitConst for core::Ptr { #[inline] fn as_raw_AffineTransformer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::AffineTransformer for core::Ptr { + impl crate::shape::AffineTransformerTrait for core::Ptr { #[inline] fn as_raw_mut_AffineTransformer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::shape::ShapeTransformerConst for core::Ptr { + impl crate::shape::ShapeTransformerTraitConst for core::Ptr { #[inline] fn as_raw_ShapeTransformer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::ShapeTransformer for core::Ptr { + impl crate::shape::ShapeTransformerTrait for core::Ptr { #[inline] fn as_raw_mut_ShapeTransformer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfAffineTransformer, core::Ptr, cv_PtrOfAffineTransformer_to_PtrOfShapeTransformer } + ptr_cast_base! { PtrOfAffineTransformer, core::Ptr, cv_PtrOfAffineTransformer_to_PtrOfShapeTransformer } - pub type PtrOfChiHistogramCostExtractor = core::Ptr; + pub type PtrOfChiHistogramCostExtractor = core::Ptr; - ptr_extern! { dyn crate::shape::ChiHistogramCostExtractor, + ptr_extern! { crate::shape::ChiHistogramCostExtractor, cv_PtrOfChiHistogramCostExtractor_delete, cv_PtrOfChiHistogramCostExtractor_get_inner_ptr, cv_PtrOfChiHistogramCostExtractor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfChiHistogramCostExtractor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfChiHistogramCostExtractor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::ChiHistogramCostExtractorConst for core::Ptr { + impl crate::shape::ChiHistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_ChiHistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::ChiHistogramCostExtractor for core::Ptr { + impl crate::shape::ChiHistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_ChiHistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::shape::HistogramCostExtractorConst for core::Ptr { + impl crate::shape::HistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::HistogramCostExtractor for core::Ptr { + impl crate::shape::HistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfChiHistogramCostExtractor, core::Ptr, cv_PtrOfChiHistogramCostExtractor_to_PtrOfHistogramCostExtractor } + ptr_cast_base! { PtrOfChiHistogramCostExtractor, core::Ptr, cv_PtrOfChiHistogramCostExtractor_to_PtrOfHistogramCostExtractor } - pub type PtrOfEMDHistogramCostExtractor = core::Ptr; + pub type PtrOfEMDHistogramCostExtractor = core::Ptr; - ptr_extern! { dyn crate::shape::EMDHistogramCostExtractor, + ptr_extern! { crate::shape::EMDHistogramCostExtractor, cv_PtrOfEMDHistogramCostExtractor_delete, cv_PtrOfEMDHistogramCostExtractor_get_inner_ptr, cv_PtrOfEMDHistogramCostExtractor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfEMDHistogramCostExtractor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfEMDHistogramCostExtractor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::EMDHistogramCostExtractorConst for core::Ptr { + impl crate::shape::EMDHistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_EMDHistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::EMDHistogramCostExtractor for core::Ptr { + impl crate::shape::EMDHistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_EMDHistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::shape::HistogramCostExtractorConst for core::Ptr { + impl crate::shape::HistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::HistogramCostExtractor for core::Ptr { + impl crate::shape::HistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfEMDHistogramCostExtractor, core::Ptr, cv_PtrOfEMDHistogramCostExtractor_to_PtrOfHistogramCostExtractor } + ptr_cast_base! { PtrOfEMDHistogramCostExtractor, core::Ptr, cv_PtrOfEMDHistogramCostExtractor_to_PtrOfHistogramCostExtractor } - pub type PtrOfEMDL1HistogramCostExtractor = core::Ptr; + pub type PtrOfEMDL1HistogramCostExtractor = core::Ptr; - ptr_extern! { dyn crate::shape::EMDL1HistogramCostExtractor, + ptr_extern! { crate::shape::EMDL1HistogramCostExtractor, cv_PtrOfEMDL1HistogramCostExtractor_delete, cv_PtrOfEMDL1HistogramCostExtractor_get_inner_ptr, cv_PtrOfEMDL1HistogramCostExtractor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfEMDL1HistogramCostExtractor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfEMDL1HistogramCostExtractor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::EMDL1HistogramCostExtractorConst for core::Ptr { + impl crate::shape::EMDL1HistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_EMDL1HistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::EMDL1HistogramCostExtractor for core::Ptr { + impl crate::shape::EMDL1HistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_EMDL1HistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::shape::HistogramCostExtractorConst for core::Ptr { + impl crate::shape::HistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::HistogramCostExtractor for core::Ptr { + impl crate::shape::HistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfEMDL1HistogramCostExtractor, core::Ptr, cv_PtrOfEMDL1HistogramCostExtractor_to_PtrOfHistogramCostExtractor } + ptr_cast_base! { PtrOfEMDL1HistogramCostExtractor, core::Ptr, cv_PtrOfEMDL1HistogramCostExtractor_to_PtrOfHistogramCostExtractor } - pub type PtrOfHausdorffDistanceExtractor = core::Ptr; + pub type PtrOfHausdorffDistanceExtractor = core::Ptr; - ptr_extern! { dyn crate::shape::HausdorffDistanceExtractor, + ptr_extern! { crate::shape::HausdorffDistanceExtractor, cv_PtrOfHausdorffDistanceExtractor_delete, cv_PtrOfHausdorffDistanceExtractor_get_inner_ptr, cv_PtrOfHausdorffDistanceExtractor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfHausdorffDistanceExtractor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfHausdorffDistanceExtractor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::HausdorffDistanceExtractorConst for core::Ptr { + impl crate::shape::HausdorffDistanceExtractorTraitConst for core::Ptr { #[inline] fn as_raw_HausdorffDistanceExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::HausdorffDistanceExtractor for core::Ptr { + impl crate::shape::HausdorffDistanceExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_HausdorffDistanceExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::shape::ShapeDistanceExtractorConst for core::Ptr { + impl crate::shape::ShapeDistanceExtractorTraitConst for core::Ptr { #[inline] fn as_raw_ShapeDistanceExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::ShapeDistanceExtractor for core::Ptr { + impl crate::shape::ShapeDistanceExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_ShapeDistanceExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfHistogramCostExtractor = core::Ptr; + pub type PtrOfHistogramCostExtractor = core::Ptr; - ptr_extern! { dyn crate::shape::HistogramCostExtractor, + ptr_extern! { crate::shape::HistogramCostExtractor, cv_PtrOfHistogramCostExtractor_delete, cv_PtrOfHistogramCostExtractor_get_inner_ptr, cv_PtrOfHistogramCostExtractor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfHistogramCostExtractor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfHistogramCostExtractor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::HistogramCostExtractorConst for core::Ptr { + impl crate::shape::HistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::HistogramCostExtractor for core::Ptr { + impl crate::shape::HistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfNormHistogramCostExtractor = core::Ptr; + pub type PtrOfNormHistogramCostExtractor = core::Ptr; - ptr_extern! { dyn crate::shape::NormHistogramCostExtractor, + ptr_extern! { crate::shape::NormHistogramCostExtractor, cv_PtrOfNormHistogramCostExtractor_delete, cv_PtrOfNormHistogramCostExtractor_get_inner_ptr, cv_PtrOfNormHistogramCostExtractor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfNormHistogramCostExtractor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfNormHistogramCostExtractor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::NormHistogramCostExtractorConst for core::Ptr { + impl crate::shape::NormHistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_NormHistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::NormHistogramCostExtractor for core::Ptr { + impl crate::shape::NormHistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_NormHistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::shape::HistogramCostExtractorConst for core::Ptr { + impl crate::shape::HistogramCostExtractorTraitConst for core::Ptr { #[inline] fn as_raw_HistogramCostExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::HistogramCostExtractor for core::Ptr { + impl crate::shape::HistogramCostExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_HistogramCostExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfNormHistogramCostExtractor, core::Ptr, cv_PtrOfNormHistogramCostExtractor_to_PtrOfHistogramCostExtractor } + ptr_cast_base! { PtrOfNormHistogramCostExtractor, core::Ptr, cv_PtrOfNormHistogramCostExtractor_to_PtrOfHistogramCostExtractor } - pub type PtrOfShapeContextDistanceExtractor = core::Ptr; + pub type PtrOfShapeContextDistanceExtractor = core::Ptr; - ptr_extern! { dyn crate::shape::ShapeContextDistanceExtractor, + ptr_extern! { crate::shape::ShapeContextDistanceExtractor, cv_PtrOfShapeContextDistanceExtractor_delete, cv_PtrOfShapeContextDistanceExtractor_get_inner_ptr, cv_PtrOfShapeContextDistanceExtractor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfShapeContextDistanceExtractor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfShapeContextDistanceExtractor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::ShapeContextDistanceExtractorConst for core::Ptr { + impl crate::shape::ShapeContextDistanceExtractorTraitConst for core::Ptr { #[inline] fn as_raw_ShapeContextDistanceExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::ShapeContextDistanceExtractor for core::Ptr { + impl crate::shape::ShapeContextDistanceExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_ShapeContextDistanceExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::shape::ShapeDistanceExtractorConst for core::Ptr { + impl crate::shape::ShapeDistanceExtractorTraitConst for core::Ptr { #[inline] fn as_raw_ShapeDistanceExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::ShapeDistanceExtractor for core::Ptr { + impl crate::shape::ShapeDistanceExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_ShapeDistanceExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfShapeTransformer = core::Ptr; + pub type PtrOfShapeTransformer = core::Ptr; - ptr_extern! { dyn crate::shape::ShapeTransformer, + ptr_extern! { crate::shape::ShapeTransformer, cv_PtrOfShapeTransformer_delete, cv_PtrOfShapeTransformer_get_inner_ptr, cv_PtrOfShapeTransformer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfShapeTransformer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfShapeTransformer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::ShapeTransformerConst for core::Ptr { + impl crate::shape::ShapeTransformerTraitConst for core::Ptr { #[inline] fn as_raw_ShapeTransformer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::ShapeTransformer for core::Ptr { + impl crate::shape::ShapeTransformerTrait for core::Ptr { #[inline] fn as_raw_mut_ShapeTransformer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfThinPlateSplineShapeTransformer = core::Ptr; + pub type PtrOfThinPlateSplineShapeTransformer = core::Ptr; - ptr_extern! { dyn crate::shape::ThinPlateSplineShapeTransformer, + ptr_extern! { crate::shape::ThinPlateSplineShapeTransformer, cv_PtrOfThinPlateSplineShapeTransformer_delete, cv_PtrOfThinPlateSplineShapeTransformer_get_inner_ptr, cv_PtrOfThinPlateSplineShapeTransformer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfThinPlateSplineShapeTransformer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfThinPlateSplineShapeTransformer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::shape::ThinPlateSplineShapeTransformerConst for core::Ptr { + impl crate::shape::ThinPlateSplineShapeTransformerTraitConst for core::Ptr { #[inline] fn as_raw_ThinPlateSplineShapeTransformer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::ThinPlateSplineShapeTransformer for core::Ptr { + impl crate::shape::ThinPlateSplineShapeTransformerTrait for core::Ptr { #[inline] fn as_raw_mut_ThinPlateSplineShapeTransformer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::shape::ShapeTransformerConst for core::Ptr { + impl crate::shape::ShapeTransformerTraitConst for core::Ptr { #[inline] fn as_raw_ShapeTransformer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::shape::ShapeTransformer for core::Ptr { + impl crate::shape::ShapeTransformerTrait for core::Ptr { #[inline] fn as_raw_mut_ShapeTransformer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfThinPlateSplineShapeTransformer, core::Ptr, cv_PtrOfThinPlateSplineShapeTransformer_to_PtrOfShapeTransformer } + ptr_cast_base! { PtrOfThinPlateSplineShapeTransformer, core::Ptr, cv_PtrOfThinPlateSplineShapeTransformer_to_PtrOfShapeTransformer } } #[cfg(ocvrs_has_module_shape)] @@ -13461,22 +13445,22 @@ pub use shape_types::*; mod stereo_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfQuasiDenseStereo = core::Ptr; + pub type PtrOfQuasiDenseStereo = core::Ptr; - ptr_extern! { dyn crate::stereo::QuasiDenseStereo, + ptr_extern! { crate::stereo::QuasiDenseStereo, cv_PtrOfQuasiDenseStereo_delete, cv_PtrOfQuasiDenseStereo_get_inner_ptr, cv_PtrOfQuasiDenseStereo_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfQuasiDenseStereo(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfQuasiDenseStereo(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stereo::QuasiDenseStereoConst for core::Ptr { + impl crate::stereo::QuasiDenseStereoTraitConst for core::Ptr { #[inline] fn as_raw_QuasiDenseStereo(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stereo::QuasiDenseStereo for core::Ptr { + impl crate::stereo::QuasiDenseStereoTrait for core::Ptr { #[inline] fn as_raw_mut_QuasiDenseStereo(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -13530,15 +13514,15 @@ mod stitching_types { #[inline] fn as_raw_mut_AffineWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfAffineWarper, core::Ptr, cv_PtrOfAffineWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfAffineWarper, core::Ptr, cv_PtrOfAffineWarper_to_PtrOfWarperCreator } pub type PtrOfCompressedRectilinearPortraitWarper = core::Ptr; @@ -13561,15 +13545,15 @@ mod stitching_types { #[inline] fn as_raw_mut_CompressedRectilinearPortraitWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfCompressedRectilinearPortraitWarper, core::Ptr, cv_PtrOfCompressedRectilinearPortraitWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfCompressedRectilinearPortraitWarper, core::Ptr, cv_PtrOfCompressedRectilinearPortraitWarper_to_PtrOfWarperCreator } pub type PtrOfCompressedRectilinearWarper = core::Ptr; @@ -13592,15 +13576,15 @@ mod stitching_types { #[inline] fn as_raw_mut_CompressedRectilinearWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfCompressedRectilinearWarper, core::Ptr, cv_PtrOfCompressedRectilinearWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfCompressedRectilinearWarper, core::Ptr, cv_PtrOfCompressedRectilinearWarper_to_PtrOfWarperCreator } pub type PtrOfCylindricalWarper = core::Ptr; @@ -13623,15 +13607,15 @@ mod stitching_types { #[inline] fn as_raw_mut_CylindricalWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfCylindricalWarper, core::Ptr, cv_PtrOfCylindricalWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfCylindricalWarper, core::Ptr, cv_PtrOfCylindricalWarper_to_PtrOfWarperCreator } pub type PtrOfCylindricalWarperGpu = core::Ptr; @@ -13654,15 +13638,15 @@ mod stitching_types { #[inline] fn as_raw_mut_CylindricalWarperGpu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfCylindricalWarperGpu, core::Ptr, cv_PtrOfCylindricalWarperGpu_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfCylindricalWarperGpu, core::Ptr, cv_PtrOfCylindricalWarperGpu_to_PtrOfWarperCreator } pub type PtrOfDetail_AffineBasedEstimator = core::Ptr; @@ -13685,15 +13669,15 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_AffineBasedEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_AffineBasedEstimator, core::Ptr, cv_PtrOfDetail_AffineBasedEstimator_to_PtrOfDetail_Estimator } + ptr_cast_base! { PtrOfDetail_AffineBasedEstimator, core::Ptr, cv_PtrOfDetail_AffineBasedEstimator_to_PtrOfDetail_Estimator } pub type PtrOfDetail_AffineBestOf2NearestMatcher = core::Ptr; @@ -13726,15 +13710,15 @@ mod stitching_types { ptr_cast_base! { PtrOfDetail_AffineBestOf2NearestMatcher, core::Ptr, cv_PtrOfDetail_AffineBestOf2NearestMatcher_to_PtrOfDetail_BestOf2NearestMatcher } - impl crate::stitching::Detail_FeaturesMatcherConst for core::Ptr { + impl crate::stitching::Detail_FeaturesMatcherTraitConst for core::Ptr { #[inline] fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_FeaturesMatcher for core::Ptr { + impl crate::stitching::Detail_FeaturesMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_AffineBestOf2NearestMatcher, core::Ptr, cv_PtrOfDetail_AffineBestOf2NearestMatcher_to_PtrOfDetail_FeaturesMatcher } + ptr_cast_base! { PtrOfDetail_AffineBestOf2NearestMatcher, core::Ptr, cv_PtrOfDetail_AffineBestOf2NearestMatcher_to_PtrOfDetail_FeaturesMatcher } pub type PtrOfDetail_BestOf2NearestMatcher = core::Ptr; @@ -13757,15 +13741,15 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_BestOf2NearestMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_FeaturesMatcherConst for core::Ptr { + impl crate::stitching::Detail_FeaturesMatcherTraitConst for core::Ptr { #[inline] fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_FeaturesMatcher for core::Ptr { + impl crate::stitching::Detail_FeaturesMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BestOf2NearestMatcher, core::Ptr, cv_PtrOfDetail_BestOf2NearestMatcher_to_PtrOfDetail_FeaturesMatcher } + ptr_cast_base! { PtrOfDetail_BestOf2NearestMatcher, core::Ptr, cv_PtrOfDetail_BestOf2NearestMatcher_to_PtrOfDetail_FeaturesMatcher } pub type PtrOfDetail_BestOf2NearestRangeMatcher = core::Ptr; @@ -13798,15 +13782,15 @@ mod stitching_types { ptr_cast_base! { PtrOfDetail_BestOf2NearestRangeMatcher, core::Ptr, cv_PtrOfDetail_BestOf2NearestRangeMatcher_to_PtrOfDetail_BestOf2NearestMatcher } - impl crate::stitching::Detail_FeaturesMatcherConst for core::Ptr { + impl crate::stitching::Detail_FeaturesMatcherTraitConst for core::Ptr { #[inline] fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_FeaturesMatcher for core::Ptr { + impl crate::stitching::Detail_FeaturesMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BestOf2NearestRangeMatcher, core::Ptr, cv_PtrOfDetail_BestOf2NearestRangeMatcher_to_PtrOfDetail_FeaturesMatcher } + ptr_cast_base! { PtrOfDetail_BestOf2NearestRangeMatcher, core::Ptr, cv_PtrOfDetail_BestOf2NearestRangeMatcher_to_PtrOfDetail_FeaturesMatcher } pub type PtrOfDetail_Blender = core::Ptr; @@ -13850,54 +13834,54 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_BlocksChannelsCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_BlocksCompensatorConst for core::Ptr { + impl crate::stitching::Detail_BlocksCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BlocksCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BlocksCompensator for core::Ptr { + impl crate::stitching::Detail_BlocksCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BlocksCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BlocksChannelsCompensator, core::Ptr, cv_PtrOfDetail_BlocksChannelsCompensator_to_PtrOfDetail_BlocksCompensator } + ptr_cast_base! { PtrOfDetail_BlocksChannelsCompensator, core::Ptr, cv_PtrOfDetail_BlocksChannelsCompensator_to_PtrOfDetail_BlocksCompensator } - impl crate::stitching::Detail_ExposureCompensatorConst for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BlocksChannelsCompensator, core::Ptr, cv_PtrOfDetail_BlocksChannelsCompensator_to_PtrOfDetail_ExposureCompensator } + ptr_cast_base! { PtrOfDetail_BlocksChannelsCompensator, core::Ptr, cv_PtrOfDetail_BlocksChannelsCompensator_to_PtrOfDetail_ExposureCompensator } - pub type PtrOfDetail_BlocksCompensator = core::Ptr; + pub type PtrOfDetail_BlocksCompensator = core::Ptr; - ptr_extern! { dyn crate::stitching::Detail_BlocksCompensator, + ptr_extern! { crate::stitching::Detail_BlocksCompensator, cv_PtrOfDetail_BlocksCompensator_delete, cv_PtrOfDetail_BlocksCompensator_get_inner_ptr, cv_PtrOfDetail_BlocksCompensator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetail_BlocksCompensator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetail_BlocksCompensator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::Detail_BlocksCompensatorConst for core::Ptr { + impl crate::stitching::Detail_BlocksCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BlocksCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BlocksCompensator for core::Ptr { + impl crate::stitching::Detail_BlocksCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BlocksCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_ExposureCompensatorConst for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BlocksCompensator, core::Ptr, cv_PtrOfDetail_BlocksCompensator_to_PtrOfDetail_ExposureCompensator } + ptr_cast_base! { PtrOfDetail_BlocksCompensator, core::Ptr, cv_PtrOfDetail_BlocksCompensator_to_PtrOfDetail_ExposureCompensator } pub type PtrOfDetail_BlocksGainCompensator = core::Ptr; @@ -13920,25 +13904,25 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_BlocksGainCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_BlocksCompensatorConst for core::Ptr { + impl crate::stitching::Detail_BlocksCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BlocksCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BlocksCompensator for core::Ptr { + impl crate::stitching::Detail_BlocksCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BlocksCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BlocksGainCompensator, core::Ptr, cv_PtrOfDetail_BlocksGainCompensator_to_PtrOfDetail_BlocksCompensator } + ptr_cast_base! { PtrOfDetail_BlocksGainCompensator, core::Ptr, cv_PtrOfDetail_BlocksGainCompensator_to_PtrOfDetail_BlocksCompensator } - impl crate::stitching::Detail_ExposureCompensatorConst for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BlocksGainCompensator, core::Ptr, cv_PtrOfDetail_BlocksGainCompensator_to_PtrOfDetail_ExposureCompensator } + ptr_cast_base! { PtrOfDetail_BlocksGainCompensator, core::Ptr, cv_PtrOfDetail_BlocksGainCompensator_to_PtrOfDetail_ExposureCompensator } pub type PtrOfDetail_BundleAdjusterAffine = core::Ptr; @@ -13961,25 +13945,25 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_BundleAdjusterAffine(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_BundleAdjusterBaseConst for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterAffine, core::Ptr, cv_PtrOfDetail_BundleAdjusterAffine_to_PtrOfDetail_BundleAdjusterBase } + ptr_cast_base! { PtrOfDetail_BundleAdjusterAffine, core::Ptr, cv_PtrOfDetail_BundleAdjusterAffine_to_PtrOfDetail_BundleAdjusterBase } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterAffine, core::Ptr, cv_PtrOfDetail_BundleAdjusterAffine_to_PtrOfDetail_Estimator } + ptr_cast_base! { PtrOfDetail_BundleAdjusterAffine, core::Ptr, cv_PtrOfDetail_BundleAdjusterAffine_to_PtrOfDetail_Estimator } pub type PtrOfDetail_BundleAdjusterAffinePartial = core::Ptr; @@ -14002,54 +13986,54 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_BundleAdjusterAffinePartial(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_BundleAdjusterBaseConst for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterAffinePartial, core::Ptr, cv_PtrOfDetail_BundleAdjusterAffinePartial_to_PtrOfDetail_BundleAdjusterBase } + ptr_cast_base! { PtrOfDetail_BundleAdjusterAffinePartial, core::Ptr, cv_PtrOfDetail_BundleAdjusterAffinePartial_to_PtrOfDetail_BundleAdjusterBase } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterAffinePartial, core::Ptr, cv_PtrOfDetail_BundleAdjusterAffinePartial_to_PtrOfDetail_Estimator } + ptr_cast_base! { PtrOfDetail_BundleAdjusterAffinePartial, core::Ptr, cv_PtrOfDetail_BundleAdjusterAffinePartial_to_PtrOfDetail_Estimator } - pub type PtrOfDetail_BundleAdjusterBase = core::Ptr; + pub type PtrOfDetail_BundleAdjusterBase = core::Ptr; - ptr_extern! { dyn crate::stitching::Detail_BundleAdjusterBase, + ptr_extern! { crate::stitching::Detail_BundleAdjusterBase, cv_PtrOfDetail_BundleAdjusterBase_delete, cv_PtrOfDetail_BundleAdjusterBase_get_inner_ptr, cv_PtrOfDetail_BundleAdjusterBase_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetail_BundleAdjusterBase(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetail_BundleAdjusterBase(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::Detail_BundleAdjusterBaseConst for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterBase, core::Ptr, cv_PtrOfDetail_BundleAdjusterBase_to_PtrOfDetail_Estimator } + ptr_cast_base! { PtrOfDetail_BundleAdjusterBase, core::Ptr, cv_PtrOfDetail_BundleAdjusterBase_to_PtrOfDetail_Estimator } pub type PtrOfDetail_BundleAdjusterRay = core::Ptr; @@ -14072,25 +14056,25 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_BundleAdjusterRay(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_BundleAdjusterBaseConst for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterRay, core::Ptr, cv_PtrOfDetail_BundleAdjusterRay_to_PtrOfDetail_BundleAdjusterBase } + ptr_cast_base! { PtrOfDetail_BundleAdjusterRay, core::Ptr, cv_PtrOfDetail_BundleAdjusterRay_to_PtrOfDetail_BundleAdjusterBase } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterRay, core::Ptr, cv_PtrOfDetail_BundleAdjusterRay_to_PtrOfDetail_Estimator } + ptr_cast_base! { PtrOfDetail_BundleAdjusterRay, core::Ptr, cv_PtrOfDetail_BundleAdjusterRay_to_PtrOfDetail_Estimator } pub type PtrOfDetail_BundleAdjusterReproj = core::Ptr; @@ -14113,25 +14097,25 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_BundleAdjusterReproj(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_BundleAdjusterBaseConst for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterReproj, core::Ptr, cv_PtrOfDetail_BundleAdjusterReproj_to_PtrOfDetail_BundleAdjusterBase } + ptr_cast_base! { PtrOfDetail_BundleAdjusterReproj, core::Ptr, cv_PtrOfDetail_BundleAdjusterReproj_to_PtrOfDetail_BundleAdjusterBase } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_BundleAdjusterReproj, core::Ptr, cv_PtrOfDetail_BundleAdjusterReproj_to_PtrOfDetail_Estimator } + ptr_cast_base! { PtrOfDetail_BundleAdjusterReproj, core::Ptr, cv_PtrOfDetail_BundleAdjusterReproj_to_PtrOfDetail_Estimator } pub type PtrOfDetail_ChannelsCompensator = core::Ptr; @@ -14154,15 +14138,15 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_ChannelsCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_ExposureCompensatorConst for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_ChannelsCompensator, core::Ptr, cv_PtrOfDetail_ChannelsCompensator_to_PtrOfDetail_ExposureCompensator } + ptr_cast_base! { PtrOfDetail_ChannelsCompensator, core::Ptr, cv_PtrOfDetail_ChannelsCompensator_to_PtrOfDetail_ExposureCompensator } pub type PtrOfDetail_DpSeamFinder = core::Ptr; @@ -14185,51 +14169,51 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_DpSeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_SeamFinderConst for core::Ptr { + impl crate::stitching::Detail_SeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_SeamFinder for core::Ptr { + impl crate::stitching::Detail_SeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_DpSeamFinder, core::Ptr, cv_PtrOfDetail_DpSeamFinder_to_PtrOfDetail_SeamFinder } + ptr_cast_base! { PtrOfDetail_DpSeamFinder, core::Ptr, cv_PtrOfDetail_DpSeamFinder_to_PtrOfDetail_SeamFinder } - pub type PtrOfDetail_Estimator = core::Ptr; + pub type PtrOfDetail_Estimator = core::Ptr; - ptr_extern! { dyn crate::stitching::Detail_Estimator, + ptr_extern! { crate::stitching::Detail_Estimator, cv_PtrOfDetail_Estimator_delete, cv_PtrOfDetail_Estimator_get_inner_ptr, cv_PtrOfDetail_Estimator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetail_Estimator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetail_Estimator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDetail_ExposureCompensator = core::Ptr; + pub type PtrOfDetail_ExposureCompensator = core::Ptr; - ptr_extern! { dyn crate::stitching::Detail_ExposureCompensator, + ptr_extern! { crate::stitching::Detail_ExposureCompensator, cv_PtrOfDetail_ExposureCompensator_delete, cv_PtrOfDetail_ExposureCompensator_get_inner_ptr, cv_PtrOfDetail_ExposureCompensator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetail_ExposureCompensator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetail_ExposureCompensator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::Detail_ExposureCompensatorConst for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -14264,22 +14248,22 @@ mod stitching_types { ptr_cast_base! { PtrOfDetail_FeatherBlender, core::Ptr, cv_PtrOfDetail_FeatherBlender_to_PtrOfDetail_Blender } - pub type PtrOfDetail_FeaturesMatcher = core::Ptr; + pub type PtrOfDetail_FeaturesMatcher = core::Ptr; - ptr_extern! { dyn crate::stitching::Detail_FeaturesMatcher, + ptr_extern! { crate::stitching::Detail_FeaturesMatcher, cv_PtrOfDetail_FeaturesMatcher_delete, cv_PtrOfDetail_FeaturesMatcher_get_inner_ptr, cv_PtrOfDetail_FeaturesMatcher_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetail_FeaturesMatcher(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetail_FeaturesMatcher(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::Detail_FeaturesMatcherConst for core::Ptr { + impl crate::stitching::Detail_FeaturesMatcherTraitConst for core::Ptr { #[inline] fn as_raw_Detail_FeaturesMatcher(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_FeaturesMatcher for core::Ptr { + impl crate::stitching::Detail_FeaturesMatcherTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_FeaturesMatcher(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -14304,15 +14288,15 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_GainCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_ExposureCompensatorConst for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_GainCompensator, core::Ptr, cv_PtrOfDetail_GainCompensator_to_PtrOfDetail_ExposureCompensator } + ptr_cast_base! { PtrOfDetail_GainCompensator, core::Ptr, cv_PtrOfDetail_GainCompensator_to_PtrOfDetail_ExposureCompensator } pub type PtrOfDetail_GraphCutSeamFinder = core::Ptr; @@ -14343,15 +14327,15 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_GraphCutSeamFinderBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_SeamFinderConst for core::Ptr { + impl crate::stitching::Detail_SeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_SeamFinder for core::Ptr { + impl crate::stitching::Detail_SeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_GraphCutSeamFinder, core::Ptr, cv_PtrOfDetail_GraphCutSeamFinder_to_PtrOfDetail_SeamFinder } + ptr_cast_base! { PtrOfDetail_GraphCutSeamFinder, core::Ptr, cv_PtrOfDetail_GraphCutSeamFinder_to_PtrOfDetail_SeamFinder } pub type PtrOfDetail_GraphCutSeamFinderGpu = core::Ptr; @@ -14382,25 +14366,25 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_GraphCutSeamFinderBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_PairwiseSeamFinderConst for core::Ptr { + impl crate::stitching::Detail_PairwiseSeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_PairwiseSeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_PairwiseSeamFinder for core::Ptr { + impl crate::stitching::Detail_PairwiseSeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_PairwiseSeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_GraphCutSeamFinderGpu, core::Ptr, cv_PtrOfDetail_GraphCutSeamFinderGpu_to_PtrOfDetail_PairwiseSeamFinder } + ptr_cast_base! { PtrOfDetail_GraphCutSeamFinderGpu, core::Ptr, cv_PtrOfDetail_GraphCutSeamFinderGpu_to_PtrOfDetail_PairwiseSeamFinder } - impl crate::stitching::Detail_SeamFinderConst for core::Ptr { + impl crate::stitching::Detail_SeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_SeamFinder for core::Ptr { + impl crate::stitching::Detail_SeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_GraphCutSeamFinderGpu, core::Ptr, cv_PtrOfDetail_GraphCutSeamFinderGpu_to_PtrOfDetail_SeamFinder } + ptr_cast_base! { PtrOfDetail_GraphCutSeamFinderGpu, core::Ptr, cv_PtrOfDetail_GraphCutSeamFinderGpu_to_PtrOfDetail_SeamFinder } pub type PtrOfDetail_HomographyBasedEstimator = core::Ptr; @@ -14423,15 +14407,15 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_HomographyBasedEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_HomographyBasedEstimator, core::Ptr, cv_PtrOfDetail_HomographyBasedEstimator_to_PtrOfDetail_Estimator } + ptr_cast_base! { PtrOfDetail_HomographyBasedEstimator, core::Ptr, cv_PtrOfDetail_HomographyBasedEstimator_to_PtrOfDetail_Estimator } pub type PtrOfDetail_MultiBandBlender = core::Ptr; @@ -14485,25 +14469,25 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_NoBundleAdjuster(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_BundleAdjusterBaseConst for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTraitConst for core::Ptr { #[inline] fn as_raw_Detail_BundleAdjusterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_BundleAdjusterBase for core::Ptr { + impl crate::stitching::Detail_BundleAdjusterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_BundleAdjusterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_NoBundleAdjuster, core::Ptr, cv_PtrOfDetail_NoBundleAdjuster_to_PtrOfDetail_BundleAdjusterBase } + ptr_cast_base! { PtrOfDetail_NoBundleAdjuster, core::Ptr, cv_PtrOfDetail_NoBundleAdjuster_to_PtrOfDetail_BundleAdjusterBase } - impl crate::stitching::Detail_EstimatorConst for core::Ptr { + impl crate::stitching::Detail_EstimatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_Estimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_Estimator for core::Ptr { + impl crate::stitching::Detail_EstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_Estimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_NoBundleAdjuster, core::Ptr, cv_PtrOfDetail_NoBundleAdjuster_to_PtrOfDetail_Estimator } + ptr_cast_base! { PtrOfDetail_NoBundleAdjuster, core::Ptr, cv_PtrOfDetail_NoBundleAdjuster_to_PtrOfDetail_Estimator } pub type PtrOfDetail_NoExposureCompensator = core::Ptr; @@ -14526,15 +14510,15 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_NoExposureCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_ExposureCompensatorConst for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTraitConst for core::Ptr { #[inline] fn as_raw_Detail_ExposureCompensator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_ExposureCompensator for core::Ptr { + impl crate::stitching::Detail_ExposureCompensatorTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_ExposureCompensator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_NoExposureCompensator, core::Ptr, cv_PtrOfDetail_NoExposureCompensator_to_PtrOfDetail_ExposureCompensator } + ptr_cast_base! { PtrOfDetail_NoExposureCompensator, core::Ptr, cv_PtrOfDetail_NoExposureCompensator_to_PtrOfDetail_ExposureCompensator } pub type PtrOfDetail_NoSeamFinder = core::Ptr; @@ -14557,80 +14541,80 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_NoSeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_SeamFinderConst for core::Ptr { + impl crate::stitching::Detail_SeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_SeamFinder for core::Ptr { + impl crate::stitching::Detail_SeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_NoSeamFinder, core::Ptr, cv_PtrOfDetail_NoSeamFinder_to_PtrOfDetail_SeamFinder } + ptr_cast_base! { PtrOfDetail_NoSeamFinder, core::Ptr, cv_PtrOfDetail_NoSeamFinder_to_PtrOfDetail_SeamFinder } - pub type PtrOfDetail_PairwiseSeamFinder = core::Ptr; + pub type PtrOfDetail_PairwiseSeamFinder = core::Ptr; - ptr_extern! { dyn crate::stitching::Detail_PairwiseSeamFinder, + ptr_extern! { crate::stitching::Detail_PairwiseSeamFinder, cv_PtrOfDetail_PairwiseSeamFinder_delete, cv_PtrOfDetail_PairwiseSeamFinder_get_inner_ptr, cv_PtrOfDetail_PairwiseSeamFinder_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetail_PairwiseSeamFinder(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetail_PairwiseSeamFinder(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::Detail_PairwiseSeamFinderConst for core::Ptr { + impl crate::stitching::Detail_PairwiseSeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_PairwiseSeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_PairwiseSeamFinder for core::Ptr { + impl crate::stitching::Detail_PairwiseSeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_PairwiseSeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_SeamFinderConst for core::Ptr { + impl crate::stitching::Detail_SeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_SeamFinder for core::Ptr { + impl crate::stitching::Detail_SeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_PairwiseSeamFinder, core::Ptr, cv_PtrOfDetail_PairwiseSeamFinder_to_PtrOfDetail_SeamFinder } + ptr_cast_base! { PtrOfDetail_PairwiseSeamFinder, core::Ptr, cv_PtrOfDetail_PairwiseSeamFinder_to_PtrOfDetail_SeamFinder } - pub type PtrOfDetail_RotationWarper = core::Ptr; + pub type PtrOfDetail_RotationWarper = core::Ptr; - ptr_extern! { dyn crate::stitching::Detail_RotationWarper, + ptr_extern! { crate::stitching::Detail_RotationWarper, cv_PtrOfDetail_RotationWarper_delete, cv_PtrOfDetail_RotationWarper_get_inner_ptr, cv_PtrOfDetail_RotationWarper_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetail_RotationWarper(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetail_RotationWarper(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::Detail_RotationWarperConst for core::Ptr { + impl crate::stitching::Detail_RotationWarperTraitConst for core::Ptr { #[inline] fn as_raw_Detail_RotationWarper(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_RotationWarper for core::Ptr { + impl crate::stitching::Detail_RotationWarperTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_RotationWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDetail_SeamFinder = core::Ptr; + pub type PtrOfDetail_SeamFinder = core::Ptr; - ptr_extern! { dyn crate::stitching::Detail_SeamFinder, + ptr_extern! { crate::stitching::Detail_SeamFinder, cv_PtrOfDetail_SeamFinder_delete, cv_PtrOfDetail_SeamFinder_get_inner_ptr, cv_PtrOfDetail_SeamFinder_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDetail_SeamFinder(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDetail_SeamFinder(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::Detail_SeamFinderConst for core::Ptr { + impl crate::stitching::Detail_SeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_SeamFinder for core::Ptr { + impl crate::stitching::Detail_SeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -14655,25 +14639,25 @@ mod stitching_types { #[inline] fn as_raw_mut_Detail_VoronoiSeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::Detail_PairwiseSeamFinderConst for core::Ptr { + impl crate::stitching::Detail_PairwiseSeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_PairwiseSeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_PairwiseSeamFinder for core::Ptr { + impl crate::stitching::Detail_PairwiseSeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_PairwiseSeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_VoronoiSeamFinder, core::Ptr, cv_PtrOfDetail_VoronoiSeamFinder_to_PtrOfDetail_PairwiseSeamFinder } + ptr_cast_base! { PtrOfDetail_VoronoiSeamFinder, core::Ptr, cv_PtrOfDetail_VoronoiSeamFinder_to_PtrOfDetail_PairwiseSeamFinder } - impl crate::stitching::Detail_SeamFinderConst for core::Ptr { + impl crate::stitching::Detail_SeamFinderTraitConst for core::Ptr { #[inline] fn as_raw_Detail_SeamFinder(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::Detail_SeamFinder for core::Ptr { + impl crate::stitching::Detail_SeamFinderTrait for core::Ptr { #[inline] fn as_raw_mut_Detail_SeamFinder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDetail_VoronoiSeamFinder, core::Ptr, cv_PtrOfDetail_VoronoiSeamFinder_to_PtrOfDetail_SeamFinder } + ptr_cast_base! { PtrOfDetail_VoronoiSeamFinder, core::Ptr, cv_PtrOfDetail_VoronoiSeamFinder_to_PtrOfDetail_SeamFinder } pub type PtrOfFisheyeWarper = core::Ptr; @@ -14696,15 +14680,15 @@ mod stitching_types { #[inline] fn as_raw_mut_FisheyeWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfFisheyeWarper, core::Ptr, cv_PtrOfFisheyeWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfFisheyeWarper, core::Ptr, cv_PtrOfFisheyeWarper_to_PtrOfWarperCreator } pub type PtrOfMercatorWarper = core::Ptr; @@ -14727,15 +14711,15 @@ mod stitching_types { #[inline] fn as_raw_mut_MercatorWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMercatorWarper, core::Ptr, cv_PtrOfMercatorWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfMercatorWarper, core::Ptr, cv_PtrOfMercatorWarper_to_PtrOfWarperCreator } pub type PtrOfPaniniPortraitWarper = core::Ptr; @@ -14758,15 +14742,15 @@ mod stitching_types { #[inline] fn as_raw_mut_PaniniPortraitWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfPaniniPortraitWarper, core::Ptr, cv_PtrOfPaniniPortraitWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfPaniniPortraitWarper, core::Ptr, cv_PtrOfPaniniPortraitWarper_to_PtrOfWarperCreator } pub type PtrOfPaniniWarper = core::Ptr; @@ -14789,15 +14773,15 @@ mod stitching_types { #[inline] fn as_raw_mut_PaniniWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfPaniniWarper, core::Ptr, cv_PtrOfPaniniWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfPaniniWarper, core::Ptr, cv_PtrOfPaniniWarper_to_PtrOfWarperCreator } pub type PtrOfPlaneWarper = core::Ptr; @@ -14820,15 +14804,15 @@ mod stitching_types { #[inline] fn as_raw_mut_PlaneWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfPlaneWarper, core::Ptr, cv_PtrOfPlaneWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfPlaneWarper, core::Ptr, cv_PtrOfPlaneWarper_to_PtrOfWarperCreator } pub type PtrOfPlaneWarperGpu = core::Ptr; @@ -14851,15 +14835,15 @@ mod stitching_types { #[inline] fn as_raw_mut_PlaneWarperGpu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfPlaneWarperGpu, core::Ptr, cv_PtrOfPlaneWarperGpu_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfPlaneWarperGpu, core::Ptr, cv_PtrOfPlaneWarperGpu_to_PtrOfWarperCreator } pub type PtrOfSphericalWarper = core::Ptr; @@ -14882,15 +14866,15 @@ mod stitching_types { #[inline] fn as_raw_mut_SphericalWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSphericalWarper, core::Ptr, cv_PtrOfSphericalWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfSphericalWarper, core::Ptr, cv_PtrOfSphericalWarper_to_PtrOfWarperCreator } pub type PtrOfSphericalWarperGpu = core::Ptr; @@ -14913,15 +14897,15 @@ mod stitching_types { #[inline] fn as_raw_mut_SphericalWarperGpu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSphericalWarperGpu, core::Ptr, cv_PtrOfSphericalWarperGpu_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfSphericalWarperGpu, core::Ptr, cv_PtrOfSphericalWarperGpu_to_PtrOfWarperCreator } pub type PtrOfStereographicWarper = core::Ptr; @@ -14944,15 +14928,15 @@ mod stitching_types { #[inline] fn as_raw_mut_StereographicWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfStereographicWarper, core::Ptr, cv_PtrOfStereographicWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfStereographicWarper, core::Ptr, cv_PtrOfStereographicWarper_to_PtrOfWarperCreator } pub type PtrOfStitcher = core::Ptr; @@ -14996,32 +14980,32 @@ mod stitching_types { #[inline] fn as_raw_mut_TransverseMercatorWarper(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfTransverseMercatorWarper, core::Ptr, cv_PtrOfTransverseMercatorWarper_to_PtrOfWarperCreator } + ptr_cast_base! { PtrOfTransverseMercatorWarper, core::Ptr, cv_PtrOfTransverseMercatorWarper_to_PtrOfWarperCreator } - pub type PtrOfWarperCreator = core::Ptr; + pub type PtrOfWarperCreator = core::Ptr; - ptr_extern! { dyn crate::stitching::WarperCreator, + ptr_extern! { crate::stitching::WarperCreator, cv_PtrOfWarperCreator_delete, cv_PtrOfWarperCreator_get_inner_ptr, cv_PtrOfWarperCreator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfWarperCreator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfWarperCreator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::stitching::WarperCreatorConst for core::Ptr { + impl crate::stitching::WarperCreatorTraitConst for core::Ptr { #[inline] fn as_raw_WarperCreator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::stitching::WarperCreator for core::Ptr { + impl crate::stitching::WarperCreatorTrait for core::Ptr { #[inline] fn as_raw_mut_WarperCreator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -15087,73 +15071,73 @@ pub use stitching_types::*; mod structured_light_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfGrayCodePattern = core::Ptr; + pub type PtrOfGrayCodePattern = core::Ptr; - ptr_extern! { dyn crate::structured_light::GrayCodePattern, + ptr_extern! { crate::structured_light::GrayCodePattern, cv_PtrOfGrayCodePattern_delete, cv_PtrOfGrayCodePattern_get_inner_ptr, cv_PtrOfGrayCodePattern_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfGrayCodePattern(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfGrayCodePattern(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::structured_light::GrayCodePatternConst for core::Ptr { + impl crate::structured_light::GrayCodePatternTraitConst for core::Ptr { #[inline] fn as_raw_GrayCodePattern(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::structured_light::GrayCodePattern for core::Ptr { + impl crate::structured_light::GrayCodePatternTrait for core::Ptr { #[inline] fn as_raw_mut_GrayCodePattern(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::structured_light::StructuredLightPatternConst for core::Ptr { + impl crate::structured_light::StructuredLightPatternTraitConst for core::Ptr { #[inline] fn as_raw_StructuredLightPattern(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::structured_light::StructuredLightPattern for core::Ptr { + impl crate::structured_light::StructuredLightPatternTrait for core::Ptr { #[inline] fn as_raw_mut_StructuredLightPattern(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSinusoidalPattern = core::Ptr; + pub type PtrOfSinusoidalPattern = core::Ptr; - ptr_extern! { dyn crate::structured_light::SinusoidalPattern, + ptr_extern! { crate::structured_light::SinusoidalPattern, cv_PtrOfSinusoidalPattern_delete, cv_PtrOfSinusoidalPattern_get_inner_ptr, cv_PtrOfSinusoidalPattern_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSinusoidalPattern(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSinusoidalPattern(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::structured_light::SinusoidalPatternConst for core::Ptr { + impl crate::structured_light::SinusoidalPatternTraitConst for core::Ptr { #[inline] fn as_raw_SinusoidalPattern(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::structured_light::SinusoidalPattern for core::Ptr { + impl crate::structured_light::SinusoidalPatternTrait for core::Ptr { #[inline] fn as_raw_mut_SinusoidalPattern(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::structured_light::StructuredLightPatternConst for core::Ptr { + impl crate::structured_light::StructuredLightPatternTraitConst for core::Ptr { #[inline] fn as_raw_StructuredLightPattern(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::structured_light::StructuredLightPattern for core::Ptr { + impl crate::structured_light::StructuredLightPatternTrait for core::Ptr { #[inline] fn as_raw_mut_StructuredLightPattern(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -15186,224 +15170,224 @@ pub use structured_light_types::*; mod superres_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfSuperres_BroxOpticalFlow = core::Ptr; + pub type PtrOfSuperres_BroxOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::superres::Superres_BroxOpticalFlow, + ptr_extern! { crate::superres::Superres_BroxOpticalFlow, cv_PtrOfSuperres_BroxOpticalFlow_delete, cv_PtrOfSuperres_BroxOpticalFlow_get_inner_ptr, cv_PtrOfSuperres_BroxOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperres_BroxOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperres_BroxOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::superres::Superres_BroxOpticalFlowConst for core::Ptr { + impl crate::superres::Superres_BroxOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_Superres_BroxOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_BroxOpticalFlow for core::Ptr { + impl crate::superres::Superres_BroxOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_BroxOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::superres::Superres_DenseOpticalFlowExtConst for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for core::Ptr { #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_DenseOpticalFlowExt for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperres_DenseOpticalFlowExt = core::Ptr; + pub type PtrOfSuperres_DenseOpticalFlowExt = core::Ptr; - ptr_extern! { dyn crate::superres::Superres_DenseOpticalFlowExt, + ptr_extern! { crate::superres::Superres_DenseOpticalFlowExt, cv_PtrOfSuperres_DenseOpticalFlowExt_delete, cv_PtrOfSuperres_DenseOpticalFlowExt_get_inner_ptr, cv_PtrOfSuperres_DenseOpticalFlowExt_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperres_DenseOpticalFlowExt(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperres_DenseOpticalFlowExt(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::superres::Superres_DenseOpticalFlowExtConst for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for core::Ptr { #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_DenseOpticalFlowExt for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperres_DualTVL1OpticalFlow = core::Ptr; + pub type PtrOfSuperres_DualTVL1OpticalFlow = core::Ptr; - ptr_extern! { dyn crate::superres::Superres_DualTVL1OpticalFlow, + ptr_extern! { crate::superres::Superres_DualTVL1OpticalFlow, cv_PtrOfSuperres_DualTVL1OpticalFlow_delete, cv_PtrOfSuperres_DualTVL1OpticalFlow_get_inner_ptr, cv_PtrOfSuperres_DualTVL1OpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperres_DualTVL1OpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperres_DualTVL1OpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::superres::Superres_DualTVL1OpticalFlowConst for core::Ptr { + impl crate::superres::Superres_DualTVL1OpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_Superres_DualTVL1OpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_DualTVL1OpticalFlow for core::Ptr { + impl crate::superres::Superres_DualTVL1OpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_DualTVL1OpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::superres::Superres_DenseOpticalFlowExtConst for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for core::Ptr { #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_DenseOpticalFlowExt for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperres_FarnebackOpticalFlow = core::Ptr; + pub type PtrOfSuperres_FarnebackOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::superres::Superres_FarnebackOpticalFlow, + ptr_extern! { crate::superres::Superres_FarnebackOpticalFlow, cv_PtrOfSuperres_FarnebackOpticalFlow_delete, cv_PtrOfSuperres_FarnebackOpticalFlow_get_inner_ptr, cv_PtrOfSuperres_FarnebackOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperres_FarnebackOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperres_FarnebackOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::superres::Superres_FarnebackOpticalFlowConst for core::Ptr { + impl crate::superres::Superres_FarnebackOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_Superres_FarnebackOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_FarnebackOpticalFlow for core::Ptr { + impl crate::superres::Superres_FarnebackOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_FarnebackOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::superres::Superres_DenseOpticalFlowExtConst for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for core::Ptr { #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_DenseOpticalFlowExt for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperres_FrameSource = core::Ptr; + pub type PtrOfSuperres_FrameSource = core::Ptr; - ptr_extern! { dyn crate::superres::Superres_FrameSource, + ptr_extern! { crate::superres::Superres_FrameSource, cv_PtrOfSuperres_FrameSource_delete, cv_PtrOfSuperres_FrameSource_get_inner_ptr, cv_PtrOfSuperres_FrameSource_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperres_FrameSource(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperres_FrameSource(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::superres::Superres_FrameSourceConst for core::Ptr { + impl crate::superres::Superres_FrameSourceTraitConst for core::Ptr { #[inline] fn as_raw_Superres_FrameSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_FrameSource for core::Ptr { + impl crate::superres::Superres_FrameSourceTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_FrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperres_PyrLKOpticalFlow = core::Ptr; + pub type PtrOfSuperres_PyrLKOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::superres::Superres_PyrLKOpticalFlow, + ptr_extern! { crate::superres::Superres_PyrLKOpticalFlow, cv_PtrOfSuperres_PyrLKOpticalFlow_delete, cv_PtrOfSuperres_PyrLKOpticalFlow_get_inner_ptr, cv_PtrOfSuperres_PyrLKOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperres_PyrLKOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperres_PyrLKOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::superres::Superres_PyrLKOpticalFlowConst for core::Ptr { + impl crate::superres::Superres_PyrLKOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_Superres_PyrLKOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_PyrLKOpticalFlow for core::Ptr { + impl crate::superres::Superres_PyrLKOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_PyrLKOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::superres::Superres_DenseOpticalFlowExtConst for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTraitConst for core::Ptr { #[inline] fn as_raw_Superres_DenseOpticalFlowExt(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_DenseOpticalFlowExt for core::Ptr { + impl crate::superres::Superres_DenseOpticalFlowExtTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_DenseOpticalFlowExt(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperres_SuperResolution = core::Ptr; + pub type PtrOfSuperres_SuperResolution = core::Ptr; - ptr_extern! { dyn crate::superres::Superres_SuperResolution, + ptr_extern! { crate::superres::Superres_SuperResolution, cv_PtrOfSuperres_SuperResolution_delete, cv_PtrOfSuperres_SuperResolution_get_inner_ptr, cv_PtrOfSuperres_SuperResolution_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperres_SuperResolution(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperres_SuperResolution(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::superres::Superres_SuperResolutionConst for core::Ptr { + impl crate::superres::Superres_SuperResolutionTraitConst for core::Ptr { #[inline] fn as_raw_Superres_SuperResolution(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_SuperResolution for core::Ptr { + impl crate::superres::Superres_SuperResolutionTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_SuperResolution(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::superres::Superres_FrameSourceConst for core::Ptr { + impl crate::superres::Superres_FrameSourceTraitConst for core::Ptr { #[inline] fn as_raw_Superres_FrameSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::superres::Superres_FrameSource for core::Ptr { + impl crate::superres::Superres_FrameSourceTrait for core::Ptr { #[inline] fn as_raw_mut_Superres_FrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -15483,49 +15467,49 @@ pub use surface_matching_types::*; mod text_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfERFilter = core::Ptr; + pub type PtrOfERFilter = core::Ptr; - ptr_extern! { dyn crate::text::ERFilter, + ptr_extern! { crate::text::ERFilter, cv_PtrOfERFilter_delete, cv_PtrOfERFilter_get_inner_ptr, cv_PtrOfERFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfERFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfERFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::text::ERFilterConst for core::Ptr { + impl crate::text::ERFilterTraitConst for core::Ptr { #[inline] fn as_raw_ERFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::ERFilter for core::Ptr { + impl crate::text::ERFilterTrait for core::Ptr { #[inline] fn as_raw_mut_ERFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfERFilter_Callback = core::Ptr; + pub type PtrOfERFilter_Callback = core::Ptr; - ptr_extern! { dyn crate::text::ERFilter_Callback, + ptr_extern! { crate::text::ERFilter_Callback, cv_PtrOfERFilter_Callback_delete, cv_PtrOfERFilter_Callback_get_inner_ptr, cv_PtrOfERFilter_Callback_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfERFilter_Callback(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfERFilter_Callback(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::text::ERFilter_CallbackConst for core::Ptr { + impl crate::text::ERFilter_CallbackTraitConst for core::Ptr { #[inline] fn as_raw_ERFilter_Callback(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::ERFilter_Callback for core::Ptr { + impl crate::text::ERFilter_CallbackTrait for core::Ptr { #[inline] fn as_raw_mut_ERFilter_Callback(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -15550,11 +15534,11 @@ mod text_types { #[inline] fn as_raw_mut_OCRBeamSearchDecoder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::text::BaseOCRConst for core::Ptr { + impl crate::text::BaseOCRTraitConst for core::Ptr { #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::BaseOCR for core::Ptr { + impl crate::text::BaseOCRTrait for core::Ptr { #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -15600,11 +15584,11 @@ mod text_types { #[inline] fn as_raw_mut_OCRHMMDecoder(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::text::BaseOCRConst for core::Ptr { + impl crate::text::BaseOCRTraitConst for core::Ptr { #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::BaseOCR for core::Ptr { + impl crate::text::BaseOCRTrait for core::Ptr { #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -15629,84 +15613,84 @@ mod text_types { #[inline] fn as_raw_mut_OCRHMMDecoder_ClassifierCallback(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfOCRHolisticWordRecognizer = core::Ptr; + pub type PtrOfOCRHolisticWordRecognizer = core::Ptr; - ptr_extern! { dyn crate::text::OCRHolisticWordRecognizer, + ptr_extern! { crate::text::OCRHolisticWordRecognizer, cv_PtrOfOCRHolisticWordRecognizer_delete, cv_PtrOfOCRHolisticWordRecognizer_get_inner_ptr, cv_PtrOfOCRHolisticWordRecognizer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfOCRHolisticWordRecognizer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfOCRHolisticWordRecognizer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::text::OCRHolisticWordRecognizerConst for core::Ptr { + impl crate::text::OCRHolisticWordRecognizerTraitConst for core::Ptr { #[inline] fn as_raw_OCRHolisticWordRecognizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::OCRHolisticWordRecognizer for core::Ptr { + impl crate::text::OCRHolisticWordRecognizerTrait for core::Ptr { #[inline] fn as_raw_mut_OCRHolisticWordRecognizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::text::BaseOCRConst for core::Ptr { + impl crate::text::BaseOCRTraitConst for core::Ptr { #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::BaseOCR for core::Ptr { + impl crate::text::BaseOCRTrait for core::Ptr { #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfOCRTesseract = core::Ptr; + pub type PtrOfOCRTesseract = core::Ptr; - ptr_extern! { dyn crate::text::OCRTesseract, + ptr_extern! { crate::text::OCRTesseract, cv_PtrOfOCRTesseract_delete, cv_PtrOfOCRTesseract_get_inner_ptr, cv_PtrOfOCRTesseract_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfOCRTesseract(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfOCRTesseract(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::text::OCRTesseractConst for core::Ptr { + impl crate::text::OCRTesseractTraitConst for core::Ptr { #[inline] fn as_raw_OCRTesseract(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::OCRTesseract for core::Ptr { + impl crate::text::OCRTesseractTrait for core::Ptr { #[inline] fn as_raw_mut_OCRTesseract(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::text::BaseOCRConst for core::Ptr { + impl crate::text::BaseOCRTraitConst for core::Ptr { #[inline] fn as_raw_BaseOCR(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::BaseOCR for core::Ptr { + impl crate::text::BaseOCRTrait for core::Ptr { #[inline] fn as_raw_mut_BaseOCR(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTextDetectorCNN = core::Ptr; + pub type PtrOfTextDetectorCNN = core::Ptr; - ptr_extern! { dyn crate::text::TextDetectorCNN, + ptr_extern! { crate::text::TextDetectorCNN, cv_PtrOfTextDetectorCNN_delete, cv_PtrOfTextDetectorCNN_get_inner_ptr, cv_PtrOfTextDetectorCNN_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTextDetectorCNN(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTextDetectorCNN(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::text::TextDetectorCNNConst for core::Ptr { + impl crate::text::TextDetectorCNNTraitConst for core::Ptr { #[inline] fn as_raw_TextDetectorCNN(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::TextDetectorCNN for core::Ptr { + impl crate::text::TextDetectorCNNTrait for core::Ptr { #[inline] fn as_raw_mut_TextDetectorCNN(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::text::TextDetectorConst for core::Ptr { + impl crate::text::TextDetectorTraitConst for core::Ptr { #[inline] fn as_raw_TextDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::text::TextDetector for core::Ptr { + impl crate::text::TextDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_TextDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -15754,57 +15738,57 @@ pub use text_types::*; mod tracking_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfTrackerCSRT = core::Ptr; + pub type PtrOfTrackerCSRT = core::Ptr; - ptr_extern! { dyn crate::tracking::TrackerCSRT, + ptr_extern! { crate::tracking::TrackerCSRT, cv_PtrOfTrackerCSRT_delete, cv_PtrOfTrackerCSRT_get_inner_ptr, cv_PtrOfTrackerCSRT_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTrackerCSRT(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTrackerCSRT(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::tracking::TrackerCSRTConst for core::Ptr { + impl crate::tracking::TrackerCSRTTraitConst for core::Ptr { #[inline] fn as_raw_TrackerCSRT(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::tracking::TrackerCSRT for core::Ptr { + impl crate::tracking::TrackerCSRTTrait for core::Ptr { #[inline] fn as_raw_mut_TrackerCSRT(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::TrackerConst for core::Ptr { + impl crate::video::TrackerTraitConst for core::Ptr { #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::Tracker for core::Ptr { + impl crate::video::TrackerTrait for core::Ptr { #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTrackerKCF = core::Ptr; + pub type PtrOfTrackerKCF = core::Ptr; - ptr_extern! { dyn crate::tracking::TrackerKCF, + ptr_extern! { crate::tracking::TrackerKCF, cv_PtrOfTrackerKCF_delete, cv_PtrOfTrackerKCF_get_inner_ptr, cv_PtrOfTrackerKCF_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTrackerKCF(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTrackerKCF(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::tracking::TrackerKCFConst for core::Ptr { + impl crate::tracking::TrackerKCFTraitConst for core::Ptr { #[inline] fn as_raw_TrackerKCF(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::tracking::TrackerKCF for core::Ptr { + impl crate::tracking::TrackerKCFTrait for core::Ptr { #[inline] fn as_raw_mut_TrackerKCF(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::TrackerConst for core::Ptr { + impl crate::video::TrackerTraitConst for core::Ptr { #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::Tracker for core::Ptr { + impl crate::video::TrackerTrait for core::Ptr { #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -15816,375 +15800,375 @@ pub use tracking_types::*; mod video_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfBackgroundSubtractorKNN = core::Ptr; + pub type PtrOfBackgroundSubtractorKNN = core::Ptr; - ptr_extern! { dyn crate::video::BackgroundSubtractorKNN, + ptr_extern! { crate::video::BackgroundSubtractorKNN, cv_PtrOfBackgroundSubtractorKNN_delete, cv_PtrOfBackgroundSubtractorKNN_get_inner_ptr, cv_PtrOfBackgroundSubtractorKNN_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBackgroundSubtractorKNN(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBackgroundSubtractorKNN(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::BackgroundSubtractorKNNConst for core::Ptr { + impl crate::video::BackgroundSubtractorKNNTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractorKNN(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractorKNN for core::Ptr { + impl crate::video::BackgroundSubtractorKNNTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractorKNN(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfBackgroundSubtractorMOG2 = core::Ptr; + pub type PtrOfBackgroundSubtractorMOG2 = core::Ptr; - ptr_extern! { dyn crate::video::BackgroundSubtractorMOG2, + ptr_extern! { crate::video::BackgroundSubtractorMOG2, cv_PtrOfBackgroundSubtractorMOG2_delete, cv_PtrOfBackgroundSubtractorMOG2_get_inner_ptr, cv_PtrOfBackgroundSubtractorMOG2_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBackgroundSubtractorMOG2(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBackgroundSubtractorMOG2(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::BackgroundSubtractorMOG2Const for core::Ptr { + impl crate::video::BackgroundSubtractorMOG2TraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractorMOG2(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractorMOG2 for core::Ptr { + impl crate::video::BackgroundSubtractorMOG2Trait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractorMOG2(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::BackgroundSubtractorConst for core::Ptr { + impl crate::video::BackgroundSubtractorTraitConst for core::Ptr { #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::BackgroundSubtractor for core::Ptr { + impl crate::video::BackgroundSubtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDISOpticalFlow = core::Ptr; + pub type PtrOfDISOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::video::DISOpticalFlow, + ptr_extern! { crate::video::DISOpticalFlow, cv_PtrOfDISOpticalFlow_delete, cv_PtrOfDISOpticalFlow_get_inner_ptr, cv_PtrOfDISOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDISOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDISOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::DISOpticalFlowConst for core::Ptr { + impl crate::video::DISOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DISOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::DISOpticalFlow for core::Ptr { + impl crate::video::DISOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DISOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::DenseOpticalFlowConst for core::Ptr { + impl crate::video::DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::DenseOpticalFlow for core::Ptr { + impl crate::video::DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDenseOpticalFlow = core::Ptr; + pub type PtrOfDenseOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::video::DenseOpticalFlow, + ptr_extern! { crate::video::DenseOpticalFlow, cv_PtrOfDenseOpticalFlow_delete, cv_PtrOfDenseOpticalFlow_get_inner_ptr, cv_PtrOfDenseOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDenseOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDenseOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::DenseOpticalFlowConst for core::Ptr { + impl crate::video::DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::DenseOpticalFlow for core::Ptr { + impl crate::video::DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFarnebackOpticalFlow = core::Ptr; + pub type PtrOfFarnebackOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::video::FarnebackOpticalFlow, + ptr_extern! { crate::video::FarnebackOpticalFlow, cv_PtrOfFarnebackOpticalFlow_delete, cv_PtrOfFarnebackOpticalFlow_get_inner_ptr, cv_PtrOfFarnebackOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFarnebackOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFarnebackOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::FarnebackOpticalFlowConst for core::Ptr { + impl crate::video::FarnebackOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_FarnebackOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::FarnebackOpticalFlow for core::Ptr { + impl crate::video::FarnebackOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_FarnebackOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::DenseOpticalFlowConst for core::Ptr { + impl crate::video::DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::DenseOpticalFlow for core::Ptr { + impl crate::video::DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSparseOpticalFlow = core::Ptr; + pub type PtrOfSparseOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::video::SparseOpticalFlow, + ptr_extern! { crate::video::SparseOpticalFlow, cv_PtrOfSparseOpticalFlow_delete, cv_PtrOfSparseOpticalFlow_get_inner_ptr, cv_PtrOfSparseOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSparseOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSparseOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::SparseOpticalFlowConst for core::Ptr { + impl crate::video::SparseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_SparseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::SparseOpticalFlow for core::Ptr { + impl crate::video::SparseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_SparseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSparsePyrLKOpticalFlow = core::Ptr; + pub type PtrOfSparsePyrLKOpticalFlow = core::Ptr; - ptr_extern! { dyn crate::video::SparsePyrLKOpticalFlow, + ptr_extern! { crate::video::SparsePyrLKOpticalFlow, cv_PtrOfSparsePyrLKOpticalFlow_delete, cv_PtrOfSparsePyrLKOpticalFlow_get_inner_ptr, cv_PtrOfSparsePyrLKOpticalFlow_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSparsePyrLKOpticalFlow(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSparsePyrLKOpticalFlow(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::SparsePyrLKOpticalFlowConst for core::Ptr { + impl crate::video::SparsePyrLKOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_SparsePyrLKOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::SparsePyrLKOpticalFlow for core::Ptr { + impl crate::video::SparsePyrLKOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_SparsePyrLKOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::SparseOpticalFlowConst for core::Ptr { + impl crate::video::SparseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_SparseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::SparseOpticalFlow for core::Ptr { + impl crate::video::SparseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_SparseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTrackerDaSiamRPN = core::Ptr; + pub type PtrOfTrackerDaSiamRPN = core::Ptr; - ptr_extern! { dyn crate::video::TrackerDaSiamRPN, + ptr_extern! { crate::video::TrackerDaSiamRPN, cv_PtrOfTrackerDaSiamRPN_delete, cv_PtrOfTrackerDaSiamRPN_get_inner_ptr, cv_PtrOfTrackerDaSiamRPN_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTrackerDaSiamRPN(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTrackerDaSiamRPN(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::TrackerDaSiamRPNConst for core::Ptr { + impl crate::video::TrackerDaSiamRPNTraitConst for core::Ptr { #[inline] fn as_raw_TrackerDaSiamRPN(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::TrackerDaSiamRPN for core::Ptr { + impl crate::video::TrackerDaSiamRPNTrait for core::Ptr { #[inline] fn as_raw_mut_TrackerDaSiamRPN(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::TrackerConst for core::Ptr { + impl crate::video::TrackerTraitConst for core::Ptr { #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::Tracker for core::Ptr { + impl crate::video::TrackerTrait for core::Ptr { #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTrackerGOTURN = core::Ptr; + pub type PtrOfTrackerGOTURN = core::Ptr; - ptr_extern! { dyn crate::video::TrackerGOTURN, + ptr_extern! { crate::video::TrackerGOTURN, cv_PtrOfTrackerGOTURN_delete, cv_PtrOfTrackerGOTURN_get_inner_ptr, cv_PtrOfTrackerGOTURN_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTrackerGOTURN(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTrackerGOTURN(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::TrackerGOTURNConst for core::Ptr { + impl crate::video::TrackerGOTURNTraitConst for core::Ptr { #[inline] fn as_raw_TrackerGOTURN(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::TrackerGOTURN for core::Ptr { + impl crate::video::TrackerGOTURNTrait for core::Ptr { #[inline] fn as_raw_mut_TrackerGOTURN(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::TrackerConst for core::Ptr { + impl crate::video::TrackerTraitConst for core::Ptr { #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::Tracker for core::Ptr { + impl crate::video::TrackerTrait for core::Ptr { #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTrackerMIL = core::Ptr; + pub type PtrOfTrackerMIL = core::Ptr; - ptr_extern! { dyn crate::video::TrackerMIL, + ptr_extern! { crate::video::TrackerMIL, cv_PtrOfTrackerMIL_delete, cv_PtrOfTrackerMIL_get_inner_ptr, cv_PtrOfTrackerMIL_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTrackerMIL(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTrackerMIL(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::TrackerMILConst for core::Ptr { + impl crate::video::TrackerMILTraitConst for core::Ptr { #[inline] fn as_raw_TrackerMIL(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::TrackerMIL for core::Ptr { + impl crate::video::TrackerMILTrait for core::Ptr { #[inline] fn as_raw_mut_TrackerMIL(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::TrackerConst for core::Ptr { + impl crate::video::TrackerTraitConst for core::Ptr { #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::Tracker for core::Ptr { + impl crate::video::TrackerTrait for core::Ptr { #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTrackerNano = core::Ptr; + pub type PtrOfTrackerNano = core::Ptr; - ptr_extern! { dyn crate::video::TrackerNano, + ptr_extern! { crate::video::TrackerNano, cv_PtrOfTrackerNano_delete, cv_PtrOfTrackerNano_get_inner_ptr, cv_PtrOfTrackerNano_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTrackerNano(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTrackerNano(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::TrackerNanoConst for core::Ptr { + impl crate::video::TrackerNanoTraitConst for core::Ptr { #[inline] fn as_raw_TrackerNano(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::TrackerNano for core::Ptr { + impl crate::video::TrackerNanoTrait for core::Ptr { #[inline] fn as_raw_mut_TrackerNano(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::TrackerConst for core::Ptr { + impl crate::video::TrackerTraitConst for core::Ptr { #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::Tracker for core::Ptr { + impl crate::video::TrackerTrait for core::Ptr { #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfVariationalRefinement = core::Ptr; + pub type PtrOfVariationalRefinement = core::Ptr; - ptr_extern! { dyn crate::video::VariationalRefinement, + ptr_extern! { crate::video::VariationalRefinement, cv_PtrOfVariationalRefinement_delete, cv_PtrOfVariationalRefinement_get_inner_ptr, cv_PtrOfVariationalRefinement_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfVariationalRefinement(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfVariationalRefinement(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::video::VariationalRefinementConst for core::Ptr { + impl crate::video::VariationalRefinementTraitConst for core::Ptr { #[inline] fn as_raw_VariationalRefinement(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::VariationalRefinement for core::Ptr { + impl crate::video::VariationalRefinementTrait for core::Ptr { #[inline] fn as_raw_mut_VariationalRefinement(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::video::DenseOpticalFlowConst for core::Ptr { + impl crate::video::DenseOpticalFlowTraitConst for core::Ptr { #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::video::DenseOpticalFlow for core::Ptr { + impl crate::video::DenseOpticalFlowTrait for core::Ptr { #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -16264,15 +16248,15 @@ mod videostab_types { #[inline] fn as_raw_mut_ColorAverageInpainter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::InpainterBaseConst for core::Ptr { + impl crate::videostab::InpainterBaseTraitConst for core::Ptr { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::InpainterBase for core::Ptr { + impl crate::videostab::InpainterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfColorAverageInpainter, core::Ptr, cv_PtrOfColorAverageInpainter_to_PtrOfInpainterBase } + ptr_cast_base! { PtrOfColorAverageInpainter, core::Ptr, cv_PtrOfColorAverageInpainter_to_PtrOfInpainterBase } pub type PtrOfColorInpainter = core::Ptr; @@ -16295,15 +16279,15 @@ mod videostab_types { #[inline] fn as_raw_mut_ColorInpainter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::InpainterBaseConst for core::Ptr { + impl crate::videostab::InpainterBaseTraitConst for core::Ptr { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::InpainterBase for core::Ptr { + impl crate::videostab::InpainterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfColorInpainter, core::Ptr, cv_PtrOfColorInpainter_to_PtrOfInpainterBase } + ptr_cast_base! { PtrOfColorInpainter, core::Ptr, cv_PtrOfColorInpainter_to_PtrOfInpainterBase } pub type PtrOfConsistentMosaicInpainter = core::Ptr; @@ -16326,32 +16310,32 @@ mod videostab_types { #[inline] fn as_raw_mut_ConsistentMosaicInpainter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::InpainterBaseConst for core::Ptr { + impl crate::videostab::InpainterBaseTraitConst for core::Ptr { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::InpainterBase for core::Ptr { + impl crate::videostab::InpainterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfConsistentMosaicInpainter, core::Ptr, cv_PtrOfConsistentMosaicInpainter_to_PtrOfInpainterBase } + ptr_cast_base! { PtrOfConsistentMosaicInpainter, core::Ptr, cv_PtrOfConsistentMosaicInpainter_to_PtrOfInpainterBase } - pub type PtrOfDeblurerBase = core::Ptr; + pub type PtrOfDeblurerBase = core::Ptr; - ptr_extern! { dyn crate::videostab::DeblurerBase, + ptr_extern! { crate::videostab::DeblurerBase, cv_PtrOfDeblurerBase_delete, cv_PtrOfDeblurerBase_get_inner_ptr, cv_PtrOfDeblurerBase_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDeblurerBase(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDeblurerBase(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::DeblurerBaseConst for core::Ptr { + impl crate::videostab::DeblurerBaseTraitConst for core::Ptr { #[inline] fn as_raw_DeblurerBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::DeblurerBase for core::Ptr { + impl crate::videostab::DeblurerBaseTrait for core::Ptr { #[inline] fn as_raw_mut_DeblurerBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -16376,15 +16360,15 @@ mod videostab_types { #[inline] fn as_raw_mut_DensePyrLkOptFlowEstimatorGpu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IDenseOptFlowEstimatorConst for core::Ptr { + impl crate::videostab::IDenseOptFlowEstimatorTraitConst for core::Ptr { #[inline] fn as_raw_IDenseOptFlowEstimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IDenseOptFlowEstimator for core::Ptr { + impl crate::videostab::IDenseOptFlowEstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_IDenseOptFlowEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfDensePyrLkOptFlowEstimatorGpu, core::Ptr, cv_PtrOfDensePyrLkOptFlowEstimatorGpu_to_PtrOfIDenseOptFlowEstimator } + ptr_cast_base! { PtrOfDensePyrLkOptFlowEstimatorGpu, core::Ptr, cv_PtrOfDensePyrLkOptFlowEstimatorGpu_to_PtrOfIDenseOptFlowEstimator } impl crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_PyrLkOptFlowEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } @@ -16415,15 +16399,15 @@ mod videostab_types { #[inline] fn as_raw_mut_FromFileMotionReader(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::ImageMotionEstimatorBaseConst for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfFromFileMotionReader, core::Ptr, cv_PtrOfFromFileMotionReader_to_PtrOfImageMotionEstimatorBase } + ptr_cast_base! { PtrOfFromFileMotionReader, core::Ptr, cv_PtrOfFromFileMotionReader_to_PtrOfImageMotionEstimatorBase } pub type PtrOfGaussianMotionFilter = core::Ptr; @@ -16446,175 +16430,175 @@ mod videostab_types { #[inline] fn as_raw_mut_GaussianMotionFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IMotionStabilizerConst for core::Ptr { + impl crate::videostab::IMotionStabilizerTraitConst for core::Ptr { #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IMotionStabilizer for core::Ptr { + impl crate::videostab::IMotionStabilizerTrait for core::Ptr { #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfGaussianMotionFilter, core::Ptr, cv_PtrOfGaussianMotionFilter_to_PtrOfIMotionStabilizer } + ptr_cast_base! { PtrOfGaussianMotionFilter, core::Ptr, cv_PtrOfGaussianMotionFilter_to_PtrOfIMotionStabilizer } - impl crate::videostab::MotionFilterBaseConst for core::Ptr { + impl crate::videostab::MotionFilterBaseTraitConst for core::Ptr { #[inline] fn as_raw_MotionFilterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::MotionFilterBase for core::Ptr { + impl crate::videostab::MotionFilterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_MotionFilterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfGaussianMotionFilter, core::Ptr, cv_PtrOfGaussianMotionFilter_to_PtrOfMotionFilterBase } + ptr_cast_base! { PtrOfGaussianMotionFilter, core::Ptr, cv_PtrOfGaussianMotionFilter_to_PtrOfMotionFilterBase } - pub type PtrOfIDenseOptFlowEstimator = core::Ptr; + pub type PtrOfIDenseOptFlowEstimator = core::Ptr; - ptr_extern! { dyn crate::videostab::IDenseOptFlowEstimator, + ptr_extern! { crate::videostab::IDenseOptFlowEstimator, cv_PtrOfIDenseOptFlowEstimator_delete, cv_PtrOfIDenseOptFlowEstimator_get_inner_ptr, cv_PtrOfIDenseOptFlowEstimator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfIDenseOptFlowEstimator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfIDenseOptFlowEstimator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::IDenseOptFlowEstimatorConst for core::Ptr { + impl crate::videostab::IDenseOptFlowEstimatorTraitConst for core::Ptr { #[inline] fn as_raw_IDenseOptFlowEstimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IDenseOptFlowEstimator for core::Ptr { + impl crate::videostab::IDenseOptFlowEstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_IDenseOptFlowEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfIFrameSource = core::Ptr; + pub type PtrOfIFrameSource = core::Ptr; - ptr_extern! { dyn crate::videostab::IFrameSource, + ptr_extern! { crate::videostab::IFrameSource, cv_PtrOfIFrameSource_delete, cv_PtrOfIFrameSource_get_inner_ptr, cv_PtrOfIFrameSource_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfIFrameSource(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfIFrameSource(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::IFrameSourceConst for core::Ptr { + impl crate::videostab::IFrameSourceTraitConst for core::Ptr { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IFrameSource for core::Ptr { + impl crate::videostab::IFrameSourceTrait for core::Ptr { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfILog = core::Ptr; + pub type PtrOfILog = core::Ptr; - ptr_extern! { dyn crate::videostab::ILog, + ptr_extern! { crate::videostab::ILog, cv_PtrOfILog_delete, cv_PtrOfILog_get_inner_ptr, cv_PtrOfILog_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfILog(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfILog(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::ILogConst for core::Ptr { + impl crate::videostab::ILogTraitConst for core::Ptr { #[inline] fn as_raw_ILog(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ILog for core::Ptr { + impl crate::videostab::ILogTrait for core::Ptr { #[inline] fn as_raw_mut_ILog(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfIMotionStabilizer = core::Ptr; + pub type PtrOfIMotionStabilizer = core::Ptr; - ptr_extern! { dyn crate::videostab::IMotionStabilizer, + ptr_extern! { crate::videostab::IMotionStabilizer, cv_PtrOfIMotionStabilizer_delete, cv_PtrOfIMotionStabilizer_get_inner_ptr, cv_PtrOfIMotionStabilizer_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfIMotionStabilizer(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfIMotionStabilizer(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::IMotionStabilizerConst for core::Ptr { + impl crate::videostab::IMotionStabilizerTraitConst for core::Ptr { #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IMotionStabilizer for core::Ptr { + impl crate::videostab::IMotionStabilizerTrait for core::Ptr { #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfIOutlierRejector = core::Ptr; + pub type PtrOfIOutlierRejector = core::Ptr; - ptr_extern! { dyn crate::videostab::IOutlierRejector, + ptr_extern! { crate::videostab::IOutlierRejector, cv_PtrOfIOutlierRejector_delete, cv_PtrOfIOutlierRejector_get_inner_ptr, cv_PtrOfIOutlierRejector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfIOutlierRejector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfIOutlierRejector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::IOutlierRejectorConst for core::Ptr { + impl crate::videostab::IOutlierRejectorTraitConst for core::Ptr { #[inline] fn as_raw_IOutlierRejector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IOutlierRejector for core::Ptr { + impl crate::videostab::IOutlierRejectorTrait for core::Ptr { #[inline] fn as_raw_mut_IOutlierRejector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfISparseOptFlowEstimator = core::Ptr; + pub type PtrOfISparseOptFlowEstimator = core::Ptr; - ptr_extern! { dyn crate::videostab::ISparseOptFlowEstimator, + ptr_extern! { crate::videostab::ISparseOptFlowEstimator, cv_PtrOfISparseOptFlowEstimator_delete, cv_PtrOfISparseOptFlowEstimator_get_inner_ptr, cv_PtrOfISparseOptFlowEstimator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfISparseOptFlowEstimator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfISparseOptFlowEstimator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::ISparseOptFlowEstimatorConst for core::Ptr { + impl crate::videostab::ISparseOptFlowEstimatorTraitConst for core::Ptr { #[inline] fn as_raw_ISparseOptFlowEstimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ISparseOptFlowEstimator for core::Ptr { + impl crate::videostab::ISparseOptFlowEstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_ISparseOptFlowEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfImageMotionEstimatorBase = core::Ptr; + pub type PtrOfImageMotionEstimatorBase = core::Ptr; - ptr_extern! { dyn crate::videostab::ImageMotionEstimatorBase, + ptr_extern! { crate::videostab::ImageMotionEstimatorBase, cv_PtrOfImageMotionEstimatorBase_delete, cv_PtrOfImageMotionEstimatorBase_get_inner_ptr, cv_PtrOfImageMotionEstimatorBase_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfImageMotionEstimatorBase(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfImageMotionEstimatorBase(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::ImageMotionEstimatorBaseConst for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfInpainterBase = core::Ptr; + pub type PtrOfInpainterBase = core::Ptr; - ptr_extern! { dyn crate::videostab::InpainterBase, + ptr_extern! { crate::videostab::InpainterBase, cv_PtrOfInpainterBase_delete, cv_PtrOfInpainterBase_get_inner_ptr, cv_PtrOfInpainterBase_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfInpainterBase(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfInpainterBase(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::InpainterBaseConst for core::Ptr { + impl crate::videostab::InpainterBaseTraitConst for core::Ptr { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::InpainterBase for core::Ptr { + impl crate::videostab::InpainterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -16639,15 +16623,15 @@ mod videostab_types { #[inline] fn as_raw_mut_InpaintingPipeline(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::InpainterBaseConst for core::Ptr { + impl crate::videostab::InpainterBaseTraitConst for core::Ptr { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::InpainterBase for core::Ptr { + impl crate::videostab::InpainterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfInpaintingPipeline, core::Ptr, cv_PtrOfInpaintingPipeline_to_PtrOfInpainterBase } + ptr_cast_base! { PtrOfInpaintingPipeline, core::Ptr, cv_PtrOfInpaintingPipeline_to_PtrOfInpainterBase } pub type PtrOfKeypointBasedMotionEstimator = core::Ptr; @@ -16670,15 +16654,15 @@ mod videostab_types { #[inline] fn as_raw_mut_KeypointBasedMotionEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::ImageMotionEstimatorBaseConst for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfKeypointBasedMotionEstimator, core::Ptr, cv_PtrOfKeypointBasedMotionEstimator_to_PtrOfImageMotionEstimatorBase } + ptr_cast_base! { PtrOfKeypointBasedMotionEstimator, core::Ptr, cv_PtrOfKeypointBasedMotionEstimator_to_PtrOfImageMotionEstimatorBase } pub type PtrOfKeypointBasedMotionEstimatorGpu = core::Ptr; @@ -16701,15 +16685,15 @@ mod videostab_types { #[inline] fn as_raw_mut_KeypointBasedMotionEstimatorGpu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::ImageMotionEstimatorBaseConst for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfKeypointBasedMotionEstimatorGpu, core::Ptr, cv_PtrOfKeypointBasedMotionEstimatorGpu_to_PtrOfImageMotionEstimatorBase } + ptr_cast_base! { PtrOfKeypointBasedMotionEstimatorGpu, core::Ptr, cv_PtrOfKeypointBasedMotionEstimatorGpu_to_PtrOfImageMotionEstimatorBase } pub type PtrOfLogToStdout = core::Ptr; @@ -16732,15 +16716,15 @@ mod videostab_types { #[inline] fn as_raw_mut_LogToStdout(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::ILogConst for core::Ptr { + impl crate::videostab::ILogTraitConst for core::Ptr { #[inline] fn as_raw_ILog(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ILog for core::Ptr { + impl crate::videostab::ILogTrait for core::Ptr { #[inline] fn as_raw_mut_ILog(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfLogToStdout, core::Ptr, cv_PtrOfLogToStdout_to_PtrOfILog } + ptr_cast_base! { PtrOfLogToStdout, core::Ptr, cv_PtrOfLogToStdout_to_PtrOfILog } pub type PtrOfLpMotionStabilizer = core::Ptr; @@ -16763,15 +16747,15 @@ mod videostab_types { #[inline] fn as_raw_mut_LpMotionStabilizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IMotionStabilizerConst for core::Ptr { + impl crate::videostab::IMotionStabilizerTraitConst for core::Ptr { #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IMotionStabilizer for core::Ptr { + impl crate::videostab::IMotionStabilizerTrait for core::Ptr { #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfLpMotionStabilizer, core::Ptr, cv_PtrOfLpMotionStabilizer_to_PtrOfIMotionStabilizer } + ptr_cast_base! { PtrOfLpMotionStabilizer, core::Ptr, cv_PtrOfLpMotionStabilizer_to_PtrOfIMotionStabilizer } pub type PtrOfMaskFrameSource = core::Ptr; @@ -16794,15 +16778,15 @@ mod videostab_types { #[inline] fn as_raw_mut_MaskFrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IFrameSourceConst for core::Ptr { + impl crate::videostab::IFrameSourceTraitConst for core::Ptr { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IFrameSource for core::Ptr { + impl crate::videostab::IFrameSourceTrait for core::Ptr { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMaskFrameSource, core::Ptr, cv_PtrOfMaskFrameSource_to_PtrOfIFrameSource } + ptr_cast_base! { PtrOfMaskFrameSource, core::Ptr, cv_PtrOfMaskFrameSource_to_PtrOfIFrameSource } pub type PtrOfMoreAccurateMotionWobbleSuppressor = core::Ptr; @@ -16825,54 +16809,54 @@ mod videostab_types { #[inline] fn as_raw_mut_MoreAccurateMotionWobbleSuppressor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseConst for core::Ptr { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst for core::Ptr { #[inline] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBase for core::Ptr { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_MoreAccurateMotionWobbleSuppressorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressor, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressor_to_PtrOfMoreAccurateMotionWobbleSuppressorBase } + ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressor, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressor_to_PtrOfMoreAccurateMotionWobbleSuppressorBase } - impl crate::videostab::WobbleSuppressorBaseConst for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTraitConst for core::Ptr { #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::WobbleSuppressorBase for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressor, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressor_to_PtrOfWobbleSuppressorBase } + ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressor, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressor_to_PtrOfWobbleSuppressorBase } - pub type PtrOfMoreAccurateMotionWobbleSuppressorBase = core::Ptr; + pub type PtrOfMoreAccurateMotionWobbleSuppressorBase = core::Ptr; - ptr_extern! { dyn crate::videostab::MoreAccurateMotionWobbleSuppressorBase, + ptr_extern! { crate::videostab::MoreAccurateMotionWobbleSuppressorBase, cv_PtrOfMoreAccurateMotionWobbleSuppressorBase_delete, cv_PtrOfMoreAccurateMotionWobbleSuppressorBase_get_inner_ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressorBase_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMoreAccurateMotionWobbleSuppressorBase(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMoreAccurateMotionWobbleSuppressorBase(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseConst for core::Ptr { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst for core::Ptr { #[inline] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBase for core::Ptr { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_MoreAccurateMotionWobbleSuppressorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::WobbleSuppressorBaseConst for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTraitConst for core::Ptr { #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::WobbleSuppressorBase for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressorBase, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressorBase_to_PtrOfWobbleSuppressorBase } + ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressorBase, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressorBase_to_PtrOfWobbleSuppressorBase } pub type PtrOfMoreAccurateMotionWobbleSuppressorGpu = core::Ptr; @@ -16895,42 +16879,42 @@ mod videostab_types { #[inline] fn as_raw_mut_MoreAccurateMotionWobbleSuppressorGpu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseConst for core::Ptr { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst for core::Ptr { #[inline] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBase for core::Ptr { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_MoreAccurateMotionWobbleSuppressorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressorGpu, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressorGpu_to_PtrOfMoreAccurateMotionWobbleSuppressorBase } + ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressorGpu, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressorGpu_to_PtrOfMoreAccurateMotionWobbleSuppressorBase } - impl crate::videostab::WobbleSuppressorBaseConst for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTraitConst for core::Ptr { #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::WobbleSuppressorBase for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressorGpu, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressorGpu_to_PtrOfWobbleSuppressorBase } + ptr_cast_base! { PtrOfMoreAccurateMotionWobbleSuppressorGpu, core::Ptr, cv_PtrOfMoreAccurateMotionWobbleSuppressorGpu_to_PtrOfWobbleSuppressorBase } - pub type PtrOfMotionEstimatorBase = core::Ptr; + pub type PtrOfMotionEstimatorBase = core::Ptr; - ptr_extern! { dyn crate::videostab::MotionEstimatorBase, + ptr_extern! { crate::videostab::MotionEstimatorBase, cv_PtrOfMotionEstimatorBase_delete, cv_PtrOfMotionEstimatorBase_get_inner_ptr, cv_PtrOfMotionEstimatorBase_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMotionEstimatorBase(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMotionEstimatorBase(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::MotionEstimatorBaseConst for core::Ptr { + impl crate::videostab::MotionEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_MotionEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::MotionEstimatorBase for core::Ptr { + impl crate::videostab::MotionEstimatorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_MotionEstimatorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -16955,15 +16939,15 @@ mod videostab_types { #[inline] fn as_raw_mut_MotionEstimatorL1(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::MotionEstimatorBaseConst for core::Ptr { + impl crate::videostab::MotionEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_MotionEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::MotionEstimatorBase for core::Ptr { + impl crate::videostab::MotionEstimatorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_MotionEstimatorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMotionEstimatorL1, core::Ptr, cv_PtrOfMotionEstimatorL1_to_PtrOfMotionEstimatorBase } + ptr_cast_base! { PtrOfMotionEstimatorL1, core::Ptr, cv_PtrOfMotionEstimatorL1_to_PtrOfMotionEstimatorBase } pub type PtrOfMotionEstimatorRansacL2 = core::Ptr; @@ -16986,44 +16970,44 @@ mod videostab_types { #[inline] fn as_raw_mut_MotionEstimatorRansacL2(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::MotionEstimatorBaseConst for core::Ptr { + impl crate::videostab::MotionEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_MotionEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::MotionEstimatorBase for core::Ptr { + impl crate::videostab::MotionEstimatorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_MotionEstimatorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMotionEstimatorRansacL2, core::Ptr, cv_PtrOfMotionEstimatorRansacL2_to_PtrOfMotionEstimatorBase } + ptr_cast_base! { PtrOfMotionEstimatorRansacL2, core::Ptr, cv_PtrOfMotionEstimatorRansacL2_to_PtrOfMotionEstimatorBase } - pub type PtrOfMotionFilterBase = core::Ptr; + pub type PtrOfMotionFilterBase = core::Ptr; - ptr_extern! { dyn crate::videostab::MotionFilterBase, + ptr_extern! { crate::videostab::MotionFilterBase, cv_PtrOfMotionFilterBase_delete, cv_PtrOfMotionFilterBase_get_inner_ptr, cv_PtrOfMotionFilterBase_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMotionFilterBase(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMotionFilterBase(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::MotionFilterBaseConst for core::Ptr { + impl crate::videostab::MotionFilterBaseTraitConst for core::Ptr { #[inline] fn as_raw_MotionFilterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::MotionFilterBase for core::Ptr { + impl crate::videostab::MotionFilterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_MotionFilterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IMotionStabilizerConst for core::Ptr { + impl crate::videostab::IMotionStabilizerTraitConst for core::Ptr { #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IMotionStabilizer for core::Ptr { + impl crate::videostab::IMotionStabilizerTrait for core::Ptr { #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMotionFilterBase, core::Ptr, cv_PtrOfMotionFilterBase_to_PtrOfIMotionStabilizer } + ptr_cast_base! { PtrOfMotionFilterBase, core::Ptr, cv_PtrOfMotionFilterBase_to_PtrOfIMotionStabilizer } pub type PtrOfMotionInpainter = core::Ptr; @@ -17046,15 +17030,15 @@ mod videostab_types { #[inline] fn as_raw_mut_MotionInpainter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::InpainterBaseConst for core::Ptr { + impl crate::videostab::InpainterBaseTraitConst for core::Ptr { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::InpainterBase for core::Ptr { + impl crate::videostab::InpainterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMotionInpainter, core::Ptr, cv_PtrOfMotionInpainter_to_PtrOfInpainterBase } + ptr_cast_base! { PtrOfMotionInpainter, core::Ptr, cv_PtrOfMotionInpainter_to_PtrOfInpainterBase } pub type PtrOfMotionStabilizationPipeline = core::Ptr; @@ -17077,15 +17061,15 @@ mod videostab_types { #[inline] fn as_raw_mut_MotionStabilizationPipeline(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IMotionStabilizerConst for core::Ptr { + impl crate::videostab::IMotionStabilizerTraitConst for core::Ptr { #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IMotionStabilizer for core::Ptr { + impl crate::videostab::IMotionStabilizerTrait for core::Ptr { #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfMotionStabilizationPipeline, core::Ptr, cv_PtrOfMotionStabilizationPipeline_to_PtrOfIMotionStabilizer } + ptr_cast_base! { PtrOfMotionStabilizationPipeline, core::Ptr, cv_PtrOfMotionStabilizationPipeline_to_PtrOfIMotionStabilizer } pub type PtrOfNullDeblurer = core::Ptr; @@ -17108,15 +17092,15 @@ mod videostab_types { #[inline] fn as_raw_mut_NullDeblurer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::DeblurerBaseConst for core::Ptr { + impl crate::videostab::DeblurerBaseTraitConst for core::Ptr { #[inline] fn as_raw_DeblurerBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::DeblurerBase for core::Ptr { + impl crate::videostab::DeblurerBaseTrait for core::Ptr { #[inline] fn as_raw_mut_DeblurerBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfNullDeblurer, core::Ptr, cv_PtrOfNullDeblurer_to_PtrOfDeblurerBase } + ptr_cast_base! { PtrOfNullDeblurer, core::Ptr, cv_PtrOfNullDeblurer_to_PtrOfDeblurerBase } pub type PtrOfNullFrameSource = core::Ptr; @@ -17139,15 +17123,15 @@ mod videostab_types { #[inline] fn as_raw_mut_NullFrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IFrameSourceConst for core::Ptr { + impl crate::videostab::IFrameSourceTraitConst for core::Ptr { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IFrameSource for core::Ptr { + impl crate::videostab::IFrameSourceTrait for core::Ptr { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfNullFrameSource, core::Ptr, cv_PtrOfNullFrameSource_to_PtrOfIFrameSource } + ptr_cast_base! { PtrOfNullFrameSource, core::Ptr, cv_PtrOfNullFrameSource_to_PtrOfIFrameSource } pub type PtrOfNullInpainter = core::Ptr; @@ -17170,15 +17154,15 @@ mod videostab_types { #[inline] fn as_raw_mut_NullInpainter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::InpainterBaseConst for core::Ptr { + impl crate::videostab::InpainterBaseTraitConst for core::Ptr { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::InpainterBase for core::Ptr { + impl crate::videostab::InpainterBaseTrait for core::Ptr { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfNullInpainter, core::Ptr, cv_PtrOfNullInpainter_to_PtrOfInpainterBase } + ptr_cast_base! { PtrOfNullInpainter, core::Ptr, cv_PtrOfNullInpainter_to_PtrOfInpainterBase } pub type PtrOfNullLog = core::Ptr; @@ -17201,15 +17185,15 @@ mod videostab_types { #[inline] fn as_raw_mut_NullLog(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::ILogConst for core::Ptr { + impl crate::videostab::ILogTraitConst for core::Ptr { #[inline] fn as_raw_ILog(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ILog for core::Ptr { + impl crate::videostab::ILogTrait for core::Ptr { #[inline] fn as_raw_mut_ILog(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfNullLog, core::Ptr, cv_PtrOfNullLog_to_PtrOfILog } + ptr_cast_base! { PtrOfNullLog, core::Ptr, cv_PtrOfNullLog_to_PtrOfILog } pub type PtrOfNullOutlierRejector = core::Ptr; @@ -17232,15 +17216,15 @@ mod videostab_types { #[inline] fn as_raw_mut_NullOutlierRejector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IOutlierRejectorConst for core::Ptr { + impl crate::videostab::IOutlierRejectorTraitConst for core::Ptr { #[inline] fn as_raw_IOutlierRejector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IOutlierRejector for core::Ptr { + impl crate::videostab::IOutlierRejectorTrait for core::Ptr { #[inline] fn as_raw_mut_IOutlierRejector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfNullOutlierRejector, core::Ptr, cv_PtrOfNullOutlierRejector_to_PtrOfIOutlierRejector } + ptr_cast_base! { PtrOfNullOutlierRejector, core::Ptr, cv_PtrOfNullOutlierRejector_to_PtrOfIOutlierRejector } pub type PtrOfNullWobbleSuppressor = core::Ptr; @@ -17263,15 +17247,15 @@ mod videostab_types { #[inline] fn as_raw_mut_NullWobbleSuppressor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::WobbleSuppressorBaseConst for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTraitConst for core::Ptr { #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::WobbleSuppressorBase for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfNullWobbleSuppressor, core::Ptr, cv_PtrOfNullWobbleSuppressor_to_PtrOfWobbleSuppressorBase } + ptr_cast_base! { PtrOfNullWobbleSuppressor, core::Ptr, cv_PtrOfNullWobbleSuppressor_to_PtrOfWobbleSuppressorBase } pub type PtrOfOnePassStabilizer = core::Ptr; @@ -17294,21 +17278,21 @@ mod videostab_types { #[inline] fn as_raw_mut_OnePassStabilizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IFrameSourceConst for core::Ptr { + impl crate::videostab::IFrameSourceTraitConst for core::Ptr { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IFrameSource for core::Ptr { + impl crate::videostab::IFrameSourceTrait for core::Ptr { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfOnePassStabilizer, core::Ptr, cv_PtrOfOnePassStabilizer_to_PtrOfIFrameSource } + ptr_cast_base! { PtrOfOnePassStabilizer, core::Ptr, cv_PtrOfOnePassStabilizer_to_PtrOfIFrameSource } - impl crate::videostab::StabilizerBaseConst for core::Ptr { + impl crate::videostab::StabilizerBaseTraitConst for core::Ptr { #[inline] fn as_raw_StabilizerBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::StabilizerBase for core::Ptr { + impl crate::videostab::StabilizerBaseTrait for core::Ptr { #[inline] fn as_raw_mut_StabilizerBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -17333,15 +17317,15 @@ mod videostab_types { #[inline] fn as_raw_mut_SparsePyrLkOptFlowEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::ISparseOptFlowEstimatorConst for core::Ptr { + impl crate::videostab::ISparseOptFlowEstimatorTraitConst for core::Ptr { #[inline] fn as_raw_ISparseOptFlowEstimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ISparseOptFlowEstimator for core::Ptr { + impl crate::videostab::ISparseOptFlowEstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_ISparseOptFlowEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSparsePyrLkOptFlowEstimator, core::Ptr, cv_PtrOfSparsePyrLkOptFlowEstimator_to_PtrOfISparseOptFlowEstimator } + ptr_cast_base! { PtrOfSparsePyrLkOptFlowEstimator, core::Ptr, cv_PtrOfSparsePyrLkOptFlowEstimator_to_PtrOfISparseOptFlowEstimator } impl crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_PyrLkOptFlowEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } @@ -17372,15 +17356,15 @@ mod videostab_types { #[inline] fn as_raw_mut_SparsePyrLkOptFlowEstimatorGpu(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::ISparseOptFlowEstimatorConst for core::Ptr { + impl crate::videostab::ISparseOptFlowEstimatorTraitConst for core::Ptr { #[inline] fn as_raw_ISparseOptFlowEstimator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ISparseOptFlowEstimator for core::Ptr { + impl crate::videostab::ISparseOptFlowEstimatorTrait for core::Ptr { #[inline] fn as_raw_mut_ISparseOptFlowEstimator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSparsePyrLkOptFlowEstimatorGpu, core::Ptr, cv_PtrOfSparsePyrLkOptFlowEstimatorGpu_to_PtrOfISparseOptFlowEstimator } + ptr_cast_base! { PtrOfSparsePyrLkOptFlowEstimatorGpu, core::Ptr, cv_PtrOfSparsePyrLkOptFlowEstimatorGpu_to_PtrOfISparseOptFlowEstimator } impl crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_PyrLkOptFlowEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } @@ -17411,15 +17395,15 @@ mod videostab_types { #[inline] fn as_raw_mut_ToFileMotionWriter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::ImageMotionEstimatorBaseConst for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for core::Ptr { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for core::Ptr { + impl crate::videostab::ImageMotionEstimatorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfToFileMotionWriter, core::Ptr, cv_PtrOfToFileMotionWriter_to_PtrOfImageMotionEstimatorBase } + ptr_cast_base! { PtrOfToFileMotionWriter, core::Ptr, cv_PtrOfToFileMotionWriter_to_PtrOfImageMotionEstimatorBase } pub type PtrOfTranslationBasedLocalOutlierRejector = core::Ptr; @@ -17442,15 +17426,15 @@ mod videostab_types { #[inline] fn as_raw_mut_TranslationBasedLocalOutlierRejector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IOutlierRejectorConst for core::Ptr { + impl crate::videostab::IOutlierRejectorTraitConst for core::Ptr { #[inline] fn as_raw_IOutlierRejector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IOutlierRejector for core::Ptr { + impl crate::videostab::IOutlierRejectorTrait for core::Ptr { #[inline] fn as_raw_mut_IOutlierRejector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfTranslationBasedLocalOutlierRejector, core::Ptr, cv_PtrOfTranslationBasedLocalOutlierRejector_to_PtrOfIOutlierRejector } + ptr_cast_base! { PtrOfTranslationBasedLocalOutlierRejector, core::Ptr, cv_PtrOfTranslationBasedLocalOutlierRejector_to_PtrOfIOutlierRejector } pub type PtrOfTwoPassStabilizer = core::Ptr; @@ -17473,21 +17457,21 @@ mod videostab_types { #[inline] fn as_raw_mut_TwoPassStabilizer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IFrameSourceConst for core::Ptr { + impl crate::videostab::IFrameSourceTraitConst for core::Ptr { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IFrameSource for core::Ptr { + impl crate::videostab::IFrameSourceTrait for core::Ptr { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfTwoPassStabilizer, core::Ptr, cv_PtrOfTwoPassStabilizer_to_PtrOfIFrameSource } + ptr_cast_base! { PtrOfTwoPassStabilizer, core::Ptr, cv_PtrOfTwoPassStabilizer_to_PtrOfIFrameSource } - impl crate::videostab::StabilizerBaseConst for core::Ptr { + impl crate::videostab::StabilizerBaseTraitConst for core::Ptr { #[inline] fn as_raw_StabilizerBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::StabilizerBase for core::Ptr { + impl crate::videostab::StabilizerBaseTrait for core::Ptr { #[inline] fn as_raw_mut_StabilizerBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -17512,15 +17496,15 @@ mod videostab_types { #[inline] fn as_raw_mut_VideoFileSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::IFrameSourceConst for core::Ptr { + impl crate::videostab::IFrameSourceTraitConst for core::Ptr { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::IFrameSource for core::Ptr { + impl crate::videostab::IFrameSourceTrait for core::Ptr { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfVideoFileSource, core::Ptr, cv_PtrOfVideoFileSource_to_PtrOfIFrameSource } + ptr_cast_base! { PtrOfVideoFileSource, core::Ptr, cv_PtrOfVideoFileSource_to_PtrOfIFrameSource } pub type PtrOfWeightingDeblurer = core::Ptr; @@ -17543,32 +17527,32 @@ mod videostab_types { #[inline] fn as_raw_mut_WeightingDeblurer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::videostab::DeblurerBaseConst for core::Ptr { + impl crate::videostab::DeblurerBaseTraitConst for core::Ptr { #[inline] fn as_raw_DeblurerBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::DeblurerBase for core::Ptr { + impl crate::videostab::DeblurerBaseTrait for core::Ptr { #[inline] fn as_raw_mut_DeblurerBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfWeightingDeblurer, core::Ptr, cv_PtrOfWeightingDeblurer_to_PtrOfDeblurerBase } + ptr_cast_base! { PtrOfWeightingDeblurer, core::Ptr, cv_PtrOfWeightingDeblurer_to_PtrOfDeblurerBase } - pub type PtrOfWobbleSuppressorBase = core::Ptr; + pub type PtrOfWobbleSuppressorBase = core::Ptr; - ptr_extern! { dyn crate::videostab::WobbleSuppressorBase, + ptr_extern! { crate::videostab::WobbleSuppressorBase, cv_PtrOfWobbleSuppressorBase_delete, cv_PtrOfWobbleSuppressorBase_get_inner_ptr, cv_PtrOfWobbleSuppressorBase_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfWobbleSuppressorBase(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfWobbleSuppressorBase(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::videostab::WobbleSuppressorBaseConst for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTraitConst for core::Ptr { #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::videostab::WobbleSuppressorBase for core::Ptr { + impl crate::videostab::WobbleSuppressorBaseTrait for core::Ptr { #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -17580,462 +17564,462 @@ pub use videostab_types::*; mod xfeatures2d_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfAffineFeature2D = core::Ptr; + pub type PtrOfAffineFeature2D = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::AffineFeature2D, + ptr_extern! { crate::xfeatures2d::AffineFeature2D, cv_PtrOfAffineFeature2D_delete, cv_PtrOfAffineFeature2D_get_inner_ptr, cv_PtrOfAffineFeature2D_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfAffineFeature2D(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfAffineFeature2D(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::AffineFeature2DConst for core::Ptr { + impl crate::xfeatures2d::AffineFeature2DTraitConst for core::Ptr { #[inline] fn as_raw_AffineFeature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::AffineFeature2D for core::Ptr { + impl crate::xfeatures2d::AffineFeature2DTrait for core::Ptr { #[inline] fn as_raw_mut_AffineFeature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfAffineFeature2D, core::Ptr, cv_PtrOfAffineFeature2D_to_PtrOfFeature2D } - pub type PtrOfBEBLID = core::Ptr; + pub type PtrOfBEBLID = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::BEBLID, + ptr_extern! { crate::xfeatures2d::BEBLID, cv_PtrOfBEBLID_delete, cv_PtrOfBEBLID_get_inner_ptr, cv_PtrOfBEBLID_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBEBLID(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBEBLID(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::BEBLIDConst for core::Ptr { + impl crate::xfeatures2d::BEBLIDTraitConst for core::Ptr { #[inline] fn as_raw_BEBLID(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::BEBLID for core::Ptr { + impl crate::xfeatures2d::BEBLIDTrait for core::Ptr { #[inline] fn as_raw_mut_BEBLID(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfBEBLID, core::Ptr, cv_PtrOfBEBLID_to_PtrOfFeature2D } - pub type PtrOfBoostDesc = core::Ptr; + pub type PtrOfBoostDesc = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::BoostDesc, + ptr_extern! { crate::xfeatures2d::BoostDesc, cv_PtrOfBoostDesc_delete, cv_PtrOfBoostDesc_get_inner_ptr, cv_PtrOfBoostDesc_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBoostDesc(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBoostDesc(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::BoostDescConst for core::Ptr { + impl crate::xfeatures2d::BoostDescTraitConst for core::Ptr { #[inline] fn as_raw_BoostDesc(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::BoostDesc for core::Ptr { + impl crate::xfeatures2d::BoostDescTrait for core::Ptr { #[inline] fn as_raw_mut_BoostDesc(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfBoostDesc, core::Ptr, cv_PtrOfBoostDesc_to_PtrOfFeature2D } - pub type PtrOfBriefDescriptorExtractor = core::Ptr; + pub type PtrOfBriefDescriptorExtractor = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::BriefDescriptorExtractor, + ptr_extern! { crate::xfeatures2d::BriefDescriptorExtractor, cv_PtrOfBriefDescriptorExtractor_delete, cv_PtrOfBriefDescriptorExtractor_get_inner_ptr, cv_PtrOfBriefDescriptorExtractor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfBriefDescriptorExtractor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfBriefDescriptorExtractor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::BriefDescriptorExtractorConst for core::Ptr { + impl crate::xfeatures2d::BriefDescriptorExtractorTraitConst for core::Ptr { #[inline] fn as_raw_BriefDescriptorExtractor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::BriefDescriptorExtractor for core::Ptr { + impl crate::xfeatures2d::BriefDescriptorExtractorTrait for core::Ptr { #[inline] fn as_raw_mut_BriefDescriptorExtractor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfBriefDescriptorExtractor, core::Ptr, cv_PtrOfBriefDescriptorExtractor_to_PtrOfFeature2D } - pub type PtrOfDAISY = core::Ptr; + pub type PtrOfDAISY = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::DAISY, + ptr_extern! { crate::xfeatures2d::DAISY, cv_PtrOfDAISY_delete, cv_PtrOfDAISY_get_inner_ptr, cv_PtrOfDAISY_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDAISY(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDAISY(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::DAISYConst for core::Ptr { + impl crate::xfeatures2d::DAISYTraitConst for core::Ptr { #[inline] fn as_raw_DAISY(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::DAISY for core::Ptr { + impl crate::xfeatures2d::DAISYTrait for core::Ptr { #[inline] fn as_raw_mut_DAISY(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfDAISY, core::Ptr, cv_PtrOfDAISY_to_PtrOfFeature2D } - pub type PtrOfFREAK = core::Ptr; + pub type PtrOfFREAK = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::FREAK, + ptr_extern! { crate::xfeatures2d::FREAK, cv_PtrOfFREAK_delete, cv_PtrOfFREAK_get_inner_ptr, cv_PtrOfFREAK_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFREAK(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFREAK(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::FREAKConst for core::Ptr { + impl crate::xfeatures2d::FREAKTraitConst for core::Ptr { #[inline] fn as_raw_FREAK(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::FREAK for core::Ptr { + impl crate::xfeatures2d::FREAKTrait for core::Ptr { #[inline] fn as_raw_mut_FREAK(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfFREAK, core::Ptr, cv_PtrOfFREAK_to_PtrOfFeature2D } - pub type PtrOfHarrisLaplaceFeatureDetector = core::Ptr; + pub type PtrOfHarrisLaplaceFeatureDetector = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::HarrisLaplaceFeatureDetector, + ptr_extern! { crate::xfeatures2d::HarrisLaplaceFeatureDetector, cv_PtrOfHarrisLaplaceFeatureDetector_delete, cv_PtrOfHarrisLaplaceFeatureDetector_get_inner_ptr, cv_PtrOfHarrisLaplaceFeatureDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfHarrisLaplaceFeatureDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfHarrisLaplaceFeatureDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::HarrisLaplaceFeatureDetectorConst for core::Ptr { + impl crate::xfeatures2d::HarrisLaplaceFeatureDetectorTraitConst for core::Ptr { #[inline] fn as_raw_HarrisLaplaceFeatureDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::HarrisLaplaceFeatureDetector for core::Ptr { + impl crate::xfeatures2d::HarrisLaplaceFeatureDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_HarrisLaplaceFeatureDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfHarrisLaplaceFeatureDetector, core::Ptr, cv_PtrOfHarrisLaplaceFeatureDetector_to_PtrOfFeature2D } - pub type PtrOfLATCH = core::Ptr; + pub type PtrOfLATCH = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::LATCH, + ptr_extern! { crate::xfeatures2d::LATCH, cv_PtrOfLATCH_delete, cv_PtrOfLATCH_get_inner_ptr, cv_PtrOfLATCH_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLATCH(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLATCH(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::LATCHConst for core::Ptr { + impl crate::xfeatures2d::LATCHTraitConst for core::Ptr { #[inline] fn as_raw_LATCH(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::LATCH for core::Ptr { + impl crate::xfeatures2d::LATCHTrait for core::Ptr { #[inline] fn as_raw_mut_LATCH(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfLATCH, core::Ptr, cv_PtrOfLATCH_to_PtrOfFeature2D } - pub type PtrOfLUCID = core::Ptr; + pub type PtrOfLUCID = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::LUCID, + ptr_extern! { crate::xfeatures2d::LUCID, cv_PtrOfLUCID_delete, cv_PtrOfLUCID_get_inner_ptr, cv_PtrOfLUCID_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLUCID(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLUCID(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::LUCIDConst for core::Ptr { + impl crate::xfeatures2d::LUCIDTraitConst for core::Ptr { #[inline] fn as_raw_LUCID(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::LUCID for core::Ptr { + impl crate::xfeatures2d::LUCIDTrait for core::Ptr { #[inline] fn as_raw_mut_LUCID(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfLUCID, core::Ptr, cv_PtrOfLUCID_to_PtrOfFeature2D } - pub type PtrOfMSDDetector = core::Ptr; + pub type PtrOfMSDDetector = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::MSDDetector, + ptr_extern! { crate::xfeatures2d::MSDDetector, cv_PtrOfMSDDetector_delete, cv_PtrOfMSDDetector_get_inner_ptr, cv_PtrOfMSDDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfMSDDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfMSDDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::MSDDetectorConst for core::Ptr { + impl crate::xfeatures2d::MSDDetectorTraitConst for core::Ptr { #[inline] fn as_raw_MSDDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::MSDDetector for core::Ptr { + impl crate::xfeatures2d::MSDDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_MSDDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfMSDDetector, core::Ptr, cv_PtrOfMSDDetector_to_PtrOfFeature2D } - pub type PtrOfPCTSignatures = core::Ptr; + pub type PtrOfPCTSignatures = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::PCTSignatures, + ptr_extern! { crate::xfeatures2d::PCTSignatures, cv_PtrOfPCTSignatures_delete, cv_PtrOfPCTSignatures_get_inner_ptr, cv_PtrOfPCTSignatures_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfPCTSignatures(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfPCTSignatures(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::PCTSignaturesConst for core::Ptr { + impl crate::xfeatures2d::PCTSignaturesTraitConst for core::Ptr { #[inline] fn as_raw_PCTSignatures(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::PCTSignatures for core::Ptr { + impl crate::xfeatures2d::PCTSignaturesTrait for core::Ptr { #[inline] fn as_raw_mut_PCTSignatures(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfPCTSignaturesSQFD = core::Ptr; + pub type PtrOfPCTSignaturesSQFD = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::PCTSignaturesSQFD, + ptr_extern! { crate::xfeatures2d::PCTSignaturesSQFD, cv_PtrOfPCTSignaturesSQFD_delete, cv_PtrOfPCTSignaturesSQFD_get_inner_ptr, cv_PtrOfPCTSignaturesSQFD_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfPCTSignaturesSQFD(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfPCTSignaturesSQFD(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::PCTSignaturesSQFDConst for core::Ptr { + impl crate::xfeatures2d::PCTSignaturesSQFDTraitConst for core::Ptr { #[inline] fn as_raw_PCTSignaturesSQFD(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::PCTSignaturesSQFD for core::Ptr { + impl crate::xfeatures2d::PCTSignaturesSQFDTrait for core::Ptr { #[inline] fn as_raw_mut_PCTSignaturesSQFD(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSURF = core::Ptr; + pub type PtrOfSURF = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::SURF, + ptr_extern! { crate::xfeatures2d::SURF, cv_PtrOfSURF_delete, cv_PtrOfSURF_get_inner_ptr, cv_PtrOfSURF_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSURF(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSURF(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::SURFConst for core::Ptr { + impl crate::xfeatures2d::SURFTraitConst for core::Ptr { #[inline] fn as_raw_SURF(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::SURF for core::Ptr { + impl crate::xfeatures2d::SURFTrait for core::Ptr { #[inline] fn as_raw_mut_SURF(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -18062,85 +18046,85 @@ mod xfeatures2d_types { #[inline] fn as_raw_mut_SURF_CUDA(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfStarDetector = core::Ptr; + pub type PtrOfStarDetector = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::StarDetector, + ptr_extern! { crate::xfeatures2d::StarDetector, cv_PtrOfStarDetector_delete, cv_PtrOfStarDetector_get_inner_ptr, cv_PtrOfStarDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfStarDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfStarDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::StarDetectorConst for core::Ptr { + impl crate::xfeatures2d::StarDetectorTraitConst for core::Ptr { #[inline] fn as_raw_StarDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::StarDetector for core::Ptr { + impl crate::xfeatures2d::StarDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_StarDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfStarDetector, core::Ptr, cv_PtrOfStarDetector_to_PtrOfFeature2D } - pub type PtrOfTBMR = core::Ptr; + pub type PtrOfTBMR = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::TBMR, + ptr_extern! { crate::xfeatures2d::TBMR, cv_PtrOfTBMR_delete, cv_PtrOfTBMR_get_inner_ptr, cv_PtrOfTBMR_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTBMR(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTBMR(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::TBMRConst for core::Ptr { + impl crate::xfeatures2d::TBMRTraitConst for core::Ptr { #[inline] fn as_raw_TBMR(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::TBMR for core::Ptr { + impl crate::xfeatures2d::TBMRTrait for core::Ptr { #[inline] fn as_raw_mut_TBMR(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } ptr_cast_base! { PtrOfTBMR, core::Ptr, cv_PtrOfTBMR_to_PtrOfFeature2D } - impl crate::xfeatures2d::AffineFeature2DConst for core::Ptr { + impl crate::xfeatures2d::AffineFeature2DTraitConst for core::Ptr { #[inline] fn as_raw_AffineFeature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::AffineFeature2D for core::Ptr { + impl crate::xfeatures2d::AffineFeature2DTrait for core::Ptr { #[inline] fn as_raw_mut_AffineFeature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -18183,38 +18167,38 @@ mod xfeatures2d_types { ptr_cast_base! { PtrOfTEBLID, core::Ptr, cv_PtrOfTEBLID_to_PtrOfFeature2D } - pub type PtrOfVGG = core::Ptr; + pub type PtrOfVGG = core::Ptr; - ptr_extern! { dyn crate::xfeatures2d::VGG, + ptr_extern! { crate::xfeatures2d::VGG, cv_PtrOfVGG_delete, cv_PtrOfVGG_get_inner_ptr, cv_PtrOfVGG_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfVGG(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfVGG(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xfeatures2d::VGGConst for core::Ptr { + impl crate::xfeatures2d::VGGTraitConst for core::Ptr { #[inline] fn as_raw_VGG(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xfeatures2d::VGG for core::Ptr { + impl crate::xfeatures2d::VGGTrait for core::Ptr { #[inline] fn as_raw_mut_VGG(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::features2d::Feature2DTraitConst for core::Ptr { + impl crate::features2d::Feature2DTraitConst for core::Ptr { #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::features2d::Feature2DTrait for core::Ptr { + impl crate::features2d::Feature2DTrait for core::Ptr { #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -18246,30 +18230,30 @@ pub use xfeatures2d_types::*; mod ximgproc_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfAdaptiveManifoldFilter = core::Ptr; + pub type PtrOfAdaptiveManifoldFilter = core::Ptr; - ptr_extern! { dyn crate::ximgproc::AdaptiveManifoldFilter, + ptr_extern! { crate::ximgproc::AdaptiveManifoldFilter, cv_PtrOfAdaptiveManifoldFilter_delete, cv_PtrOfAdaptiveManifoldFilter_get_inner_ptr, cv_PtrOfAdaptiveManifoldFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfAdaptiveManifoldFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfAdaptiveManifoldFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::AdaptiveManifoldFilterConst for core::Ptr { + impl crate::ximgproc::AdaptiveManifoldFilterTraitConst for core::Ptr { #[inline] fn as_raw_AdaptiveManifoldFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::AdaptiveManifoldFilter for core::Ptr { + impl crate::ximgproc::AdaptiveManifoldFilterTrait for core::Ptr { #[inline] fn as_raw_mut_AdaptiveManifoldFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -18302,752 +18286,752 @@ mod ximgproc_types { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDTFilter = core::Ptr; + pub type PtrOfDTFilter = core::Ptr; - ptr_extern! { dyn crate::ximgproc::DTFilter, + ptr_extern! { crate::ximgproc::DTFilter, cv_PtrOfDTFilter_delete, cv_PtrOfDTFilter_get_inner_ptr, cv_PtrOfDTFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDTFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDTFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::DTFilterConst for core::Ptr { + impl crate::ximgproc::DTFilterTraitConst for core::Ptr { #[inline] fn as_raw_DTFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::DTFilter for core::Ptr { + impl crate::ximgproc::DTFilterTrait for core::Ptr { #[inline] fn as_raw_mut_DTFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfDisparityWLSFilter = core::Ptr; + pub type PtrOfDisparityWLSFilter = core::Ptr; - ptr_extern! { dyn crate::ximgproc::DisparityWLSFilter, + ptr_extern! { crate::ximgproc::DisparityWLSFilter, cv_PtrOfDisparityWLSFilter_delete, cv_PtrOfDisparityWLSFilter_get_inner_ptr, cv_PtrOfDisparityWLSFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfDisparityWLSFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfDisparityWLSFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::DisparityWLSFilterConst for core::Ptr { + impl crate::ximgproc::DisparityWLSFilterTraitConst for core::Ptr { #[inline] fn as_raw_DisparityWLSFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::DisparityWLSFilter for core::Ptr { + impl crate::ximgproc::DisparityWLSFilterTrait for core::Ptr { #[inline] fn as_raw_mut_DisparityWLSFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ximgproc::DisparityFilterConst for core::Ptr { + impl crate::ximgproc::DisparityFilterTraitConst for core::Ptr { #[inline] fn as_raw_DisparityFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::DisparityFilter for core::Ptr { + impl crate::ximgproc::DisparityFilterTrait for core::Ptr { #[inline] fn as_raw_mut_DisparityFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfEdgeAwareInterpolator = core::Ptr; + pub type PtrOfEdgeAwareInterpolator = core::Ptr; - ptr_extern! { dyn crate::ximgproc::EdgeAwareInterpolator, + ptr_extern! { crate::ximgproc::EdgeAwareInterpolator, cv_PtrOfEdgeAwareInterpolator_delete, cv_PtrOfEdgeAwareInterpolator_get_inner_ptr, cv_PtrOfEdgeAwareInterpolator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfEdgeAwareInterpolator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfEdgeAwareInterpolator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::EdgeAwareInterpolatorConst for core::Ptr { + impl crate::ximgproc::EdgeAwareInterpolatorTraitConst for core::Ptr { #[inline] fn as_raw_EdgeAwareInterpolator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::EdgeAwareInterpolator for core::Ptr { + impl crate::ximgproc::EdgeAwareInterpolatorTrait for core::Ptr { #[inline] fn as_raw_mut_EdgeAwareInterpolator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ximgproc::SparseMatchInterpolatorConst for core::Ptr { + impl crate::ximgproc::SparseMatchInterpolatorTraitConst for core::Ptr { #[inline] fn as_raw_SparseMatchInterpolator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SparseMatchInterpolator for core::Ptr { + impl crate::ximgproc::SparseMatchInterpolatorTrait for core::Ptr { #[inline] fn as_raw_mut_SparseMatchInterpolator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfEdgeBoxes = core::Ptr; + pub type PtrOfEdgeBoxes = core::Ptr; - ptr_extern! { dyn crate::ximgproc::EdgeBoxes, + ptr_extern! { crate::ximgproc::EdgeBoxes, cv_PtrOfEdgeBoxes_delete, cv_PtrOfEdgeBoxes_get_inner_ptr, cv_PtrOfEdgeBoxes_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfEdgeBoxes(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfEdgeBoxes(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::EdgeBoxesConst for core::Ptr { + impl crate::ximgproc::EdgeBoxesTraitConst for core::Ptr { #[inline] fn as_raw_EdgeBoxes(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::EdgeBoxes for core::Ptr { + impl crate::ximgproc::EdgeBoxesTrait for core::Ptr { #[inline] fn as_raw_mut_EdgeBoxes(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfEdgeDrawing = core::Ptr; + pub type PtrOfEdgeDrawing = core::Ptr; - ptr_extern! { dyn crate::ximgproc::EdgeDrawing, + ptr_extern! { crate::ximgproc::EdgeDrawing, cv_PtrOfEdgeDrawing_delete, cv_PtrOfEdgeDrawing_get_inner_ptr, cv_PtrOfEdgeDrawing_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfEdgeDrawing(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfEdgeDrawing(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::EdgeDrawingConst for core::Ptr { + impl crate::ximgproc::EdgeDrawingTraitConst for core::Ptr { #[inline] fn as_raw_EdgeDrawing(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::EdgeDrawing for core::Ptr { + impl crate::ximgproc::EdgeDrawingTrait for core::Ptr { #[inline] fn as_raw_mut_EdgeDrawing(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFastBilateralSolverFilter = core::Ptr; + pub type PtrOfFastBilateralSolverFilter = core::Ptr; - ptr_extern! { dyn crate::ximgproc::FastBilateralSolverFilter, + ptr_extern! { crate::ximgproc::FastBilateralSolverFilter, cv_PtrOfFastBilateralSolverFilter_delete, cv_PtrOfFastBilateralSolverFilter_get_inner_ptr, cv_PtrOfFastBilateralSolverFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFastBilateralSolverFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFastBilateralSolverFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::FastBilateralSolverFilterConst for core::Ptr { + impl crate::ximgproc::FastBilateralSolverFilterTraitConst for core::Ptr { #[inline] fn as_raw_FastBilateralSolverFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::FastBilateralSolverFilter for core::Ptr { + impl crate::ximgproc::FastBilateralSolverFilterTrait for core::Ptr { #[inline] fn as_raw_mut_FastBilateralSolverFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFastGlobalSmootherFilter = core::Ptr; + pub type PtrOfFastGlobalSmootherFilter = core::Ptr; - ptr_extern! { dyn crate::ximgproc::FastGlobalSmootherFilter, + ptr_extern! { crate::ximgproc::FastGlobalSmootherFilter, cv_PtrOfFastGlobalSmootherFilter_delete, cv_PtrOfFastGlobalSmootherFilter_get_inner_ptr, cv_PtrOfFastGlobalSmootherFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFastGlobalSmootherFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFastGlobalSmootherFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::FastGlobalSmootherFilterConst for core::Ptr { + impl crate::ximgproc::FastGlobalSmootherFilterTraitConst for core::Ptr { #[inline] fn as_raw_FastGlobalSmootherFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::FastGlobalSmootherFilter for core::Ptr { + impl crate::ximgproc::FastGlobalSmootherFilterTrait for core::Ptr { #[inline] fn as_raw_mut_FastGlobalSmootherFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfFastLineDetector = core::Ptr; + pub type PtrOfFastLineDetector = core::Ptr; - ptr_extern! { dyn crate::ximgproc::FastLineDetector, + ptr_extern! { crate::ximgproc::FastLineDetector, cv_PtrOfFastLineDetector_delete, cv_PtrOfFastLineDetector_get_inner_ptr, cv_PtrOfFastLineDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfFastLineDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfFastLineDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::FastLineDetectorConst for core::Ptr { + impl crate::ximgproc::FastLineDetectorTraitConst for core::Ptr { #[inline] fn as_raw_FastLineDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::FastLineDetector for core::Ptr { + impl crate::ximgproc::FastLineDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_FastLineDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfGraphSegmentation = core::Ptr; + pub type PtrOfGraphSegmentation = core::Ptr; - ptr_extern! { dyn crate::ximgproc::GraphSegmentation, + ptr_extern! { crate::ximgproc::GraphSegmentation, cv_PtrOfGraphSegmentation_delete, cv_PtrOfGraphSegmentation_get_inner_ptr, cv_PtrOfGraphSegmentation_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfGraphSegmentation(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfGraphSegmentation(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::GraphSegmentationConst for core::Ptr { + impl crate::ximgproc::GraphSegmentationTraitConst for core::Ptr { #[inline] fn as_raw_GraphSegmentation(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::GraphSegmentation for core::Ptr { + impl crate::ximgproc::GraphSegmentationTrait for core::Ptr { #[inline] fn as_raw_mut_GraphSegmentation(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfGuidedFilter = core::Ptr; + pub type PtrOfGuidedFilter = core::Ptr; - ptr_extern! { dyn crate::ximgproc::GuidedFilter, + ptr_extern! { crate::ximgproc::GuidedFilter, cv_PtrOfGuidedFilter_delete, cv_PtrOfGuidedFilter_get_inner_ptr, cv_PtrOfGuidedFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfGuidedFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfGuidedFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::GuidedFilterConst for core::Ptr { + impl crate::ximgproc::GuidedFilterTraitConst for core::Ptr { #[inline] fn as_raw_GuidedFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::GuidedFilter for core::Ptr { + impl crate::ximgproc::GuidedFilterTrait for core::Ptr { #[inline] fn as_raw_mut_GuidedFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfRFFeatureGetter = core::Ptr; + pub type PtrOfRFFeatureGetter = core::Ptr; - ptr_extern! { dyn crate::ximgproc::RFFeatureGetter, + ptr_extern! { crate::ximgproc::RFFeatureGetter, cv_PtrOfRFFeatureGetter_delete, cv_PtrOfRFFeatureGetter_get_inner_ptr, cv_PtrOfRFFeatureGetter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRFFeatureGetter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRFFeatureGetter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::RFFeatureGetterConst for core::Ptr { + impl crate::ximgproc::RFFeatureGetterTraitConst for core::Ptr { #[inline] fn as_raw_RFFeatureGetter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::RFFeatureGetter for core::Ptr { + impl crate::ximgproc::RFFeatureGetterTrait for core::Ptr { #[inline] fn as_raw_mut_RFFeatureGetter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfRICInterpolator = core::Ptr; + pub type PtrOfRICInterpolator = core::Ptr; - ptr_extern! { dyn crate::ximgproc::RICInterpolator, + ptr_extern! { crate::ximgproc::RICInterpolator, cv_PtrOfRICInterpolator_delete, cv_PtrOfRICInterpolator_get_inner_ptr, cv_PtrOfRICInterpolator_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRICInterpolator(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRICInterpolator(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::RICInterpolatorConst for core::Ptr { + impl crate::ximgproc::RICInterpolatorTraitConst for core::Ptr { #[inline] fn as_raw_RICInterpolator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::RICInterpolator for core::Ptr { + impl crate::ximgproc::RICInterpolatorTrait for core::Ptr { #[inline] fn as_raw_mut_RICInterpolator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ximgproc::SparseMatchInterpolatorConst for core::Ptr { + impl crate::ximgproc::SparseMatchInterpolatorTraitConst for core::Ptr { #[inline] fn as_raw_SparseMatchInterpolator(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SparseMatchInterpolator for core::Ptr { + impl crate::ximgproc::SparseMatchInterpolatorTrait for core::Ptr { #[inline] fn as_raw_mut_SparseMatchInterpolator(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfRidgeDetectionFilter = core::Ptr; + pub type PtrOfRidgeDetectionFilter = core::Ptr; - ptr_extern! { dyn crate::ximgproc::RidgeDetectionFilter, + ptr_extern! { crate::ximgproc::RidgeDetectionFilter, cv_PtrOfRidgeDetectionFilter_delete, cv_PtrOfRidgeDetectionFilter_get_inner_ptr, cv_PtrOfRidgeDetectionFilter_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfRidgeDetectionFilter(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfRidgeDetectionFilter(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::RidgeDetectionFilterConst for core::Ptr { + impl crate::ximgproc::RidgeDetectionFilterTraitConst for core::Ptr { #[inline] fn as_raw_RidgeDetectionFilter(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::RidgeDetectionFilter for core::Ptr { + impl crate::ximgproc::RidgeDetectionFilterTrait for core::Ptr { #[inline] fn as_raw_mut_RidgeDetectionFilter(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfScanSegment = core::Ptr; + pub type PtrOfScanSegment = core::Ptr; - ptr_extern! { dyn crate::ximgproc::ScanSegment, + ptr_extern! { crate::ximgproc::ScanSegment, cv_PtrOfScanSegment_delete, cv_PtrOfScanSegment_get_inner_ptr, cv_PtrOfScanSegment_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfScanSegment(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfScanSegment(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::ScanSegmentConst for core::Ptr { + impl crate::ximgproc::ScanSegmentTraitConst for core::Ptr { #[inline] fn as_raw_ScanSegment(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::ScanSegment for core::Ptr { + impl crate::ximgproc::ScanSegmentTrait for core::Ptr { #[inline] fn as_raw_mut_ScanSegment(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSelectiveSearchSegmentation = core::Ptr; + pub type PtrOfSelectiveSearchSegmentation = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SelectiveSearchSegmentation, + ptr_extern! { crate::ximgproc::SelectiveSearchSegmentation, cv_PtrOfSelectiveSearchSegmentation_delete, cv_PtrOfSelectiveSearchSegmentation_get_inner_ptr, cv_PtrOfSelectiveSearchSegmentation_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSelectiveSearchSegmentation(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSelectiveSearchSegmentation(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentation(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentation for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentation(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSelectiveSearchSegmentationStrategy = core::Ptr; + pub type PtrOfSelectiveSearchSegmentationStrategy = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SelectiveSearchSegmentationStrategy, + ptr_extern! { crate::ximgproc::SelectiveSearchSegmentationStrategy, cv_PtrOfSelectiveSearchSegmentationStrategy_delete, cv_PtrOfSelectiveSearchSegmentationStrategy_get_inner_ptr, cv_PtrOfSelectiveSearchSegmentationStrategy_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSelectiveSearchSegmentationStrategy(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategy for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSelectiveSearchSegmentationStrategyColor = core::Ptr; + pub type PtrOfSelectiveSearchSegmentationStrategyColor = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SelectiveSearchSegmentationStrategyColor, + ptr_extern! { crate::ximgproc::SelectiveSearchSegmentationStrategyColor, cv_PtrOfSelectiveSearchSegmentationStrategyColor_delete, cv_PtrOfSelectiveSearchSegmentationStrategyColor_get_inner_ptr, cv_PtrOfSelectiveSearchSegmentationStrategyColor_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSelectiveSearchSegmentationStrategyColor(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSelectiveSearchSegmentationStrategyColor(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyColorConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyColorTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategyColor(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyColor for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyColorTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategyColor(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategy for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategyColor, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategyColor_to_PtrOfSelectiveSearchSegmentationStrategy } + ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategyColor, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategyColor_to_PtrOfSelectiveSearchSegmentationStrategy } - pub type PtrOfSelectiveSearchSegmentationStrategyFill = core::Ptr; + pub type PtrOfSelectiveSearchSegmentationStrategyFill = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SelectiveSearchSegmentationStrategyFill, + ptr_extern! { crate::ximgproc::SelectiveSearchSegmentationStrategyFill, cv_PtrOfSelectiveSearchSegmentationStrategyFill_delete, cv_PtrOfSelectiveSearchSegmentationStrategyFill_get_inner_ptr, cv_PtrOfSelectiveSearchSegmentationStrategyFill_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSelectiveSearchSegmentationStrategyFill(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSelectiveSearchSegmentationStrategyFill(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyFillConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyFillTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategyFill(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyFill for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyFillTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategyFill(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategy for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategyFill, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategyFill_to_PtrOfSelectiveSearchSegmentationStrategy } + ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategyFill, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategyFill_to_PtrOfSelectiveSearchSegmentationStrategy } - pub type PtrOfSelectiveSearchSegmentationStrategyMultiple = core::Ptr; + pub type PtrOfSelectiveSearchSegmentationStrategyMultiple = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SelectiveSearchSegmentationStrategyMultiple, + ptr_extern! { crate::ximgproc::SelectiveSearchSegmentationStrategyMultiple, cv_PtrOfSelectiveSearchSegmentationStrategyMultiple_delete, cv_PtrOfSelectiveSearchSegmentationStrategyMultiple_get_inner_ptr, cv_PtrOfSelectiveSearchSegmentationStrategyMultiple_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSelectiveSearchSegmentationStrategyMultiple(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSelectiveSearchSegmentationStrategyMultiple(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyMultipleConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyMultipleTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategyMultiple(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyMultiple for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyMultipleTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategyMultiple(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategy for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategyMultiple, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategyMultiple_to_PtrOfSelectiveSearchSegmentationStrategy } + ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategyMultiple, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategyMultiple_to_PtrOfSelectiveSearchSegmentationStrategy } - pub type PtrOfSelectiveSearchSegmentationStrategySize = core::Ptr; + pub type PtrOfSelectiveSearchSegmentationStrategySize = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SelectiveSearchSegmentationStrategySize, + ptr_extern! { crate::ximgproc::SelectiveSearchSegmentationStrategySize, cv_PtrOfSelectiveSearchSegmentationStrategySize_delete, cv_PtrOfSelectiveSearchSegmentationStrategySize_get_inner_ptr, cv_PtrOfSelectiveSearchSegmentationStrategySize_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSelectiveSearchSegmentationStrategySize(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSelectiveSearchSegmentationStrategySize(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategySizeConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategySizeTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategySize(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategySize for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategySizeTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategySize(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategy for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategySize, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategySize_to_PtrOfSelectiveSearchSegmentationStrategy } + ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategySize, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategySize_to_PtrOfSelectiveSearchSegmentationStrategy } - pub type PtrOfSelectiveSearchSegmentationStrategyTexture = core::Ptr; + pub type PtrOfSelectiveSearchSegmentationStrategyTexture = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SelectiveSearchSegmentationStrategyTexture, + ptr_extern! { crate::ximgproc::SelectiveSearchSegmentationStrategyTexture, cv_PtrOfSelectiveSearchSegmentationStrategyTexture_delete, cv_PtrOfSelectiveSearchSegmentationStrategyTexture_get_inner_ptr, cv_PtrOfSelectiveSearchSegmentationStrategyTexture_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSelectiveSearchSegmentationStrategyTexture(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSelectiveSearchSegmentationStrategyTexture(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyTextureConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTextureTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategyTexture(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyTexture for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTextureTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategyTexture(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategyConst for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for core::Ptr { #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SelectiveSearchSegmentationStrategy for core::Ptr { + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for core::Ptr { #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategyTexture, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategyTexture_to_PtrOfSelectiveSearchSegmentationStrategy } + ptr_cast_base! { PtrOfSelectiveSearchSegmentationStrategyTexture, core::Ptr, cv_PtrOfSelectiveSearchSegmentationStrategyTexture_to_PtrOfSelectiveSearchSegmentationStrategy } - pub type PtrOfStructuredEdgeDetection = core::Ptr; + pub type PtrOfStructuredEdgeDetection = core::Ptr; - ptr_extern! { dyn crate::ximgproc::StructuredEdgeDetection, + ptr_extern! { crate::ximgproc::StructuredEdgeDetection, cv_PtrOfStructuredEdgeDetection_delete, cv_PtrOfStructuredEdgeDetection_get_inner_ptr, cv_PtrOfStructuredEdgeDetection_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfStructuredEdgeDetection(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfStructuredEdgeDetection(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::StructuredEdgeDetectionConst for core::Ptr { + impl crate::ximgproc::StructuredEdgeDetectionTraitConst for core::Ptr { #[inline] fn as_raw_StructuredEdgeDetection(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::StructuredEdgeDetection for core::Ptr { + impl crate::ximgproc::StructuredEdgeDetectionTrait for core::Ptr { #[inline] fn as_raw_mut_StructuredEdgeDetection(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperpixelLSC = core::Ptr; + pub type PtrOfSuperpixelLSC = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SuperpixelLSC, + ptr_extern! { crate::ximgproc::SuperpixelLSC, cv_PtrOfSuperpixelLSC_delete, cv_PtrOfSuperpixelLSC_get_inner_ptr, cv_PtrOfSuperpixelLSC_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperpixelLSC(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperpixelLSC(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SuperpixelLSCConst for core::Ptr { + impl crate::ximgproc::SuperpixelLSCTraitConst for core::Ptr { #[inline] fn as_raw_SuperpixelLSC(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SuperpixelLSC for core::Ptr { + impl crate::ximgproc::SuperpixelLSCTrait for core::Ptr { #[inline] fn as_raw_mut_SuperpixelLSC(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperpixelSEEDS = core::Ptr; + pub type PtrOfSuperpixelSEEDS = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SuperpixelSEEDS, + ptr_extern! { crate::ximgproc::SuperpixelSEEDS, cv_PtrOfSuperpixelSEEDS_delete, cv_PtrOfSuperpixelSEEDS_get_inner_ptr, cv_PtrOfSuperpixelSEEDS_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperpixelSEEDS(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperpixelSEEDS(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SuperpixelSEEDSConst for core::Ptr { + impl crate::ximgproc::SuperpixelSEEDSTraitConst for core::Ptr { #[inline] fn as_raw_SuperpixelSEEDS(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SuperpixelSEEDS for core::Ptr { + impl crate::ximgproc::SuperpixelSEEDSTrait for core::Ptr { #[inline] fn as_raw_mut_SuperpixelSEEDS(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSuperpixelSLIC = core::Ptr; + pub type PtrOfSuperpixelSLIC = core::Ptr; - ptr_extern! { dyn crate::ximgproc::SuperpixelSLIC, + ptr_extern! { crate::ximgproc::SuperpixelSLIC, cv_PtrOfSuperpixelSLIC_delete, cv_PtrOfSuperpixelSLIC_get_inner_ptr, cv_PtrOfSuperpixelSLIC_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSuperpixelSLIC(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperpixelSLIC(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::ximgproc::SuperpixelSLICConst for core::Ptr { + impl crate::ximgproc::SuperpixelSLICTraitConst for core::Ptr { #[inline] fn as_raw_SuperpixelSLIC(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::ximgproc::SuperpixelSLIC for core::Ptr { + impl crate::ximgproc::SuperpixelSLICTrait for core::Ptr { #[inline] fn as_raw_mut_SuperpixelSLIC(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -19059,22 +19043,22 @@ pub use ximgproc_types::*; mod xobjdetect_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfWBDetector = core::Ptr; + pub type PtrOfWBDetector = core::Ptr; - ptr_extern! { dyn crate::xobjdetect::WBDetector, + ptr_extern! { crate::xobjdetect::WBDetector, cv_PtrOfWBDetector_delete, cv_PtrOfWBDetector_get_inner_ptr, cv_PtrOfWBDetector_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfWBDetector(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfWBDetector(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xobjdetect::WBDetectorConst for core::Ptr { + impl crate::xobjdetect::WBDetectorTraitConst for core::Ptr { #[inline] fn as_raw_WBDetector(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xobjdetect::WBDetector for core::Ptr { + impl crate::xobjdetect::WBDetectorTrait for core::Ptr { #[inline] fn as_raw_mut_WBDetector(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } @@ -19086,143 +19070,143 @@ pub use xobjdetect_types::*; mod xphoto_types { use crate::{mod_prelude::*, core, types, sys}; - pub type PtrOfGrayworldWB = core::Ptr; + pub type PtrOfGrayworldWB = core::Ptr; - ptr_extern! { dyn crate::xphoto::GrayworldWB, + ptr_extern! { crate::xphoto::GrayworldWB, cv_PtrOfGrayworldWB_delete, cv_PtrOfGrayworldWB_get_inner_ptr, cv_PtrOfGrayworldWB_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfGrayworldWB(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfGrayworldWB(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xphoto::GrayworldWBConst for core::Ptr { + impl crate::xphoto::GrayworldWBTraitConst for core::Ptr { #[inline] fn as_raw_GrayworldWB(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xphoto::GrayworldWB for core::Ptr { + impl crate::xphoto::GrayworldWBTrait for core::Ptr { #[inline] fn as_raw_mut_GrayworldWB(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::xphoto::WhiteBalancerConst for core::Ptr { + impl crate::xphoto::WhiteBalancerTraitConst for core::Ptr { #[inline] fn as_raw_WhiteBalancer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xphoto::WhiteBalancer for core::Ptr { + impl crate::xphoto::WhiteBalancerTrait for core::Ptr { #[inline] fn as_raw_mut_WhiteBalancer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfLearningBasedWB = core::Ptr; + pub type PtrOfLearningBasedWB = core::Ptr; - ptr_extern! { dyn crate::xphoto::LearningBasedWB, + ptr_extern! { crate::xphoto::LearningBasedWB, cv_PtrOfLearningBasedWB_delete, cv_PtrOfLearningBasedWB_get_inner_ptr, cv_PtrOfLearningBasedWB_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfLearningBasedWB(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfLearningBasedWB(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xphoto::LearningBasedWBConst for core::Ptr { + impl crate::xphoto::LearningBasedWBTraitConst for core::Ptr { #[inline] fn as_raw_LearningBasedWB(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xphoto::LearningBasedWB for core::Ptr { + impl crate::xphoto::LearningBasedWBTrait for core::Ptr { #[inline] fn as_raw_mut_LearningBasedWB(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::xphoto::WhiteBalancerConst for core::Ptr { + impl crate::xphoto::WhiteBalancerTraitConst for core::Ptr { #[inline] fn as_raw_WhiteBalancer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xphoto::WhiteBalancer for core::Ptr { + impl crate::xphoto::WhiteBalancerTrait for core::Ptr { #[inline] fn as_raw_mut_WhiteBalancer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfSimpleWB = core::Ptr; + pub type PtrOfSimpleWB = core::Ptr; - ptr_extern! { dyn crate::xphoto::SimpleWB, + ptr_extern! { crate::xphoto::SimpleWB, cv_PtrOfSimpleWB_delete, cv_PtrOfSimpleWB_get_inner_ptr, cv_PtrOfSimpleWB_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfSimpleWB(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSimpleWB(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xphoto::SimpleWBConst for core::Ptr { + impl crate::xphoto::SimpleWBTraitConst for core::Ptr { #[inline] fn as_raw_SimpleWB(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xphoto::SimpleWB for core::Ptr { + impl crate::xphoto::SimpleWBTrait for core::Ptr { #[inline] fn as_raw_mut_SimpleWB(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::xphoto::WhiteBalancerConst for core::Ptr { + impl crate::xphoto::WhiteBalancerTraitConst for core::Ptr { #[inline] fn as_raw_WhiteBalancer(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xphoto::WhiteBalancer for core::Ptr { + impl crate::xphoto::WhiteBalancerTrait for core::Ptr { #[inline] fn as_raw_mut_WhiteBalancer(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - pub type PtrOfTonemapDurand = core::Ptr; + pub type PtrOfTonemapDurand = core::Ptr; - ptr_extern! { dyn crate::xphoto::TonemapDurand, + ptr_extern! { crate::xphoto::TonemapDurand, cv_PtrOfTonemapDurand_delete, cv_PtrOfTonemapDurand_get_inner_ptr, cv_PtrOfTonemapDurand_get_inner_ptr_mut } - impl core::Ptr { + impl core::Ptr { #[inline] pub fn as_raw_PtrOfTonemapDurand(&self) -> extern_send!(Self) { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfTonemapDurand(&mut self) -> extern_send!(mut Self) { self.as_raw_mut() } } - impl crate::xphoto::TonemapDurandConst for core::Ptr { + impl crate::xphoto::TonemapDurandTraitConst for core::Ptr { #[inline] fn as_raw_TonemapDurand(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::xphoto::TonemapDurand for core::Ptr { + impl crate::xphoto::TonemapDurandTrait for core::Ptr { #[inline] fn as_raw_mut_TonemapDurand(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl core::AlgorithmTraitConst for core::Ptr { + impl core::AlgorithmTraitConst for core::Ptr { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } - impl core::AlgorithmTrait for core::Ptr { + impl core::AlgorithmTrait for core::Ptr { #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } - impl crate::photo::TonemapConst for core::Ptr { + impl crate::photo::TonemapTraitConst for core::Ptr { #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.inner_as_raw() } } - impl crate::photo::Tonemap for core::Ptr { + impl crate::photo::TonemapTrait for core::Ptr { #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } diff --git a/docs/video.rs b/docs/video.rs index 24febcac5..550b27823 100644 --- a/docs/video.rs +++ b/docs/video.rs @@ -5,7 +5,7 @@ pub mod video { //! # C API use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::KalmanFilterTraitConst, super::KalmanFilterTrait, super::DenseOpticalFlowConst, super::DenseOpticalFlow, super::SparseOpticalFlowConst, super::SparseOpticalFlow, super::FarnebackOpticalFlowConst, super::FarnebackOpticalFlow, super::VariationalRefinementConst, super::VariationalRefinement, super::DISOpticalFlowConst, super::DISOpticalFlow, super::SparsePyrLKOpticalFlowConst, super::SparsePyrLKOpticalFlow, super::TrackerConst, super::Tracker, super::TrackerMILConst, super::TrackerMIL, super::TrackerGOTURN_ParamsTraitConst, super::TrackerGOTURN_ParamsTrait, super::TrackerGOTURNConst, super::TrackerGOTURN, super::TrackerDaSiamRPN_ParamsTraitConst, super::TrackerDaSiamRPN_ParamsTrait, super::TrackerDaSiamRPNConst, super::TrackerDaSiamRPN, super::TrackerNano_ParamsTraitConst, super::TrackerNano_ParamsTrait, super::TrackerNanoConst, super::TrackerNano, super::BackgroundSubtractorConst, super::BackgroundSubtractor, super::BackgroundSubtractorMOG2Const, super::BackgroundSubtractorMOG2, super::BackgroundSubtractorKNNConst, super::BackgroundSubtractorKNN }; + pub use { super::KalmanFilterTraitConst, super::KalmanFilterTrait, super::DenseOpticalFlowTraitConst, super::DenseOpticalFlowTrait, super::SparseOpticalFlowTraitConst, super::SparseOpticalFlowTrait, super::FarnebackOpticalFlowTraitConst, super::FarnebackOpticalFlowTrait, super::VariationalRefinementTraitConst, super::VariationalRefinementTrait, super::DISOpticalFlowTraitConst, super::DISOpticalFlowTrait, super::SparsePyrLKOpticalFlowTraitConst, super::SparsePyrLKOpticalFlowTrait, super::TrackerTraitConst, super::TrackerTrait, super::TrackerMILTraitConst, super::TrackerMILTrait, super::TrackerGOTURN_ParamsTraitConst, super::TrackerGOTURN_ParamsTrait, super::TrackerGOTURNTraitConst, super::TrackerGOTURNTrait, super::TrackerDaSiamRPN_ParamsTraitConst, super::TrackerDaSiamRPN_ParamsTrait, super::TrackerDaSiamRPNTraitConst, super::TrackerDaSiamRPNTrait, super::TrackerNano_ParamsTraitConst, super::TrackerNano_ParamsTrait, super::TrackerNanoTraitConst, super::TrackerNanoTrait, super::BackgroundSubtractorTraitConst, super::BackgroundSubtractorTrait, super::BackgroundSubtractorMOG2TraitConst, super::BackgroundSubtractorMOG2Trait, super::BackgroundSubtractorKNNTraitConst, super::BackgroundSubtractorKNNTrait }; } pub const DISOpticalFlow_PRESET_FAST: i32 = 1; @@ -240,12 +240,12 @@ pub mod video { /// * dist2_threshold: 400.0 /// * detect_shadows: true #[inline] - pub fn create_background_subtractor_knn(history: i32, dist2_threshold: f64, detect_shadows: bool) -> Result> { + pub fn create_background_subtractor_knn(history: i32, dist2_threshold: f64, detect_shadows: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createBackgroundSubtractorKNN_int_double_bool(history, dist2_threshold, detect_shadows, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -264,12 +264,12 @@ pub mod video { /// * var_threshold: 16 /// * detect_shadows: true #[inline] - pub fn create_background_subtractor_mog2(history: i32, var_threshold: f64, detect_shadows: bool) -> Result> { + pub fn create_background_subtractor_mog2(history: i32, var_threshold: f64, detect_shadows: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_createBackgroundSubtractorMOG2_int_double_bool(history, var_threshold, detect_shadows, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -517,7 +517,7 @@ pub mod video { } /// Constant methods for [crate::video::BackgroundSubtractor] - pub trait BackgroundSubtractorConst: core::AlgorithmTraitConst { + pub trait BackgroundSubtractorTraitConst: core::AlgorithmTraitConst { fn as_raw_BackgroundSubtractor(&self) -> *const c_void; /// Computes a background image. @@ -540,11 +540,8 @@ pub mod video { } - /// Base class for background/foreground segmentation. : - /// - /// The class is only used to define the common interface for the whole family of background/foreground - /// segmentation algorithms. - pub trait BackgroundSubtractor: core::AlgorithmTrait + crate::video::BackgroundSubtractorConst { + /// Mutable methods for [crate::video::BackgroundSubtractor] + pub trait BackgroundSubtractorTrait: core::AlgorithmTrait + crate::video::BackgroundSubtractorTraitConst { fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void; /// Computes a foreground mask. @@ -572,8 +569,49 @@ pub mod video { } + /// Base class for background/foreground segmentation. : + /// + /// The class is only used to define the common interface for the whole family of background/foreground + /// segmentation algorithms. + pub struct BackgroundSubtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { BackgroundSubtractor } + + impl Drop for BackgroundSubtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackgroundSubtractor_delete(instance: *mut c_void); } + unsafe { cv_BackgroundSubtractor_delete(self.as_raw_mut_BackgroundSubtractor()) }; + } + } + + unsafe impl Send for BackgroundSubtractor {} + + impl core::AlgorithmTraitConst for BackgroundSubtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BackgroundSubtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for BackgroundSubtractor { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for BackgroundSubtractor { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackgroundSubtractor { + } + + boxed_cast_base! { BackgroundSubtractor, core::Algorithm, cv_BackgroundSubtractor_to_Algorithm } + /// Constant methods for [crate::video::BackgroundSubtractorKNN] - pub trait BackgroundSubtractorKNNConst: crate::video::BackgroundSubtractorConst { + pub trait BackgroundSubtractorKNNTraitConst: crate::video::BackgroundSubtractorTraitConst { fn as_raw_BackgroundSubtractorKNN(&self) -> *const c_void; /// Returns the number of last frames that affect the background model @@ -665,11 +703,8 @@ pub mod video { } - /// K-nearest neighbours - based Background/Foreground Segmentation Algorithm. - /// - /// The class implements the K-nearest neighbours background subtraction described in [Zivkovic2006](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zivkovic2006) . - /// Very efficient if number of foreground pixels is low. - pub trait BackgroundSubtractorKNN: crate::video::BackgroundSubtractor + crate::video::BackgroundSubtractorKNNConst { + /// Mutable methods for [crate::video::BackgroundSubtractorKNN] + pub trait BackgroundSubtractorKNNTrait: crate::video::BackgroundSubtractorKNNTraitConst + crate::video::BackgroundSubtractorTrait { fn as_raw_mut_BackgroundSubtractorKNN(&mut self) -> *mut c_void; /// Sets the number of last frames that affect the background model @@ -746,8 +781,57 @@ pub mod video { } + /// K-nearest neighbours - based Background/Foreground Segmentation Algorithm. + /// + /// The class implements the K-nearest neighbours background subtraction described in [Zivkovic2006](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zivkovic2006) . + /// Very efficient if number of foreground pixels is low. + pub struct BackgroundSubtractorKNN { + ptr: *mut c_void + } + + opencv_type_boxed! { BackgroundSubtractorKNN } + + impl Drop for BackgroundSubtractorKNN { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackgroundSubtractorKNN_delete(instance: *mut c_void); } + unsafe { cv_BackgroundSubtractorKNN_delete(self.as_raw_mut_BackgroundSubtractorKNN()) }; + } + } + + unsafe impl Send for BackgroundSubtractorKNN {} + + impl core::AlgorithmTraitConst for BackgroundSubtractorKNN { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BackgroundSubtractorKNN { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for BackgroundSubtractorKNN { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for BackgroundSubtractorKNN { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorKNNTraitConst for BackgroundSubtractorKNN { + #[inline] fn as_raw_BackgroundSubtractorKNN(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorKNNTrait for BackgroundSubtractorKNN { + #[inline] fn as_raw_mut_BackgroundSubtractorKNN(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackgroundSubtractorKNN { + } + + boxed_cast_base! { BackgroundSubtractorKNN, core::Algorithm, cv_BackgroundSubtractorKNN_to_Algorithm } + /// Constant methods for [crate::video::BackgroundSubtractorMOG2] - pub trait BackgroundSubtractorMOG2Const: crate::video::BackgroundSubtractorConst { + pub trait BackgroundSubtractorMOG2TraitConst: crate::video::BackgroundSubtractorTraitConst { fn as_raw_BackgroundSubtractorMOG2(&self) -> *const c_void; /// Returns the number of last frames that affect the background model @@ -898,11 +982,8 @@ pub mod video { } - /// Gaussian Mixture-based Background/Foreground Segmentation Algorithm. - /// - /// The class implements the Gaussian mixture model background subtraction described in [Zivkovic2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zivkovic2004) - /// and [Zivkovic2006](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zivkovic2006) . - pub trait BackgroundSubtractorMOG2: crate::video::BackgroundSubtractor + crate::video::BackgroundSubtractorMOG2Const { + /// Mutable methods for [crate::video::BackgroundSubtractorMOG2] + pub trait BackgroundSubtractorMOG2Trait: crate::video::BackgroundSubtractorMOG2TraitConst + crate::video::BackgroundSubtractorTrait { fn as_raw_mut_BackgroundSubtractorMOG2(&mut self) -> *mut c_void; /// Sets the number of last frames that affect the background model @@ -1050,8 +1131,57 @@ pub mod video { } + /// Gaussian Mixture-based Background/Foreground Segmentation Algorithm. + /// + /// The class implements the Gaussian mixture model background subtraction described in [Zivkovic2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zivkovic2004) + /// and [Zivkovic2006](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Zivkovic2006) . + pub struct BackgroundSubtractorMOG2 { + ptr: *mut c_void + } + + opencv_type_boxed! { BackgroundSubtractorMOG2 } + + impl Drop for BackgroundSubtractorMOG2 { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BackgroundSubtractorMOG2_delete(instance: *mut c_void); } + unsafe { cv_BackgroundSubtractorMOG2_delete(self.as_raw_mut_BackgroundSubtractorMOG2()) }; + } + } + + unsafe impl Send for BackgroundSubtractorMOG2 {} + + impl core::AlgorithmTraitConst for BackgroundSubtractorMOG2 { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BackgroundSubtractorMOG2 { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorTraitConst for BackgroundSubtractorMOG2 { + #[inline] fn as_raw_BackgroundSubtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorTrait for BackgroundSubtractorMOG2 { + #[inline] fn as_raw_mut_BackgroundSubtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::BackgroundSubtractorMOG2TraitConst for BackgroundSubtractorMOG2 { + #[inline] fn as_raw_BackgroundSubtractorMOG2(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::BackgroundSubtractorMOG2Trait for BackgroundSubtractorMOG2 { + #[inline] fn as_raw_mut_BackgroundSubtractorMOG2(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BackgroundSubtractorMOG2 { + } + + boxed_cast_base! { BackgroundSubtractorMOG2, core::Algorithm, cv_BackgroundSubtractorMOG2_to_Algorithm } + /// Constant methods for [crate::video::DISOpticalFlow] - pub trait DISOpticalFlowConst: crate::video::DenseOpticalFlowConst { + pub trait DISOpticalFlowTraitConst: crate::video::DenseOpticalFlowTraitConst { fn as_raw_DISOpticalFlow(&self) -> *const c_void; /// Finest level of the Gaussian pyramid on which the flow is computed (zero level @@ -1188,18 +1318,8 @@ pub mod video { } - /// DIS optical flow algorithm. - /// - /// This class implements the Dense Inverse Search (DIS) optical flow algorithm. More - /// details about the algorithm can be found at [Kroeger2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Kroeger2016) . Includes three presets with preselected - /// parameters to provide reasonable trade-off between speed and quality. However, even the slowest preset is - /// still relatively fast, use DeepFlow if you need better quality and don't care about speed. - /// - /// This implementation includes several additional features compared to the algorithm described in the paper, - /// including spatial propagation of flow vectors ([getUseSpatialPropagation]), as well as an option to - /// utilize an initial flow approximation passed to [calc] (which is, essentially, temporal propagation, - /// if the previous frame's flow field is passed). - pub trait DISOpticalFlow: crate::video::DISOpticalFlowConst + crate::video::DenseOpticalFlow { + /// Mutable methods for [crate::video::DISOpticalFlow] + pub trait DISOpticalFlowTrait: crate::video::DISOpticalFlowTraitConst + crate::video::DenseOpticalFlowTrait { fn as_raw_mut_DISOpticalFlow(&mut self) -> *mut c_void; /// Finest level of the Gaussian pyramid on which the flow is computed (zero level @@ -1335,7 +1455,58 @@ pub mod video { } - impl dyn DISOpticalFlow + '_ { + /// DIS optical flow algorithm. + /// + /// This class implements the Dense Inverse Search (DIS) optical flow algorithm. More + /// details about the algorithm can be found at [Kroeger2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Kroeger2016) . Includes three presets with preselected + /// parameters to provide reasonable trade-off between speed and quality. However, even the slowest preset is + /// still relatively fast, use DeepFlow if you need better quality and don't care about speed. + /// + /// This implementation includes several additional features compared to the algorithm described in the paper, + /// including spatial propagation of flow vectors ([getUseSpatialPropagation]), as well as an option to + /// utilize an initial flow approximation passed to [calc] (which is, essentially, temporal propagation, + /// if the previous frame's flow field is passed). + pub struct DISOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { DISOpticalFlow } + + impl Drop for DISOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DISOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_DISOpticalFlow_delete(self.as_raw_mut_DISOpticalFlow()) }; + } + } + + unsafe impl Send for DISOpticalFlow {} + + impl core::AlgorithmTraitConst for DISOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DISOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::DenseOpticalFlowTraitConst for DISOpticalFlow { + #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::DenseOpticalFlowTrait for DISOpticalFlow { + #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::DISOpticalFlowTraitConst for DISOpticalFlow { + #[inline] fn as_raw_DISOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::DISOpticalFlowTrait for DISOpticalFlow { + #[inline] fn as_raw_mut_DISOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DISOpticalFlow { /// Creates an instance of DISOpticalFlow /// /// ## Parameters @@ -1344,24 +1515,27 @@ pub mod video { /// ## C++ default parameters /// * preset: DISOpticalFlow::PRESET_FAST #[inline] - pub fn create(preset: i32) -> Result> { + pub fn create(preset: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_DISOpticalFlow_create_int(preset, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { DISOpticalFlow, core::Algorithm, cv_DISOpticalFlow_to_Algorithm } + /// Constant methods for [crate::video::DenseOpticalFlow] - pub trait DenseOpticalFlowConst: core::AlgorithmTraitConst { + pub trait DenseOpticalFlowTraitConst: core::AlgorithmTraitConst { fn as_raw_DenseOpticalFlow(&self) -> *const c_void; } - /// Base class for dense optical flow algorithms - pub trait DenseOpticalFlow: core::AlgorithmTrait + crate::video::DenseOpticalFlowConst { + /// Mutable methods for [crate::video::DenseOpticalFlow] + pub trait DenseOpticalFlowTrait: core::AlgorithmTrait + crate::video::DenseOpticalFlowTraitConst { fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void; /// Calculates an optical flow. @@ -1394,8 +1568,46 @@ pub mod video { } + /// Base class for dense optical flow algorithms + pub struct DenseOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { DenseOpticalFlow } + + impl Drop for DenseOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DenseOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_DenseOpticalFlow_delete(self.as_raw_mut_DenseOpticalFlow()) }; + } + } + + unsafe impl Send for DenseOpticalFlow {} + + impl core::AlgorithmTraitConst for DenseOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DenseOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::DenseOpticalFlowTraitConst for DenseOpticalFlow { + #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::DenseOpticalFlowTrait for DenseOpticalFlow { + #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DenseOpticalFlow { + } + + boxed_cast_base! { DenseOpticalFlow, core::Algorithm, cv_DenseOpticalFlow_to_Algorithm } + /// Constant methods for [crate::video::FarnebackOpticalFlow] - pub trait FarnebackOpticalFlowConst: crate::video::DenseOpticalFlowConst { + pub trait FarnebackOpticalFlowTraitConst: crate::video::DenseOpticalFlowTraitConst { fn as_raw_FarnebackOpticalFlow(&self) -> *const c_void; #[inline] @@ -1472,8 +1684,8 @@ pub mod video { } - /// Class computing a dense optical flow using the Gunnar Farneback's algorithm. - pub trait FarnebackOpticalFlow: crate::video::DenseOpticalFlow + crate::video::FarnebackOpticalFlowConst { + /// Mutable methods for [crate::video::FarnebackOpticalFlow] + pub trait FarnebackOpticalFlowTrait: crate::video::DenseOpticalFlowTrait + crate::video::FarnebackOpticalFlowTraitConst { fn as_raw_mut_FarnebackOpticalFlow(&mut self) -> *mut c_void; #[inline] @@ -1550,7 +1762,48 @@ pub mod video { } - impl dyn FarnebackOpticalFlow + '_ { + /// Class computing a dense optical flow using the Gunnar Farneback's algorithm. + pub struct FarnebackOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { FarnebackOpticalFlow } + + impl Drop for FarnebackOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FarnebackOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_FarnebackOpticalFlow_delete(self.as_raw_mut_FarnebackOpticalFlow()) }; + } + } + + unsafe impl Send for FarnebackOpticalFlow {} + + impl core::AlgorithmTraitConst for FarnebackOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FarnebackOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::DenseOpticalFlowTraitConst for FarnebackOpticalFlow { + #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::DenseOpticalFlowTrait for FarnebackOpticalFlow { + #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::FarnebackOpticalFlowTraitConst for FarnebackOpticalFlow { + #[inline] fn as_raw_FarnebackOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::FarnebackOpticalFlowTrait for FarnebackOpticalFlow { + #[inline] fn as_raw_mut_FarnebackOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FarnebackOpticalFlow { /// ## C++ default parameters /// * num_levels: 5 /// * pyr_scale: 0.5 @@ -1561,16 +1814,19 @@ pub mod video { /// * poly_sigma: 1.1 /// * flags: 0 #[inline] - pub fn create(num_levels: i32, pyr_scale: f64, fast_pyramids: bool, win_size: i32, num_iters: i32, poly_n: i32, poly_sigma: f64, flags: i32) -> Result> { + pub fn create(num_levels: i32, pyr_scale: f64, fast_pyramids: bool, win_size: i32, num_iters: i32, poly_n: i32, poly_sigma: f64, flags: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_FarnebackOpticalFlow_create_int_double_bool_int_int_int_double_int(num_levels, pyr_scale, fast_pyramids, win_size, num_iters, poly_n, poly_sigma, flags, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { FarnebackOpticalFlow, core::Algorithm, cv_FarnebackOpticalFlow_to_Algorithm } + /// Constant methods for [crate::video::KalmanFilter] pub trait KalmanFilterTraitConst { fn as_raw_KalmanFilter(&self) -> *const c_void; @@ -1915,13 +2171,13 @@ pub mod video { } /// Constant methods for [crate::video::SparseOpticalFlow] - pub trait SparseOpticalFlowConst: core::AlgorithmTraitConst { + pub trait SparseOpticalFlowTraitConst: core::AlgorithmTraitConst { fn as_raw_SparseOpticalFlow(&self) -> *const c_void; } - /// Base interface for sparse optical flow algorithms. - pub trait SparseOpticalFlow: core::AlgorithmTrait + crate::video::SparseOpticalFlowConst { + /// Mutable methods for [crate::video::SparseOpticalFlow] + pub trait SparseOpticalFlowTrait: core::AlgorithmTrait + crate::video::SparseOpticalFlowTraitConst { fn as_raw_mut_SparseOpticalFlow(&mut self) -> *mut c_void; /// Calculates a sparse optical flow. @@ -1954,8 +2210,46 @@ pub mod video { } + /// Base interface for sparse optical flow algorithms. + pub struct SparseOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { SparseOpticalFlow } + + impl Drop for SparseOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SparseOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_SparseOpticalFlow_delete(self.as_raw_mut_SparseOpticalFlow()) }; + } + } + + unsafe impl Send for SparseOpticalFlow {} + + impl core::AlgorithmTraitConst for SparseOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SparseOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::SparseOpticalFlowTraitConst for SparseOpticalFlow { + #[inline] fn as_raw_SparseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::SparseOpticalFlowTrait for SparseOpticalFlow { + #[inline] fn as_raw_mut_SparseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SparseOpticalFlow { + } + + boxed_cast_base! { SparseOpticalFlow, core::Algorithm, cv_SparseOpticalFlow_to_Algorithm } + /// Constant methods for [crate::video::SparsePyrLKOpticalFlow] - pub trait SparsePyrLKOpticalFlowConst: crate::video::SparseOpticalFlowConst { + pub trait SparsePyrLKOpticalFlowTraitConst: crate::video::SparseOpticalFlowTraitConst { fn as_raw_SparsePyrLKOpticalFlow(&self) -> *const c_void; #[inline] @@ -2005,13 +2299,8 @@ pub mod video { } - /// Class used for calculating a sparse optical flow. - /// - /// The class can calculate an optical flow for a sparse feature set using the - /// iterative Lucas-Kanade method with pyramids. - /// ## See also - /// calcOpticalFlowPyrLK - pub trait SparsePyrLKOpticalFlow: crate::video::SparseOpticalFlow + crate::video::SparsePyrLKOpticalFlowConst { + /// Mutable methods for [crate::video::SparsePyrLKOpticalFlow] + pub trait SparsePyrLKOpticalFlowTrait: crate::video::SparseOpticalFlowTrait + crate::video::SparsePyrLKOpticalFlowTraitConst { fn as_raw_mut_SparsePyrLKOpticalFlow(&mut self) -> *mut c_void; #[inline] @@ -2061,7 +2350,53 @@ pub mod video { } - impl dyn SparsePyrLKOpticalFlow + '_ { + /// Class used for calculating a sparse optical flow. + /// + /// The class can calculate an optical flow for a sparse feature set using the + /// iterative Lucas-Kanade method with pyramids. + /// ## See also + /// calcOpticalFlowPyrLK + pub struct SparsePyrLKOpticalFlow { + ptr: *mut c_void + } + + opencv_type_boxed! { SparsePyrLKOpticalFlow } + + impl Drop for SparsePyrLKOpticalFlow { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SparsePyrLKOpticalFlow_delete(instance: *mut c_void); } + unsafe { cv_SparsePyrLKOpticalFlow_delete(self.as_raw_mut_SparsePyrLKOpticalFlow()) }; + } + } + + unsafe impl Send for SparsePyrLKOpticalFlow {} + + impl core::AlgorithmTraitConst for SparsePyrLKOpticalFlow { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SparsePyrLKOpticalFlow { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::SparseOpticalFlowTraitConst for SparsePyrLKOpticalFlow { + #[inline] fn as_raw_SparseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::SparseOpticalFlowTrait for SparsePyrLKOpticalFlow { + #[inline] fn as_raw_mut_SparseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::SparsePyrLKOpticalFlowTraitConst for SparsePyrLKOpticalFlow { + #[inline] fn as_raw_SparsePyrLKOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::SparsePyrLKOpticalFlowTrait for SparsePyrLKOpticalFlow { + #[inline] fn as_raw_mut_SparsePyrLKOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SparsePyrLKOpticalFlow { /// ## C++ default parameters /// * win_size: Size(21,21) /// * max_level: 3 @@ -2069,24 +2404,27 @@ pub mod video { /// * flags: 0 /// * min_eig_threshold: 1e-4 #[inline] - pub fn create(win_size: core::Size, max_level: i32, crit: core::TermCriteria, flags: i32, min_eig_threshold: f64) -> Result> { + pub fn create(win_size: core::Size, max_level: i32, crit: core::TermCriteria, flags: i32, min_eig_threshold: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_SparsePyrLKOpticalFlow_create_Size_int_TermCriteria_int_double(win_size.opencv_as_extern(), max_level, crit.opencv_as_extern(), flags, min_eig_threshold, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { SparsePyrLKOpticalFlow, core::Algorithm, cv_SparsePyrLKOpticalFlow_to_Algorithm } + /// Constant methods for [crate::video::Tracker] - pub trait TrackerConst { + pub trait TrackerTraitConst { fn as_raw_Tracker(&self) -> *const c_void; } - /// Base abstract class for the long-term tracker - pub trait Tracker: crate::video::TrackerConst { + /// Mutable methods for [crate::video::Tracker] + pub trait TrackerTrait: crate::video::TrackerTraitConst { fn as_raw_mut_Tracker(&mut self) -> *mut c_void; /// Initialize the tracker with a known bounding box that surrounded the target @@ -2125,13 +2463,42 @@ pub mod video { } + /// Base abstract class for the long-term tracker + pub struct Tracker { + ptr: *mut c_void + } + + opencv_type_boxed! { Tracker } + + impl Drop for Tracker { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_Tracker_delete(instance: *mut c_void); } + unsafe { cv_Tracker_delete(self.as_raw_mut_Tracker()) }; + } + } + + unsafe impl Send for Tracker {} + + impl crate::video::TrackerTraitConst for Tracker { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerTrait for Tracker { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl Tracker { + } + /// Constant methods for [crate::video::TrackerDaSiamRPN] - pub trait TrackerDaSiamRPNConst: crate::video::TrackerConst { + pub trait TrackerDaSiamRPNTraitConst: crate::video::TrackerTraitConst { fn as_raw_TrackerDaSiamRPN(&self) -> *const c_void; } - pub trait TrackerDaSiamRPN: crate::video::Tracker + crate::video::TrackerDaSiamRPNConst { + /// Mutable methods for [crate::video::TrackerDaSiamRPN] + pub trait TrackerDaSiamRPNTrait: crate::video::TrackerDaSiamRPNTraitConst + crate::video::TrackerTrait { fn as_raw_mut_TrackerDaSiamRPN(&mut self) -> *mut c_void; /// Return tracking score @@ -2146,7 +2513,39 @@ pub mod video { } - impl dyn TrackerDaSiamRPN + '_ { + pub struct TrackerDaSiamRPN { + ptr: *mut c_void + } + + opencv_type_boxed! { TrackerDaSiamRPN } + + impl Drop for TrackerDaSiamRPN { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TrackerDaSiamRPN_delete(instance: *mut c_void); } + unsafe { cv_TrackerDaSiamRPN_delete(self.as_raw_mut_TrackerDaSiamRPN()) }; + } + } + + unsafe impl Send for TrackerDaSiamRPN {} + + impl crate::video::TrackerTraitConst for TrackerDaSiamRPN { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerTrait for TrackerDaSiamRPN { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::TrackerDaSiamRPNTraitConst for TrackerDaSiamRPN { + #[inline] fn as_raw_TrackerDaSiamRPN(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerDaSiamRPNTrait for TrackerDaSiamRPN { + #[inline] fn as_raw_mut_TrackerDaSiamRPN(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TrackerDaSiamRPN { /// Constructor /// ## Parameters /// * parameters: DaSiamRPN parameters TrackerDaSiamRPN::Params @@ -2154,16 +2553,17 @@ pub mod video { /// ## C++ default parameters /// * parameters: TrackerDaSiamRPN::Params() #[inline] - pub fn create(parameters: &crate::video::TrackerDaSiamRPN_Params) -> Result> { + pub fn create(parameters: &crate::video::TrackerDaSiamRPN_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_TrackerDaSiamRPN_create_const_ParamsR(parameters.as_raw_TrackerDaSiamRPN_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::video::TrackerDaSiamRPN_Params] pub trait TrackerDaSiamRPN_ParamsTraitConst { fn as_raw_TrackerDaSiamRPN_Params(&self) -> *const c_void; @@ -2288,11 +2688,17 @@ pub mod video { } /// Constant methods for [crate::video::TrackerGOTURN] - pub trait TrackerGOTURNConst: crate::video::TrackerConst { + pub trait TrackerGOTURNTraitConst: crate::video::TrackerTraitConst { fn as_raw_TrackerGOTURN(&self) -> *const c_void; } + /// Mutable methods for [crate::video::TrackerGOTURN] + pub trait TrackerGOTURNTrait: crate::video::TrackerGOTURNTraitConst + crate::video::TrackerTrait { + fn as_raw_mut_TrackerGOTURN(&mut self) -> *mut c_void; + + } + /// the GOTURN (Generic Object Tracking Using Regression Networks) tracker /// /// GOTURN ([GOTURN](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_GOTURN)) is kind of trackers based on Convolutional Neural Networks (CNN). While taking all advantages of CNN trackers, @@ -2307,12 +2713,39 @@ pub mod video { /// Implementation of training algorithm is placed in separately here due to 3d-party dependencies: /// /// GOTURN architecture goturn.prototxt and trained model goturn.caffemodel are accessible on opencv_extra GitHub repository. - pub trait TrackerGOTURN: crate::video::Tracker + crate::video::TrackerGOTURNConst { - fn as_raw_mut_TrackerGOTURN(&mut self) -> *mut c_void; + pub struct TrackerGOTURN { + ptr: *mut c_void + } + + opencv_type_boxed! { TrackerGOTURN } + + impl Drop for TrackerGOTURN { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TrackerGOTURN_delete(instance: *mut c_void); } + unsafe { cv_TrackerGOTURN_delete(self.as_raw_mut_TrackerGOTURN()) }; + } + } + + unsafe impl Send for TrackerGOTURN {} + impl crate::video::TrackerTraitConst for TrackerGOTURN { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } } - impl dyn TrackerGOTURN + '_ { + impl crate::video::TrackerTrait for TrackerGOTURN { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::TrackerGOTURNTraitConst for TrackerGOTURN { + #[inline] fn as_raw_TrackerGOTURN(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerGOTURNTrait for TrackerGOTURN { + #[inline] fn as_raw_mut_TrackerGOTURN(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TrackerGOTURN { /// Constructor /// ## Parameters /// * parameters: GOTURN parameters TrackerGOTURN::Params @@ -2320,16 +2753,17 @@ pub mod video { /// ## C++ default parameters /// * parameters: TrackerGOTURN::Params() #[inline] - pub fn create(parameters: &crate::video::TrackerGOTURN_Params) -> Result> { + pub fn create(parameters: &crate::video::TrackerGOTURN_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_TrackerGOTURN_create_const_ParamsR(parameters.as_raw_TrackerGOTURN_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::video::TrackerGOTURN_Params] pub trait TrackerGOTURN_ParamsTraitConst { fn as_raw_TrackerGOTURN_Params(&self) -> *const c_void; @@ -2416,11 +2850,17 @@ pub mod video { } /// Constant methods for [crate::video::TrackerMIL] - pub trait TrackerMILConst: crate::video::TrackerConst { + pub trait TrackerMILTraitConst: crate::video::TrackerTraitConst { fn as_raw_TrackerMIL(&self) -> *const c_void; } + /// Mutable methods for [crate::video::TrackerMIL] + pub trait TrackerMILTrait: crate::video::TrackerMILTraitConst + crate::video::TrackerTrait { + fn as_raw_mut_TrackerMIL(&mut self) -> *mut c_void; + + } + /// The MIL algorithm trains a classifier in an online manner to separate the object from the /// background. /// @@ -2428,12 +2868,39 @@ pub mod video { /// based on [MIL](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_MIL) . /// /// Original code can be found here - pub trait TrackerMIL: crate::video::Tracker + crate::video::TrackerMILConst { - fn as_raw_mut_TrackerMIL(&mut self) -> *mut c_void; + pub struct TrackerMIL { + ptr: *mut c_void + } + + opencv_type_boxed! { TrackerMIL } + impl Drop for TrackerMIL { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TrackerMIL_delete(instance: *mut c_void); } + unsafe { cv_TrackerMIL_delete(self.as_raw_mut_TrackerMIL()) }; + } + } + + unsafe impl Send for TrackerMIL {} + + impl crate::video::TrackerTraitConst for TrackerMIL { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerTrait for TrackerMIL { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::TrackerMILTraitConst for TrackerMIL { + #[inline] fn as_raw_TrackerMIL(&self) -> *const c_void { self.as_raw() } } - impl dyn TrackerMIL + '_ { + impl crate::video::TrackerMILTrait for TrackerMIL { + #[inline] fn as_raw_mut_TrackerMIL(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TrackerMIL { /// Create MIL tracker instance /// ## Parameters /// * parameters: MIL parameters TrackerMIL::Params @@ -2441,16 +2908,17 @@ pub mod video { /// ## C++ default parameters /// * parameters: TrackerMIL::Params() #[inline] - pub fn create(parameters: crate::video::TrackerMIL_Params) -> Result> { + pub fn create(parameters: crate::video::TrackerMIL_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_TrackerMIL_create_const_ParamsR(¶meters, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq)] pub struct TrackerMIL_Params { @@ -2485,19 +2953,13 @@ pub mod video { } /// Constant methods for [crate::video::TrackerNano] - pub trait TrackerNanoConst: crate::video::TrackerConst { + pub trait TrackerNanoTraitConst: crate::video::TrackerTraitConst { fn as_raw_TrackerNano(&self) -> *const c_void; } - /// the Nano tracker is a super lightweight dnn-based general object tracking. - /// - /// Nano tracker is much faster and extremely lightweight due to special model structure, the whole model size is about 1.9 MB. - /// Nano tracker needs two models: one for feature extraction (backbone) and the another for localization (neckhead). - /// Model download link: - /// Original repo is here: - /// Author: HongLinChu, 1628464345@qq.com - pub trait TrackerNano: crate::video::Tracker + crate::video::TrackerNanoConst { + /// Mutable methods for [crate::video::TrackerNano] + pub trait TrackerNanoTrait: crate::video::TrackerNanoTraitConst + crate::video::TrackerTrait { fn as_raw_mut_TrackerNano(&mut self) -> *mut c_void; /// Return tracking score @@ -2512,7 +2974,46 @@ pub mod video { } - impl dyn TrackerNano + '_ { + /// the Nano tracker is a super lightweight dnn-based general object tracking. + /// + /// Nano tracker is much faster and extremely lightweight due to special model structure, the whole model size is about 1.9 MB. + /// Nano tracker needs two models: one for feature extraction (backbone) and the another for localization (neckhead). + /// Model download link: + /// Original repo is here: + /// Author: HongLinChu, 1628464345@qq.com + pub struct TrackerNano { + ptr: *mut c_void + } + + opencv_type_boxed! { TrackerNano } + + impl Drop for TrackerNano { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TrackerNano_delete(instance: *mut c_void); } + unsafe { cv_TrackerNano_delete(self.as_raw_mut_TrackerNano()) }; + } + } + + unsafe impl Send for TrackerNano {} + + impl crate::video::TrackerTraitConst for TrackerNano { + #[inline] fn as_raw_Tracker(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerTrait for TrackerNano { + #[inline] fn as_raw_mut_Tracker(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::TrackerNanoTraitConst for TrackerNano { + #[inline] fn as_raw_TrackerNano(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::TrackerNanoTrait for TrackerNano { + #[inline] fn as_raw_mut_TrackerNano(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TrackerNano { /// Constructor /// ## Parameters /// * parameters: NanoTrack parameters TrackerNano::Params @@ -2520,16 +3021,17 @@ pub mod video { /// ## C++ default parameters /// * parameters: TrackerNano::Params() #[inline] - pub fn create(parameters: &crate::video::TrackerNano_Params) -> Result> { + pub fn create(parameters: &crate::video::TrackerNano_Params) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_TrackerNano_create_const_ParamsR(parameters.as_raw_TrackerNano_Params(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + /// Constant methods for [crate::video::TrackerNano_Params] pub trait TrackerNano_ParamsTraitConst { fn as_raw_TrackerNano_Params(&self) -> *const c_void; @@ -2640,7 +3142,7 @@ pub mod video { } /// Constant methods for [crate::video::VariationalRefinement] - pub trait VariationalRefinementConst: crate::video::DenseOpticalFlowConst { + pub trait VariationalRefinementTraitConst: crate::video::DenseOpticalFlowTraitConst { fn as_raw_VariationalRefinement(&self) -> *const c_void; /// Number of outer (fixed-point) iterations in the minimization procedure. @@ -2718,16 +3220,8 @@ pub mod video { } - /// Variational optical flow refinement - /// - /// This class implements variational refinement of the input flow field, i.e. - /// it uses input flow to initialize the minimization of the following functional: - /// ![inline formula](https://latex.codecogs.com/png.latex?E%28U%29%20%3D%20%5Cint%5F%7B%5COmega%7D%20%5Cdelta%20%5CPsi%28E%5FI%29%20%2B%20%5Cgamma%20%5CPsi%28E%5FG%29%20%2B%20%5Calpha%20%5CPsi%28E%5FS%29%20), - /// where ![inline formula](https://latex.codecogs.com/png.latex?E%5FI%2CE%5FG%2CE%5FS) are color constancy, gradient constancy and smoothness terms - /// respectively. ![inline formula](https://latex.codecogs.com/png.latex?%5CPsi%28s%5E2%29%3D%5Csqrt%7Bs%5E2%2B%5Cepsilon%5E2%7D) is a robust penalizer to limit the - /// influence of outliers. A complete formulation and a description of the minimization - /// procedure can be found in [Brox2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Brox2004) - pub trait VariationalRefinement: crate::video::DenseOpticalFlow + crate::video::VariationalRefinementConst { + /// Mutable methods for [crate::video::VariationalRefinement] + pub trait VariationalRefinementTrait: crate::video::DenseOpticalFlowTrait + crate::video::VariationalRefinementTraitConst { fn as_raw_mut_VariationalRefinement(&mut self) -> *mut c_void; /// [calc] function overload to handle separate horizontal (u) and vertical (v) flow components @@ -2820,16 +3314,68 @@ pub mod video { } - impl dyn VariationalRefinement + '_ { + /// Variational optical flow refinement + /// + /// This class implements variational refinement of the input flow field, i.e. + /// it uses input flow to initialize the minimization of the following functional: + /// ![inline formula](https://latex.codecogs.com/png.latex?E%28U%29%20%3D%20%5Cint%5F%7B%5COmega%7D%20%5Cdelta%20%5CPsi%28E%5FI%29%20%2B%20%5Cgamma%20%5CPsi%28E%5FG%29%20%2B%20%5Calpha%20%5CPsi%28E%5FS%29%20), + /// where ![inline formula](https://latex.codecogs.com/png.latex?E%5FI%2CE%5FG%2CE%5FS) are color constancy, gradient constancy and smoothness terms + /// respectively. ![inline formula](https://latex.codecogs.com/png.latex?%5CPsi%28s%5E2%29%3D%5Csqrt%7Bs%5E2%2B%5Cepsilon%5E2%7D) is a robust penalizer to limit the + /// influence of outliers. A complete formulation and a description of the minimization + /// procedure can be found in [Brox2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Brox2004) + pub struct VariationalRefinement { + ptr: *mut c_void + } + + opencv_type_boxed! { VariationalRefinement } + + impl Drop for VariationalRefinement { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_VariationalRefinement_delete(instance: *mut c_void); } + unsafe { cv_VariationalRefinement_delete(self.as_raw_mut_VariationalRefinement()) }; + } + } + + unsafe impl Send for VariationalRefinement {} + + impl core::AlgorithmTraitConst for VariationalRefinement { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for VariationalRefinement { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::DenseOpticalFlowTraitConst for VariationalRefinement { + #[inline] fn as_raw_DenseOpticalFlow(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::DenseOpticalFlowTrait for VariationalRefinement { + #[inline] fn as_raw_mut_DenseOpticalFlow(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::video::VariationalRefinementTraitConst for VariationalRefinement { + #[inline] fn as_raw_VariationalRefinement(&self) -> *const c_void { self.as_raw() } + } + + impl crate::video::VariationalRefinementTrait for VariationalRefinement { + #[inline] fn as_raw_mut_VariationalRefinement(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl VariationalRefinement { /// Creates an instance of VariationalRefinement #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_VariationalRefinement_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { VariationalRefinement, core::Algorithm, cv_VariationalRefinement_to_Algorithm } +} diff --git a/docs/videostab.rs b/docs/videostab.rs index e9107cccc..e5e7891eb 100644 --- a/docs/videostab.rs +++ b/docs/videostab.rs @@ -25,7 +25,7 @@ pub mod videostab { //! color inpainting. The method is implemented is a flexible way and it's made public for other users. use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::ISparseOptFlowEstimatorConst, super::ISparseOptFlowEstimator, super::IDenseOptFlowEstimatorConst, super::IDenseOptFlowEstimator, super::PyrLkOptFlowEstimatorBaseTraitConst, super::PyrLkOptFlowEstimatorBaseTrait, super::SparsePyrLkOptFlowEstimatorTraitConst, super::SparsePyrLkOptFlowEstimatorTrait, super::SparsePyrLkOptFlowEstimatorGpuTraitConst, super::SparsePyrLkOptFlowEstimatorGpuTrait, super::DensePyrLkOptFlowEstimatorGpuTraitConst, super::DensePyrLkOptFlowEstimatorGpuTrait, super::RansacParamsTraitConst, super::RansacParamsTrait, super::IOutlierRejectorConst, super::IOutlierRejector, super::NullOutlierRejectorTraitConst, super::NullOutlierRejectorTrait, super::TranslationBasedLocalOutlierRejectorTraitConst, super::TranslationBasedLocalOutlierRejectorTrait, super::MotionEstimatorBaseConst, super::MotionEstimatorBase, super::MotionEstimatorRansacL2TraitConst, super::MotionEstimatorRansacL2Trait, super::MotionEstimatorL1TraitConst, super::MotionEstimatorL1Trait, super::ImageMotionEstimatorBaseConst, super::ImageMotionEstimatorBase, super::FromFileMotionReaderTraitConst, super::FromFileMotionReaderTrait, super::ToFileMotionWriterTraitConst, super::ToFileMotionWriterTrait, super::KeypointBasedMotionEstimatorTraitConst, super::KeypointBasedMotionEstimatorTrait, super::KeypointBasedMotionEstimatorGpuTraitConst, super::KeypointBasedMotionEstimatorGpuTrait, super::IMotionStabilizerConst, super::IMotionStabilizer, super::MotionStabilizationPipelineTraitConst, super::MotionStabilizationPipelineTrait, super::MotionFilterBaseConst, super::MotionFilterBase, super::GaussianMotionFilterTraitConst, super::GaussianMotionFilterTrait, super::LpMotionStabilizerTraitConst, super::LpMotionStabilizerTrait, super::IFrameSourceConst, super::IFrameSource, super::NullFrameSourceTraitConst, super::NullFrameSourceTrait, super::VideoFileSourceTraitConst, super::VideoFileSourceTrait, super::MaskFrameSourceTraitConst, super::MaskFrameSourceTrait, super::ILogConst, super::ILog, super::NullLogTraitConst, super::NullLogTrait, super::LogToStdoutTraitConst, super::LogToStdoutTrait, super::FastMarchingMethodTraitConst, super::FastMarchingMethodTrait, super::InpainterBaseConst, super::InpainterBase, super::NullInpainterTraitConst, super::NullInpainterTrait, super::InpaintingPipelineTraitConst, super::InpaintingPipelineTrait, super::ConsistentMosaicInpainterTraitConst, super::ConsistentMosaicInpainterTrait, super::MotionInpainterTraitConst, super::MotionInpainterTrait, super::ColorAverageInpainterTraitConst, super::ColorAverageInpainterTrait, super::ColorInpainterTraitConst, super::ColorInpainterTrait, super::DeblurerBaseConst, super::DeblurerBase, super::NullDeblurerTraitConst, super::NullDeblurerTrait, super::WeightingDeblurerTraitConst, super::WeightingDeblurerTrait, super::WobbleSuppressorBaseConst, super::WobbleSuppressorBase, super::NullWobbleSuppressorTraitConst, super::NullWobbleSuppressorTrait, super::MoreAccurateMotionWobbleSuppressorBaseConst, super::MoreAccurateMotionWobbleSuppressorBase, super::MoreAccurateMotionWobbleSuppressorTraitConst, super::MoreAccurateMotionWobbleSuppressorTrait, super::MoreAccurateMotionWobbleSuppressorGpuTraitConst, super::MoreAccurateMotionWobbleSuppressorGpuTrait, super::StabilizerBaseConst, super::StabilizerBase, super::OnePassStabilizerTraitConst, super::OnePassStabilizerTrait, super::TwoPassStabilizerTraitConst, super::TwoPassStabilizerTrait }; + pub use { super::ISparseOptFlowEstimatorTraitConst, super::ISparseOptFlowEstimatorTrait, super::IDenseOptFlowEstimatorTraitConst, super::IDenseOptFlowEstimatorTrait, super::PyrLkOptFlowEstimatorBaseTraitConst, super::PyrLkOptFlowEstimatorBaseTrait, super::SparsePyrLkOptFlowEstimatorTraitConst, super::SparsePyrLkOptFlowEstimatorTrait, super::SparsePyrLkOptFlowEstimatorGpuTraitConst, super::SparsePyrLkOptFlowEstimatorGpuTrait, super::DensePyrLkOptFlowEstimatorGpuTraitConst, super::DensePyrLkOptFlowEstimatorGpuTrait, super::RansacParamsTraitConst, super::RansacParamsTrait, super::IOutlierRejectorTraitConst, super::IOutlierRejectorTrait, super::NullOutlierRejectorTraitConst, super::NullOutlierRejectorTrait, super::TranslationBasedLocalOutlierRejectorTraitConst, super::TranslationBasedLocalOutlierRejectorTrait, super::MotionEstimatorBaseTraitConst, super::MotionEstimatorBaseTrait, super::MotionEstimatorRansacL2TraitConst, super::MotionEstimatorRansacL2Trait, super::MotionEstimatorL1TraitConst, super::MotionEstimatorL1Trait, super::ImageMotionEstimatorBaseTraitConst, super::ImageMotionEstimatorBaseTrait, super::FromFileMotionReaderTraitConst, super::FromFileMotionReaderTrait, super::ToFileMotionWriterTraitConst, super::ToFileMotionWriterTrait, super::KeypointBasedMotionEstimatorTraitConst, super::KeypointBasedMotionEstimatorTrait, super::KeypointBasedMotionEstimatorGpuTraitConst, super::KeypointBasedMotionEstimatorGpuTrait, super::IMotionStabilizerTraitConst, super::IMotionStabilizerTrait, super::MotionStabilizationPipelineTraitConst, super::MotionStabilizationPipelineTrait, super::MotionFilterBaseTraitConst, super::MotionFilterBaseTrait, super::GaussianMotionFilterTraitConst, super::GaussianMotionFilterTrait, super::LpMotionStabilizerTraitConst, super::LpMotionStabilizerTrait, super::IFrameSourceTraitConst, super::IFrameSourceTrait, super::NullFrameSourceTraitConst, super::NullFrameSourceTrait, super::VideoFileSourceTraitConst, super::VideoFileSourceTrait, super::MaskFrameSourceTraitConst, super::MaskFrameSourceTrait, super::ILogTraitConst, super::ILogTrait, super::NullLogTraitConst, super::NullLogTrait, super::LogToStdoutTraitConst, super::LogToStdoutTrait, super::FastMarchingMethodTraitConst, super::FastMarchingMethodTrait, super::InpainterBaseTraitConst, super::InpainterBaseTrait, super::NullInpainterTraitConst, super::NullInpainterTrait, super::InpaintingPipelineTraitConst, super::InpaintingPipelineTrait, super::ConsistentMosaicInpainterTraitConst, super::ConsistentMosaicInpainterTrait, super::MotionInpainterTraitConst, super::MotionInpainterTrait, super::ColorAverageInpainterTraitConst, super::ColorAverageInpainterTrait, super::ColorInpainterTraitConst, super::ColorInpainterTrait, super::DeblurerBaseTraitConst, super::DeblurerBaseTrait, super::NullDeblurerTraitConst, super::NullDeblurerTrait, super::WeightingDeblurerTraitConst, super::WeightingDeblurerTrait, super::WobbleSuppressorBaseTraitConst, super::WobbleSuppressorBaseTrait, super::NullWobbleSuppressorTraitConst, super::NullWobbleSuppressorTrait, super::MoreAccurateMotionWobbleSuppressorBaseTraitConst, super::MoreAccurateMotionWobbleSuppressorBaseTrait, super::MoreAccurateMotionWobbleSuppressorTraitConst, super::MoreAccurateMotionWobbleSuppressorTrait, super::MoreAccurateMotionWobbleSuppressorGpuTraitConst, super::MoreAccurateMotionWobbleSuppressorGpuTrait, super::StabilizerBaseTraitConst, super::StabilizerBaseTrait, super::OnePassStabilizerTraitConst, super::OnePassStabilizerTrait, super::TwoPassStabilizerTraitConst, super::TwoPassStabilizerTrait }; } pub const MM_AFFINE: i32 = 5; @@ -172,13 +172,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::ColorAverageInpainter] - pub trait ColorAverageInpainterTraitConst: crate::videostab::InpainterBaseConst { + pub trait ColorAverageInpainterTraitConst: crate::videostab::InpainterBaseTraitConst { fn as_raw_ColorAverageInpainter(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::ColorAverageInpainter] - pub trait ColorAverageInpainterTrait: crate::videostab::ColorAverageInpainterTraitConst + crate::videostab::InpainterBase { + pub trait ColorAverageInpainterTrait: crate::videostab::ColorAverageInpainterTraitConst + crate::videostab::InpainterBaseTrait { fn as_raw_mut_ColorAverageInpainter(&mut self) -> *mut c_void; #[inline] @@ -208,11 +208,11 @@ pub mod videostab { unsafe impl Send for ColorAverageInpainter {} - impl crate::videostab::InpainterBaseConst for ColorAverageInpainter { + impl crate::videostab::InpainterBaseTraitConst for ColorAverageInpainter { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::InpainterBase for ColorAverageInpainter { + impl crate::videostab::InpainterBaseTrait for ColorAverageInpainter { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -228,13 +228,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::ColorInpainter] - pub trait ColorInpainterTraitConst: crate::videostab::InpainterBaseConst { + pub trait ColorInpainterTraitConst: crate::videostab::InpainterBaseTraitConst { fn as_raw_ColorInpainter(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::ColorInpainter] - pub trait ColorInpainterTrait: crate::videostab::ColorInpainterTraitConst + crate::videostab::InpainterBase { + pub trait ColorInpainterTrait: crate::videostab::ColorInpainterTraitConst + crate::videostab::InpainterBaseTrait { fn as_raw_mut_ColorInpainter(&mut self) -> *mut c_void; #[inline] @@ -264,11 +264,11 @@ pub mod videostab { unsafe impl Send for ColorInpainter {} - impl crate::videostab::InpainterBaseConst for ColorInpainter { + impl crate::videostab::InpainterBaseTraitConst for ColorInpainter { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::InpainterBase for ColorInpainter { + impl crate::videostab::InpainterBaseTrait for ColorInpainter { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -297,7 +297,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::ConsistentMosaicInpainter] - pub trait ConsistentMosaicInpainterTraitConst: crate::videostab::InpainterBaseConst { + pub trait ConsistentMosaicInpainterTraitConst: crate::videostab::InpainterBaseTraitConst { fn as_raw_ConsistentMosaicInpainter(&self) -> *const c_void; #[inline] @@ -312,7 +312,7 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::ConsistentMosaicInpainter] - pub trait ConsistentMosaicInpainterTrait: crate::videostab::ConsistentMosaicInpainterTraitConst + crate::videostab::InpainterBase { + pub trait ConsistentMosaicInpainterTrait: crate::videostab::ConsistentMosaicInpainterTraitConst + crate::videostab::InpainterBaseTrait { fn as_raw_mut_ConsistentMosaicInpainter(&mut self) -> *mut c_void; #[inline] @@ -351,11 +351,11 @@ pub mod videostab { unsafe impl Send for ConsistentMosaicInpainter {} - impl crate::videostab::InpainterBaseConst for ConsistentMosaicInpainter { + impl crate::videostab::InpainterBaseTraitConst for ConsistentMosaicInpainter { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::InpainterBase for ConsistentMosaicInpainter { + impl crate::videostab::InpainterBaseTrait for ConsistentMosaicInpainter { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -381,7 +381,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::DeblurerBase] - pub trait DeblurerBaseConst { + pub trait DeblurerBaseTraitConst { fn as_raw_DeblurerBase(&self) -> *const c_void; #[inline] @@ -425,7 +425,8 @@ pub mod videostab { } - pub trait DeblurerBase: crate::videostab::DeblurerBaseConst { + /// Mutable methods for [crate::videostab::DeblurerBase] + pub trait DeblurerBaseTrait: crate::videostab::DeblurerBaseTraitConst { fn as_raw_mut_DeblurerBase(&mut self) -> *mut c_void; #[inline] @@ -475,14 +476,45 @@ pub mod videostab { } + pub struct DeblurerBase { + ptr: *mut c_void + } + + opencv_type_boxed! { DeblurerBase } + + impl Drop for DeblurerBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DeblurerBase_delete(instance: *mut c_void); } + unsafe { cv_DeblurerBase_delete(self.as_raw_mut_DeblurerBase()) }; + } + } + + unsafe impl Send for DeblurerBase {} + + impl crate::videostab::DeblurerBaseTraitConst for DeblurerBase { + #[inline] fn as_raw_DeblurerBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::DeblurerBaseTrait for DeblurerBase { + #[inline] fn as_raw_mut_DeblurerBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DeblurerBase { + } + + boxed_cast_descendant! { DeblurerBase, crate::videostab::NullDeblurer, cv_DeblurerBase_to_NullDeblurer } + + boxed_cast_descendant! { DeblurerBase, crate::videostab::WeightingDeblurer, cv_DeblurerBase_to_WeightingDeblurer } + /// Constant methods for [crate::videostab::DensePyrLkOptFlowEstimatorGpu] - pub trait DensePyrLkOptFlowEstimatorGpuTraitConst: crate::videostab::IDenseOptFlowEstimatorConst + crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst { + pub trait DensePyrLkOptFlowEstimatorGpuTraitConst: crate::videostab::IDenseOptFlowEstimatorTraitConst + crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst { fn as_raw_DensePyrLkOptFlowEstimatorGpu(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::DensePyrLkOptFlowEstimatorGpu] - pub trait DensePyrLkOptFlowEstimatorGpuTrait: crate::videostab::DensePyrLkOptFlowEstimatorGpuTraitConst + crate::videostab::IDenseOptFlowEstimator + crate::videostab::PyrLkOptFlowEstimatorBaseTrait { + pub trait DensePyrLkOptFlowEstimatorGpuTrait: crate::videostab::DensePyrLkOptFlowEstimatorGpuTraitConst + crate::videostab::IDenseOptFlowEstimatorTrait + crate::videostab::PyrLkOptFlowEstimatorBaseTrait { fn as_raw_mut_DensePyrLkOptFlowEstimatorGpu(&mut self) -> *mut c_void; #[inline] @@ -517,11 +549,11 @@ pub mod videostab { unsafe impl Send for DensePyrLkOptFlowEstimatorGpu {} - impl crate::videostab::IDenseOptFlowEstimatorConst for DensePyrLkOptFlowEstimatorGpu { + impl crate::videostab::IDenseOptFlowEstimatorTraitConst for DensePyrLkOptFlowEstimatorGpu { #[inline] fn as_raw_IDenseOptFlowEstimator(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IDenseOptFlowEstimator for DensePyrLkOptFlowEstimatorGpu { + impl crate::videostab::IDenseOptFlowEstimatorTrait for DensePyrLkOptFlowEstimatorGpu { #[inline] fn as_raw_mut_IDenseOptFlowEstimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -621,13 +653,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::FromFileMotionReader] - pub trait FromFileMotionReaderTraitConst: crate::videostab::ImageMotionEstimatorBaseConst { + pub trait FromFileMotionReaderTraitConst: crate::videostab::ImageMotionEstimatorBaseTraitConst { fn as_raw_FromFileMotionReader(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::FromFileMotionReader] - pub trait FromFileMotionReaderTrait: crate::videostab::FromFileMotionReaderTraitConst + crate::videostab::ImageMotionEstimatorBase { + pub trait FromFileMotionReaderTrait: crate::videostab::FromFileMotionReaderTraitConst + crate::videostab::ImageMotionEstimatorBaseTrait { fn as_raw_mut_FromFileMotionReader(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -660,11 +692,11 @@ pub mod videostab { unsafe impl Send for FromFileMotionReader {} - impl crate::videostab::ImageMotionEstimatorBaseConst for FromFileMotionReader { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for FromFileMotionReader { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for FromFileMotionReader { + impl crate::videostab::ImageMotionEstimatorBaseTrait for FromFileMotionReader { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -691,7 +723,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::GaussianMotionFilter] - pub trait GaussianMotionFilterTraitConst: crate::videostab::MotionFilterBaseConst { + pub trait GaussianMotionFilterTraitConst: crate::videostab::MotionFilterBaseTraitConst { fn as_raw_GaussianMotionFilter(&self) -> *const c_void; #[inline] @@ -715,7 +747,7 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::GaussianMotionFilter] - pub trait GaussianMotionFilterTrait: crate::videostab::GaussianMotionFilterTraitConst + crate::videostab::MotionFilterBase { + pub trait GaussianMotionFilterTrait: crate::videostab::GaussianMotionFilterTraitConst + crate::videostab::MotionFilterBaseTrait { fn as_raw_mut_GaussianMotionFilter(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -757,19 +789,19 @@ pub mod videostab { unsafe impl Send for GaussianMotionFilter {} - impl crate::videostab::IMotionStabilizerConst for GaussianMotionFilter { + impl crate::videostab::IMotionStabilizerTraitConst for GaussianMotionFilter { #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IMotionStabilizer for GaussianMotionFilter { + impl crate::videostab::IMotionStabilizerTrait for GaussianMotionFilter { #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::videostab::MotionFilterBaseConst for GaussianMotionFilter { + impl crate::videostab::MotionFilterBaseTraitConst for GaussianMotionFilter { #[inline] fn as_raw_MotionFilterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::MotionFilterBase for GaussianMotionFilter { + impl crate::videostab::MotionFilterBaseTrait for GaussianMotionFilter { #[inline] fn as_raw_mut_MotionFilterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -798,12 +830,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::IDenseOptFlowEstimator] - pub trait IDenseOptFlowEstimatorConst { + pub trait IDenseOptFlowEstimatorTraitConst { fn as_raw_IDenseOptFlowEstimator(&self) -> *const c_void; } - pub trait IDenseOptFlowEstimator: crate::videostab::IDenseOptFlowEstimatorConst { + /// Mutable methods for [crate::videostab::IDenseOptFlowEstimator] + pub trait IDenseOptFlowEstimatorTrait: crate::videostab::IDenseOptFlowEstimatorTraitConst { fn as_raw_mut_IDenseOptFlowEstimator(&mut self) -> *mut c_void; #[inline] @@ -822,13 +855,43 @@ pub mod videostab { } + pub struct IDenseOptFlowEstimator { + ptr: *mut c_void + } + + opencv_type_boxed! { IDenseOptFlowEstimator } + + impl Drop for IDenseOptFlowEstimator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_IDenseOptFlowEstimator_delete(instance: *mut c_void); } + unsafe { cv_IDenseOptFlowEstimator_delete(self.as_raw_mut_IDenseOptFlowEstimator()) }; + } + } + + unsafe impl Send for IDenseOptFlowEstimator {} + + impl crate::videostab::IDenseOptFlowEstimatorTraitConst for IDenseOptFlowEstimator { + #[inline] fn as_raw_IDenseOptFlowEstimator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::IDenseOptFlowEstimatorTrait for IDenseOptFlowEstimator { + #[inline] fn as_raw_mut_IDenseOptFlowEstimator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl IDenseOptFlowEstimator { + } + + boxed_cast_descendant! { IDenseOptFlowEstimator, crate::videostab::DensePyrLkOptFlowEstimatorGpu, cv_IDenseOptFlowEstimator_to_DensePyrLkOptFlowEstimatorGpu } + /// Constant methods for [crate::videostab::IFrameSource] - pub trait IFrameSourceConst { + pub trait IFrameSourceTraitConst { fn as_raw_IFrameSource(&self) -> *const c_void; } - pub trait IFrameSource: crate::videostab::IFrameSourceConst { + /// Mutable methods for [crate::videostab::IFrameSource] + pub trait IFrameSourceTrait: crate::videostab::IFrameSourceTraitConst { fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void; #[inline] @@ -852,13 +915,51 @@ pub mod videostab { } + pub struct IFrameSource { + ptr: *mut c_void + } + + opencv_type_boxed! { IFrameSource } + + impl Drop for IFrameSource { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_IFrameSource_delete(instance: *mut c_void); } + unsafe { cv_IFrameSource_delete(self.as_raw_mut_IFrameSource()) }; + } + } + + unsafe impl Send for IFrameSource {} + + impl crate::videostab::IFrameSourceTraitConst for IFrameSource { + #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::IFrameSourceTrait for IFrameSource { + #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl IFrameSource { + } + + boxed_cast_descendant! { IFrameSource, crate::videostab::MaskFrameSource, cv_IFrameSource_to_MaskFrameSource } + + boxed_cast_descendant! { IFrameSource, crate::videostab::NullFrameSource, cv_IFrameSource_to_NullFrameSource } + + boxed_cast_descendant! { IFrameSource, crate::videostab::OnePassStabilizer, cv_IFrameSource_to_OnePassStabilizer } + + boxed_cast_descendant! { IFrameSource, crate::videostab::TwoPassStabilizer, cv_IFrameSource_to_TwoPassStabilizer } + + boxed_cast_descendant! { IFrameSource, crate::videostab::VideoFileSource, cv_IFrameSource_to_VideoFileSource } + /// Constant methods for [crate::videostab::ILog] - pub trait ILogConst { + pub trait ILogTraitConst { fn as_raw_ILog(&self) -> *const c_void; } - pub trait ILog: crate::videostab::ILogConst { + /// Mutable methods for [crate::videostab::ILog] + pub trait ILogTrait: crate::videostab::ILogTraitConst { fn as_raw_mut_ILog(&mut self) -> *mut c_void; #[inline] @@ -873,13 +974,45 @@ pub mod videostab { } + pub struct ILog { + ptr: *mut c_void + } + + opencv_type_boxed! { ILog } + + impl Drop for ILog { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ILog_delete(instance: *mut c_void); } + unsafe { cv_ILog_delete(self.as_raw_mut_ILog()) }; + } + } + + unsafe impl Send for ILog {} + + impl crate::videostab::ILogTraitConst for ILog { + #[inline] fn as_raw_ILog(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::ILogTrait for ILog { + #[inline] fn as_raw_mut_ILog(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ILog { + } + + boxed_cast_descendant! { ILog, crate::videostab::LogToStdout, cv_ILog_to_LogToStdout } + + boxed_cast_descendant! { ILog, crate::videostab::NullLog, cv_ILog_to_NullLog } + /// Constant methods for [crate::videostab::IMotionStabilizer] - pub trait IMotionStabilizerConst { + pub trait IMotionStabilizerTraitConst { fn as_raw_IMotionStabilizer(&self) -> *const c_void; } - pub trait IMotionStabilizer: crate::videostab::IMotionStabilizerConst { + /// Mutable methods for [crate::videostab::IMotionStabilizer] + pub trait IMotionStabilizerTrait: crate::videostab::IMotionStabilizerTraitConst { fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void; /// assumes that [0, size-1) is in or equals to [range.first, range.second) @@ -894,13 +1027,45 @@ pub mod videostab { } + pub struct IMotionStabilizer { + ptr: *mut c_void + } + + opencv_type_boxed! { IMotionStabilizer } + + impl Drop for IMotionStabilizer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_IMotionStabilizer_delete(instance: *mut c_void); } + unsafe { cv_IMotionStabilizer_delete(self.as_raw_mut_IMotionStabilizer()) }; + } + } + + unsafe impl Send for IMotionStabilizer {} + + impl crate::videostab::IMotionStabilizerTraitConst for IMotionStabilizer { + #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::IMotionStabilizerTrait for IMotionStabilizer { + #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl IMotionStabilizer { + } + + boxed_cast_descendant! { IMotionStabilizer, crate::videostab::LpMotionStabilizer, cv_IMotionStabilizer_to_LpMotionStabilizer } + + boxed_cast_descendant! { IMotionStabilizer, crate::videostab::MotionStabilizationPipeline, cv_IMotionStabilizer_to_MotionStabilizationPipeline } + /// Constant methods for [crate::videostab::IOutlierRejector] - pub trait IOutlierRejectorConst { + pub trait IOutlierRejectorTraitConst { fn as_raw_IOutlierRejector(&self) -> *const c_void; } - pub trait IOutlierRejector: crate::videostab::IOutlierRejectorConst { + /// Mutable methods for [crate::videostab::IOutlierRejector] + pub trait IOutlierRejectorTrait: crate::videostab::IOutlierRejectorTraitConst { fn as_raw_mut_IOutlierRejector(&mut self) -> *mut c_void; #[inline] @@ -917,13 +1082,45 @@ pub mod videostab { } + pub struct IOutlierRejector { + ptr: *mut c_void + } + + opencv_type_boxed! { IOutlierRejector } + + impl Drop for IOutlierRejector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_IOutlierRejector_delete(instance: *mut c_void); } + unsafe { cv_IOutlierRejector_delete(self.as_raw_mut_IOutlierRejector()) }; + } + } + + unsafe impl Send for IOutlierRejector {} + + impl crate::videostab::IOutlierRejectorTraitConst for IOutlierRejector { + #[inline] fn as_raw_IOutlierRejector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::IOutlierRejectorTrait for IOutlierRejector { + #[inline] fn as_raw_mut_IOutlierRejector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl IOutlierRejector { + } + + boxed_cast_descendant! { IOutlierRejector, crate::videostab::NullOutlierRejector, cv_IOutlierRejector_to_NullOutlierRejector } + + boxed_cast_descendant! { IOutlierRejector, crate::videostab::TranslationBasedLocalOutlierRejector, cv_IOutlierRejector_to_TranslationBasedLocalOutlierRejector } + /// Constant methods for [crate::videostab::ISparseOptFlowEstimator] - pub trait ISparseOptFlowEstimatorConst { + pub trait ISparseOptFlowEstimatorTraitConst { fn as_raw_ISparseOptFlowEstimator(&self) -> *const c_void; } - pub trait ISparseOptFlowEstimator: crate::videostab::ISparseOptFlowEstimatorConst { + /// Mutable methods for [crate::videostab::ISparseOptFlowEstimator] + pub trait ISparseOptFlowEstimatorTrait: crate::videostab::ISparseOptFlowEstimatorTraitConst { fn as_raw_mut_ISparseOptFlowEstimator(&mut self) -> *mut c_void; #[inline] @@ -943,8 +1140,39 @@ pub mod videostab { } + pub struct ISparseOptFlowEstimator { + ptr: *mut c_void + } + + opencv_type_boxed! { ISparseOptFlowEstimator } + + impl Drop for ISparseOptFlowEstimator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ISparseOptFlowEstimator_delete(instance: *mut c_void); } + unsafe { cv_ISparseOptFlowEstimator_delete(self.as_raw_mut_ISparseOptFlowEstimator()) }; + } + } + + unsafe impl Send for ISparseOptFlowEstimator {} + + impl crate::videostab::ISparseOptFlowEstimatorTraitConst for ISparseOptFlowEstimator { + #[inline] fn as_raw_ISparseOptFlowEstimator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::ISparseOptFlowEstimatorTrait for ISparseOptFlowEstimator { + #[inline] fn as_raw_mut_ISparseOptFlowEstimator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ISparseOptFlowEstimator { + } + + boxed_cast_descendant! { ISparseOptFlowEstimator, crate::videostab::SparsePyrLkOptFlowEstimator, cv_ISparseOptFlowEstimator_to_SparsePyrLkOptFlowEstimator } + + boxed_cast_descendant! { ISparseOptFlowEstimator, crate::videostab::SparsePyrLkOptFlowEstimatorGpu, cv_ISparseOptFlowEstimator_to_SparsePyrLkOptFlowEstimatorGpu } + /// Constant methods for [crate::videostab::ImageMotionEstimatorBase] - pub trait ImageMotionEstimatorBaseConst { + pub trait ImageMotionEstimatorBaseTraitConst { fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void; #[inline] @@ -958,8 +1186,8 @@ pub mod videostab { } - /// Base class for global 2D motion estimation methods which take frames as input. - pub trait ImageMotionEstimatorBase: crate::videostab::ImageMotionEstimatorBaseConst { + /// Mutable methods for [crate::videostab::ImageMotionEstimatorBase] + pub trait ImageMotionEstimatorBaseTrait: crate::videostab::ImageMotionEstimatorBaseTraitConst { fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void; #[inline] @@ -995,8 +1223,44 @@ pub mod videostab { } + /// Base class for global 2D motion estimation methods which take frames as input. + pub struct ImageMotionEstimatorBase { + ptr: *mut c_void + } + + opencv_type_boxed! { ImageMotionEstimatorBase } + + impl Drop for ImageMotionEstimatorBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ImageMotionEstimatorBase_delete(instance: *mut c_void); } + unsafe { cv_ImageMotionEstimatorBase_delete(self.as_raw_mut_ImageMotionEstimatorBase()) }; + } + } + + unsafe impl Send for ImageMotionEstimatorBase {} + + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for ImageMotionEstimatorBase { + #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::ImageMotionEstimatorBaseTrait for ImageMotionEstimatorBase { + #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ImageMotionEstimatorBase { + } + + boxed_cast_descendant! { ImageMotionEstimatorBase, crate::videostab::FromFileMotionReader, cv_ImageMotionEstimatorBase_to_FromFileMotionReader } + + boxed_cast_descendant! { ImageMotionEstimatorBase, crate::videostab::KeypointBasedMotionEstimator, cv_ImageMotionEstimatorBase_to_KeypointBasedMotionEstimator } + + boxed_cast_descendant! { ImageMotionEstimatorBase, crate::videostab::KeypointBasedMotionEstimatorGpu, cv_ImageMotionEstimatorBase_to_KeypointBasedMotionEstimatorGpu } + + boxed_cast_descendant! { ImageMotionEstimatorBase, crate::videostab::ToFileMotionWriter, cv_ImageMotionEstimatorBase_to_ToFileMotionWriter } + /// Constant methods for [crate::videostab::InpainterBase] - pub trait InpainterBaseConst { + pub trait InpainterBaseTraitConst { fn as_raw_InpainterBase(&self) -> *const c_void; #[inline] @@ -1059,7 +1323,8 @@ pub mod videostab { } - pub trait InpainterBase: crate::videostab::InpainterBaseConst { + /// Mutable methods for [crate::videostab::InpainterBase] + pub trait InpainterBaseTrait: crate::videostab::InpainterBaseTraitConst { fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void; #[inline] @@ -1127,8 +1392,47 @@ pub mod videostab { } + pub struct InpainterBase { + ptr: *mut c_void + } + + opencv_type_boxed! { InpainterBase } + + impl Drop for InpainterBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_InpainterBase_delete(instance: *mut c_void); } + unsafe { cv_InpainterBase_delete(self.as_raw_mut_InpainterBase()) }; + } + } + + unsafe impl Send for InpainterBase {} + + impl crate::videostab::InpainterBaseTraitConst for InpainterBase { + #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::InpainterBaseTrait for InpainterBase { + #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl InpainterBase { + } + + boxed_cast_descendant! { InpainterBase, crate::videostab::ColorAverageInpainter, cv_InpainterBase_to_ColorAverageInpainter } + + boxed_cast_descendant! { InpainterBase, crate::videostab::ColorInpainter, cv_InpainterBase_to_ColorInpainter } + + boxed_cast_descendant! { InpainterBase, crate::videostab::ConsistentMosaicInpainter, cv_InpainterBase_to_ConsistentMosaicInpainter } + + boxed_cast_descendant! { InpainterBase, crate::videostab::InpaintingPipeline, cv_InpainterBase_to_InpaintingPipeline } + + boxed_cast_descendant! { InpainterBase, crate::videostab::MotionInpainter, cv_InpainterBase_to_MotionInpainter } + + boxed_cast_descendant! { InpainterBase, crate::videostab::NullInpainter, cv_InpainterBase_to_NullInpainter } + /// Constant methods for [crate::videostab::InpaintingPipeline] - pub trait InpaintingPipelineTraitConst: crate::videostab::InpainterBaseConst { + pub trait InpaintingPipelineTraitConst: crate::videostab::InpainterBaseTraitConst { fn as_raw_InpaintingPipeline(&self) -> *const c_void; #[inline] @@ -1143,11 +1447,11 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::InpaintingPipeline] - pub trait InpaintingPipelineTrait: crate::videostab::InpainterBase + crate::videostab::InpaintingPipelineTraitConst { + pub trait InpaintingPipelineTrait: crate::videostab::InpainterBaseTrait + crate::videostab::InpaintingPipelineTraitConst { fn as_raw_mut_InpaintingPipeline(&mut self) -> *mut c_void; #[inline] - fn push_back(&mut self, mut inpainter: core::Ptr) -> Result<()> { + fn push_back(&mut self, mut inpainter: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_InpaintingPipeline_pushBack_PtrLInpainterBaseG(self.as_raw_mut_InpaintingPipeline(), inpainter.as_raw_mut_PtrOfInpainterBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1236,11 +1540,11 @@ pub mod videostab { unsafe impl Send for InpaintingPipeline {} - impl crate::videostab::InpainterBaseConst for InpaintingPipeline { + impl crate::videostab::InpainterBaseTraitConst for InpaintingPipeline { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::InpainterBase for InpaintingPipeline { + impl crate::videostab::InpainterBaseTrait for InpaintingPipeline { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1256,7 +1560,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::KeypointBasedMotionEstimator] - pub trait KeypointBasedMotionEstimatorTraitConst: crate::videostab::ImageMotionEstimatorBaseConst { + pub trait KeypointBasedMotionEstimatorTraitConst: crate::videostab::ImageMotionEstimatorBaseTraitConst { fn as_raw_KeypointBasedMotionEstimator(&self) -> *const c_void; #[inline] @@ -1279,29 +1583,29 @@ pub mod videostab { } #[inline] - fn optical_flow_estimator(&self) -> Result> { + fn optical_flow_estimator(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_KeypointBasedMotionEstimator_opticalFlowEstimator_const(self.as_raw_KeypointBasedMotionEstimator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn outlier_rejector(&self) -> Result> { + fn outlier_rejector(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_KeypointBasedMotionEstimator_outlierRejector_const(self.as_raw_KeypointBasedMotionEstimator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::videostab::KeypointBasedMotionEstimator] - pub trait KeypointBasedMotionEstimatorTrait: crate::videostab::ImageMotionEstimatorBase + crate::videostab::KeypointBasedMotionEstimatorTraitConst { + pub trait KeypointBasedMotionEstimatorTrait: crate::videostab::ImageMotionEstimatorBaseTrait + crate::videostab::KeypointBasedMotionEstimatorTraitConst { fn as_raw_mut_KeypointBasedMotionEstimator(&mut self) -> *mut c_void; #[inline] @@ -1323,7 +1627,7 @@ pub mod videostab { } #[inline] - fn set_optical_flow_estimator(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_optical_flow_estimator(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_KeypointBasedMotionEstimator_setOpticalFlowEstimator_PtrLISparseOptFlowEstimatorG(self.as_raw_mut_KeypointBasedMotionEstimator(), val.as_raw_mut_PtrOfISparseOptFlowEstimator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1332,7 +1636,7 @@ pub mod videostab { } #[inline] - fn set_outlier_rejector(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_outlier_rejector(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_KeypointBasedMotionEstimator_setOutlierRejector_PtrLIOutlierRejectorG(self.as_raw_mut_KeypointBasedMotionEstimator(), val.as_raw_mut_PtrOfIOutlierRejector(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1396,11 +1700,11 @@ pub mod videostab { unsafe impl Send for KeypointBasedMotionEstimator {} - impl crate::videostab::ImageMotionEstimatorBaseConst for KeypointBasedMotionEstimator { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for KeypointBasedMotionEstimator { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for KeypointBasedMotionEstimator { + impl crate::videostab::ImageMotionEstimatorBaseTrait for KeypointBasedMotionEstimator { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1414,7 +1718,7 @@ pub mod videostab { impl KeypointBasedMotionEstimator { #[inline] - pub fn new(mut estimator: core::Ptr) -> Result { + pub fn new(mut estimator: core::Ptr) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_KeypointBasedMotionEstimator_KeypointBasedMotionEstimator_PtrLMotionEstimatorBaseG(estimator.as_raw_mut_PtrOfMotionEstimatorBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1426,7 +1730,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::KeypointBasedMotionEstimatorGpu] - pub trait KeypointBasedMotionEstimatorGpuTraitConst: crate::videostab::ImageMotionEstimatorBaseConst { + pub trait KeypointBasedMotionEstimatorGpuTraitConst: crate::videostab::ImageMotionEstimatorBaseTraitConst { fn as_raw_KeypointBasedMotionEstimatorGpu(&self) -> *const c_void; #[inline] @@ -1439,19 +1743,19 @@ pub mod videostab { } #[inline] - fn outlier_rejector(&self) -> Result> { + fn outlier_rejector(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_KeypointBasedMotionEstimatorGpu_outlierRejector_const(self.as_raw_KeypointBasedMotionEstimatorGpu(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::videostab::KeypointBasedMotionEstimatorGpu] - pub trait KeypointBasedMotionEstimatorGpuTrait: crate::videostab::ImageMotionEstimatorBase + crate::videostab::KeypointBasedMotionEstimatorGpuTraitConst { + pub trait KeypointBasedMotionEstimatorGpuTrait: crate::videostab::ImageMotionEstimatorBaseTrait + crate::videostab::KeypointBasedMotionEstimatorGpuTraitConst { fn as_raw_mut_KeypointBasedMotionEstimatorGpu(&mut self) -> *mut c_void; #[inline] @@ -1464,7 +1768,7 @@ pub mod videostab { } #[inline] - fn set_outlier_rejector(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_outlier_rejector(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_KeypointBasedMotionEstimatorGpu_setOutlierRejector_PtrLIOutlierRejectorG(self.as_raw_mut_KeypointBasedMotionEstimatorGpu(), val.as_raw_mut_PtrOfIOutlierRejector(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1514,11 +1818,11 @@ pub mod videostab { unsafe impl Send for KeypointBasedMotionEstimatorGpu {} - impl crate::videostab::ImageMotionEstimatorBaseConst for KeypointBasedMotionEstimatorGpu { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for KeypointBasedMotionEstimatorGpu { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for KeypointBasedMotionEstimatorGpu { + impl crate::videostab::ImageMotionEstimatorBaseTrait for KeypointBasedMotionEstimatorGpu { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1532,7 +1836,7 @@ pub mod videostab { impl KeypointBasedMotionEstimatorGpu { #[inline] - pub fn new(mut estimator: core::Ptr) -> Result { + pub fn new(mut estimator: core::Ptr) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_KeypointBasedMotionEstimatorGpu_KeypointBasedMotionEstimatorGpu_PtrLMotionEstimatorBaseG(estimator.as_raw_mut_PtrOfMotionEstimatorBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1544,13 +1848,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::LogToStdout] - pub trait LogToStdoutTraitConst: crate::videostab::ILogConst { + pub trait LogToStdoutTraitConst: crate::videostab::ILogTraitConst { fn as_raw_LogToStdout(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::LogToStdout] - pub trait LogToStdoutTrait: crate::videostab::ILog + crate::videostab::LogToStdoutTraitConst { + pub trait LogToStdoutTrait: crate::videostab::ILogTrait + crate::videostab::LogToStdoutTraitConst { fn as_raw_mut_LogToStdout(&mut self) -> *mut c_void; #[inline] @@ -1581,11 +1885,11 @@ pub mod videostab { unsafe impl Send for LogToStdout {} - impl crate::videostab::ILogConst for LogToStdout { + impl crate::videostab::ILogTraitConst for LogToStdout { #[inline] fn as_raw_ILog(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::ILog for LogToStdout { + impl crate::videostab::ILogTrait for LogToStdout { #[inline] fn as_raw_mut_ILog(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1601,7 +1905,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::LpMotionStabilizer] - pub trait LpMotionStabilizerTraitConst: crate::videostab::IMotionStabilizerConst { + pub trait LpMotionStabilizerTraitConst: crate::videostab::IMotionStabilizerTraitConst { fn as_raw_LpMotionStabilizer(&self) -> *const c_void; #[inline] @@ -1670,7 +1974,7 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::LpMotionStabilizer] - pub trait LpMotionStabilizerTrait: crate::videostab::IMotionStabilizer + crate::videostab::LpMotionStabilizerTraitConst { + pub trait LpMotionStabilizerTrait: crate::videostab::IMotionStabilizerTrait + crate::videostab::LpMotionStabilizerTraitConst { fn as_raw_mut_LpMotionStabilizer(&mut self) -> *mut c_void; #[inline] @@ -1763,11 +2067,11 @@ pub mod videostab { unsafe impl Send for LpMotionStabilizer {} - impl crate::videostab::IMotionStabilizerConst for LpMotionStabilizer { + impl crate::videostab::IMotionStabilizerTraitConst for LpMotionStabilizer { #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IMotionStabilizer for LpMotionStabilizer { + impl crate::videostab::IMotionStabilizerTrait for LpMotionStabilizer { #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1795,13 +2099,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::MaskFrameSource] - pub trait MaskFrameSourceTraitConst: crate::videostab::IFrameSourceConst { + pub trait MaskFrameSourceTraitConst: crate::videostab::IFrameSourceTraitConst { fn as_raw_MaskFrameSource(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::MaskFrameSource] - pub trait MaskFrameSourceTrait: crate::videostab::IFrameSource + crate::videostab::MaskFrameSourceTraitConst { + pub trait MaskFrameSourceTrait: crate::videostab::IFrameSourceTrait + crate::videostab::MaskFrameSourceTraitConst { fn as_raw_mut_MaskFrameSource(&mut self) -> *mut c_void; #[inline] @@ -1841,11 +2145,11 @@ pub mod videostab { unsafe impl Send for MaskFrameSource {} - impl crate::videostab::IFrameSourceConst for MaskFrameSource { + impl crate::videostab::IFrameSourceTraitConst for MaskFrameSource { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IFrameSource for MaskFrameSource { + impl crate::videostab::IFrameSourceTrait for MaskFrameSource { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1859,7 +2163,7 @@ pub mod videostab { impl MaskFrameSource { #[inline] - pub fn new(source: &core::Ptr) -> Result { + pub fn new(source: &core::Ptr) -> Result { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_MaskFrameSource_MaskFrameSource_const_PtrLIFrameSourceGR(source.as_raw_PtrOfIFrameSource(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -1871,13 +2175,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::MoreAccurateMotionWobbleSuppressor] - pub trait MoreAccurateMotionWobbleSuppressorTraitConst: crate::videostab::MoreAccurateMotionWobbleSuppressorBaseConst { + pub trait MoreAccurateMotionWobbleSuppressorTraitConst: crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst { fn as_raw_MoreAccurateMotionWobbleSuppressor(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::MoreAccurateMotionWobbleSuppressor] - pub trait MoreAccurateMotionWobbleSuppressorTrait: crate::videostab::MoreAccurateMotionWobbleSuppressorBase + crate::videostab::MoreAccurateMotionWobbleSuppressorTraitConst { + pub trait MoreAccurateMotionWobbleSuppressorTrait: crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTrait + crate::videostab::MoreAccurateMotionWobbleSuppressorTraitConst { fn as_raw_mut_MoreAccurateMotionWobbleSuppressor(&mut self) -> *mut c_void; #[inline] @@ -1907,19 +2211,19 @@ pub mod videostab { unsafe impl Send for MoreAccurateMotionWobbleSuppressor {} - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseConst for MoreAccurateMotionWobbleSuppressor { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst for MoreAccurateMotionWobbleSuppressor { #[inline] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBase for MoreAccurateMotionWobbleSuppressor { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTrait for MoreAccurateMotionWobbleSuppressor { #[inline] fn as_raw_mut_MoreAccurateMotionWobbleSuppressorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::videostab::WobbleSuppressorBaseConst for MoreAccurateMotionWobbleSuppressor { + impl crate::videostab::WobbleSuppressorBaseTraitConst for MoreAccurateMotionWobbleSuppressor { #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::WobbleSuppressorBase for MoreAccurateMotionWobbleSuppressor { + impl crate::videostab::WobbleSuppressorBaseTrait for MoreAccurateMotionWobbleSuppressor { #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -1935,7 +2239,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::MoreAccurateMotionWobbleSuppressorBase] - pub trait MoreAccurateMotionWobbleSuppressorBaseConst: crate::videostab::WobbleSuppressorBaseConst { + pub trait MoreAccurateMotionWobbleSuppressorBaseTraitConst: crate::videostab::WobbleSuppressorBaseTraitConst { fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *const c_void; #[inline] @@ -1949,7 +2253,8 @@ pub mod videostab { } - pub trait MoreAccurateMotionWobbleSuppressorBase: crate::videostab::MoreAccurateMotionWobbleSuppressorBaseConst + crate::videostab::WobbleSuppressorBase { + /// Mutable methods for [crate::videostab::MoreAccurateMotionWobbleSuppressorBase] + pub trait MoreAccurateMotionWobbleSuppressorBaseTrait: crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst + crate::videostab::WobbleSuppressorBaseTrait { fn as_raw_mut_MoreAccurateMotionWobbleSuppressorBase(&mut self) -> *mut c_void; #[inline] @@ -1963,14 +2268,53 @@ pub mod videostab { } + pub struct MoreAccurateMotionWobbleSuppressorBase { + ptr: *mut c_void + } + + opencv_type_boxed! { MoreAccurateMotionWobbleSuppressorBase } + + impl Drop for MoreAccurateMotionWobbleSuppressorBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MoreAccurateMotionWobbleSuppressorBase_delete(instance: *mut c_void); } + unsafe { cv_MoreAccurateMotionWobbleSuppressorBase_delete(self.as_raw_mut_MoreAccurateMotionWobbleSuppressorBase()) }; + } + } + + unsafe impl Send for MoreAccurateMotionWobbleSuppressorBase {} + + impl crate::videostab::WobbleSuppressorBaseTraitConst for MoreAccurateMotionWobbleSuppressorBase { + #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::WobbleSuppressorBaseTrait for MoreAccurateMotionWobbleSuppressorBase { + #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst for MoreAccurateMotionWobbleSuppressorBase { + #[inline] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTrait for MoreAccurateMotionWobbleSuppressorBase { + #[inline] fn as_raw_mut_MoreAccurateMotionWobbleSuppressorBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MoreAccurateMotionWobbleSuppressorBase { + } + + boxed_cast_descendant! { MoreAccurateMotionWobbleSuppressorBase, crate::videostab::MoreAccurateMotionWobbleSuppressor, cv_MoreAccurateMotionWobbleSuppressorBase_to_MoreAccurateMotionWobbleSuppressor } + + boxed_cast_descendant! { MoreAccurateMotionWobbleSuppressorBase, crate::videostab::MoreAccurateMotionWobbleSuppressorGpu, cv_MoreAccurateMotionWobbleSuppressorBase_to_MoreAccurateMotionWobbleSuppressorGpu } + /// Constant methods for [crate::videostab::MoreAccurateMotionWobbleSuppressorGpu] - pub trait MoreAccurateMotionWobbleSuppressorGpuTraitConst: crate::videostab::MoreAccurateMotionWobbleSuppressorBaseConst { + pub trait MoreAccurateMotionWobbleSuppressorGpuTraitConst: crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst { fn as_raw_MoreAccurateMotionWobbleSuppressorGpu(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::MoreAccurateMotionWobbleSuppressorGpu] - pub trait MoreAccurateMotionWobbleSuppressorGpuTrait: crate::videostab::MoreAccurateMotionWobbleSuppressorBase + crate::videostab::MoreAccurateMotionWobbleSuppressorGpuTraitConst { + pub trait MoreAccurateMotionWobbleSuppressorGpuTrait: crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTrait + crate::videostab::MoreAccurateMotionWobbleSuppressorGpuTraitConst { fn as_raw_mut_MoreAccurateMotionWobbleSuppressorGpu(&mut self) -> *mut c_void; #[inline] @@ -2009,19 +2353,19 @@ pub mod videostab { unsafe impl Send for MoreAccurateMotionWobbleSuppressorGpu {} - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseConst for MoreAccurateMotionWobbleSuppressorGpu { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTraitConst for MoreAccurateMotionWobbleSuppressorGpu { #[inline] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::MoreAccurateMotionWobbleSuppressorBase for MoreAccurateMotionWobbleSuppressorGpu { + impl crate::videostab::MoreAccurateMotionWobbleSuppressorBaseTrait for MoreAccurateMotionWobbleSuppressorGpu { #[inline] fn as_raw_mut_MoreAccurateMotionWobbleSuppressorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::videostab::WobbleSuppressorBaseConst for MoreAccurateMotionWobbleSuppressorGpu { + impl crate::videostab::WobbleSuppressorBaseTraitConst for MoreAccurateMotionWobbleSuppressorGpu { #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::WobbleSuppressorBase for MoreAccurateMotionWobbleSuppressorGpu { + impl crate::videostab::WobbleSuppressorBaseTrait for MoreAccurateMotionWobbleSuppressorGpu { #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2037,7 +2381,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::MotionEstimatorBase] - pub trait MotionEstimatorBaseConst { + pub trait MotionEstimatorBaseTraitConst { fn as_raw_MotionEstimatorBase(&self) -> *const c_void; /// ## Returns @@ -2053,8 +2397,8 @@ pub mod videostab { } - /// Base class for all global motion estimation methods. - pub trait MotionEstimatorBase: crate::videostab::MotionEstimatorBaseConst { + /// Mutable methods for [crate::videostab::MotionEstimatorBase] + pub trait MotionEstimatorBaseTrait: crate::videostab::MotionEstimatorBaseTraitConst { fn as_raw_mut_MotionEstimatorBase(&mut self) -> *mut c_void; /// Sets motion model. @@ -2095,14 +2439,46 @@ pub mod videostab { } + /// Base class for all global motion estimation methods. + pub struct MotionEstimatorBase { + ptr: *mut c_void + } + + opencv_type_boxed! { MotionEstimatorBase } + + impl Drop for MotionEstimatorBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MotionEstimatorBase_delete(instance: *mut c_void); } + unsafe { cv_MotionEstimatorBase_delete(self.as_raw_mut_MotionEstimatorBase()) }; + } + } + + unsafe impl Send for MotionEstimatorBase {} + + impl crate::videostab::MotionEstimatorBaseTraitConst for MotionEstimatorBase { + #[inline] fn as_raw_MotionEstimatorBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::MotionEstimatorBaseTrait for MotionEstimatorBase { + #[inline] fn as_raw_mut_MotionEstimatorBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MotionEstimatorBase { + } + + boxed_cast_descendant! { MotionEstimatorBase, crate::videostab::MotionEstimatorL1, cv_MotionEstimatorBase_to_MotionEstimatorL1 } + + boxed_cast_descendant! { MotionEstimatorBase, crate::videostab::MotionEstimatorRansacL2, cv_MotionEstimatorBase_to_MotionEstimatorRansacL2 } + /// Constant methods for [crate::videostab::MotionEstimatorL1] - pub trait MotionEstimatorL1TraitConst: crate::videostab::MotionEstimatorBaseConst { + pub trait MotionEstimatorL1TraitConst: crate::videostab::MotionEstimatorBaseTraitConst { fn as_raw_MotionEstimatorL1(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::MotionEstimatorL1] - pub trait MotionEstimatorL1Trait: crate::videostab::MotionEstimatorBase + crate::videostab::MotionEstimatorL1TraitConst { + pub trait MotionEstimatorL1Trait: crate::videostab::MotionEstimatorBaseTrait + crate::videostab::MotionEstimatorL1TraitConst { fn as_raw_mut_MotionEstimatorL1(&mut self) -> *mut c_void; /// ## C++ default parameters @@ -2141,11 +2517,11 @@ pub mod videostab { unsafe impl Send for MotionEstimatorL1 {} - impl crate::videostab::MotionEstimatorBaseConst for MotionEstimatorL1 { + impl crate::videostab::MotionEstimatorBaseTraitConst for MotionEstimatorL1 { #[inline] fn as_raw_MotionEstimatorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::MotionEstimatorBase for MotionEstimatorL1 { + impl crate::videostab::MotionEstimatorBaseTrait for MotionEstimatorL1 { #[inline] fn as_raw_mut_MotionEstimatorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2173,7 +2549,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::MotionEstimatorRansacL2] - pub trait MotionEstimatorRansacL2TraitConst: crate::videostab::MotionEstimatorBaseConst { + pub trait MotionEstimatorRansacL2TraitConst: crate::videostab::MotionEstimatorBaseTraitConst { fn as_raw_MotionEstimatorRansacL2(&self) -> *const c_void; #[inline] @@ -2198,7 +2574,7 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::MotionEstimatorRansacL2] - pub trait MotionEstimatorRansacL2Trait: crate::videostab::MotionEstimatorBase + crate::videostab::MotionEstimatorRansacL2TraitConst { + pub trait MotionEstimatorRansacL2Trait: crate::videostab::MotionEstimatorBaseTrait + crate::videostab::MotionEstimatorRansacL2TraitConst { fn as_raw_mut_MotionEstimatorRansacL2(&mut self) -> *mut c_void; #[inline] @@ -2252,11 +2628,11 @@ pub mod videostab { unsafe impl Send for MotionEstimatorRansacL2 {} - impl crate::videostab::MotionEstimatorBaseConst for MotionEstimatorRansacL2 { + impl crate::videostab::MotionEstimatorBaseTraitConst for MotionEstimatorRansacL2 { #[inline] fn as_raw_MotionEstimatorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::MotionEstimatorBase for MotionEstimatorRansacL2 { + impl crate::videostab::MotionEstimatorBaseTrait for MotionEstimatorRansacL2 { #[inline] fn as_raw_mut_MotionEstimatorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2284,12 +2660,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::MotionFilterBase] - pub trait MotionFilterBaseConst: crate::videostab::IMotionStabilizerConst { + pub trait MotionFilterBaseTraitConst: crate::videostab::IMotionStabilizerTraitConst { fn as_raw_MotionFilterBase(&self) -> *const c_void; } - pub trait MotionFilterBase: crate::videostab::IMotionStabilizer + crate::videostab::MotionFilterBaseConst { + /// Mutable methods for [crate::videostab::MotionFilterBase] + pub trait MotionFilterBaseTrait: crate::videostab::IMotionStabilizerTrait + crate::videostab::MotionFilterBaseTraitConst { fn as_raw_mut_MotionFilterBase(&mut self) -> *mut c_void; #[inline] @@ -2313,17 +2690,54 @@ pub mod videostab { } + pub struct MotionFilterBase { + ptr: *mut c_void + } + + opencv_type_boxed! { MotionFilterBase } + + impl Drop for MotionFilterBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MotionFilterBase_delete(instance: *mut c_void); } + unsafe { cv_MotionFilterBase_delete(self.as_raw_mut_MotionFilterBase()) }; + } + } + + unsafe impl Send for MotionFilterBase {} + + impl crate::videostab::IMotionStabilizerTraitConst for MotionFilterBase { + #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::IMotionStabilizerTrait for MotionFilterBase { + #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::videostab::MotionFilterBaseTraitConst for MotionFilterBase { + #[inline] fn as_raw_MotionFilterBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::MotionFilterBaseTrait for MotionFilterBase { + #[inline] fn as_raw_mut_MotionFilterBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MotionFilterBase { + } + + boxed_cast_descendant! { MotionFilterBase, crate::videostab::GaussianMotionFilter, cv_MotionFilterBase_to_GaussianMotionFilter } + /// Constant methods for [crate::videostab::MotionInpainter] - pub trait MotionInpainterTraitConst: crate::videostab::InpainterBaseConst { + pub trait MotionInpainterTraitConst: crate::videostab::InpainterBaseTraitConst { fn as_raw_MotionInpainter(&self) -> *const c_void; #[inline] - fn opt_flow_estimator(&self) -> Result> { + fn opt_flow_estimator(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_MotionInpainter_optFlowEstimator_const(self.as_raw_MotionInpainter(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2357,11 +2771,11 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::MotionInpainter] - pub trait MotionInpainterTrait: crate::videostab::InpainterBase + crate::videostab::MotionInpainterTraitConst { + pub trait MotionInpainterTrait: crate::videostab::InpainterBaseTrait + crate::videostab::MotionInpainterTraitConst { fn as_raw_mut_MotionInpainter(&mut self) -> *mut c_void; #[inline] - fn set_opt_flow_estimator(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_opt_flow_estimator(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_MotionInpainter_setOptFlowEstimator_PtrLIDenseOptFlowEstimatorG(self.as_raw_mut_MotionInpainter(), val.as_raw_mut_PtrOfIDenseOptFlowEstimator(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -2423,11 +2837,11 @@ pub mod videostab { unsafe impl Send for MotionInpainter {} - impl crate::videostab::InpainterBaseConst for MotionInpainter { + impl crate::videostab::InpainterBaseTraitConst for MotionInpainter { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::InpainterBase for MotionInpainter { + impl crate::videostab::InpainterBaseTrait for MotionInpainter { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2453,7 +2867,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::MotionStabilizationPipeline] - pub trait MotionStabilizationPipelineTraitConst: crate::videostab::IMotionStabilizerConst { + pub trait MotionStabilizationPipelineTraitConst: crate::videostab::IMotionStabilizerTraitConst { fn as_raw_MotionStabilizationPipeline(&self) -> *const c_void; #[inline] @@ -2468,11 +2882,11 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::MotionStabilizationPipeline] - pub trait MotionStabilizationPipelineTrait: crate::videostab::IMotionStabilizer + crate::videostab::MotionStabilizationPipelineTraitConst { + pub trait MotionStabilizationPipelineTrait: crate::videostab::IMotionStabilizerTrait + crate::videostab::MotionStabilizationPipelineTraitConst { fn as_raw_mut_MotionStabilizationPipeline(&mut self) -> *mut c_void; #[inline] - fn push_back(&mut self, mut stabilizer: core::Ptr) -> Result<()> { + fn push_back(&mut self, mut stabilizer: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_MotionStabilizationPipeline_pushBack_PtrLIMotionStabilizerG(self.as_raw_mut_MotionStabilizationPipeline(), stabilizer.as_raw_mut_PtrOfIMotionStabilizer(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -2507,11 +2921,11 @@ pub mod videostab { unsafe impl Send for MotionStabilizationPipeline {} - impl crate::videostab::IMotionStabilizerConst for MotionStabilizationPipeline { + impl crate::videostab::IMotionStabilizerTraitConst for MotionStabilizationPipeline { #[inline] fn as_raw_IMotionStabilizer(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IMotionStabilizer for MotionStabilizationPipeline { + impl crate::videostab::IMotionStabilizerTrait for MotionStabilizationPipeline { #[inline] fn as_raw_mut_IMotionStabilizer(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2527,13 +2941,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::NullDeblurer] - pub trait NullDeblurerTraitConst: crate::videostab::DeblurerBaseConst { + pub trait NullDeblurerTraitConst: crate::videostab::DeblurerBaseTraitConst { fn as_raw_NullDeblurer(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::NullDeblurer] - pub trait NullDeblurerTrait: crate::videostab::DeblurerBase + crate::videostab::NullDeblurerTraitConst { + pub trait NullDeblurerTrait: crate::videostab::DeblurerBaseTrait + crate::videostab::NullDeblurerTraitConst { fn as_raw_mut_NullDeblurer(&mut self) -> *mut c_void; #[inline] @@ -2563,11 +2977,11 @@ pub mod videostab { unsafe impl Send for NullDeblurer {} - impl crate::videostab::DeblurerBaseConst for NullDeblurer { + impl crate::videostab::DeblurerBaseTraitConst for NullDeblurer { #[inline] fn as_raw_DeblurerBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::DeblurerBase for NullDeblurer { + impl crate::videostab::DeblurerBaseTrait for NullDeblurer { #[inline] fn as_raw_mut_DeblurerBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2583,13 +2997,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::NullFrameSource] - pub trait NullFrameSourceTraitConst: crate::videostab::IFrameSourceConst { + pub trait NullFrameSourceTraitConst: crate::videostab::IFrameSourceTraitConst { fn as_raw_NullFrameSource(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::NullFrameSource] - pub trait NullFrameSourceTrait: crate::videostab::IFrameSource + crate::videostab::NullFrameSourceTraitConst { + pub trait NullFrameSourceTrait: crate::videostab::IFrameSourceTrait + crate::videostab::NullFrameSourceTraitConst { fn as_raw_mut_NullFrameSource(&mut self) -> *mut c_void; #[inline] @@ -2629,11 +3043,11 @@ pub mod videostab { unsafe impl Send for NullFrameSource {} - impl crate::videostab::IFrameSourceConst for NullFrameSource { + impl crate::videostab::IFrameSourceTraitConst for NullFrameSource { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IFrameSource for NullFrameSource { + impl crate::videostab::IFrameSourceTrait for NullFrameSource { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2649,13 +3063,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::NullInpainter] - pub trait NullInpainterTraitConst: crate::videostab::InpainterBaseConst { + pub trait NullInpainterTraitConst: crate::videostab::InpainterBaseTraitConst { fn as_raw_NullInpainter(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::NullInpainter] - pub trait NullInpainterTrait: crate::videostab::InpainterBase + crate::videostab::NullInpainterTraitConst { + pub trait NullInpainterTrait: crate::videostab::InpainterBaseTrait + crate::videostab::NullInpainterTraitConst { fn as_raw_mut_NullInpainter(&mut self) -> *mut c_void; #[inline] @@ -2685,11 +3099,11 @@ pub mod videostab { unsafe impl Send for NullInpainter {} - impl crate::videostab::InpainterBaseConst for NullInpainter { + impl crate::videostab::InpainterBaseTraitConst for NullInpainter { #[inline] fn as_raw_InpainterBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::InpainterBase for NullInpainter { + impl crate::videostab::InpainterBaseTrait for NullInpainter { #[inline] fn as_raw_mut_InpainterBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2705,13 +3119,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::NullLog] - pub trait NullLogTraitConst: crate::videostab::ILogConst { + pub trait NullLogTraitConst: crate::videostab::ILogTraitConst { fn as_raw_NullLog(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::NullLog] - pub trait NullLogTrait: crate::videostab::ILog + crate::videostab::NullLogTraitConst { + pub trait NullLogTrait: crate::videostab::ILogTrait + crate::videostab::NullLogTraitConst { fn as_raw_mut_NullLog(&mut self) -> *mut c_void; #[inline] @@ -2742,11 +3156,11 @@ pub mod videostab { unsafe impl Send for NullLog {} - impl crate::videostab::ILogConst for NullLog { + impl crate::videostab::ILogTraitConst for NullLog { #[inline] fn as_raw_ILog(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::ILog for NullLog { + impl crate::videostab::ILogTrait for NullLog { #[inline] fn as_raw_mut_ILog(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2762,13 +3176,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::NullOutlierRejector] - pub trait NullOutlierRejectorTraitConst: crate::videostab::IOutlierRejectorConst { + pub trait NullOutlierRejectorTraitConst: crate::videostab::IOutlierRejectorTraitConst { fn as_raw_NullOutlierRejector(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::NullOutlierRejector] - pub trait NullOutlierRejectorTrait: crate::videostab::IOutlierRejector + crate::videostab::NullOutlierRejectorTraitConst { + pub trait NullOutlierRejectorTrait: crate::videostab::IOutlierRejectorTrait + crate::videostab::NullOutlierRejectorTraitConst { fn as_raw_mut_NullOutlierRejector(&mut self) -> *mut c_void; #[inline] @@ -2801,11 +3215,11 @@ pub mod videostab { unsafe impl Send for NullOutlierRejector {} - impl crate::videostab::IOutlierRejectorConst for NullOutlierRejector { + impl crate::videostab::IOutlierRejectorTraitConst for NullOutlierRejector { #[inline] fn as_raw_IOutlierRejector(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IOutlierRejector for NullOutlierRejector { + impl crate::videostab::IOutlierRejectorTrait for NullOutlierRejector { #[inline] fn as_raw_mut_IOutlierRejector(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2821,13 +3235,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::NullWobbleSuppressor] - pub trait NullWobbleSuppressorTraitConst: crate::videostab::WobbleSuppressorBaseConst { + pub trait NullWobbleSuppressorTraitConst: crate::videostab::WobbleSuppressorBaseTraitConst { fn as_raw_NullWobbleSuppressor(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::NullWobbleSuppressor] - pub trait NullWobbleSuppressorTrait: crate::videostab::NullWobbleSuppressorTraitConst + crate::videostab::WobbleSuppressorBase { + pub trait NullWobbleSuppressorTrait: crate::videostab::NullWobbleSuppressorTraitConst + crate::videostab::WobbleSuppressorBaseTrait { fn as_raw_mut_NullWobbleSuppressor(&mut self) -> *mut c_void; #[inline] @@ -2857,11 +3271,11 @@ pub mod videostab { unsafe impl Send for NullWobbleSuppressor {} - impl crate::videostab::WobbleSuppressorBaseConst for NullWobbleSuppressor { + impl crate::videostab::WobbleSuppressorBaseTraitConst for NullWobbleSuppressor { #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::WobbleSuppressorBase for NullWobbleSuppressor { + impl crate::videostab::WobbleSuppressorBaseTrait for NullWobbleSuppressor { #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -2877,27 +3291,27 @@ pub mod videostab { } /// Constant methods for [crate::videostab::OnePassStabilizer] - pub trait OnePassStabilizerTraitConst: crate::videostab::IFrameSourceConst + crate::videostab::StabilizerBaseConst { + pub trait OnePassStabilizerTraitConst: crate::videostab::IFrameSourceTraitConst + crate::videostab::StabilizerBaseTraitConst { fn as_raw_OnePassStabilizer(&self) -> *const c_void; #[inline] - fn motion_filter(&self) -> Result> { + fn motion_filter(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_OnePassStabilizer_motionFilter_const(self.as_raw_OnePassStabilizer(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } /// Mutable methods for [crate::videostab::OnePassStabilizer] - pub trait OnePassStabilizerTrait: crate::videostab::IFrameSource + crate::videostab::OnePassStabilizerTraitConst + crate::videostab::StabilizerBase { + pub trait OnePassStabilizerTrait: crate::videostab::IFrameSourceTrait + crate::videostab::OnePassStabilizerTraitConst + crate::videostab::StabilizerBaseTrait { fn as_raw_mut_OnePassStabilizer(&mut self) -> *mut c_void; #[inline] - fn set_motion_filter(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_motion_filter(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_OnePassStabilizer_setMotionFilter_PtrLMotionFilterBaseG(self.as_raw_mut_OnePassStabilizer(), val.as_raw_mut_PtrOfMotionFilterBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -2942,19 +3356,19 @@ pub mod videostab { unsafe impl Send for OnePassStabilizer {} - impl crate::videostab::IFrameSourceConst for OnePassStabilizer { + impl crate::videostab::IFrameSourceTraitConst for OnePassStabilizer { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IFrameSource for OnePassStabilizer { + impl crate::videostab::IFrameSourceTrait for OnePassStabilizer { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::videostab::StabilizerBaseConst for OnePassStabilizer { + impl crate::videostab::StabilizerBaseTraitConst for OnePassStabilizer { #[inline] fn as_raw_StabilizerBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::StabilizerBase for OnePassStabilizer { + impl crate::videostab::StabilizerBaseTrait for OnePassStabilizer { #[inline] fn as_raw_mut_StabilizerBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3218,13 +3632,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::SparsePyrLkOptFlowEstimator] - pub trait SparsePyrLkOptFlowEstimatorTraitConst: crate::videostab::ISparseOptFlowEstimatorConst + crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst { + pub trait SparsePyrLkOptFlowEstimatorTraitConst: crate::videostab::ISparseOptFlowEstimatorTraitConst + crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst { fn as_raw_SparsePyrLkOptFlowEstimator(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::SparsePyrLkOptFlowEstimator] - pub trait SparsePyrLkOptFlowEstimatorTrait: crate::videostab::ISparseOptFlowEstimator + crate::videostab::PyrLkOptFlowEstimatorBaseTrait + crate::videostab::SparsePyrLkOptFlowEstimatorTraitConst { + pub trait SparsePyrLkOptFlowEstimatorTrait: crate::videostab::ISparseOptFlowEstimatorTrait + crate::videostab::PyrLkOptFlowEstimatorBaseTrait + crate::videostab::SparsePyrLkOptFlowEstimatorTraitConst { fn as_raw_mut_SparsePyrLkOptFlowEstimator(&mut self) -> *mut c_void; #[inline] @@ -3260,11 +3674,11 @@ pub mod videostab { unsafe impl Send for SparsePyrLkOptFlowEstimator {} - impl crate::videostab::ISparseOptFlowEstimatorConst for SparsePyrLkOptFlowEstimator { + impl crate::videostab::ISparseOptFlowEstimatorTraitConst for SparsePyrLkOptFlowEstimator { #[inline] fn as_raw_ISparseOptFlowEstimator(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::ISparseOptFlowEstimator for SparsePyrLkOptFlowEstimator { + impl crate::videostab::ISparseOptFlowEstimatorTrait for SparsePyrLkOptFlowEstimator { #[inline] fn as_raw_mut_ISparseOptFlowEstimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3290,13 +3704,13 @@ pub mod videostab { boxed_cast_base! { SparsePyrLkOptFlowEstimator, crate::videostab::PyrLkOptFlowEstimatorBase, cv_SparsePyrLkOptFlowEstimator_to_PyrLkOptFlowEstimatorBase } /// Constant methods for [crate::videostab::SparsePyrLkOptFlowEstimatorGpu] - pub trait SparsePyrLkOptFlowEstimatorGpuTraitConst: crate::videostab::ISparseOptFlowEstimatorConst + crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst { + pub trait SparsePyrLkOptFlowEstimatorGpuTraitConst: crate::videostab::ISparseOptFlowEstimatorTraitConst + crate::videostab::PyrLkOptFlowEstimatorBaseTraitConst { fn as_raw_SparsePyrLkOptFlowEstimatorGpu(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::SparsePyrLkOptFlowEstimatorGpu] - pub trait SparsePyrLkOptFlowEstimatorGpuTrait: crate::videostab::ISparseOptFlowEstimator + crate::videostab::PyrLkOptFlowEstimatorBaseTrait + crate::videostab::SparsePyrLkOptFlowEstimatorGpuTraitConst { + pub trait SparsePyrLkOptFlowEstimatorGpuTrait: crate::videostab::ISparseOptFlowEstimatorTrait + crate::videostab::PyrLkOptFlowEstimatorBaseTrait + crate::videostab::SparsePyrLkOptFlowEstimatorGpuTraitConst { fn as_raw_mut_SparsePyrLkOptFlowEstimatorGpu(&mut self) -> *mut c_void; #[inline] @@ -3350,11 +3764,11 @@ pub mod videostab { unsafe impl Send for SparsePyrLkOptFlowEstimatorGpu {} - impl crate::videostab::ISparseOptFlowEstimatorConst for SparsePyrLkOptFlowEstimatorGpu { + impl crate::videostab::ISparseOptFlowEstimatorTraitConst for SparsePyrLkOptFlowEstimatorGpu { #[inline] fn as_raw_ISparseOptFlowEstimator(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::ISparseOptFlowEstimator for SparsePyrLkOptFlowEstimatorGpu { + impl crate::videostab::ISparseOptFlowEstimatorTrait for SparsePyrLkOptFlowEstimatorGpu { #[inline] fn as_raw_mut_ISparseOptFlowEstimator(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3390,16 +3804,16 @@ pub mod videostab { boxed_cast_base! { SparsePyrLkOptFlowEstimatorGpu, crate::videostab::PyrLkOptFlowEstimatorBase, cv_SparsePyrLkOptFlowEstimatorGpu_to_PyrLkOptFlowEstimatorBase } /// Constant methods for [crate::videostab::StabilizerBase] - pub trait StabilizerBaseConst { + pub trait StabilizerBaseTraitConst { fn as_raw_StabilizerBase(&self) -> *const c_void; #[inline] - fn log(&self) -> Result> { + fn log(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_log_const(self.as_raw_StabilizerBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3413,42 +3827,42 @@ pub mod videostab { } #[inline] - fn frame_source(&self) -> Result> { + fn frame_source(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_frameSource_const(self.as_raw_StabilizerBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn mask_source(&self) -> Result> { + fn mask_source(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_maskSource_const(self.as_raw_StabilizerBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn motion_estimator(&self) -> Result> { + fn motion_estimator(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_motionEstimator_const(self.as_raw_StabilizerBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn deblurrer(&self) -> Result> { + fn deblurrer(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_deblurrer_const(self.as_raw_StabilizerBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3480,22 +3894,23 @@ pub mod videostab { } #[inline] - fn inpainter(&self) -> Result> { + fn inpainter(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_inpainter_const(self.as_raw_StabilizerBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } - pub trait StabilizerBase: crate::videostab::StabilizerBaseConst { + /// Mutable methods for [crate::videostab::StabilizerBase] + pub trait StabilizerBaseTrait: crate::videostab::StabilizerBaseTraitConst { fn as_raw_mut_StabilizerBase(&mut self) -> *mut c_void; #[inline] - fn set_log(&mut self, mut ilog: core::Ptr) -> Result<()> { + fn set_log(&mut self, mut ilog: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_setLog_PtrLILogG(self.as_raw_mut_StabilizerBase(), ilog.as_raw_mut_PtrOfILog(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3513,7 +3928,7 @@ pub mod videostab { } #[inline] - fn set_frame_source(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_frame_source(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_setFrameSource_PtrLIFrameSourceG(self.as_raw_mut_StabilizerBase(), val.as_raw_mut_PtrOfIFrameSource(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3522,7 +3937,7 @@ pub mod videostab { } #[inline] - fn set_mask_source(&mut self, val: &core::Ptr) -> Result<()> { + fn set_mask_source(&mut self, val: &core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_setMaskSource_const_PtrLIFrameSourceGR(self.as_raw_mut_StabilizerBase(), val.as_raw_PtrOfIFrameSource(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3531,7 +3946,7 @@ pub mod videostab { } #[inline] - fn set_motion_estimator(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_motion_estimator(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_setMotionEstimator_PtrLImageMotionEstimatorBaseG(self.as_raw_mut_StabilizerBase(), val.as_raw_mut_PtrOfImageMotionEstimatorBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3540,7 +3955,7 @@ pub mod videostab { } #[inline] - fn set_deblurer(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_deblurer(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_setDeblurer_PtrLDeblurerBaseG(self.as_raw_mut_StabilizerBase(), val.as_raw_mut_PtrOfDeblurerBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3576,7 +3991,7 @@ pub mod videostab { } #[inline] - fn set_inpainter(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_inpainter(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_StabilizerBase_setInpainter_PtrLInpainterBaseG(self.as_raw_mut_StabilizerBase(), val.as_raw_mut_PtrOfInpainterBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3586,8 +4001,39 @@ pub mod videostab { } + pub struct StabilizerBase { + ptr: *mut c_void + } + + opencv_type_boxed! { StabilizerBase } + + impl Drop for StabilizerBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_StabilizerBase_delete(instance: *mut c_void); } + unsafe { cv_StabilizerBase_delete(self.as_raw_mut_StabilizerBase()) }; + } + } + + unsafe impl Send for StabilizerBase {} + + impl crate::videostab::StabilizerBaseTraitConst for StabilizerBase { + #[inline] fn as_raw_StabilizerBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::StabilizerBaseTrait for StabilizerBase { + #[inline] fn as_raw_mut_StabilizerBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StabilizerBase { + } + + boxed_cast_descendant! { StabilizerBase, crate::videostab::OnePassStabilizer, cv_StabilizerBase_to_OnePassStabilizer } + + boxed_cast_descendant! { StabilizerBase, crate::videostab::TwoPassStabilizer, cv_StabilizerBase_to_TwoPassStabilizer } + /// Constant methods for [crate::videostab::ToFileMotionWriter] - pub trait ToFileMotionWriterTraitConst: crate::videostab::ImageMotionEstimatorBaseConst { + pub trait ToFileMotionWriterTraitConst: crate::videostab::ImageMotionEstimatorBaseTraitConst { fn as_raw_ToFileMotionWriter(&self) -> *const c_void; #[inline] @@ -3602,7 +4048,7 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::ToFileMotionWriter] - pub trait ToFileMotionWriterTrait: crate::videostab::ImageMotionEstimatorBase + crate::videostab::ToFileMotionWriterTraitConst { + pub trait ToFileMotionWriterTrait: crate::videostab::ImageMotionEstimatorBaseTrait + crate::videostab::ToFileMotionWriterTraitConst { fn as_raw_mut_ToFileMotionWriter(&mut self) -> *mut c_void; #[inline] @@ -3654,11 +4100,11 @@ pub mod videostab { unsafe impl Send for ToFileMotionWriter {} - impl crate::videostab::ImageMotionEstimatorBaseConst for ToFileMotionWriter { + impl crate::videostab::ImageMotionEstimatorBaseTraitConst for ToFileMotionWriter { #[inline] fn as_raw_ImageMotionEstimatorBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::ImageMotionEstimatorBase for ToFileMotionWriter { + impl crate::videostab::ImageMotionEstimatorBaseTrait for ToFileMotionWriter { #[inline] fn as_raw_mut_ImageMotionEstimatorBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3672,7 +4118,7 @@ pub mod videostab { impl ToFileMotionWriter { #[inline] - pub fn new(path: &str, mut estimator: core::Ptr) -> Result { + pub fn new(path: &str, mut estimator: core::Ptr) -> Result { extern_container_arg!(path); return_send!(via ocvrs_return); unsafe { sys::cv_videostab_ToFileMotionWriter_ToFileMotionWriter_const_StringR_PtrLImageMotionEstimatorBaseG(path.opencv_as_extern(), estimator.as_raw_mut_PtrOfImageMotionEstimatorBase(), ocvrs_return.as_mut_ptr()) }; @@ -3685,7 +4131,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::TranslationBasedLocalOutlierRejector] - pub trait TranslationBasedLocalOutlierRejectorTraitConst: crate::videostab::IOutlierRejectorConst { + pub trait TranslationBasedLocalOutlierRejectorTraitConst: crate::videostab::IOutlierRejectorTraitConst { fn as_raw_TranslationBasedLocalOutlierRejector(&self) -> *const c_void; #[inline] @@ -3710,7 +4156,7 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::TranslationBasedLocalOutlierRejector] - pub trait TranslationBasedLocalOutlierRejectorTrait: crate::videostab::IOutlierRejector + crate::videostab::TranslationBasedLocalOutlierRejectorTraitConst { + pub trait TranslationBasedLocalOutlierRejectorTrait: crate::videostab::IOutlierRejectorTrait + crate::videostab::TranslationBasedLocalOutlierRejectorTraitConst { fn as_raw_mut_TranslationBasedLocalOutlierRejector(&mut self) -> *mut c_void; #[inline] @@ -3761,11 +4207,11 @@ pub mod videostab { unsafe impl Send for TranslationBasedLocalOutlierRejector {} - impl crate::videostab::IOutlierRejectorConst for TranslationBasedLocalOutlierRejector { + impl crate::videostab::IOutlierRejectorTraitConst for TranslationBasedLocalOutlierRejector { #[inline] fn as_raw_IOutlierRejector(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IOutlierRejector for TranslationBasedLocalOutlierRejector { + impl crate::videostab::IOutlierRejectorTrait for TranslationBasedLocalOutlierRejector { #[inline] fn as_raw_mut_IOutlierRejector(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3791,26 +4237,26 @@ pub mod videostab { } /// Constant methods for [crate::videostab::TwoPassStabilizer] - pub trait TwoPassStabilizerTraitConst: crate::videostab::IFrameSourceConst + crate::videostab::StabilizerBaseConst { + pub trait TwoPassStabilizerTraitConst: crate::videostab::IFrameSourceTraitConst + crate::videostab::StabilizerBaseTraitConst { fn as_raw_TwoPassStabilizer(&self) -> *const c_void; #[inline] - fn motion_stabilizer(&self) -> Result> { + fn motion_stabilizer(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_TwoPassStabilizer_motionStabilizer_const(self.as_raw_TwoPassStabilizer(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } #[inline] - fn wobble_suppressor(&self) -> Result> { + fn wobble_suppressor(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_TwoPassStabilizer_wobbleSuppressor_const(self.as_raw_TwoPassStabilizer(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -3826,11 +4272,11 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::TwoPassStabilizer] - pub trait TwoPassStabilizerTrait: crate::videostab::IFrameSource + crate::videostab::StabilizerBase + crate::videostab::TwoPassStabilizerTraitConst { + pub trait TwoPassStabilizerTrait: crate::videostab::IFrameSourceTrait + crate::videostab::StabilizerBaseTrait + crate::videostab::TwoPassStabilizerTraitConst { fn as_raw_mut_TwoPassStabilizer(&mut self) -> *mut c_void; #[inline] - fn set_motion_stabilizer(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_motion_stabilizer(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_TwoPassStabilizer_setMotionStabilizer_PtrLIMotionStabilizerG(self.as_raw_mut_TwoPassStabilizer(), val.as_raw_mut_PtrOfIMotionStabilizer(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3839,7 +4285,7 @@ pub mod videostab { } #[inline] - fn set_wobble_suppressor(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_wobble_suppressor(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_TwoPassStabilizer_setWobbleSuppressor_PtrLWobbleSuppressorBaseG(self.as_raw_mut_TwoPassStabilizer(), val.as_raw_mut_PtrOfWobbleSuppressorBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -3893,19 +4339,19 @@ pub mod videostab { unsafe impl Send for TwoPassStabilizer {} - impl crate::videostab::IFrameSourceConst for TwoPassStabilizer { + impl crate::videostab::IFrameSourceTraitConst for TwoPassStabilizer { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IFrameSource for TwoPassStabilizer { + impl crate::videostab::IFrameSourceTrait for TwoPassStabilizer { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.as_raw_mut() } } - impl crate::videostab::StabilizerBaseConst for TwoPassStabilizer { + impl crate::videostab::StabilizerBaseTraitConst for TwoPassStabilizer { #[inline] fn as_raw_StabilizerBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::StabilizerBase for TwoPassStabilizer { + impl crate::videostab::StabilizerBaseTrait for TwoPassStabilizer { #[inline] fn as_raw_mut_StabilizerBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -3931,13 +4377,13 @@ pub mod videostab { } /// Constant methods for [crate::videostab::VideoFileSource] - pub trait VideoFileSourceTraitConst: crate::videostab::IFrameSourceConst { + pub trait VideoFileSourceTraitConst: crate::videostab::IFrameSourceTraitConst { fn as_raw_VideoFileSource(&self) -> *const c_void; } /// Mutable methods for [crate::videostab::VideoFileSource] - pub trait VideoFileSourceTrait: crate::videostab::IFrameSource + crate::videostab::VideoFileSourceTraitConst { + pub trait VideoFileSourceTrait: crate::videostab::IFrameSourceTrait + crate::videostab::VideoFileSourceTraitConst { fn as_raw_mut_VideoFileSource(&mut self) -> *mut c_void; #[inline] @@ -4013,11 +4459,11 @@ pub mod videostab { unsafe impl Send for VideoFileSource {} - impl crate::videostab::IFrameSourceConst for VideoFileSource { + impl crate::videostab::IFrameSourceTraitConst for VideoFileSource { #[inline] fn as_raw_IFrameSource(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::IFrameSource for VideoFileSource { + impl crate::videostab::IFrameSourceTrait for VideoFileSource { #[inline] fn as_raw_mut_IFrameSource(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4046,7 +4492,7 @@ pub mod videostab { } /// Constant methods for [crate::videostab::WeightingDeblurer] - pub trait WeightingDeblurerTraitConst: crate::videostab::DeblurerBaseConst { + pub trait WeightingDeblurerTraitConst: crate::videostab::DeblurerBaseTraitConst { fn as_raw_WeightingDeblurer(&self) -> *const c_void; #[inline] @@ -4061,7 +4507,7 @@ pub mod videostab { } /// Mutable methods for [crate::videostab::WeightingDeblurer] - pub trait WeightingDeblurerTrait: crate::videostab::DeblurerBase + crate::videostab::WeightingDeblurerTraitConst { + pub trait WeightingDeblurerTrait: crate::videostab::DeblurerBaseTrait + crate::videostab::WeightingDeblurerTraitConst { fn as_raw_mut_WeightingDeblurer(&mut self) -> *mut c_void; #[inline] @@ -4100,11 +4546,11 @@ pub mod videostab { unsafe impl Send for WeightingDeblurer {} - impl crate::videostab::DeblurerBaseConst for WeightingDeblurer { + impl crate::videostab::DeblurerBaseTraitConst for WeightingDeblurer { #[inline] fn as_raw_DeblurerBase(&self) -> *const c_void { self.as_raw() } } - impl crate::videostab::DeblurerBase for WeightingDeblurer { + impl crate::videostab::DeblurerBaseTrait for WeightingDeblurer { #[inline] fn as_raw_mut_DeblurerBase(&mut self) -> *mut c_void { self.as_raw_mut() } } @@ -4130,16 +4576,16 @@ pub mod videostab { } /// Constant methods for [crate::videostab::WobbleSuppressorBase] - pub trait WobbleSuppressorBaseConst { + pub trait WobbleSuppressorBaseTraitConst { fn as_raw_WobbleSuppressorBase(&self) -> *const c_void; #[inline] - fn motion_estimator(&self) -> Result> { + fn motion_estimator(&self) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_WobbleSuppressorBase_motionEstimator_const(self.as_raw_WobbleSuppressorBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -4184,11 +4630,12 @@ pub mod videostab { } - pub trait WobbleSuppressorBase: crate::videostab::WobbleSuppressorBaseConst { + /// Mutable methods for [crate::videostab::WobbleSuppressorBase] + pub trait WobbleSuppressorBaseTrait: crate::videostab::WobbleSuppressorBaseTraitConst { fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void; #[inline] - fn set_motion_estimator(&mut self, mut val: core::Ptr) -> Result<()> { + fn set_motion_estimator(&mut self, mut val: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_videostab_WobbleSuppressorBase_setMotionEstimator_PtrLImageMotionEstimatorBaseG(self.as_raw_mut_WobbleSuppressorBase(), val.as_raw_mut_PtrOfImageMotionEstimatorBase(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -4242,4 +4689,33 @@ pub mod videostab { } } + + pub struct WobbleSuppressorBase { + ptr: *mut c_void + } + + opencv_type_boxed! { WobbleSuppressorBase } + + impl Drop for WobbleSuppressorBase { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_WobbleSuppressorBase_delete(instance: *mut c_void); } + unsafe { cv_WobbleSuppressorBase_delete(self.as_raw_mut_WobbleSuppressorBase()) }; + } + } + + unsafe impl Send for WobbleSuppressorBase {} + + impl crate::videostab::WobbleSuppressorBaseTraitConst for WobbleSuppressorBase { + #[inline] fn as_raw_WobbleSuppressorBase(&self) -> *const c_void { self.as_raw() } + } + + impl crate::videostab::WobbleSuppressorBaseTrait for WobbleSuppressorBase { + #[inline] fn as_raw_mut_WobbleSuppressorBase(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl WobbleSuppressorBase { + } + + boxed_cast_descendant! { WobbleSuppressorBase, crate::videostab::NullWobbleSuppressor, cv_WobbleSuppressorBase_to_NullWobbleSuppressor } } diff --git a/docs/xfeatures2d.rs b/docs/xfeatures2d.rs index 2ea5f6122..a11bb952b 100644 --- a/docs/xfeatures2d.rs +++ b/docs/xfeatures2d.rs @@ -16,7 +16,7 @@ pub mod xfeatures2d { //! - LOGOS: Local geometric support for high-outlier spatial verification, [Lowry2018LOGOSLG](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Lowry2018LOGOSLG) use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::SURFConst, super::SURF, super::FREAKConst, super::FREAK, super::StarDetectorConst, super::StarDetector, super::BriefDescriptorExtractorConst, super::BriefDescriptorExtractor, super::LUCIDConst, super::LUCID, super::LATCHConst, super::LATCH, super::BEBLIDConst, super::BEBLID, super::TEBLIDTraitConst, super::TEBLIDTrait, super::DAISYConst, super::DAISY, super::MSDDetectorConst, super::MSDDetector, super::VGGConst, super::VGG, super::BoostDescConst, super::BoostDesc, super::PCTSignaturesConst, super::PCTSignatures, super::PCTSignaturesSQFDConst, super::PCTSignaturesSQFD, super::Elliptic_KeyPointTraitConst, super::Elliptic_KeyPointTrait, super::HarrisLaplaceFeatureDetectorConst, super::HarrisLaplaceFeatureDetector, super::AffineFeature2DConst, super::AffineFeature2D, super::TBMRConst, super::TBMR, super::SURF_CUDATraitConst, super::SURF_CUDATrait }; + pub use { super::SURFTraitConst, super::SURFTrait, super::FREAKTraitConst, super::FREAKTrait, super::StarDetectorTraitConst, super::StarDetectorTrait, super::BriefDescriptorExtractorTraitConst, super::BriefDescriptorExtractorTrait, super::LUCIDTraitConst, super::LUCIDTrait, super::LATCHTraitConst, super::LATCHTrait, super::BEBLIDTraitConst, super::BEBLIDTrait, super::TEBLIDTraitConst, super::TEBLIDTrait, super::DAISYTraitConst, super::DAISYTrait, super::MSDDetectorTraitConst, super::MSDDetectorTrait, super::VGGTraitConst, super::VGGTrait, super::BoostDescTraitConst, super::BoostDescTrait, super::PCTSignaturesTraitConst, super::PCTSignaturesTrait, super::PCTSignaturesSQFDTraitConst, super::PCTSignaturesSQFDTrait, super::Elliptic_KeyPointTraitConst, super::Elliptic_KeyPointTrait, super::HarrisLaplaceFeatureDetectorTraitConst, super::HarrisLaplaceFeatureDetectorTrait, super::AffineFeature2DTraitConst, super::AffineFeature2DTrait, super::TBMRTraitConst, super::TBMRTrait, super::SURF_CUDATraitConst, super::SURF_CUDATrait }; } pub const BEBLID_SIZE_256_BITS: i32 = 101; @@ -164,8 +164,8 @@ pub mod xfeatures2d { opencv_type_enum! { crate::xfeatures2d::TEBLID_TeblidSize } - pub type SurfDescriptorExtractor = dyn crate::xfeatures2d::SURF; - pub type SurfFeatureDetector = dyn crate::xfeatures2d::SURF; + pub type SurfDescriptorExtractor = crate::xfeatures2d::SURF; + pub type SurfFeatureDetector = crate::xfeatures2d::SURF; /// Estimates cornerness for prespecified KeyPoints using the FAST algorithm /// /// ## Parameters @@ -683,20 +683,13 @@ pub mod xfeatures2d { } /// Constant methods for [crate::xfeatures2d::AffineFeature2D] - pub trait AffineFeature2DConst: crate::features2d::Feature2DTraitConst { + pub trait AffineFeature2DTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_AffineFeature2D(&self) -> *const c_void; } - /// Class implementing affine adaptation for key points. - /// - /// A [FeatureDetector] and a [DescriptorExtractor] are wrapped to augment the - /// detected points with their affine invariant elliptic region and to compute - /// the feature descriptors on the regions after warping them into circles. - /// - /// The interface is equivalent to [Feature2D], adding operations for - /// [Elliptic_KeyPoint] "Elliptic_KeyPoints" instead of [KeyPoint] "KeyPoints". - pub trait AffineFeature2D: crate::features2d::Feature2DTrait + crate::xfeatures2d::AffineFeature2DConst { + /// Mutable methods for [crate::xfeatures2d::AffineFeature2D] + pub trait AffineFeature2DTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::AffineFeature2DTraitConst { fn as_raw_mut_AffineFeature2D(&mut self) -> *mut c_void; /// Detects keypoints in the image using the wrapped detector and @@ -734,34 +727,87 @@ pub mod xfeatures2d { } - impl dyn AffineFeature2D + '_ { + /// Class implementing affine adaptation for key points. + /// + /// A [FeatureDetector] and a [DescriptorExtractor] are wrapped to augment the + /// detected points with their affine invariant elliptic region and to compute + /// the feature descriptors on the regions after warping them into circles. + /// + /// The interface is equivalent to [Feature2D], adding operations for + /// [Elliptic_KeyPoint] "Elliptic_KeyPoints" instead of [KeyPoint] "KeyPoints". + pub struct AffineFeature2D { + ptr: *mut c_void + } + + opencv_type_boxed! { AffineFeature2D } + + impl Drop for AffineFeature2D { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_AffineFeature2D_delete(instance: *mut c_void); } + unsafe { cv_AffineFeature2D_delete(self.as_raw_mut_AffineFeature2D()) }; + } + } + + unsafe impl Send for AffineFeature2D {} + + impl core::AlgorithmTraitConst for AffineFeature2D { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for AffineFeature2D { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for AffineFeature2D { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for AffineFeature2D { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::AffineFeature2DTraitConst for AffineFeature2D { + #[inline] fn as_raw_AffineFeature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::AffineFeature2DTrait for AffineFeature2D { + #[inline] fn as_raw_mut_AffineFeature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl AffineFeature2D { /// Creates an instance wrapping the given keypoint detector and /// descriptor extractor. #[inline] - pub fn create(mut keypoint_detector: core::Ptr, mut descriptor_extractor: core::Ptr) -> Result> { + pub fn create(mut keypoint_detector: core::Ptr, mut descriptor_extractor: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_AffineFeature2D_create_PtrLFeature2DG_PtrLFeature2DG(keypoint_detector.as_raw_mut_PtrOfFeature2D(), descriptor_extractor.as_raw_mut_PtrOfFeature2D(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates an instance where keypoint detector and descriptor /// extractor are identical. #[inline] - pub fn create_1(mut keypoint_detector: core::Ptr) -> Result> { + pub fn create_1(mut keypoint_detector: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_AffineFeature2D_create_PtrLFeature2DG(keypoint_detector.as_raw_mut_PtrOfFeature2D(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { AffineFeature2D, core::Algorithm, cv_AffineFeature2D_to_Algorithm } + + boxed_cast_base! { AffineFeature2D, crate::features2d::Feature2D, cv_AffineFeature2D_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::BEBLID] - pub trait BEBLIDConst: crate::features2d::Feature2DTraitConst { + pub trait BEBLIDTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_BEBLID(&self) -> *const c_void; #[inline] @@ -785,6 +831,21 @@ pub mod xfeatures2d { } + /// Mutable methods for [crate::xfeatures2d::BEBLID] + pub trait BEBLIDTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::BEBLIDTraitConst { + fn as_raw_mut_BEBLID(&mut self) -> *mut c_void; + + #[inline] + fn set_scale_factor(&mut self, scale_factor: f32) -> Result<()> { + return_send!(via ocvrs_return); + unsafe { sys::cv_xfeatures2d_BEBLID_setScaleFactor_float(self.as_raw_mut_BEBLID(), scale_factor, ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// Class implementing BEBLID (Boosted Efficient Binary Local Image Descriptor), /// described in [Suarez2020BEBLID](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Suarez2020BEBLID) . /// @@ -806,21 +867,47 @@ pub mod xfeatures2d { /// You can check in the [AKAZE example](https://raw.githubusercontent.com/opencv/opencv/master/samples/cpp/tutorial_code/features2D/AKAZE_match.cpp) /// how well BEBLID works. Detecting 10000 keypoints with ORB and describing with BEBLID obtains /// 561 inliers (75%) whereas describing with ORB obtains only 493 inliers (63%). - pub trait BEBLID: crate::features2d::Feature2DTrait + crate::xfeatures2d::BEBLIDConst { - fn as_raw_mut_BEBLID(&mut self) -> *mut c_void; + pub struct BEBLID { + ptr: *mut c_void + } + + opencv_type_boxed! { BEBLID } + impl Drop for BEBLID { #[inline] - fn set_scale_factor(&mut self, scale_factor: f32) -> Result<()> { - return_send!(via ocvrs_return); - unsafe { sys::cv_xfeatures2d_BEBLID_setScaleFactor_float(self.as_raw_mut_BEBLID(), scale_factor, ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_BEBLID_delete(instance: *mut c_void); } + unsafe { cv_BEBLID_delete(self.as_raw_mut_BEBLID()) }; } - } - impl dyn BEBLID + '_ { + unsafe impl Send for BEBLID {} + + impl core::AlgorithmTraitConst for BEBLID { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BEBLID { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for BEBLID { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for BEBLID { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::BEBLIDTraitConst for BEBLID { + #[inline] fn as_raw_BEBLID(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::BEBLIDTrait for BEBLID { + #[inline] fn as_raw_mut_BEBLID(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BEBLID { /// Creates the BEBLID descriptor. /// ## Parameters /// * scale_factor: Adjust the sampling window around detected keypoints: @@ -834,18 +921,23 @@ pub mod xfeatures2d { /// ## C++ default parameters /// * n_bits: BEBLID::SIZE_512_BITS #[inline] - pub fn create(scale_factor: f32, n_bits: i32) -> Result> { + pub fn create(scale_factor: f32, n_bits: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_BEBLID_create_float_int(scale_factor, n_bits, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { BEBLID, core::Algorithm, cv_BEBLID_to_Algorithm } + + boxed_cast_base! { BEBLID, crate::features2d::Feature2D, cv_BEBLID_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::BoostDesc] - pub trait BoostDescConst: crate::features2d::Feature2DTraitConst { + pub trait BoostDescTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_BoostDesc(&self) -> *const c_void; #[inline] @@ -878,6 +970,30 @@ pub mod xfeatures2d { } + /// Mutable methods for [crate::xfeatures2d::BoostDesc] + pub trait BoostDescTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::BoostDescTraitConst { + fn as_raw_mut_BoostDesc(&mut self) -> *mut c_void; + + #[inline] + fn set_use_scale_orientation(&mut self, use_scale_orientation: bool) -> Result<()> { + return_send!(via ocvrs_return); + unsafe { sys::cv_xfeatures2d_BoostDesc_setUseScaleOrientation_const_bool(self.as_raw_mut_BoostDesc(), use_scale_orientation, ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + #[inline] + fn set_scale_factor(&mut self, scale_factor: f32) -> Result<()> { + return_send!(via ocvrs_return); + unsafe { sys::cv_xfeatures2d_BoostDesc_setScaleFactor_const_float(self.as_raw_mut_BoostDesc(), scale_factor, ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// Class implementing BoostDesc (Learning Image Descriptors with Boosting), described in /// [Trzcinski13a](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Trzcinski13a) and [Trzcinski13b](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Trzcinski13b). /// @@ -904,47 +1020,69 @@ pub mod xfeatures2d { /// where each bit is computed as a thresholded linear combination of a set of weak learners. /// BoostDesc header files (boostdesc_*.i) was exported from original binaries with export-boostdesc.py script from /// samples subfolder. - pub trait BoostDesc: crate::features2d::Feature2DTrait + crate::xfeatures2d::BoostDescConst { - fn as_raw_mut_BoostDesc(&mut self) -> *mut c_void; + pub struct BoostDesc { + ptr: *mut c_void + } + opencv_type_boxed! { BoostDesc } + + impl Drop for BoostDesc { #[inline] - fn set_use_scale_orientation(&mut self, use_scale_orientation: bool) -> Result<()> { - return_send!(via ocvrs_return); - unsafe { sys::cv_xfeatures2d_BoostDesc_setUseScaleOrientation_const_bool(self.as_raw_mut_BoostDesc(), use_scale_orientation, ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) - } - - #[inline] - fn set_scale_factor(&mut self, scale_factor: f32) -> Result<()> { - return_send!(via ocvrs_return); - unsafe { sys::cv_xfeatures2d_BoostDesc_setScaleFactor_const_float(self.as_raw_mut_BoostDesc(), scale_factor, ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_BoostDesc_delete(instance: *mut c_void); } + unsafe { cv_BoostDesc_delete(self.as_raw_mut_BoostDesc()) }; } - } - impl dyn BoostDesc + '_ { + unsafe impl Send for BoostDesc {} + + impl core::AlgorithmTraitConst for BoostDesc { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BoostDesc { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for BoostDesc { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for BoostDesc { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::BoostDescTraitConst for BoostDesc { + #[inline] fn as_raw_BoostDesc(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::BoostDescTrait for BoostDesc { + #[inline] fn as_raw_mut_BoostDesc(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BoostDesc { /// ## C++ default parameters /// * desc: BoostDesc::BINBOOST_256 /// * use_scale_orientation: true /// * scale_factor: 6.25f #[inline] - pub fn create(desc: i32, use_scale_orientation: bool, scale_factor: f32) -> Result> { + pub fn create(desc: i32, use_scale_orientation: bool, scale_factor: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_BoostDesc_create_int_bool_float(desc, use_scale_orientation, scale_factor, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { BoostDesc, core::Algorithm, cv_BoostDesc_to_Algorithm } + + boxed_cast_base! { BoostDesc, crate::features2d::Feature2D, cv_BoostDesc_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::BriefDescriptorExtractor] - pub trait BriefDescriptorExtractorConst: crate::features2d::Feature2DTraitConst { + pub trait BriefDescriptorExtractorTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_BriefDescriptorExtractor(&self) -> *const c_void; #[inline] @@ -977,12 +1115,8 @@ pub mod xfeatures2d { } - /// Class for computing BRIEF descriptors described in [calon2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_calon2010) . - /// - /// ## Parameters - /// * bytes: legth of the descriptor in bytes, valid values are: 16, 32 (default) or 64 . - /// * use_orientation: sample patterns using keypoints orientation, disabled by default. - pub trait BriefDescriptorExtractor: crate::features2d::Feature2DTrait + crate::xfeatures2d::BriefDescriptorExtractorConst { + /// Mutable methods for [crate::xfeatures2d::BriefDescriptorExtractor] + pub trait BriefDescriptorExtractorTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::BriefDescriptorExtractorTraitConst { fn as_raw_mut_BriefDescriptorExtractor(&mut self) -> *mut c_void; #[inline] @@ -1005,23 +1139,73 @@ pub mod xfeatures2d { } - impl dyn BriefDescriptorExtractor + '_ { + /// Class for computing BRIEF descriptors described in [calon2010](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_calon2010) . + /// + /// ## Parameters + /// * bytes: legth of the descriptor in bytes, valid values are: 16, 32 (default) or 64 . + /// * use_orientation: sample patterns using keypoints orientation, disabled by default. + pub struct BriefDescriptorExtractor { + ptr: *mut c_void + } + + opencv_type_boxed! { BriefDescriptorExtractor } + + impl Drop for BriefDescriptorExtractor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_BriefDescriptorExtractor_delete(instance: *mut c_void); } + unsafe { cv_BriefDescriptorExtractor_delete(self.as_raw_mut_BriefDescriptorExtractor()) }; + } + } + + unsafe impl Send for BriefDescriptorExtractor {} + + impl core::AlgorithmTraitConst for BriefDescriptorExtractor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for BriefDescriptorExtractor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for BriefDescriptorExtractor { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for BriefDescriptorExtractor { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::BriefDescriptorExtractorTraitConst for BriefDescriptorExtractor { + #[inline] fn as_raw_BriefDescriptorExtractor(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::BriefDescriptorExtractorTrait for BriefDescriptorExtractor { + #[inline] fn as_raw_mut_BriefDescriptorExtractor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl BriefDescriptorExtractor { /// ## C++ default parameters /// * bytes: 32 /// * use_orientation: false #[inline] - pub fn create(bytes: i32, use_orientation: bool) -> Result> { + pub fn create(bytes: i32, use_orientation: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_BriefDescriptorExtractor_create_int_bool(bytes, use_orientation, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { BriefDescriptorExtractor, core::Algorithm, cv_BriefDescriptorExtractor_to_Algorithm } + + boxed_cast_base! { BriefDescriptorExtractor, crate::features2d::Feature2D, cv_BriefDescriptorExtractor_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::DAISY] - pub trait DAISYConst: crate::features2d::Feature2DTraitConst { + pub trait DAISYTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_DAISY(&self) -> *const c_void; #[inline] @@ -1167,22 +1351,8 @@ pub mod xfeatures2d { } - /// Class implementing DAISY descriptor, described in [Tola10](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Tola10) - /// - /// ## Parameters - /// * radius: radius of the descriptor at the initial scale - /// * q_radius: amount of radial range division quantity - /// * q_theta: amount of angular range division quantity - /// * q_hist: amount of gradient orientations range division quantity - /// * norm: choose descriptors normalization type, where - /// DAISY::NRM_NONE will not do any normalization (default), - /// DAISY::NRM_PARTIAL mean that histograms are normalized independently for L2 norm equal to 1.0, - /// DAISY::NRM_FULL mean that descriptors are normalized for L2 norm equal to 1.0, - /// DAISY::NRM_SIFT mean that descriptors are normalized for L2 norm equal to 1.0 but no individual one is bigger than 0.154 as in SIFT - /// * H: optional 3x3 homography matrix used to warp the grid of daisy but sampling keypoints remains unwarped on image - /// * interpolation: switch to disable interpolation for speed improvement at minor quality loss - /// * use_orientation: sample patterns using keypoints orientation, disabled by default. - pub trait DAISY: crate::features2d::Feature2DTrait + crate::xfeatures2d::DAISYConst { + /// Mutable methods for [crate::xfeatures2d::DAISY] + pub trait DAISYTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::DAISYTraitConst { fn as_raw_mut_DAISY(&mut self) -> *mut c_void; #[inline] @@ -1318,7 +1488,62 @@ pub mod xfeatures2d { } - impl dyn DAISY + '_ { + /// Class implementing DAISY descriptor, described in [Tola10](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Tola10) + /// + /// ## Parameters + /// * radius: radius of the descriptor at the initial scale + /// * q_radius: amount of radial range division quantity + /// * q_theta: amount of angular range division quantity + /// * q_hist: amount of gradient orientations range division quantity + /// * norm: choose descriptors normalization type, where + /// DAISY::NRM_NONE will not do any normalization (default), + /// DAISY::NRM_PARTIAL mean that histograms are normalized independently for L2 norm equal to 1.0, + /// DAISY::NRM_FULL mean that descriptors are normalized for L2 norm equal to 1.0, + /// DAISY::NRM_SIFT mean that descriptors are normalized for L2 norm equal to 1.0 but no individual one is bigger than 0.154 as in SIFT + /// * H: optional 3x3 homography matrix used to warp the grid of daisy but sampling keypoints remains unwarped on image + /// * interpolation: switch to disable interpolation for speed improvement at minor quality loss + /// * use_orientation: sample patterns using keypoints orientation, disabled by default. + pub struct DAISY { + ptr: *mut c_void + } + + opencv_type_boxed! { DAISY } + + impl Drop for DAISY { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DAISY_delete(instance: *mut c_void); } + unsafe { cv_DAISY_delete(self.as_raw_mut_DAISY()) }; + } + } + + unsafe impl Send for DAISY {} + + impl core::AlgorithmTraitConst for DAISY { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DAISY { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for DAISY { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for DAISY { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::DAISYTraitConst for DAISY { + #[inline] fn as_raw_DAISY(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::DAISYTrait for DAISY { + #[inline] fn as_raw_mut_DAISY(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DAISY { /// ## C++ default parameters /// * radius: 15 /// * q_radius: 3 @@ -1329,17 +1554,22 @@ pub mod xfeatures2d { /// * interpolation: true /// * use_orientation: false #[inline] - pub fn create(radius: f32, q_radius: i32, q_theta: i32, q_hist: i32, norm: crate::xfeatures2d::DAISY_NormalizationType, h: &dyn core::ToInputArray, interpolation: bool, use_orientation: bool) -> Result> { + pub fn create(radius: f32, q_radius: i32, q_theta: i32, q_hist: i32, norm: crate::xfeatures2d::DAISY_NormalizationType, h: &dyn core::ToInputArray, interpolation: bool, use_orientation: bool) -> Result> { extern_container_arg!(h); return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_DAISY_create_float_int_int_int_NormalizationType_const__InputArrayR_bool_bool(radius, q_radius, q_theta, q_hist, norm, h.as_raw__InputArray(), interpolation, use_orientation, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { DAISY, core::Algorithm, cv_DAISY_to_Algorithm } + + boxed_cast_base! { DAISY, crate::features2d::Feature2D, cv_DAISY_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::Elliptic_KeyPoint] pub trait Elliptic_KeyPointTraitConst: core::KeyPointTraitConst { fn as_raw_Elliptic_KeyPoint(&self) -> *const c_void; @@ -1457,7 +1687,7 @@ pub mod xfeatures2d { boxed_cast_base! { Elliptic_KeyPoint, core::KeyPoint, cv_Elliptic_KeyPoint_to_KeyPoint } /// Constant methods for [crate::xfeatures2d::FREAK] - pub trait FREAKConst: crate::features2d::Feature2DTraitConst { + pub trait FREAKTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_FREAK(&self) -> *const c_void; #[inline] @@ -1508,19 +1738,8 @@ pub mod xfeatures2d { } - /// Class implementing the FREAK (*Fast Retina Keypoint*) keypoint descriptor, described in [AOV12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_AOV12) . - /// - /// The algorithm propose a novel keypoint descriptor inspired by the human visual system and more - /// precisely the retina, coined Fast Retina Key- point (FREAK). A cascade of binary strings is - /// computed by efficiently comparing image intensities over a retinal sampling pattern. FREAKs are in - /// general faster to compute with lower memory load and also more robust than SIFT, SURF or BRISK. - /// They are competitive alternatives to existing keypoints in particular for embedded applications. - /// - /// - /// Note: - /// * An example on how to use the FREAK descriptor can be found at - /// opencv_source_code/samples/cpp/freak_demo.cpp - pub trait FREAK: crate::features2d::Feature2DTrait + crate::xfeatures2d::FREAKConst { + /// Mutable methods for [crate::xfeatures2d::FREAK] + pub trait FREAKTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::FREAKTraitConst { fn as_raw_mut_FREAK(&mut self) -> *mut c_void; #[inline] @@ -1561,7 +1780,59 @@ pub mod xfeatures2d { } - impl dyn FREAK + '_ { + /// Class implementing the FREAK (*Fast Retina Keypoint*) keypoint descriptor, described in [AOV12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_AOV12) . + /// + /// The algorithm propose a novel keypoint descriptor inspired by the human visual system and more + /// precisely the retina, coined Fast Retina Key- point (FREAK). A cascade of binary strings is + /// computed by efficiently comparing image intensities over a retinal sampling pattern. FREAKs are in + /// general faster to compute with lower memory load and also more robust than SIFT, SURF or BRISK. + /// They are competitive alternatives to existing keypoints in particular for embedded applications. + /// + /// + /// Note: + /// * An example on how to use the FREAK descriptor can be found at + /// opencv_source_code/samples/cpp/freak_demo.cpp + pub struct FREAK { + ptr: *mut c_void + } + + opencv_type_boxed! { FREAK } + + impl Drop for FREAK { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FREAK_delete(instance: *mut c_void); } + unsafe { cv_FREAK_delete(self.as_raw_mut_FREAK()) }; + } + } + + unsafe impl Send for FREAK {} + + impl core::AlgorithmTraitConst for FREAK { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FREAK { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for FREAK { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for FREAK { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::FREAKTraitConst for FREAK { + #[inline] fn as_raw_FREAK(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::FREAKTrait for FREAK { + #[inline] fn as_raw_mut_FREAK(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FREAK { pub const NB_SCALES: i32 = 64; pub const NB_PAIRS: i32 = 512; pub const NB_ORIENPAIRS: i32 = 45; @@ -1579,18 +1850,23 @@ pub mod xfeatures2d { /// * n_octaves: 4 /// * selected_pairs: std::vector() #[inline] - pub fn create(orientation_normalized: bool, scale_normalized: bool, pattern_scale: f32, n_octaves: i32, selected_pairs: &core::Vector) -> Result> { + pub fn create(orientation_normalized: bool, scale_normalized: bool, pattern_scale: f32, n_octaves: i32, selected_pairs: &core::Vector) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_FREAK_create_bool_bool_float_int_const_vectorLintGR(orientation_normalized, scale_normalized, pattern_scale, n_octaves, selected_pairs.as_raw_VectorOfi32(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { FREAK, core::Algorithm, cv_FREAK_to_Algorithm } + + boxed_cast_base! { FREAK, crate::features2d::Feature2D, cv_FREAK_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::HarrisLaplaceFeatureDetector] - pub trait HarrisLaplaceFeatureDetectorConst: crate::features2d::Feature2DTraitConst { + pub trait HarrisLaplaceFeatureDetectorTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_HarrisLaplaceFeatureDetector(&self) -> *const c_void; #[inline] @@ -1650,8 +1926,8 @@ pub mod xfeatures2d { } - /// Class implementing the Harris-Laplace feature detector as described in [Mikolajczyk2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Mikolajczyk2004). - pub trait HarrisLaplaceFeatureDetector: crate::features2d::Feature2DTrait + crate::xfeatures2d::HarrisLaplaceFeatureDetectorConst { + /// Mutable methods for [crate::xfeatures2d::HarrisLaplaceFeatureDetector] + pub trait HarrisLaplaceFeatureDetectorTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::HarrisLaplaceFeatureDetectorTraitConst { fn as_raw_mut_HarrisLaplaceFeatureDetector(&mut self) -> *mut c_void; #[inline] @@ -1701,7 +1977,48 @@ pub mod xfeatures2d { } - impl dyn HarrisLaplaceFeatureDetector + '_ { + /// Class implementing the Harris-Laplace feature detector as described in [Mikolajczyk2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Mikolajczyk2004). + pub struct HarrisLaplaceFeatureDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { HarrisLaplaceFeatureDetector } + + impl Drop for HarrisLaplaceFeatureDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_HarrisLaplaceFeatureDetector_delete(instance: *mut c_void); } + unsafe { cv_HarrisLaplaceFeatureDetector_delete(self.as_raw_mut_HarrisLaplaceFeatureDetector()) }; + } + } + + unsafe impl Send for HarrisLaplaceFeatureDetector {} + + impl core::AlgorithmTraitConst for HarrisLaplaceFeatureDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for HarrisLaplaceFeatureDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for HarrisLaplaceFeatureDetector { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for HarrisLaplaceFeatureDetector { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::HarrisLaplaceFeatureDetectorTraitConst for HarrisLaplaceFeatureDetector { + #[inline] fn as_raw_HarrisLaplaceFeatureDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::HarrisLaplaceFeatureDetectorTrait for HarrisLaplaceFeatureDetector { + #[inline] fn as_raw_mut_HarrisLaplaceFeatureDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl HarrisLaplaceFeatureDetector { /// Creates a new implementation instance. /// /// ## Parameters @@ -1718,18 +2035,23 @@ pub mod xfeatures2d { /// * max_corners: 5000 /// * num_layers: 4 #[inline] - pub fn create(num_octaves: i32, corn_thresh: f32, dog_thresh: f32, max_corners: i32, num_layers: i32) -> Result> { + pub fn create(num_octaves: i32, corn_thresh: f32, dog_thresh: f32, max_corners: i32, num_layers: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_HarrisLaplaceFeatureDetector_create_int_float_float_int_int(num_octaves, corn_thresh, dog_thresh, max_corners, num_layers, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { HarrisLaplaceFeatureDetector, core::Algorithm, cv_HarrisLaplaceFeatureDetector_to_Algorithm } + + boxed_cast_base! { HarrisLaplaceFeatureDetector, crate::features2d::Feature2D, cv_HarrisLaplaceFeatureDetector_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::LATCH] - pub trait LATCHConst: crate::features2d::Feature2DTraitConst { + pub trait LATCHTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_LATCH(&self) -> *const c_void; #[inline] @@ -1780,23 +2102,8 @@ pub mod xfeatures2d { } - /// latch Class for computing the LATCH descriptor. - /// If you find this code useful, please add a reference to the following paper in your work: - /// Gil Levi and Tal Hassner, "LATCH: Learned Arrangements of Three Patch Codes", arXiv preprint arXiv:1501.03719, 15 Jan. 2015 - /// - /// LATCH is a binary descriptor based on learned comparisons of triplets of image patches. - /// - /// * bytes is the size of the descriptor - can be 64, 32, 16, 8, 4, 2 or 1 - /// * rotationInvariance - whether or not the descriptor should compansate for orientation changes. - /// * half_ssd_size - the size of half of the mini-patches size. For example, if we would like to compare triplets of patches of size 7x7x - /// then the half_ssd_size should be (7-1)/2 = 3. - /// * sigma - sigma value for GaussianBlur smoothing of the source image. Source image will be used without smoothing in case sigma value is 0. - /// - /// Note: the descriptor can be coupled with any keypoint extractor. The only demand is that if you use set rotationInvariance = True then - /// you will have to use an extractor which estimates the patch orientation (in degrees). Examples for such extractors are ORB and SIFT. - /// - /// Note: a complete example can be found under /samples/cpp/tutorial_code/xfeatures2D/latch_match.cpp - pub trait LATCH: crate::features2d::Feature2DTrait + crate::xfeatures2d::LATCHConst { + /// Mutable methods for [crate::xfeatures2d::LATCH] + pub trait LATCHTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::LATCHTraitConst { fn as_raw_mut_LATCH(&mut self) -> *mut c_void; #[inline] @@ -1837,25 +2144,86 @@ pub mod xfeatures2d { } - impl dyn LATCH + '_ { + /// latch Class for computing the LATCH descriptor. + /// If you find this code useful, please add a reference to the following paper in your work: + /// Gil Levi and Tal Hassner, "LATCH: Learned Arrangements of Three Patch Codes", arXiv preprint arXiv:1501.03719, 15 Jan. 2015 + /// + /// LATCH is a binary descriptor based on learned comparisons of triplets of image patches. + /// + /// * bytes is the size of the descriptor - can be 64, 32, 16, 8, 4, 2 or 1 + /// * rotationInvariance - whether or not the descriptor should compansate for orientation changes. + /// * half_ssd_size - the size of half of the mini-patches size. For example, if we would like to compare triplets of patches of size 7x7x + /// then the half_ssd_size should be (7-1)/2 = 3. + /// * sigma - sigma value for GaussianBlur smoothing of the source image. Source image will be used without smoothing in case sigma value is 0. + /// + /// Note: the descriptor can be coupled with any keypoint extractor. The only demand is that if you use set rotationInvariance = True then + /// you will have to use an extractor which estimates the patch orientation (in degrees). Examples for such extractors are ORB and SIFT. + /// + /// Note: a complete example can be found under /samples/cpp/tutorial_code/xfeatures2D/latch_match.cpp + pub struct LATCH { + ptr: *mut c_void + } + + opencv_type_boxed! { LATCH } + + impl Drop for LATCH { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LATCH_delete(instance: *mut c_void); } + unsafe { cv_LATCH_delete(self.as_raw_mut_LATCH()) }; + } + } + + unsafe impl Send for LATCH {} + + impl core::AlgorithmTraitConst for LATCH { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LATCH { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for LATCH { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for LATCH { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::LATCHTraitConst for LATCH { + #[inline] fn as_raw_LATCH(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::LATCHTrait for LATCH { + #[inline] fn as_raw_mut_LATCH(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LATCH { /// ## C++ default parameters /// * bytes: 32 /// * rotation_invariance: true /// * half_ssd_size: 3 /// * sigma: 2.0 #[inline] - pub fn create(bytes: i32, rotation_invariance: bool, half_ssd_size: i32, sigma: f64) -> Result> { + pub fn create(bytes: i32, rotation_invariance: bool, half_ssd_size: i32, sigma: f64) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_LATCH_create_int_bool_int_double(bytes, rotation_invariance, half_ssd_size, sigma, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { LATCH, core::Algorithm, cv_LATCH_to_Algorithm } + + boxed_cast_base! { LATCH, crate::features2d::Feature2D, cv_LATCH_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::LUCID] - pub trait LUCIDConst: crate::features2d::Feature2DTraitConst { + pub trait LUCIDTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_LUCID(&self) -> *const c_void; #[inline] @@ -1888,14 +2256,8 @@ pub mod xfeatures2d { } - /// Class implementing the locally uniform comparison image descriptor, described in [LUCID](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LUCID) - /// - /// An image descriptor that can be computed very fast, while being - /// about as robust as, for example, SURF or BRIEF. - /// - /// - /// Note: It requires a color image as input. - pub trait LUCID: crate::features2d::Feature2DTrait + crate::xfeatures2d::LUCIDConst { + /// Mutable methods for [crate::xfeatures2d::LUCID] + pub trait LUCIDTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::LUCIDTraitConst { fn as_raw_mut_LUCID(&mut self) -> *mut c_void; #[inline] @@ -1918,7 +2280,54 @@ pub mod xfeatures2d { } - impl dyn LUCID + '_ { + /// Class implementing the locally uniform comparison image descriptor, described in [LUCID](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LUCID) + /// + /// An image descriptor that can be computed very fast, while being + /// about as robust as, for example, SURF or BRIEF. + /// + /// + /// Note: It requires a color image as input. + pub struct LUCID { + ptr: *mut c_void + } + + opencv_type_boxed! { LUCID } + + impl Drop for LUCID { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LUCID_delete(instance: *mut c_void); } + unsafe { cv_LUCID_delete(self.as_raw_mut_LUCID()) }; + } + } + + unsafe impl Send for LUCID {} + + impl core::AlgorithmTraitConst for LUCID { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LUCID { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for LUCID { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for LUCID { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::LUCIDTraitConst for LUCID { + #[inline] fn as_raw_LUCID(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::LUCIDTrait for LUCID { + #[inline] fn as_raw_mut_LUCID(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LUCID { /// ## Parameters /// * lucid_kernel: kernel for descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth /// * blur_kernel: kernel for blurring image prior to descriptor construction, where 1=3x3, 2=5x5, 3=7x7 and so forth @@ -1927,18 +2336,23 @@ pub mod xfeatures2d { /// * lucid_kernel: 1 /// * blur_kernel: 2 #[inline] - pub fn create(lucid_kernel: i32, blur_kernel: i32) -> Result> { + pub fn create(lucid_kernel: i32, blur_kernel: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_LUCID_create_const_int_const_int(lucid_kernel, blur_kernel, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { LUCID, core::Algorithm, cv_LUCID_to_Algorithm } + + boxed_cast_base! { LUCID, crate::features2d::Feature2D, cv_LUCID_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::MSDDetector] - pub trait MSDDetectorConst: crate::features2d::Feature2DTraitConst { + pub trait MSDDetectorTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_MSDDetector(&self) -> *const c_void; #[inline] @@ -2034,17 +2448,8 @@ pub mod xfeatures2d { } - /// Class implementing the MSD (*Maximal Self-Dissimilarity*) keypoint detector, described in [Tombari14](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Tombari14). - /// - /// The algorithm implements a novel interest point detector stemming from the intuition that image patches - /// which are highly dissimilar over a relatively large extent of their surroundings hold the property of - /// being repeatable and distinctive. This concept of "contextual self-dissimilarity" reverses the key - /// paradigm of recent successful techniques such as the Local Self-Similarity descriptor and the Non-Local - /// Means filter, which build upon the presence of similar - rather than dissimilar - patches. Moreover, - /// it extends to contextual information the local self-dissimilarity notion embedded in established - /// detectors of corner-like interest points, thereby achieving enhanced repeatability, distinctiveness and - /// localization accuracy. - pub trait MSDDetector: crate::features2d::Feature2DTrait + crate::xfeatures2d::MSDDetectorConst { + /// Mutable methods for [crate::xfeatures2d::MSDDetector] + pub trait MSDDetectorTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::MSDDetectorTraitConst { fn as_raw_mut_MSDDetector(&mut self) -> *mut c_void; #[inline] @@ -2130,7 +2535,57 @@ pub mod xfeatures2d { } - impl dyn MSDDetector + '_ { + /// Class implementing the MSD (*Maximal Self-Dissimilarity*) keypoint detector, described in [Tombari14](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Tombari14). + /// + /// The algorithm implements a novel interest point detector stemming from the intuition that image patches + /// which are highly dissimilar over a relatively large extent of their surroundings hold the property of + /// being repeatable and distinctive. This concept of "contextual self-dissimilarity" reverses the key + /// paradigm of recent successful techniques such as the Local Self-Similarity descriptor and the Non-Local + /// Means filter, which build upon the presence of similar - rather than dissimilar - patches. Moreover, + /// it extends to contextual information the local self-dissimilarity notion embedded in established + /// detectors of corner-like interest points, thereby achieving enhanced repeatability, distinctiveness and + /// localization accuracy. + pub struct MSDDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { MSDDetector } + + impl Drop for MSDDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_MSDDetector_delete(instance: *mut c_void); } + unsafe { cv_MSDDetector_delete(self.as_raw_mut_MSDDetector()) }; + } + } + + unsafe impl Send for MSDDetector {} + + impl core::AlgorithmTraitConst for MSDDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for MSDDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for MSDDetector { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for MSDDetector { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::MSDDetectorTraitConst for MSDDetector { + #[inline] fn as_raw_MSDDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::MSDDetectorTrait for MSDDetector { + #[inline] fn as_raw_mut_MSDDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl MSDDetector { /// ## C++ default parameters /// * m_patch_radius: 3 /// * m_search_area_radius: 5 @@ -2142,18 +2597,23 @@ pub mod xfeatures2d { /// * m_n_scales: -1 /// * m_compute_orientation: false #[inline] - pub fn create(m_patch_radius: i32, m_search_area_radius: i32, m_nms_radius: i32, m_nms_scale_radius: i32, m_th_saliency: f32, m_k_nn: i32, m_scale_factor: f32, m_n_scales: i32, m_compute_orientation: bool) -> Result> { + pub fn create(m_patch_radius: i32, m_search_area_radius: i32, m_nms_radius: i32, m_nms_scale_radius: i32, m_th_saliency: f32, m_k_nn: i32, m_scale_factor: f32, m_n_scales: i32, m_compute_orientation: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_MSDDetector_create_int_int_int_int_float_int_float_int_bool(m_patch_radius, m_search_area_radius, m_nms_radius, m_nms_scale_radius, m_th_saliency, m_k_nn, m_scale_factor, m_n_scales, m_compute_orientation, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { MSDDetector, core::Algorithm, cv_MSDDetector_to_Algorithm } + + boxed_cast_base! { MSDDetector, crate::features2d::Feature2D, cv_MSDDetector_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::PCTSignatures] - pub trait PCTSignaturesConst: core::AlgorithmTraitConst { + pub trait PCTSignaturesTraitConst: core::AlgorithmTraitConst { fn as_raw_PCTSignatures(&self) -> *const c_void; /// Computes signature of given image. @@ -2399,19 +2859,8 @@ pub mod xfeatures2d { } - /// Class implementing PCT (position-color-texture) signature extraction - /// as described in [KrulisLS16](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KrulisLS16). - /// The algorithm is divided to a feature sampler and a clusterizer. - /// Feature sampler produces samples at given set of coordinates. - /// Clusterizer then produces clusters of these samples using k-means algorithm. - /// Resulting set of clusters is the signature of the input image. - /// - /// A signature is an array of SIGNATURE_DIMENSION-dimensional points. - /// Used dimensions are: - /// weight, x, y position; lab color, contrast, entropy. - /// [KrulisLS16](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KrulisLS16) - /// [BeecksUS10](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_BeecksUS10) - pub trait PCTSignatures: core::AlgorithmTrait + crate::xfeatures2d::PCTSignaturesConst { + /// Mutable methods for [crate::xfeatures2d::PCTSignatures] + pub trait PCTSignaturesTrait: core::AlgorithmTrait + crate::xfeatures2d::PCTSignaturesTraitConst { fn as_raw_mut_PCTSignatures(&mut self) -> *mut c_void; /// Color resolution of the greyscale bitmap represented in allocated bits @@ -2699,29 +3148,73 @@ pub mod xfeatures2d { } - impl dyn PCTSignatures + '_ { - /// Creates PCTSignatures algorithm using sample and seed count. - /// It generates its own sets of sampling points and clusterization seed indexes. - /// ## Parameters - /// * initSampleCount: Number of points used for image sampling. - /// * initSeedCount: Number of initial clusterization seeds. - /// Must be lower or equal to initSampleCount - /// * pointDistribution: Distribution of generated points. Default: UNIFORM. - /// Available: UNIFORM, REGULAR, NORMAL. - /// ## Returns - /// Created algorithm. - /// - /// ## C++ default parameters + /// Class implementing PCT (position-color-texture) signature extraction + /// as described in [KrulisLS16](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KrulisLS16). + /// The algorithm is divided to a feature sampler and a clusterizer. + /// Feature sampler produces samples at given set of coordinates. + /// Clusterizer then produces clusters of these samples using k-means algorithm. + /// Resulting set of clusters is the signature of the input image. + /// + /// A signature is an array of SIGNATURE_DIMENSION-dimensional points. + /// Used dimensions are: + /// weight, x, y position; lab color, contrast, entropy. + /// [KrulisLS16](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_KrulisLS16) + /// [BeecksUS10](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_BeecksUS10) + pub struct PCTSignatures { + ptr: *mut c_void + } + + opencv_type_boxed! { PCTSignatures } + + impl Drop for PCTSignatures { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_PCTSignatures_delete(instance: *mut c_void); } + unsafe { cv_PCTSignatures_delete(self.as_raw_mut_PCTSignatures()) }; + } + } + + unsafe impl Send for PCTSignatures {} + + impl core::AlgorithmTraitConst for PCTSignatures { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for PCTSignatures { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::PCTSignaturesTraitConst for PCTSignatures { + #[inline] fn as_raw_PCTSignatures(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::PCTSignaturesTrait for PCTSignatures { + #[inline] fn as_raw_mut_PCTSignatures(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl PCTSignatures { + /// Creates PCTSignatures algorithm using sample and seed count. + /// It generates its own sets of sampling points and clusterization seed indexes. + /// ## Parameters + /// * initSampleCount: Number of points used for image sampling. + /// * initSeedCount: Number of initial clusterization seeds. + /// Must be lower or equal to initSampleCount + /// * pointDistribution: Distribution of generated points. Default: UNIFORM. + /// Available: UNIFORM, REGULAR, NORMAL. + /// ## Returns + /// Created algorithm. + /// + /// ## C++ default parameters /// * init_sample_count: 2000 /// * init_seed_count: 400 /// * point_distribution: 0 #[inline] - pub fn create(init_sample_count: i32, init_seed_count: i32, point_distribution: i32) -> Result> { + pub fn create(init_sample_count: i32, init_seed_count: i32, point_distribution: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_PCTSignatures_create_const_int_const_int_const_int(init_sample_count, init_seed_count, point_distribution, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2735,12 +3228,12 @@ pub mod xfeatures2d { /// ## Returns /// Created algorithm. #[inline] - pub fn create_1(init_sampling_points: &core::Vector, init_seed_count: i32) -> Result> { + pub fn create_1(init_sampling_points: &core::Vector, init_seed_count: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_PCTSignatures_create_const_vectorLPoint2fGR_const_int(init_sampling_points.as_raw_VectorOfPoint2f(), init_seed_count, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2753,12 +3246,12 @@ pub mod xfeatures2d { /// ## Returns /// Created algorithm. #[inline] - pub fn create_2(init_sampling_points: &core::Vector, init_cluster_seed_indexes: &core::Vector) -> Result> { + pub fn create_2(init_sampling_points: &core::Vector, init_cluster_seed_indexes: &core::Vector) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_PCTSignatures_create_const_vectorLPoint2fGR_const_vectorLintGR(init_sampling_points.as_raw_VectorOfPoint2f(), init_cluster_seed_indexes.as_raw_VectorOfi32(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2807,8 +3300,11 @@ pub mod xfeatures2d { } } + + boxed_cast_base! { PCTSignatures, core::Algorithm, cv_PCTSignatures_to_Algorithm } + /// Constant methods for [crate::xfeatures2d::PCTSignaturesSQFD] - pub trait PCTSignaturesSQFDConst: core::AlgorithmTraitConst { + pub trait PCTSignaturesSQFDTraitConst: core::AlgorithmTraitConst { fn as_raw_PCTSignaturesSQFD(&self) -> *const c_void; /// Computes Signature Quadratic Form Distance of two signatures. @@ -2843,6 +3339,12 @@ pub mod xfeatures2d { } + /// Mutable methods for [crate::xfeatures2d::PCTSignaturesSQFD] + pub trait PCTSignaturesSQFDTrait: core::AlgorithmTrait + crate::xfeatures2d::PCTSignaturesSQFDTraitConst { + fn as_raw_mut_PCTSignaturesSQFD(&mut self) -> *mut c_void; + + } + /// Class implementing Signature Quadratic Form Distance (SQFD). /// ## See also /// Christian Beecks, Merih Seran Uysal, Thomas Seidl. @@ -2850,12 +3352,39 @@ pub mod xfeatures2d { /// In Proceedings of the ACM International Conference on Image and Video Retrieval, pages 438-445. /// ACM, 2010. /// [BeecksUS10](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_BeecksUS10) - pub trait PCTSignaturesSQFD: core::AlgorithmTrait + crate::xfeatures2d::PCTSignaturesSQFDConst { - fn as_raw_mut_PCTSignaturesSQFD(&mut self) -> *mut c_void; + pub struct PCTSignaturesSQFD { + ptr: *mut c_void + } + opencv_type_boxed! { PCTSignaturesSQFD } + + impl Drop for PCTSignaturesSQFD { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_PCTSignaturesSQFD_delete(instance: *mut c_void); } + unsafe { cv_PCTSignaturesSQFD_delete(self.as_raw_mut_PCTSignaturesSQFD()) }; + } } - impl dyn PCTSignaturesSQFD + '_ { + unsafe impl Send for PCTSignaturesSQFD {} + + impl core::AlgorithmTraitConst for PCTSignaturesSQFD { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for PCTSignaturesSQFD { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::PCTSignaturesSQFDTraitConst for PCTSignaturesSQFD { + #[inline] fn as_raw_PCTSignaturesSQFD(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::PCTSignaturesSQFDTrait for PCTSignaturesSQFD { + #[inline] fn as_raw_mut_PCTSignaturesSQFD(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl PCTSignaturesSQFD { /// Creates the algorithm instance using selected distance function, /// similarity function and similarity function parameter. /// ## Parameters @@ -2870,18 +3399,21 @@ pub mod xfeatures2d { /// * similarity_function: 2 /// * similarity_parameter: 1.0f #[inline] - pub fn create(distance_function: i32, similarity_function: i32, similarity_parameter: f32) -> Result> { + pub fn create(distance_function: i32, similarity_function: i32, similarity_parameter: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_PCTSignaturesSQFD_create_const_int_const_int_const_float(distance_function, similarity_function, similarity_parameter, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { PCTSignaturesSQFD, core::Algorithm, cv_PCTSignaturesSQFD_to_Algorithm } + /// Constant methods for [crate::xfeatures2d::SURF] - pub trait SURFConst: crate::features2d::Feature2DTraitConst { + pub trait SURFTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_SURF(&self) -> *const c_void; #[inline] @@ -2941,36 +3473,8 @@ pub mod xfeatures2d { } - /// Class for extracting Speeded Up Robust Features from an image [Bay06](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Bay06) . - /// - /// The algorithm parameters: - /// * member int extended - /// * 0 means that the basic descriptors (64 elements each) shall be computed - /// * 1 means that the extended descriptors (128 elements each) shall be computed - /// * member int upright - /// * 0 means that detector computes orientation of each feature. - /// * 1 means that the orientation is not computed (which is much, much faster). For example, - /// if you match images from a stereo pair, or do image stitching, the matched features - /// likely have very similar angles, and you can speed up feature extraction by setting - /// upright=1. - /// * member double hessianThreshold - /// Threshold for the keypoint detector. Only features, whose hessian is larger than - /// hessianThreshold are retained by the detector. Therefore, the larger the value, the less - /// keypoints you will get. A good default value could be from 300 to 500, depending from the - /// image contrast. - /// * member int nOctaves - /// The number of a gaussian pyramid octaves that the detector uses. It is set to 4 by default. - /// If you want to get very large features, use the larger value. If you want just small - /// features, decrease it. - /// * member int nOctaveLayers - /// The number of images within each octave of a gaussian pyramid. It is set to 2 by default. - /// - /// Note: - /// * An example using the SURF feature detector can be found at - /// opencv_source_code/samples/cpp/generic_descriptor_match.cpp - /// * Another example using the SURF feature detector, extractor and matcher can be found at - /// opencv_source_code/samples/cpp/matcher_simple.cpp - pub trait SURF: crate::features2d::Feature2DTrait + crate::xfeatures2d::SURFConst { + /// Mutable methods for [crate::xfeatures2d::SURF] + pub trait SURFTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::SURFTraitConst { fn as_raw_mut_SURF(&mut self) -> *mut c_void; #[inline] @@ -3020,7 +3524,76 @@ pub mod xfeatures2d { } - impl dyn SURF + '_ { + /// Class for extracting Speeded Up Robust Features from an image [Bay06](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Bay06) . + /// + /// The algorithm parameters: + /// * member int extended + /// * 0 means that the basic descriptors (64 elements each) shall be computed + /// * 1 means that the extended descriptors (128 elements each) shall be computed + /// * member int upright + /// * 0 means that detector computes orientation of each feature. + /// * 1 means that the orientation is not computed (which is much, much faster). For example, + /// if you match images from a stereo pair, or do image stitching, the matched features + /// likely have very similar angles, and you can speed up feature extraction by setting + /// upright=1. + /// * member double hessianThreshold + /// Threshold for the keypoint detector. Only features, whose hessian is larger than + /// hessianThreshold are retained by the detector. Therefore, the larger the value, the less + /// keypoints you will get. A good default value could be from 300 to 500, depending from the + /// image contrast. + /// * member int nOctaves + /// The number of a gaussian pyramid octaves that the detector uses. It is set to 4 by default. + /// If you want to get very large features, use the larger value. If you want just small + /// features, decrease it. + /// * member int nOctaveLayers + /// The number of images within each octave of a gaussian pyramid. It is set to 2 by default. + /// + /// Note: + /// * An example using the SURF feature detector can be found at + /// opencv_source_code/samples/cpp/generic_descriptor_match.cpp + /// * Another example using the SURF feature detector, extractor and matcher can be found at + /// opencv_source_code/samples/cpp/matcher_simple.cpp + pub struct SURF { + ptr: *mut c_void + } + + opencv_type_boxed! { SURF } + + impl Drop for SURF { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SURF_delete(instance: *mut c_void); } + unsafe { cv_SURF_delete(self.as_raw_mut_SURF()) }; + } + } + + unsafe impl Send for SURF {} + + impl core::AlgorithmTraitConst for SURF { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SURF { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for SURF { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for SURF { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::SURFTraitConst for SURF { + #[inline] fn as_raw_SURF(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::SURFTrait for SURF { + #[inline] fn as_raw_mut_SURF(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SURF { /// ## Parameters /// * hessianThreshold: Threshold for hessian keypoint detector used in SURF. /// * nOctaves: Number of pyramid octaves the keypoint detector will use. @@ -3037,18 +3610,23 @@ pub mod xfeatures2d { /// * extended: false /// * upright: false #[inline] - pub fn create(hessian_threshold: f64, n_octaves: i32, n_octave_layers: i32, extended: bool, upright: bool) -> Result> { + pub fn create(hessian_threshold: f64, n_octaves: i32, n_octave_layers: i32, extended: bool, upright: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_SURF_create_double_int_int_bool_bool(hessian_threshold, n_octaves, n_octave_layers, extended, upright, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { SURF, core::Algorithm, cv_SURF_to_Algorithm } + + boxed_cast_base! { SURF, crate::features2d::Feature2D, cv_SURF_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::StarDetector] - pub trait StarDetectorConst: crate::features2d::Feature2DTraitConst { + pub trait StarDetectorTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_StarDetector(&self) -> *const c_void; #[inline] @@ -3108,8 +3686,8 @@ pub mod xfeatures2d { } - /// The class implements the keypoint detector introduced by [Agrawal08](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Agrawal08), synonym of StarDetector. : - pub trait StarDetector: crate::features2d::Feature2DTrait + crate::xfeatures2d::StarDetectorConst { + /// Mutable methods for [crate::xfeatures2d::StarDetector] + pub trait StarDetectorTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::StarDetectorTraitConst { fn as_raw_mut_StarDetector(&mut self) -> *mut c_void; #[inline] @@ -3159,7 +3737,48 @@ pub mod xfeatures2d { } - impl dyn StarDetector + '_ { + /// The class implements the keypoint detector introduced by [Agrawal08](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Agrawal08), synonym of StarDetector. : + pub struct StarDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { StarDetector } + + impl Drop for StarDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_StarDetector_delete(instance: *mut c_void); } + unsafe { cv_StarDetector_delete(self.as_raw_mut_StarDetector()) }; + } + } + + unsafe impl Send for StarDetector {} + + impl core::AlgorithmTraitConst for StarDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for StarDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for StarDetector { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for StarDetector { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::StarDetectorTraitConst for StarDetector { + #[inline] fn as_raw_StarDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::StarDetectorTrait for StarDetector { + #[inline] fn as_raw_mut_StarDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StarDetector { /// the full constructor /// /// ## C++ default parameters @@ -3169,18 +3788,23 @@ pub mod xfeatures2d { /// * line_threshold_binarized: 8 /// * suppress_nonmax_size: 5 #[inline] - pub fn create(max_size: i32, response_threshold: i32, line_threshold_projected: i32, line_threshold_binarized: i32, suppress_nonmax_size: i32) -> Result> { + pub fn create(max_size: i32, response_threshold: i32, line_threshold_projected: i32, line_threshold_binarized: i32, suppress_nonmax_size: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_StarDetector_create_int_int_int_int_int(max_size, response_threshold, line_threshold_projected, line_threshold_binarized, suppress_nonmax_size, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { StarDetector, core::Algorithm, cv_StarDetector_to_Algorithm } + + boxed_cast_base! { StarDetector, crate::features2d::Feature2D, cv_StarDetector_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::TBMR] - pub trait TBMRConst: crate::xfeatures2d::AffineFeature2DConst { + pub trait TBMRTraitConst: crate::xfeatures2d::AffineFeature2DTraitConst { fn as_raw_TBMR(&self) -> *const c_void; #[inline] @@ -3221,23 +3845,8 @@ pub mod xfeatures2d { } - /// Class implementing the Tree Based Morse Regions (TBMR) as described in - /// [Najman2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Najman2014) extended with scaled extraction ability. - /// - /// ## Parameters - /// * min_area: prune areas smaller than minArea - /// * max_area_relative: prune areas bigger than maxArea = max_area_relative * - /// input_image_size - /// * scale_factor: scale factor for scaled extraction. - /// * n_scales: number of applications of the scale factor (octaves). - /// - /// - /// Note: This algorithm is based on Component Tree (Min/Max) as well as MSER but - /// uses a Morse-theory approach to extract features. - /// - /// Features are ellipses (similar to MSER, however a MSER feature can never be a - /// TBMR feature and vice versa). - pub trait TBMR: crate::xfeatures2d::AffineFeature2D + crate::xfeatures2d::TBMRConst { + /// Mutable methods for [crate::xfeatures2d::TBMR] + pub trait TBMRTrait: crate::xfeatures2d::AffineFeature2DTrait + crate::xfeatures2d::TBMRTraitConst { fn as_raw_mut_TBMR(&mut self) -> *mut c_void; #[inline] @@ -3278,23 +3887,92 @@ pub mod xfeatures2d { } - impl dyn TBMR + '_ { + /// Class implementing the Tree Based Morse Regions (TBMR) as described in + /// [Najman2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Najman2014) extended with scaled extraction ability. + /// + /// ## Parameters + /// * min_area: prune areas smaller than minArea + /// * max_area_relative: prune areas bigger than maxArea = max_area_relative * + /// input_image_size + /// * scale_factor: scale factor for scaled extraction. + /// * n_scales: number of applications of the scale factor (octaves). + /// + /// + /// Note: This algorithm is based on Component Tree (Min/Max) as well as MSER but + /// uses a Morse-theory approach to extract features. + /// + /// Features are ellipses (similar to MSER, however a MSER feature can never be a + /// TBMR feature and vice versa). + pub struct TBMR { + ptr: *mut c_void + } + + opencv_type_boxed! { TBMR } + + impl Drop for TBMR { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TBMR_delete(instance: *mut c_void); } + unsafe { cv_TBMR_delete(self.as_raw_mut_TBMR()) }; + } + } + + unsafe impl Send for TBMR {} + + impl crate::xfeatures2d::AffineFeature2DTraitConst for TBMR { + #[inline] fn as_raw_AffineFeature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::AffineFeature2DTrait for TBMR { + #[inline] fn as_raw_mut_AffineFeature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl core::AlgorithmTraitConst for TBMR { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for TBMR { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for TBMR { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for TBMR { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::TBMRTraitConst for TBMR { + #[inline] fn as_raw_TBMR(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::TBMRTrait for TBMR { + #[inline] fn as_raw_mut_TBMR(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TBMR { /// ## C++ default parameters /// * min_area: 60 /// * max_area_relative: 0.01f /// * scale_factor: 1.25f /// * n_scales: -1 #[inline] - pub fn create(min_area: i32, max_area_relative: f32, scale_factor: f32, n_scales: i32) -> Result> { + pub fn create(min_area: i32, max_area_relative: f32, scale_factor: f32, n_scales: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_TBMR_create_int_float_float_int(min_area, max_area_relative, scale_factor, n_scales, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { TBMR, core::Algorithm, cv_TBMR_to_Algorithm } + + boxed_cast_base! { TBMR, crate::features2d::Feature2D, cv_TBMR_to_Feature2D } + /// Constant methods for [crate::xfeatures2d::TEBLID] pub trait TEBLIDTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_TEBLID(&self) -> *const c_void; @@ -3406,7 +4084,7 @@ pub mod xfeatures2d { boxed_cast_base! { TEBLID, crate::features2d::Feature2D, cv_TEBLID_to_Feature2D } /// Constant methods for [crate::xfeatures2d::VGG] - pub trait VGGConst: crate::features2d::Feature2DTraitConst { + pub trait VGGTraitConst: crate::features2d::Feature2DTraitConst { fn as_raw_VGG(&self) -> *const c_void; #[inline] @@ -3466,23 +4144,8 @@ pub mod xfeatures2d { } - /// Class implementing VGG (Oxford Visual Geometry Group) descriptor trained end to end - /// using "Descriptor Learning Using Convex Optimisation" (DLCO) aparatus described in [Simonyan14](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Simonyan14). - /// - /// ## Parameters - /// * desc: type of descriptor to use, VGG::VGG_120 is default (120 dimensions float) - /// Available types are VGG::VGG_120, VGG::VGG_80, VGG::VGG_64, VGG::VGG_48 - /// * isigma: gaussian kernel value for image blur (default is 1.4f) - /// * img_normalize: use image sample intensity normalization (enabled by default) - /// * use_orientation: sample patterns using keypoints orientation, enabled by default - /// * scale_factor: adjust the sampling window of detected keypoints to 64.0f (VGG sampling window) - /// 6.25f is default and fits for KAZE, SURF detected keypoints window ratio - /// 6.75f should be the scale for SIFT detected keypoints window ratio - /// 5.00f should be the scale for AKAZE, MSD, AGAST, FAST, BRISK keypoints window ratio - /// 0.75f should be the scale for ORB keypoints ratio - /// - /// * dsc_normalize: clamp descriptors to 255 and convert to uchar CV_8UC1 (disabled by default) - pub trait VGG: crate::features2d::Feature2DTrait + crate::xfeatures2d::VGGConst { + /// Mutable methods for [crate::xfeatures2d::VGG] + pub trait VGGTrait: crate::features2d::Feature2DTrait + crate::xfeatures2d::VGGTraitConst { fn as_raw_mut_VGG(&mut self) -> *mut c_void; #[inline] @@ -3532,7 +4195,63 @@ pub mod xfeatures2d { } - impl dyn VGG + '_ { + /// Class implementing VGG (Oxford Visual Geometry Group) descriptor trained end to end + /// using "Descriptor Learning Using Convex Optimisation" (DLCO) aparatus described in [Simonyan14](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Simonyan14). + /// + /// ## Parameters + /// * desc: type of descriptor to use, VGG::VGG_120 is default (120 dimensions float) + /// Available types are VGG::VGG_120, VGG::VGG_80, VGG::VGG_64, VGG::VGG_48 + /// * isigma: gaussian kernel value for image blur (default is 1.4f) + /// * img_normalize: use image sample intensity normalization (enabled by default) + /// * use_orientation: sample patterns using keypoints orientation, enabled by default + /// * scale_factor: adjust the sampling window of detected keypoints to 64.0f (VGG sampling window) + /// 6.25f is default and fits for KAZE, SURF detected keypoints window ratio + /// 6.75f should be the scale for SIFT detected keypoints window ratio + /// 5.00f should be the scale for AKAZE, MSD, AGAST, FAST, BRISK keypoints window ratio + /// 0.75f should be the scale for ORB keypoints ratio + /// + /// * dsc_normalize: clamp descriptors to 255 and convert to uchar CV_8UC1 (disabled by default) + pub struct VGG { + ptr: *mut c_void + } + + opencv_type_boxed! { VGG } + + impl Drop for VGG { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_VGG_delete(instance: *mut c_void); } + unsafe { cv_VGG_delete(self.as_raw_mut_VGG()) }; + } + } + + unsafe impl Send for VGG {} + + impl core::AlgorithmTraitConst for VGG { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for VGG { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::features2d::Feature2DTraitConst for VGG { + #[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() } + } + + impl crate::features2d::Feature2DTrait for VGG { + #[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xfeatures2d::VGGTraitConst for VGG { + #[inline] fn as_raw_VGG(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xfeatures2d::VGGTrait for VGG { + #[inline] fn as_raw_mut_VGG(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl VGG { /// ## C++ default parameters /// * desc: VGG::VGG_120 /// * isigma: 1.4f @@ -3541,13 +4260,18 @@ pub mod xfeatures2d { /// * scale_factor: 6.25f /// * dsc_normalize: false #[inline] - pub fn create(desc: i32, isigma: f32, img_normalize: bool, use_scale_orientation: bool, scale_factor: f32, dsc_normalize: bool) -> Result> { + pub fn create(desc: i32, isigma: f32, img_normalize: bool, use_scale_orientation: bool, scale_factor: f32, dsc_normalize: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xfeatures2d_VGG_create_int_float_bool_bool_float_bool(desc, isigma, img_normalize, use_scale_orientation, scale_factor, dsc_normalize, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } + + boxed_cast_base! { VGG, core::Algorithm, cv_VGG_to_Algorithm } + + boxed_cast_base! { VGG, crate::features2d::Feature2D, cv_VGG_to_Feature2D } +} diff --git a/docs/ximgproc.rs b/docs/ximgproc.rs index 0b94fcf84..a77fc3dda 100644 --- a/docs/ximgproc.rs +++ b/docs/ximgproc.rs @@ -50,7 +50,7 @@ pub mod ximgproc { //! "on". use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::DTFilterConst, super::DTFilter, super::GuidedFilterConst, super::GuidedFilter, super::AdaptiveManifoldFilterConst, super::AdaptiveManifoldFilter, super::FastBilateralSolverFilterConst, super::FastBilateralSolverFilter, super::FastGlobalSmootherFilterConst, super::FastGlobalSmootherFilter, super::DisparityFilterConst, super::DisparityFilter, super::DisparityWLSFilterConst, super::DisparityWLSFilter, super::SparseMatchInterpolatorConst, super::SparseMatchInterpolator, super::EdgeAwareInterpolatorConst, super::EdgeAwareInterpolator, super::RICInterpolatorConst, super::RICInterpolator, super::RFFeatureGetterConst, super::RFFeatureGetter, super::StructuredEdgeDetectionConst, super::StructuredEdgeDetection, super::EdgeBoxesConst, super::EdgeBoxes, super::EdgeDrawingConst, super::EdgeDrawing, super::ScanSegmentConst, super::ScanSegment, super::SuperpixelSEEDSConst, super::SuperpixelSEEDS, super::GraphSegmentationConst, super::GraphSegmentation, super::SelectiveSearchSegmentationStrategyConst, super::SelectiveSearchSegmentationStrategy, super::SelectiveSearchSegmentationStrategyColorConst, super::SelectiveSearchSegmentationStrategyColor, super::SelectiveSearchSegmentationStrategySizeConst, super::SelectiveSearchSegmentationStrategySize, super::SelectiveSearchSegmentationStrategyTextureConst, super::SelectiveSearchSegmentationStrategyTexture, super::SelectiveSearchSegmentationStrategyFillConst, super::SelectiveSearchSegmentationStrategyFill, super::SelectiveSearchSegmentationStrategyMultipleConst, super::SelectiveSearchSegmentationStrategyMultiple, super::SelectiveSearchSegmentationConst, super::SelectiveSearchSegmentation, super::SuperpixelSLICConst, super::SuperpixelSLIC, super::SuperpixelLSCConst, super::SuperpixelLSC, super::FastLineDetectorConst, super::FastLineDetector, super::ContourFittingTraitConst, super::ContourFittingTrait, super::RidgeDetectionFilterConst, super::RidgeDetectionFilter }; + pub use { super::DTFilterTraitConst, super::DTFilterTrait, super::GuidedFilterTraitConst, super::GuidedFilterTrait, super::AdaptiveManifoldFilterTraitConst, super::AdaptiveManifoldFilterTrait, super::FastBilateralSolverFilterTraitConst, super::FastBilateralSolverFilterTrait, super::FastGlobalSmootherFilterTraitConst, super::FastGlobalSmootherFilterTrait, super::DisparityFilterTraitConst, super::DisparityFilterTrait, super::DisparityWLSFilterTraitConst, super::DisparityWLSFilterTrait, super::SparseMatchInterpolatorTraitConst, super::SparseMatchInterpolatorTrait, super::EdgeAwareInterpolatorTraitConst, super::EdgeAwareInterpolatorTrait, super::RICInterpolatorTraitConst, super::RICInterpolatorTrait, super::RFFeatureGetterTraitConst, super::RFFeatureGetterTrait, super::StructuredEdgeDetectionTraitConst, super::StructuredEdgeDetectionTrait, super::EdgeBoxesTraitConst, super::EdgeBoxesTrait, super::EdgeDrawingTraitConst, super::EdgeDrawingTrait, super::ScanSegmentTraitConst, super::ScanSegmentTrait, super::SuperpixelSEEDSTraitConst, super::SuperpixelSEEDSTrait, super::GraphSegmentationTraitConst, super::GraphSegmentationTrait, super::SelectiveSearchSegmentationStrategyTraitConst, super::SelectiveSearchSegmentationStrategyTrait, super::SelectiveSearchSegmentationStrategyColorTraitConst, super::SelectiveSearchSegmentationStrategyColorTrait, super::SelectiveSearchSegmentationStrategySizeTraitConst, super::SelectiveSearchSegmentationStrategySizeTrait, super::SelectiveSearchSegmentationStrategyTextureTraitConst, super::SelectiveSearchSegmentationStrategyTextureTrait, super::SelectiveSearchSegmentationStrategyFillTraitConst, super::SelectiveSearchSegmentationStrategyFillTrait, super::SelectiveSearchSegmentationStrategyMultipleTraitConst, super::SelectiveSearchSegmentationStrategyMultipleTrait, super::SelectiveSearchSegmentationTraitConst, super::SelectiveSearchSegmentationTrait, super::SuperpixelSLICTraitConst, super::SuperpixelSLICTrait, super::SuperpixelLSCTraitConst, super::SuperpixelLSCTrait, super::FastLineDetectorTraitConst, super::FastLineDetectorTrait, super::ContourFittingTraitConst, super::ContourFittingTrait, super::RidgeDetectionFilterTraitConst, super::RidgeDetectionFilterTrait }; } pub const AM_FILTER: i32 = 4; @@ -711,12 +711,12 @@ pub mod ximgproc { /// ## C++ default parameters /// * adjust_outliers: false #[inline] - pub fn create_am_filter(sigma_s: f64, sigma_r: f64, adjust_outliers: bool) -> Result> { + pub fn create_am_filter(sigma_s: f64, sigma_r: f64, adjust_outliers: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createAMFilter_double_double_bool(sigma_s, sigma_r, adjust_outliers, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -763,13 +763,13 @@ pub mod ximgproc { /// * mode: DTF_NC /// * num_iters: 3 #[inline] - pub fn create_dt_filter(guide: &dyn core::ToInputArray, sigma_spatial: f64, sigma_color: f64, mode: i32, num_iters: i32) -> Result> { + pub fn create_dt_filter(guide: &dyn core::ToInputArray, sigma_spatial: f64, sigma_color: f64, mode: i32, num_iters: i32) -> Result> { extern_container_arg!(guide); return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createDTFilter_const__InputArrayR_double_double_int_int(guide.as_raw__InputArray(), sigma_spatial, sigma_color, mode, num_iters, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -781,12 +781,12 @@ pub mod ximgproc { /// * use_confidence: filtering with confidence requires two disparity maps (for the left and right views) and is /// approximately two times slower. However, quality is typically significantly better. #[inline] - pub fn create_disparity_wls_filter_generic(use_confidence: bool) -> Result> { + pub fn create_disparity_wls_filter_generic(use_confidence: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createDisparityWLSFilterGeneric_bool(use_confidence, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -796,24 +796,24 @@ pub mod ximgproc { /// ## Parameters /// * matcher_left: stereo matcher instance that will be used with the filter #[inline] - pub fn create_disparity_wls_filter(mut matcher_left: core::Ptr) -> Result> { + pub fn create_disparity_wls_filter(mut matcher_left: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createDisparityWLSFilter_PtrLStereoMatcherG(matcher_left.as_raw_mut_PtrOfStereoMatcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Factory method that creates an instance of the /// EdgeAwareInterpolator. #[inline] - pub fn create_edge_aware_interpolator() -> Result> { + pub fn create_edge_aware_interpolator() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createEdgeAwareInterpolator(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -847,23 +847,23 @@ pub mod ximgproc { /// * gamma: 2 /// * kappa: 1.5f #[inline] - pub fn create_edge_boxes(alpha: f32, beta: f32, eta: f32, min_score: f32, max_boxes: i32, edge_min_mag: f32, edge_merge_thr: f32, cluster_min_mag: f32, max_aspect_ratio: f32, min_box_area: f32, gamma: f32, kappa: f32) -> Result> { + pub fn create_edge_boxes(alpha: f32, beta: f32, eta: f32, min_score: f32, max_boxes: i32, edge_min_mag: f32, edge_merge_thr: f32, cluster_min_mag: f32, max_aspect_ratio: f32, min_box_area: f32, gamma: f32, kappa: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createEdgeBoxes_float_float_float_float_int_float_float_float_float_float_float_float(alpha, beta, eta, min_score, max_boxes, edge_min_mag, edge_merge_thr, cluster_min_mag, max_aspect_ratio, min_box_area, gamma, kappa, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates a smart pointer to a EdgeDrawing object and initializes it #[inline] - pub fn create_edge_drawing() -> Result> { + pub fn create_edge_drawing() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createEdgeDrawing(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -891,13 +891,13 @@ pub mod ximgproc { /// * num_iter: 25 /// * max_tol: 1e-5 #[inline] - pub fn create_fast_bilateral_solver_filter(guide: &dyn core::ToInputArray, sigma_spatial: f64, sigma_luma: f64, sigma_chroma: f64, lambda: f64, num_iter: i32, max_tol: f64) -> Result> { + pub fn create_fast_bilateral_solver_filter(guide: &dyn core::ToInputArray, sigma_spatial: f64, sigma_luma: f64, sigma_chroma: f64, lambda: f64, num_iter: i32, max_tol: f64) -> Result> { extern_container_arg!(guide); return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createFastBilateralSolverFilter_const__InputArrayR_double_double_double_double_int_double(guide.as_raw__InputArray(), sigma_spatial, sigma_luma, sigma_chroma, lambda, num_iter, max_tol, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -926,13 +926,13 @@ pub mod ximgproc { /// * lambda_attenuation: 0.25 /// * num_iter: 3 #[inline] - pub fn create_fast_global_smoother_filter(guide: &dyn core::ToInputArray, lambda: f64, sigma_color: f64, lambda_attenuation: f64, num_iter: i32) -> Result> { + pub fn create_fast_global_smoother_filter(guide: &dyn core::ToInputArray, lambda: f64, sigma_color: f64, lambda_attenuation: f64, num_iter: i32) -> Result> { extern_container_arg!(guide); return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createFastGlobalSmootherFilter_const__InputArrayR_double_double_double_int(guide.as_raw__InputArray(), lambda, sigma_color, lambda_attenuation, num_iter, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -956,12 +956,12 @@ pub mod ximgproc { /// * canny_aperture_size: 3 /// * do_merge: false #[inline] - pub fn create_fast_line_detector(length_threshold: i32, distance_threshold: f32, canny_th1: f64, canny_th2: f64, canny_aperture_size: i32, do_merge: bool) -> Result> { + pub fn create_fast_line_detector(length_threshold: i32, distance_threshold: f32, canny_th1: f64, canny_th2: f64, canny_aperture_size: i32, do_merge: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createFastLineDetector_int_float_double_double_int_bool(length_threshold, distance_threshold, canny_th1, canny_th2, canny_aperture_size, do_merge, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -978,13 +978,13 @@ pub mod ximgproc { /// /// For more details about Guided Filter parameters, see the original article [Kaiming10](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Kaiming10) . #[inline] - pub fn create_guided_filter(guide: &dyn core::ToInputArray, radius: i32, eps: f64) -> Result> { + pub fn create_guided_filter(guide: &dyn core::ToInputArray, radius: i32, eps: f64) -> Result> { extern_container_arg!(guide); return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createGuidedFilter_const__InputArrayR_int_double(guide.as_raw__InputArray(), radius, eps, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1005,24 +1005,24 @@ pub mod ximgproc { } #[inline] - pub fn create_rf_feature_getter() -> Result> { + pub fn create_rf_feature_getter() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createRFFeatureGetter(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Factory method that creates an instance of the /// RICInterpolator. #[inline] - pub fn create_ric_interpolator() -> Result> { + pub fn create_ric_interpolator() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createRICInterpolator(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1032,12 +1032,12 @@ pub mod ximgproc { /// ## Parameters /// * matcher_left: main stereo matcher instance that will be used with the filter #[inline] - pub fn create_right_matcher(mut matcher_left: core::Ptr) -> Result> { + pub fn create_right_matcher(mut matcher_left: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createRightMatcher_PtrLStereoMatcherG(matcher_left.as_raw_mut_PtrOfStereoMatcher(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1062,12 +1062,12 @@ pub mod ximgproc { /// * slices: 8 /// * merge_small: true #[inline] - pub fn create_scan_segment(image_width: i32, image_height: i32, num_superpixels: i32, slices: i32, merge_small: bool) -> Result> { + pub fn create_scan_segment(image_width: i32, image_height: i32, num_superpixels: i32, slices: i32, merge_small: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createScanSegment_int_int_int_int_bool(image_width, image_height, num_superpixels, slices, merge_small, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1082,13 +1082,13 @@ pub mod ximgproc { /// ## C++ default parameters /// * how_to_get_features: Ptr() #[inline] - pub fn create_structured_edge_detection(model: &str, how_to_get_features: Option>) -> Result> { + pub fn create_structured_edge_detection(model: &str, how_to_get_features: Option>) -> Result> { extern_container_arg!(model); return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createStructuredEdgeDetection_const_StringR_PtrLconst_RFFeatureGetterG(model.opencv_as_extern(), how_to_get_features.map_or(::core::ptr::null(), |how_to_get_features| how_to_get_features.as_raw_PtrOfRFFeatureGetter()), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1111,13 +1111,13 @@ pub mod ximgproc { /// * region_size: 10 /// * ratio: 0.075f #[inline] - pub fn create_superpixel_lsc(image: &dyn core::ToInputArray, region_size: i32, ratio: f32) -> Result> { + pub fn create_superpixel_lsc(image: &dyn core::ToInputArray, region_size: i32, ratio: f32) -> Result> { extern_container_arg!(image); return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createSuperpixelLSC_const__InputArrayR_int_float(image.as_raw__InputArray(), region_size, ratio, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1156,12 +1156,12 @@ pub mod ximgproc { /// * histogram_bins: 5 /// * double_step: false #[inline] - pub fn create_superpixel_seeds(image_width: i32, image_height: i32, image_channels: i32, num_superpixels: i32, num_levels: i32, prior: i32, histogram_bins: i32, double_step: bool) -> Result> { + pub fn create_superpixel_seeds(image_width: i32, image_height: i32, image_channels: i32, num_superpixels: i32, num_levels: i32, prior: i32, histogram_bins: i32, double_step: bool) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createSuperpixelSEEDS_int_int_int_int_int_int_int_bool(image_width, image_height, image_channels, num_superpixels, num_levels, prior, histogram_bins, double_step, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1188,13 +1188,13 @@ pub mod ximgproc { /// * region_size: 10 /// * ruler: 10.0f #[inline] - pub fn create_superpixel_slic(image: &dyn core::ToInputArray, algorithm: i32, region_size: i32, ruler: f32) -> Result> { + pub fn create_superpixel_slic(image: &dyn core::ToInputArray, algorithm: i32, region_size: i32, ruler: f32) -> Result> { extern_container_arg!(image); return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_createSuperpixelSLIC_const__InputArrayR_int_int_float(image.as_raw__InputArray(), algorithm, region_size, ruler, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1878,56 +1878,56 @@ pub mod ximgproc { /// * k: 300 /// * min_size: 100 #[inline] - pub fn create_graph_segmentation(sigma: f64, k: f32, min_size: i32) -> Result> { + pub fn create_graph_segmentation(sigma: f64, k: f32, min_size: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createGraphSegmentation_double_float_int(sigma, k, min_size, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Create a new SelectiveSearchSegmentation class. #[inline] - pub fn create_selective_search_segmentation() -> Result> { + pub fn create_selective_search_segmentation() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentation(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Create a new color-based strategy #[inline] - pub fn create_selective_search_segmentation_strategy_color() -> Result> { + pub fn create_selective_search_segmentation_strategy_color() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategyColor(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Create a new fill-based strategy #[inline] - pub fn create_selective_search_segmentation_strategy_fill() -> Result> { + pub fn create_selective_search_segmentation_strategy_fill() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategyFill(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Create a new multiple strategy #[inline] - pub fn create_selective_search_segmentation_strategy_multiple() -> Result> { + pub fn create_selective_search_segmentation_strategy_multiple() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategyMultiple(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1935,12 +1935,12 @@ pub mod ximgproc { /// ## Parameters /// * s1: The first strategy #[inline] - pub fn create_selective_search_segmentation_strategy_multiple_1(mut s1: core::Ptr) -> Result> { + pub fn create_selective_search_segmentation_strategy_multiple_1(mut s1: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategyMultiple_PtrLSelectiveSearchSegmentationStrategyG(s1.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1949,12 +1949,12 @@ pub mod ximgproc { /// * s1: The first strategy /// * s2: The second strategy #[inline] - pub fn create_selective_search_segmentation_strategy_multiple_2(mut s1: core::Ptr, mut s2: core::Ptr) -> Result> { + pub fn create_selective_search_segmentation_strategy_multiple_2(mut s1: core::Ptr, mut s2: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategyMultiple_PtrLSelectiveSearchSegmentationStrategyG_PtrLSelectiveSearchSegmentationStrategyG(s1.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), s2.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1964,12 +1964,12 @@ pub mod ximgproc { /// * s2: The second strategy /// * s3: The third strategy #[inline] - pub fn create_selective_search_segmentation_strategy_multiple_3(mut s1: core::Ptr, mut s2: core::Ptr, mut s3: core::Ptr) -> Result> { + pub fn create_selective_search_segmentation_strategy_multiple_3(mut s1: core::Ptr, mut s2: core::Ptr, mut s3: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategyMultiple_PtrLSelectiveSearchSegmentationStrategyG_PtrLSelectiveSearchSegmentationStrategyG_PtrLSelectiveSearchSegmentationStrategyG(s1.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), s2.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), s3.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -1980,34 +1980,34 @@ pub mod ximgproc { /// * s3: The third strategy /// * s4: The forth strategy #[inline] - pub fn create_selective_search_segmentation_strategy_multiple_4(mut s1: core::Ptr, mut s2: core::Ptr, mut s3: core::Ptr, mut s4: core::Ptr) -> Result> { + pub fn create_selective_search_segmentation_strategy_multiple_4(mut s1: core::Ptr, mut s2: core::Ptr, mut s3: core::Ptr, mut s4: core::Ptr) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategyMultiple_PtrLSelectiveSearchSegmentationStrategyG_PtrLSelectiveSearchSegmentationStrategyG_PtrLSelectiveSearchSegmentationStrategyG_PtrLSelectiveSearchSegmentationStrategyG(s1.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), s2.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), s3.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), s4.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Create a new size-based strategy #[inline] - pub fn create_selective_search_segmentation_strategy_size() -> Result> { + pub fn create_selective_search_segmentation_strategy_size() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategySize(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Create a new size-based strategy #[inline] - pub fn create_selective_search_segmentation_strategy_texture() -> Result> { + pub fn create_selective_search_segmentation_strategy_texture() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_createSelectiveSearchSegmentationStrategyTexture(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -2089,7 +2089,7 @@ pub mod ximgproc { } /// Constant methods for [crate::ximgproc::AdaptiveManifoldFilter] - pub trait AdaptiveManifoldFilterConst: core::AlgorithmTraitConst { + pub trait AdaptiveManifoldFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_AdaptiveManifoldFilter(&self) -> *const c_void; /// ## See also @@ -2160,24 +2160,8 @@ pub mod ximgproc { } - /// Interface for Adaptive Manifold Filter realizations. - /// - /// For more details about this filter see [Gastal12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Gastal12) and References_. - /// - /// Below listed optional parameters which may be set up with Algorithm::set function. - /// * member double sigma_s = 16.0 - /// Spatial standard deviation. - /// * member double sigma_r = 0.2 - /// Color space standard deviation. - /// * member int tree_height = -1 - /// Height of the manifold tree (default = -1 : automatically computed). - /// * member int num_pca_iterations = 1 - /// Number of iterations to computed the eigenvector. - /// * member bool adjust_outliers = false - /// Specify adjust outliers using Eq. 9 or not. - /// * member bool use_RNG = true - /// Specify use random number generator to compute eigenvector or not. - pub trait AdaptiveManifoldFilter: core::AlgorithmTrait + crate::ximgproc::AdaptiveManifoldFilterConst { + /// Mutable methods for [crate::ximgproc::AdaptiveManifoldFilter] + pub trait AdaptiveManifoldFilterTrait: core::AlgorithmTrait + crate::ximgproc::AdaptiveManifoldFilterTraitConst { fn as_raw_mut_AdaptiveManifoldFilter(&mut self) -> *mut c_void; /// Apply high-dimensional filtering using adaptive manifolds. @@ -2280,18 +2264,70 @@ pub mod ximgproc { } - impl dyn AdaptiveManifoldFilter + '_ { + /// Interface for Adaptive Manifold Filter realizations. + /// + /// For more details about this filter see [Gastal12](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Gastal12) and References_. + /// + /// Below listed optional parameters which may be set up with Algorithm::set function. + /// * member double sigma_s = 16.0 + /// Spatial standard deviation. + /// * member double sigma_r = 0.2 + /// Color space standard deviation. + /// * member int tree_height = -1 + /// Height of the manifold tree (default = -1 : automatically computed). + /// * member int num_pca_iterations = 1 + /// Number of iterations to computed the eigenvector. + /// * member bool adjust_outliers = false + /// Specify adjust outliers using Eq. 9 or not. + /// * member bool use_RNG = true + /// Specify use random number generator to compute eigenvector or not. + pub struct AdaptiveManifoldFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { AdaptiveManifoldFilter } + + impl Drop for AdaptiveManifoldFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_AdaptiveManifoldFilter_delete(instance: *mut c_void); } + unsafe { cv_AdaptiveManifoldFilter_delete(self.as_raw_mut_AdaptiveManifoldFilter()) }; + } + } + + unsafe impl Send for AdaptiveManifoldFilter {} + + impl core::AlgorithmTraitConst for AdaptiveManifoldFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for AdaptiveManifoldFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::AdaptiveManifoldFilterTraitConst for AdaptiveManifoldFilter { + #[inline] fn as_raw_AdaptiveManifoldFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::AdaptiveManifoldFilterTrait for AdaptiveManifoldFilter { + #[inline] fn as_raw_mut_AdaptiveManifoldFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl AdaptiveManifoldFilter { #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_AdaptiveManifoldFilter_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { AdaptiveManifoldFilter, core::Algorithm, cv_AdaptiveManifoldFilter_to_Algorithm } + /// Constant methods for [crate::ximgproc::ContourFitting] pub trait ContourFittingTraitConst: core::AlgorithmTraitConst { fn as_raw_ContourFitting(&self) -> *const c_void; @@ -2459,15 +2495,13 @@ pub mod ximgproc { boxed_cast_base! { ContourFitting, core::Algorithm, cv_ContourFitting_to_Algorithm } /// Constant methods for [crate::ximgproc::DTFilter] - pub trait DTFilterConst: core::AlgorithmTraitConst { + pub trait DTFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_DTFilter(&self) -> *const c_void; } - /// Interface for realizations of Domain Transform filter. - /// - /// For more details about this filter see [Gastal11](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Gastal11) . - pub trait DTFilter: core::AlgorithmTrait + crate::ximgproc::DTFilterConst { + /// Mutable methods for [crate::ximgproc::DTFilter] + pub trait DTFilterTrait: core::AlgorithmTrait + crate::ximgproc::DTFilterTraitConst { fn as_raw_mut_DTFilter(&mut self) -> *mut c_void; /// Produce domain transform filtering operation on source image. @@ -2495,14 +2529,54 @@ pub mod ximgproc { } + /// Interface for realizations of Domain Transform filter. + /// + /// For more details about this filter see [Gastal11](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Gastal11) . + pub struct DTFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { DTFilter } + + impl Drop for DTFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DTFilter_delete(instance: *mut c_void); } + unsafe { cv_DTFilter_delete(self.as_raw_mut_DTFilter()) }; + } + } + + unsafe impl Send for DTFilter {} + + impl core::AlgorithmTraitConst for DTFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DTFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::DTFilterTraitConst for DTFilter { + #[inline] fn as_raw_DTFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::DTFilterTrait for DTFilter { + #[inline] fn as_raw_mut_DTFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DTFilter { + } + + boxed_cast_base! { DTFilter, core::Algorithm, cv_DTFilter_to_Algorithm } + /// Constant methods for [crate::ximgproc::DisparityFilter] - pub trait DisparityFilterConst: core::AlgorithmTraitConst { + pub trait DisparityFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_DisparityFilter(&self) -> *const c_void; } - /// Main interface for all disparity map filters. - pub trait DisparityFilter: core::AlgorithmTrait + crate::ximgproc::DisparityFilterConst { + /// Mutable methods for [crate::ximgproc::DisparityFilter] + pub trait DisparityFilterTrait: core::AlgorithmTrait + crate::ximgproc::DisparityFilterTraitConst { fn as_raw_mut_DisparityFilter(&mut self) -> *mut c_void; /// Apply filtering to the disparity map. @@ -2545,16 +2619,52 @@ pub mod ximgproc { } + /// Main interface for all disparity map filters. + pub struct DisparityFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { DisparityFilter } + + impl Drop for DisparityFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DisparityFilter_delete(instance: *mut c_void); } + unsafe { cv_DisparityFilter_delete(self.as_raw_mut_DisparityFilter()) }; + } + } + + unsafe impl Send for DisparityFilter {} + + impl core::AlgorithmTraitConst for DisparityFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DisparityFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::DisparityFilterTraitConst for DisparityFilter { + #[inline] fn as_raw_DisparityFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::DisparityFilterTrait for DisparityFilter { + #[inline] fn as_raw_mut_DisparityFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DisparityFilter { + } + + boxed_cast_base! { DisparityFilter, core::Algorithm, cv_DisparityFilter_to_Algorithm } + /// Constant methods for [crate::ximgproc::DisparityWLSFilter] - pub trait DisparityWLSFilterConst: crate::ximgproc::DisparityFilterConst { + pub trait DisparityWLSFilterTraitConst: crate::ximgproc::DisparityFilterTraitConst { fn as_raw_DisparityWLSFilter(&self) -> *const c_void; } - /// Disparity map filter based on Weighted Least Squares filter (in form of Fast Global Smoother that - /// is a lot faster than traditional Weighted Least Squares filter implementations) and optional use of - /// left-right-consistency-based confidence to refine the results in half-occlusions and uniform areas. - pub trait DisparityWLSFilter: crate::ximgproc::DisparityFilter + crate::ximgproc::DisparityWLSFilterConst { + /// Mutable methods for [crate::ximgproc::DisparityWLSFilter] + pub trait DisparityWLSFilterTrait: crate::ximgproc::DisparityFilterTrait + crate::ximgproc::DisparityWLSFilterTraitConst { fn as_raw_mut_DisparityWLSFilter(&mut self) -> *mut c_void; /// Lambda is a parameter defining the amount of regularization during filtering. Larger values force @@ -2671,15 +2781,62 @@ pub mod ximgproc { } + /// Disparity map filter based on Weighted Least Squares filter (in form of Fast Global Smoother that + /// is a lot faster than traditional Weighted Least Squares filter implementations) and optional use of + /// left-right-consistency-based confidence to refine the results in half-occlusions and uniform areas. + pub struct DisparityWLSFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { DisparityWLSFilter } + + impl Drop for DisparityWLSFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_DisparityWLSFilter_delete(instance: *mut c_void); } + unsafe { cv_DisparityWLSFilter_delete(self.as_raw_mut_DisparityWLSFilter()) }; + } + } + + unsafe impl Send for DisparityWLSFilter {} + + impl core::AlgorithmTraitConst for DisparityWLSFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for DisparityWLSFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::DisparityFilterTraitConst for DisparityWLSFilter { + #[inline] fn as_raw_DisparityFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::DisparityFilterTrait for DisparityWLSFilter { + #[inline] fn as_raw_mut_DisparityFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::DisparityWLSFilterTraitConst for DisparityWLSFilter { + #[inline] fn as_raw_DisparityWLSFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::DisparityWLSFilterTrait for DisparityWLSFilter { + #[inline] fn as_raw_mut_DisparityWLSFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl DisparityWLSFilter { + } + + boxed_cast_base! { DisparityWLSFilter, core::Algorithm, cv_DisparityWLSFilter_to_Algorithm } + /// Constant methods for [crate::ximgproc::EdgeAwareInterpolator] - pub trait EdgeAwareInterpolatorConst: crate::ximgproc::SparseMatchInterpolatorConst { + pub trait EdgeAwareInterpolatorTraitConst: crate::ximgproc::SparseMatchInterpolatorTraitConst { fn as_raw_EdgeAwareInterpolator(&self) -> *const c_void; } - /// Sparse match interpolation algorithm based on modified locally-weighted affine - /// estimator from [Revaud2015](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Revaud2015) and Fast Global Smoother as post-processing filter. - pub trait EdgeAwareInterpolator: crate::ximgproc::EdgeAwareInterpolatorConst + crate::ximgproc::SparseMatchInterpolator { + /// Mutable methods for [crate::ximgproc::EdgeAwareInterpolator] + pub trait EdgeAwareInterpolatorTrait: crate::ximgproc::EdgeAwareInterpolatorTraitConst + crate::ximgproc::SparseMatchInterpolatorTrait { fn as_raw_mut_EdgeAwareInterpolator(&mut self) -> *mut c_void; /// Interface to provide a more elaborated cost map, i.e. edge map, for the edge-aware term. @@ -2839,8 +2996,55 @@ pub mod ximgproc { } + /// Sparse match interpolation algorithm based on modified locally-weighted affine + /// estimator from [Revaud2015](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Revaud2015) and Fast Global Smoother as post-processing filter. + pub struct EdgeAwareInterpolator { + ptr: *mut c_void + } + + opencv_type_boxed! { EdgeAwareInterpolator } + + impl Drop for EdgeAwareInterpolator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_EdgeAwareInterpolator_delete(instance: *mut c_void); } + unsafe { cv_EdgeAwareInterpolator_delete(self.as_raw_mut_EdgeAwareInterpolator()) }; + } + } + + unsafe impl Send for EdgeAwareInterpolator {} + + impl core::AlgorithmTraitConst for EdgeAwareInterpolator { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for EdgeAwareInterpolator { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SparseMatchInterpolatorTraitConst for EdgeAwareInterpolator { + #[inline] fn as_raw_SparseMatchInterpolator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SparseMatchInterpolatorTrait for EdgeAwareInterpolator { + #[inline] fn as_raw_mut_SparseMatchInterpolator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::EdgeAwareInterpolatorTraitConst for EdgeAwareInterpolator { + #[inline] fn as_raw_EdgeAwareInterpolator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::EdgeAwareInterpolatorTrait for EdgeAwareInterpolator { + #[inline] fn as_raw_mut_EdgeAwareInterpolator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl EdgeAwareInterpolator { + } + + boxed_cast_base! { EdgeAwareInterpolator, core::Algorithm, cv_EdgeAwareInterpolator_to_Algorithm } + /// Constant methods for [crate::ximgproc::EdgeBoxes] - pub trait EdgeBoxesConst: core::AlgorithmTraitConst { + pub trait EdgeBoxesTraitConst: core::AlgorithmTraitConst { fn as_raw_EdgeBoxes(&self) -> *const c_void; /// Returns the step size of sliding window search. @@ -2965,8 +3169,8 @@ pub mod ximgproc { } - /// Class implementing EdgeBoxes algorithm from [ZitnickECCV14edgeBoxes](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_ZitnickECCV14edgeBoxes) : - pub trait EdgeBoxes: core::AlgorithmTrait + crate::ximgproc::EdgeBoxesConst { + /// Mutable methods for [crate::ximgproc::EdgeBoxes] + pub trait EdgeBoxesTrait: core::AlgorithmTrait + crate::ximgproc::EdgeBoxesTraitConst { fn as_raw_mut_EdgeBoxes(&mut self) -> *mut c_void; /// Returns array containing proposal boxes. @@ -3113,8 +3317,46 @@ pub mod ximgproc { } + /// Class implementing EdgeBoxes algorithm from [ZitnickECCV14edgeBoxes](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_ZitnickECCV14edgeBoxes) : + pub struct EdgeBoxes { + ptr: *mut c_void + } + + opencv_type_boxed! { EdgeBoxes } + + impl Drop for EdgeBoxes { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_EdgeBoxes_delete(instance: *mut c_void); } + unsafe { cv_EdgeBoxes_delete(self.as_raw_mut_EdgeBoxes()) }; + } + } + + unsafe impl Send for EdgeBoxes {} + + impl core::AlgorithmTraitConst for EdgeBoxes { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for EdgeBoxes { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::EdgeBoxesTraitConst for EdgeBoxes { + #[inline] fn as_raw_EdgeBoxes(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::EdgeBoxesTrait for EdgeBoxes { + #[inline] fn as_raw_mut_EdgeBoxes(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl EdgeBoxes { + } + + boxed_cast_base! { EdgeBoxes, core::Algorithm, cv_EdgeBoxes_to_Algorithm } + /// Constant methods for [crate::ximgproc::EdgeDrawing] - pub trait EdgeDrawingConst: core::AlgorithmTraitConst { + pub trait EdgeDrawingTraitConst: core::AlgorithmTraitConst { fn as_raw_EdgeDrawing(&self) -> *const c_void; #[inline] @@ -3138,8 +3380,8 @@ pub mod ximgproc { } - /// Class implementing the ED (EdgeDrawing) [topal2012edge](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_topal2012edge), EDLines [akinlar2011edlines](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_akinlar2011edlines), EDPF [akinlar2012edpf](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_akinlar2012edpf) and EDCircles [akinlar2013edcircles](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_akinlar2013edcircles) algorithms - pub trait EdgeDrawing: core::AlgorithmTrait + crate::ximgproc::EdgeDrawingConst { + /// Mutable methods for [crate::ximgproc::EdgeDrawing] + pub trait EdgeDrawingTrait: core::AlgorithmTrait + crate::ximgproc::EdgeDrawingTraitConst { fn as_raw_mut_EdgeDrawing(&mut self) -> *mut c_void; #[inline] @@ -3249,6 +3491,44 @@ pub mod ximgproc { } + /// Class implementing the ED (EdgeDrawing) [topal2012edge](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_topal2012edge), EDLines [akinlar2011edlines](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_akinlar2011edlines), EDPF [akinlar2012edpf](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_akinlar2012edpf) and EDCircles [akinlar2013edcircles](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_akinlar2013edcircles) algorithms + pub struct EdgeDrawing { + ptr: *mut c_void + } + + opencv_type_boxed! { EdgeDrawing } + + impl Drop for EdgeDrawing { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_EdgeDrawing_delete(instance: *mut c_void); } + unsafe { cv_EdgeDrawing_delete(self.as_raw_mut_EdgeDrawing()) }; + } + } + + unsafe impl Send for EdgeDrawing {} + + impl core::AlgorithmTraitConst for EdgeDrawing { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for EdgeDrawing { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::EdgeDrawingTraitConst for EdgeDrawing { + #[inline] fn as_raw_EdgeDrawing(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::EdgeDrawingTrait for EdgeDrawing { + #[inline] fn as_raw_mut_EdgeDrawing(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl EdgeDrawing { + } + + boxed_cast_base! { EdgeDrawing, core::Algorithm, cv_EdgeDrawing_to_Algorithm } + #[repr(C)] #[derive(Copy, Clone, Debug, PartialEq)] pub struct EdgeDrawing_Params { @@ -3317,15 +3597,13 @@ pub mod ximgproc { } /// Constant methods for [crate::ximgproc::FastBilateralSolverFilter] - pub trait FastBilateralSolverFilterConst: core::AlgorithmTraitConst { + pub trait FastBilateralSolverFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_FastBilateralSolverFilter(&self) -> *const c_void; } - /// Interface for implementations of Fast Bilateral Solver. - /// - /// For more details about this solver see [BarronPoole2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_BarronPoole2016) . - pub trait FastBilateralSolverFilter: core::AlgorithmTrait + crate::ximgproc::FastBilateralSolverFilterConst { + /// Mutable methods for [crate::ximgproc::FastBilateralSolverFilter] + pub trait FastBilateralSolverFilterTrait: core::AlgorithmTrait + crate::ximgproc::FastBilateralSolverFilterTraitConst { fn as_raw_mut_FastBilateralSolverFilter(&mut self) -> *mut c_void; /// Apply smoothing operation to the source image. @@ -3353,16 +3631,54 @@ pub mod ximgproc { } + /// Interface for implementations of Fast Bilateral Solver. + /// + /// For more details about this solver see [BarronPoole2016](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_BarronPoole2016) . + pub struct FastBilateralSolverFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { FastBilateralSolverFilter } + + impl Drop for FastBilateralSolverFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FastBilateralSolverFilter_delete(instance: *mut c_void); } + unsafe { cv_FastBilateralSolverFilter_delete(self.as_raw_mut_FastBilateralSolverFilter()) }; + } + } + + unsafe impl Send for FastBilateralSolverFilter {} + + impl core::AlgorithmTraitConst for FastBilateralSolverFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FastBilateralSolverFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::FastBilateralSolverFilterTraitConst for FastBilateralSolverFilter { + #[inline] fn as_raw_FastBilateralSolverFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::FastBilateralSolverFilterTrait for FastBilateralSolverFilter { + #[inline] fn as_raw_mut_FastBilateralSolverFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FastBilateralSolverFilter { + } + + boxed_cast_base! { FastBilateralSolverFilter, core::Algorithm, cv_FastBilateralSolverFilter_to_Algorithm } + /// Constant methods for [crate::ximgproc::FastGlobalSmootherFilter] - pub trait FastGlobalSmootherFilterConst: core::AlgorithmTraitConst { + pub trait FastGlobalSmootherFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_FastGlobalSmootherFilter(&self) -> *const c_void; } - /// Interface for implementations of Fast Global Smoother filter. - /// - /// For more details about this filter see [Min2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Min2014) and [Farbman2008](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Farbman2008) . - pub trait FastGlobalSmootherFilter: core::AlgorithmTrait + crate::ximgproc::FastGlobalSmootherFilterConst { + /// Mutable methods for [crate::ximgproc::FastGlobalSmootherFilter] + pub trait FastGlobalSmootherFilterTrait: core::AlgorithmTrait + crate::ximgproc::FastGlobalSmootherFilterTraitConst { fn as_raw_mut_FastGlobalSmootherFilter(&mut self) -> *mut c_void; /// Apply smoothing operation to the source image. @@ -3384,14 +3700,54 @@ pub mod ximgproc { } + /// Interface for implementations of Fast Global Smoother filter. + /// + /// For more details about this filter see [Min2014](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Min2014) and [Farbman2008](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Farbman2008) . + pub struct FastGlobalSmootherFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { FastGlobalSmootherFilter } + + impl Drop for FastGlobalSmootherFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FastGlobalSmootherFilter_delete(instance: *mut c_void); } + unsafe { cv_FastGlobalSmootherFilter_delete(self.as_raw_mut_FastGlobalSmootherFilter()) }; + } + } + + unsafe impl Send for FastGlobalSmootherFilter {} + + impl core::AlgorithmTraitConst for FastGlobalSmootherFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FastGlobalSmootherFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::FastGlobalSmootherFilterTraitConst for FastGlobalSmootherFilter { + #[inline] fn as_raw_FastGlobalSmootherFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::FastGlobalSmootherFilterTrait for FastGlobalSmootherFilter { + #[inline] fn as_raw_mut_FastGlobalSmootherFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FastGlobalSmootherFilter { + } + + boxed_cast_base! { FastGlobalSmootherFilter, core::Algorithm, cv_FastGlobalSmootherFilter_to_Algorithm } + /// Constant methods for [crate::ximgproc::FastLineDetector] - pub trait FastLineDetectorConst: core::AlgorithmTraitConst { + pub trait FastLineDetectorTraitConst: core::AlgorithmTraitConst { fn as_raw_FastLineDetector(&self) -> *const c_void; } - /// @include samples/fld_lines.cpp - pub trait FastLineDetector: core::AlgorithmTrait + crate::ximgproc::FastLineDetectorConst { + /// Mutable methods for [crate::ximgproc::FastLineDetector] + pub trait FastLineDetectorTrait: core::AlgorithmTrait + crate::ximgproc::FastLineDetectorTraitConst { fn as_raw_mut_FastLineDetector(&mut self) -> *mut c_void; /// @example fld_lines.cpp @@ -3448,16 +3804,52 @@ pub mod ximgproc { } + /// @include samples/fld_lines.cpp + pub struct FastLineDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { FastLineDetector } + + impl Drop for FastLineDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_FastLineDetector_delete(instance: *mut c_void); } + unsafe { cv_FastLineDetector_delete(self.as_raw_mut_FastLineDetector()) }; + } + } + + unsafe impl Send for FastLineDetector {} + + impl core::AlgorithmTraitConst for FastLineDetector { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for FastLineDetector { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::FastLineDetectorTraitConst for FastLineDetector { + #[inline] fn as_raw_FastLineDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::FastLineDetectorTrait for FastLineDetector { + #[inline] fn as_raw_mut_FastLineDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl FastLineDetector { + } + + boxed_cast_base! { FastLineDetector, core::Algorithm, cv_FastLineDetector_to_Algorithm } + /// Constant methods for [crate::ximgproc::GuidedFilter] - pub trait GuidedFilterConst: core::AlgorithmTraitConst { + pub trait GuidedFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_GuidedFilter(&self) -> *const c_void; } - /// Interface for realizations of Guided Filter. - /// - /// For more details about this filter see [Kaiming10](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Kaiming10) . - pub trait GuidedFilter: core::AlgorithmTrait + crate::ximgproc::GuidedFilterConst { + /// Mutable methods for [crate::ximgproc::GuidedFilter] + pub trait GuidedFilterTrait: core::AlgorithmTrait + crate::ximgproc::GuidedFilterTraitConst { fn as_raw_mut_GuidedFilter(&mut self) -> *mut c_void; /// Apply Guided Filter to the filtering image. @@ -3485,8 +3877,48 @@ pub mod ximgproc { } + /// Interface for realizations of Guided Filter. + /// + /// For more details about this filter see [Kaiming10](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Kaiming10) . + pub struct GuidedFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { GuidedFilter } + + impl Drop for GuidedFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GuidedFilter_delete(instance: *mut c_void); } + unsafe { cv_GuidedFilter_delete(self.as_raw_mut_GuidedFilter()) }; + } + } + + unsafe impl Send for GuidedFilter {} + + impl core::AlgorithmTraitConst for GuidedFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GuidedFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::GuidedFilterTraitConst for GuidedFilter { + #[inline] fn as_raw_GuidedFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::GuidedFilterTrait for GuidedFilter { + #[inline] fn as_raw_mut_GuidedFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GuidedFilter { + } + + boxed_cast_base! { GuidedFilter, core::Algorithm, cv_GuidedFilter_to_Algorithm } + /// Constant methods for [crate::ximgproc::RFFeatureGetter] - pub trait RFFeatureGetterConst: core::AlgorithmTraitConst { + pub trait RFFeatureGetterTraitConst: core::AlgorithmTraitConst { fn as_raw_RFFeatureGetter(&self) -> *const c_void; /// ! @@ -3513,15 +3945,53 @@ pub mod ximgproc { } + /// Mutable methods for [crate::ximgproc::RFFeatureGetter] + pub trait RFFeatureGetterTrait: core::AlgorithmTrait + crate::ximgproc::RFFeatureGetterTraitConst { + fn as_raw_mut_RFFeatureGetter(&mut self) -> *mut c_void; + + } + /// ! /// Helper class for training part of [P. Dollar and C. L. Zitnick. Structured Forests for Fast Edge Detection, 2013]. - pub trait RFFeatureGetter: core::AlgorithmTrait + crate::ximgproc::RFFeatureGetterConst { - fn as_raw_mut_RFFeatureGetter(&mut self) -> *mut c_void; + pub struct RFFeatureGetter { + ptr: *mut c_void + } + + opencv_type_boxed! { RFFeatureGetter } + + impl Drop for RFFeatureGetter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_RFFeatureGetter_delete(instance: *mut c_void); } + unsafe { cv_RFFeatureGetter_delete(self.as_raw_mut_RFFeatureGetter()) }; + } + } + + unsafe impl Send for RFFeatureGetter {} + + impl core::AlgorithmTraitConst for RFFeatureGetter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for RFFeatureGetter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::RFFeatureGetterTraitConst for RFFeatureGetter { + #[inline] fn as_raw_RFFeatureGetter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::RFFeatureGetterTrait for RFFeatureGetter { + #[inline] fn as_raw_mut_RFFeatureGetter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + impl RFFeatureGetter { } + boxed_cast_base! { RFFeatureGetter, core::Algorithm, cv_RFFeatureGetter_to_Algorithm } + /// Constant methods for [crate::ximgproc::RICInterpolator] - pub trait RICInterpolatorConst: crate::ximgproc::SparseMatchInterpolatorConst { + pub trait RICInterpolatorTraitConst: crate::ximgproc::SparseMatchInterpolatorTraitConst { fn as_raw_RICInterpolator(&self) -> *const c_void; /// K is a number of nearest-neighbor matches considered, when fitting a locally affine @@ -3689,12 +4159,8 @@ pub mod ximgproc { } - /// Sparse match interpolation algorithm based on modified piecewise locally-weighted affine - /// estimator called Robust Interpolation method of Correspondences or RIC from [Hu2017](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Hu2017) and Variational - /// and Fast Global Smoother as post-processing filter. The RICInterpolator is a extension of the EdgeAwareInterpolator. - /// Main concept of this extension is an piece-wise affine model based on over-segmentation via SLIC superpixel estimation. - /// The method contains an efficient propagation mechanism to estimate among the pieces-wise models. - pub trait RICInterpolator: crate::ximgproc::RICInterpolatorConst + crate::ximgproc::SparseMatchInterpolator { + /// Mutable methods for [crate::ximgproc::RICInterpolator] + pub trait RICInterpolatorTrait: crate::ximgproc::RICInterpolatorTraitConst + crate::ximgproc::SparseMatchInterpolatorTrait { fn as_raw_mut_RICInterpolator(&mut self) -> *mut c_void; /// K is a number of nearest-neighbor matches considered, when fitting a locally affine @@ -3899,17 +4365,64 @@ pub mod ximgproc { } + /// Sparse match interpolation algorithm based on modified piecewise locally-weighted affine + /// estimator called Robust Interpolation method of Correspondences or RIC from [Hu2017](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Hu2017) and Variational + /// and Fast Global Smoother as post-processing filter. The RICInterpolator is a extension of the EdgeAwareInterpolator. + /// Main concept of this extension is an piece-wise affine model based on over-segmentation via SLIC superpixel estimation. + /// The method contains an efficient propagation mechanism to estimate among the pieces-wise models. + pub struct RICInterpolator { + ptr: *mut c_void + } + + opencv_type_boxed! { RICInterpolator } + + impl Drop for RICInterpolator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_RICInterpolator_delete(instance: *mut c_void); } + unsafe { cv_RICInterpolator_delete(self.as_raw_mut_RICInterpolator()) }; + } + } + + unsafe impl Send for RICInterpolator {} + + impl core::AlgorithmTraitConst for RICInterpolator { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for RICInterpolator { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SparseMatchInterpolatorTraitConst for RICInterpolator { + #[inline] fn as_raw_SparseMatchInterpolator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SparseMatchInterpolatorTrait for RICInterpolator { + #[inline] fn as_raw_mut_SparseMatchInterpolator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::RICInterpolatorTraitConst for RICInterpolator { + #[inline] fn as_raw_RICInterpolator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::RICInterpolatorTrait for RICInterpolator { + #[inline] fn as_raw_mut_RICInterpolator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl RICInterpolator { + } + + boxed_cast_base! { RICInterpolator, core::Algorithm, cv_RICInterpolator_to_Algorithm } + /// Constant methods for [crate::ximgproc::RidgeDetectionFilter] - pub trait RidgeDetectionFilterConst: core::AlgorithmTraitConst { + pub trait RidgeDetectionFilterTraitConst: core::AlgorithmTraitConst { fn as_raw_RidgeDetectionFilter(&self) -> *const c_void; } - /// Applies Ridge Detection Filter to an input image. - /// Implements Ridge detection similar to the one in [Mathematica](http://reference.wolfram.com/language/ref/RidgeFilter.html) - /// using the eigen values from the Hessian Matrix of the input image using Sobel Derivatives. - /// Additional refinement can be done using Skeletonization and Binarization. Adapted from [segleafvein](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_segleafvein) and [M_RF](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_M_RF) - pub trait RidgeDetectionFilter: core::AlgorithmTrait + crate::ximgproc::RidgeDetectionFilterConst { + /// Mutable methods for [crate::ximgproc::RidgeDetectionFilter] + pub trait RidgeDetectionFilterTrait: core::AlgorithmTrait + crate::ximgproc::RidgeDetectionFilterTraitConst { fn as_raw_mut_RidgeDetectionFilter(&mut self) -> *mut c_void; /// Apply Ridge detection filter on input image. @@ -3929,7 +4442,43 @@ pub mod ximgproc { } - impl dyn RidgeDetectionFilter + '_ { + /// Applies Ridge Detection Filter to an input image. + /// Implements Ridge detection similar to the one in [Mathematica](http://reference.wolfram.com/language/ref/RidgeFilter.html) + /// using the eigen values from the Hessian Matrix of the input image using Sobel Derivatives. + /// Additional refinement can be done using Skeletonization and Binarization. Adapted from [segleafvein](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_segleafvein) and [M_RF](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_M_RF) + pub struct RidgeDetectionFilter { + ptr: *mut c_void + } + + opencv_type_boxed! { RidgeDetectionFilter } + + impl Drop for RidgeDetectionFilter { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_RidgeDetectionFilter_delete(instance: *mut c_void); } + unsafe { cv_RidgeDetectionFilter_delete(self.as_raw_mut_RidgeDetectionFilter()) }; + } + } + + unsafe impl Send for RidgeDetectionFilter {} + + impl core::AlgorithmTraitConst for RidgeDetectionFilter { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for RidgeDetectionFilter { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::RidgeDetectionFilterTraitConst for RidgeDetectionFilter { + #[inline] fn as_raw_RidgeDetectionFilter(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::RidgeDetectionFilterTrait for RidgeDetectionFilter { + #[inline] fn as_raw_mut_RidgeDetectionFilter(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl RidgeDetectionFilter { /// Create pointer to the Ridge detection filter. /// ## Parameters /// * ddepth: Specifies output image depth. Defualt is CV_32FC1 @@ -3953,31 +4502,27 @@ pub mod ximgproc { /// * delta: 0 /// * border_type: BORDER_DEFAULT #[inline] - pub fn create(ddepth: i32, dx: i32, dy: i32, ksize: i32, out_dtype: i32, scale: f64, delta: f64, border_type: i32) -> Result> { + pub fn create(ddepth: i32, dx: i32, dy: i32, ksize: i32, out_dtype: i32, scale: f64, delta: f64, border_type: i32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_RidgeDetectionFilter_create_int_int_int_int_int_double_double_int(ddepth, dx, dy, ksize, out_dtype, scale, delta, border_type, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } } + + boxed_cast_base! { RidgeDetectionFilter, core::Algorithm, cv_RidgeDetectionFilter_to_Algorithm } + /// Constant methods for [crate::ximgproc::ScanSegment] - pub trait ScanSegmentConst: core::AlgorithmTraitConst { + pub trait ScanSegmentTraitConst: core::AlgorithmTraitConst { fn as_raw_ScanSegment(&self) -> *const c_void; } - /// Class implementing the F-DBSCAN (Accelerated superpixel image segmentation with a parallelized DBSCAN algorithm) superpixels - /// algorithm by Loke SC, et al. [loke2021accelerated](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_loke2021accelerated) for original paper. - /// - /// The algorithm uses a parallelised DBSCAN cluster search that is resistant to noise, competitive in segmentation quality, and faster than - /// existing superpixel segmentation methods. When tested on the Berkeley Segmentation Dataset, the average processing speed is 175 frames/s - /// with a Boundary Recall of 0.797 and an Achievable Segmentation Accuracy of 0.944. The computational complexity is quadratic O(n2) and - /// more suited to smaller images, but can still process a 2MP colour image faster than the SEEDS algorithm in OpenCV. The output is deterministic - /// when the number of processing threads is fixed, and requires the source image to be in Lab colour format. - pub trait ScanSegment: core::AlgorithmTrait + crate::ximgproc::ScanSegmentConst { + /// Mutable methods for [crate::ximgproc::ScanSegment] + pub trait ScanSegmentTrait: core::AlgorithmTrait + crate::ximgproc::ScanSegmentTraitConst { fn as_raw_mut_ScanSegment(&mut self) -> *mut c_void; /// Returns the actual superpixel segmentation from the last image processed using iterate. @@ -4050,15 +4595,59 @@ pub mod ximgproc { } + /// Class implementing the F-DBSCAN (Accelerated superpixel image segmentation with a parallelized DBSCAN algorithm) superpixels + /// algorithm by Loke SC, et al. [loke2021accelerated](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_loke2021accelerated) for original paper. + /// + /// The algorithm uses a parallelised DBSCAN cluster search that is resistant to noise, competitive in segmentation quality, and faster than + /// existing superpixel segmentation methods. When tested on the Berkeley Segmentation Dataset, the average processing speed is 175 frames/s + /// with a Boundary Recall of 0.797 and an Achievable Segmentation Accuracy of 0.944. The computational complexity is quadratic O(n2) and + /// more suited to smaller images, but can still process a 2MP colour image faster than the SEEDS algorithm in OpenCV. The output is deterministic + /// when the number of processing threads is fixed, and requires the source image to be in Lab colour format. + pub struct ScanSegment { + ptr: *mut c_void + } + + opencv_type_boxed! { ScanSegment } + + impl Drop for ScanSegment { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_ScanSegment_delete(instance: *mut c_void); } + unsafe { cv_ScanSegment_delete(self.as_raw_mut_ScanSegment()) }; + } + } + + unsafe impl Send for ScanSegment {} + + impl core::AlgorithmTraitConst for ScanSegment { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for ScanSegment { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::ScanSegmentTraitConst for ScanSegment { + #[inline] fn as_raw_ScanSegment(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::ScanSegmentTrait for ScanSegment { + #[inline] fn as_raw_mut_ScanSegment(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl ScanSegment { + } + + boxed_cast_base! { ScanSegment, core::Algorithm, cv_ScanSegment_to_Algorithm } + /// Constant methods for [crate::ximgproc::SparseMatchInterpolator] - pub trait SparseMatchInterpolatorConst: core::AlgorithmTraitConst { + pub trait SparseMatchInterpolatorTraitConst: core::AlgorithmTraitConst { fn as_raw_SparseMatchInterpolator(&self) -> *const c_void; } - /// Main interface for all filters, that take sparse matches as an - /// input and produce a dense per-pixel matching (optical flow) as an output. - pub trait SparseMatchInterpolator: core::AlgorithmTrait + crate::ximgproc::SparseMatchInterpolatorConst { + /// Mutable methods for [crate::ximgproc::SparseMatchInterpolator] + pub trait SparseMatchInterpolatorTrait: core::AlgorithmTrait + crate::ximgproc::SparseMatchInterpolatorTraitConst { fn as_raw_mut_SparseMatchInterpolator(&mut self) -> *mut c_void; /// Interpolate input sparse matches. @@ -4091,8 +4680,47 @@ pub mod ximgproc { } + /// Main interface for all filters, that take sparse matches as an + /// input and produce a dense per-pixel matching (optical flow) as an output. + pub struct SparseMatchInterpolator { + ptr: *mut c_void + } + + opencv_type_boxed! { SparseMatchInterpolator } + + impl Drop for SparseMatchInterpolator { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SparseMatchInterpolator_delete(instance: *mut c_void); } + unsafe { cv_SparseMatchInterpolator_delete(self.as_raw_mut_SparseMatchInterpolator()) }; + } + } + + unsafe impl Send for SparseMatchInterpolator {} + + impl core::AlgorithmTraitConst for SparseMatchInterpolator { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SparseMatchInterpolator { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SparseMatchInterpolatorTraitConst for SparseMatchInterpolator { + #[inline] fn as_raw_SparseMatchInterpolator(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SparseMatchInterpolatorTrait for SparseMatchInterpolator { + #[inline] fn as_raw_mut_SparseMatchInterpolator(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SparseMatchInterpolator { + } + + boxed_cast_base! { SparseMatchInterpolator, core::Algorithm, cv_SparseMatchInterpolator_to_Algorithm } + /// Constant methods for [crate::ximgproc::StructuredEdgeDetection] - pub trait StructuredEdgeDetectionConst: core::AlgorithmTraitConst { + pub trait StructuredEdgeDetectionTraitConst: core::AlgorithmTraitConst { fn as_raw_StructuredEdgeDetection(&self) -> *const c_void; /// The function detects edges in src and draw them to dst. @@ -4161,28 +4789,66 @@ pub mod ximgproc { } - /// Class implementing edge detection algorithm from [Dollar2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Dollar2013) : - pub trait StructuredEdgeDetection: core::AlgorithmTrait + crate::ximgproc::StructuredEdgeDetectionConst { + /// Mutable methods for [crate::ximgproc::StructuredEdgeDetection] + pub trait StructuredEdgeDetectionTrait: core::AlgorithmTrait + crate::ximgproc::StructuredEdgeDetectionTraitConst { fn as_raw_mut_StructuredEdgeDetection(&mut self) -> *mut c_void; } - /// Constant methods for [crate::ximgproc::SuperpixelLSC] - pub trait SuperpixelLSCConst: core::AlgorithmTraitConst { - fn as_raw_SuperpixelLSC(&self) -> *const c_void; + /// Class implementing edge detection algorithm from [Dollar2013](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Dollar2013) : + pub struct StructuredEdgeDetection { + ptr: *mut c_void + } - /// Calculates the actual amount of superpixels on a given segmentation computed - /// and stored in SuperpixelLSC object. + opencv_type_boxed! { StructuredEdgeDetection } + + impl Drop for StructuredEdgeDetection { #[inline] - fn get_number_of_superpixels(&self) -> Result { - return_send!(via ocvrs_return); - unsafe { sys::cv_ximgproc_SuperpixelLSC_getNumberOfSuperpixels_const(self.as_raw_SuperpixelLSC(), ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_StructuredEdgeDetection_delete(instance: *mut c_void); } + unsafe { cv_StructuredEdgeDetection_delete(self.as_raw_mut_StructuredEdgeDetection()) }; } - - /// Returns the segmentation labeling of the image. + } + + unsafe impl Send for StructuredEdgeDetection {} + + impl core::AlgorithmTraitConst for StructuredEdgeDetection { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for StructuredEdgeDetection { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::StructuredEdgeDetectionTraitConst for StructuredEdgeDetection { + #[inline] fn as_raw_StructuredEdgeDetection(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::StructuredEdgeDetectionTrait for StructuredEdgeDetection { + #[inline] fn as_raw_mut_StructuredEdgeDetection(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl StructuredEdgeDetection { + } + + boxed_cast_base! { StructuredEdgeDetection, core::Algorithm, cv_StructuredEdgeDetection_to_Algorithm } + + /// Constant methods for [crate::ximgproc::SuperpixelLSC] + pub trait SuperpixelLSCTraitConst: core::AlgorithmTraitConst { + fn as_raw_SuperpixelLSC(&self) -> *const c_void; + + /// Calculates the actual amount of superpixels on a given segmentation computed + /// and stored in SuperpixelLSC object. + #[inline] + fn get_number_of_superpixels(&self) -> Result { + return_send!(via ocvrs_return); + unsafe { sys::cv_ximgproc_SuperpixelLSC_getNumberOfSuperpixels_const(self.as_raw_SuperpixelLSC(), ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + /// Returns the segmentation labeling of the image. /// /// Each label represents a superpixel, and each pixel is assigned to one superpixel label. /// @@ -4227,15 +4893,8 @@ pub mod ximgproc { } - /// Class implementing the LSC (Linear Spectral Clustering) superpixels - /// algorithm described in [LiCVPR2015LSC](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LiCVPR2015LSC). - /// - /// LSC (Linear Spectral Clustering) produces compact and uniform superpixels with low - /// computational costs. Basically, a normalized cuts formulation of the superpixel - /// segmentation is adopted based on a similarity metric that measures the color - /// similarity and space proximity between image pixels. LSC is of linear computational - /// complexity and high memory efficiency and is able to preserve global properties of images - pub trait SuperpixelLSC: core::AlgorithmTrait + crate::ximgproc::SuperpixelLSCConst { + /// Mutable methods for [crate::ximgproc::SuperpixelLSC] + pub trait SuperpixelLSCTrait: core::AlgorithmTrait + crate::ximgproc::SuperpixelLSCTraitConst { fn as_raw_mut_SuperpixelLSC(&mut self) -> *mut c_void; /// Calculates the superpixel segmentation on a given image with the initialized @@ -4286,22 +4945,59 @@ pub mod ximgproc { } + /// Class implementing the LSC (Linear Spectral Clustering) superpixels + /// algorithm described in [LiCVPR2015LSC](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_LiCVPR2015LSC). + /// + /// LSC (Linear Spectral Clustering) produces compact and uniform superpixels with low + /// computational costs. Basically, a normalized cuts formulation of the superpixel + /// segmentation is adopted based on a similarity metric that measures the color + /// similarity and space proximity between image pixels. LSC is of linear computational + /// complexity and high memory efficiency and is able to preserve global properties of images + pub struct SuperpixelLSC { + ptr: *mut c_void + } + + opencv_type_boxed! { SuperpixelLSC } + + impl Drop for SuperpixelLSC { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SuperpixelLSC_delete(instance: *mut c_void); } + unsafe { cv_SuperpixelLSC_delete(self.as_raw_mut_SuperpixelLSC()) }; + } + } + + unsafe impl Send for SuperpixelLSC {} + + impl core::AlgorithmTraitConst for SuperpixelLSC { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SuperpixelLSC { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SuperpixelLSCTraitConst for SuperpixelLSC { + #[inline] fn as_raw_SuperpixelLSC(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SuperpixelLSCTrait for SuperpixelLSC { + #[inline] fn as_raw_mut_SuperpixelLSC(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SuperpixelLSC { + } + + boxed_cast_base! { SuperpixelLSC, core::Algorithm, cv_SuperpixelLSC_to_Algorithm } + /// Constant methods for [crate::ximgproc::SuperpixelSEEDS] - pub trait SuperpixelSEEDSConst: core::AlgorithmTraitConst { + pub trait SuperpixelSEEDSTraitConst: core::AlgorithmTraitConst { fn as_raw_SuperpixelSEEDS(&self) -> *const c_void; } - /// Class implementing the SEEDS (Superpixels Extracted via Energy-Driven Sampling) superpixels - /// algorithm described in [VBRV14](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_VBRV14) . - /// - /// The algorithm uses an efficient hill-climbing algorithm to optimize the superpixels' energy - /// function that is based on color histograms and a boundary term, which is optional. The energy - /// function encourages superpixels to be of the same color, and if the boundary term is activated, the - /// superpixels have smooth boundaries and are of similar shape. In practice it starts from a regular - /// grid of superpixels and moves the pixels or blocks of pixels at the boundaries to refine the - /// solution. The algorithm runs in real-time using a single CPU. - pub trait SuperpixelSEEDS: core::AlgorithmTrait + crate::ximgproc::SuperpixelSEEDSConst { + /// Mutable methods for [crate::ximgproc::SuperpixelSEEDS] + pub trait SuperpixelSEEDSTrait: core::AlgorithmTrait + crate::ximgproc::SuperpixelSEEDSTraitConst { fn as_raw_mut_SuperpixelSEEDS(&mut self) -> *mut c_void; /// Calculates the superpixel segmentation on a given image stored in SuperpixelSEEDS object. @@ -4414,8 +5110,54 @@ pub mod ximgproc { } + /// Class implementing the SEEDS (Superpixels Extracted via Energy-Driven Sampling) superpixels + /// algorithm described in [VBRV14](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_VBRV14) . + /// + /// The algorithm uses an efficient hill-climbing algorithm to optimize the superpixels' energy + /// function that is based on color histograms and a boundary term, which is optional. The energy + /// function encourages superpixels to be of the same color, and if the boundary term is activated, the + /// superpixels have smooth boundaries and are of similar shape. In practice it starts from a regular + /// grid of superpixels and moves the pixels or blocks of pixels at the boundaries to refine the + /// solution. The algorithm runs in real-time using a single CPU. + pub struct SuperpixelSEEDS { + ptr: *mut c_void + } + + opencv_type_boxed! { SuperpixelSEEDS } + + impl Drop for SuperpixelSEEDS { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SuperpixelSEEDS_delete(instance: *mut c_void); } + unsafe { cv_SuperpixelSEEDS_delete(self.as_raw_mut_SuperpixelSEEDS()) }; + } + } + + unsafe impl Send for SuperpixelSEEDS {} + + impl core::AlgorithmTraitConst for SuperpixelSEEDS { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SuperpixelSEEDS { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SuperpixelSEEDSTraitConst for SuperpixelSEEDS { + #[inline] fn as_raw_SuperpixelSEEDS(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SuperpixelSEEDSTrait for SuperpixelSEEDS { + #[inline] fn as_raw_mut_SuperpixelSEEDS(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SuperpixelSEEDS { + } + + boxed_cast_base! { SuperpixelSEEDS, core::Algorithm, cv_SuperpixelSEEDS_to_Algorithm } + /// Constant methods for [crate::ximgproc::SuperpixelSLIC] - pub trait SuperpixelSLICConst: core::AlgorithmTraitConst { + pub trait SuperpixelSLICTraitConst: core::AlgorithmTraitConst { fn as_raw_SuperpixelSLIC(&self) -> *const c_void; /// Calculates the actual amount of superpixels on a given segmentation computed @@ -4474,17 +5216,8 @@ pub mod ximgproc { } - /// Class implementing the SLIC (Simple Linear Iterative Clustering) superpixels - /// algorithm described in [Achanta2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Achanta2012). - /// - /// SLIC (Simple Linear Iterative Clustering) clusters pixels using pixel channels and image plane space - /// to efficiently generate compact, nearly uniform superpixels. The simplicity of approach makes it - /// extremely easy to use a lone parameter specifies the number of superpixels and the efficiency of - /// the algorithm makes it very practical. - /// Several optimizations are available for SLIC class: - /// SLICO stands for "Zero parameter SLIC" and it is an optimization of baseline SLIC described in [Achanta2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Achanta2012). - /// MSLIC stands for "Manifold SLIC" and it is an optimization of baseline SLIC described in [Liu_2017_IEEE](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Liu_2017_IEEE). - pub trait SuperpixelSLIC: core::AlgorithmTrait + crate::ximgproc::SuperpixelSLICConst { + /// Mutable methods for [crate::ximgproc::SuperpixelSLIC] + pub trait SuperpixelSLICTrait: core::AlgorithmTrait + crate::ximgproc::SuperpixelSLICTraitConst { fn as_raw_mut_SuperpixelSLIC(&mut self) -> *mut c_void; /// Calculates the superpixel segmentation on a given image with the initialized @@ -4535,15 +5268,61 @@ pub mod ximgproc { } + /// Class implementing the SLIC (Simple Linear Iterative Clustering) superpixels + /// algorithm described in [Achanta2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Achanta2012). + /// + /// SLIC (Simple Linear Iterative Clustering) clusters pixels using pixel channels and image plane space + /// to efficiently generate compact, nearly uniform superpixels. The simplicity of approach makes it + /// extremely easy to use a lone parameter specifies the number of superpixels and the efficiency of + /// the algorithm makes it very practical. + /// Several optimizations are available for SLIC class: + /// SLICO stands for "Zero parameter SLIC" and it is an optimization of baseline SLIC described in [Achanta2012](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Achanta2012). + /// MSLIC stands for "Manifold SLIC" and it is an optimization of baseline SLIC described in [Liu_2017_IEEE](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Liu_2017_IEEE). + pub struct SuperpixelSLIC { + ptr: *mut c_void + } + + opencv_type_boxed! { SuperpixelSLIC } + + impl Drop for SuperpixelSLIC { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SuperpixelSLIC_delete(instance: *mut c_void); } + unsafe { cv_SuperpixelSLIC_delete(self.as_raw_mut_SuperpixelSLIC()) }; + } + } + + unsafe impl Send for SuperpixelSLIC {} + + impl core::AlgorithmTraitConst for SuperpixelSLIC { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SuperpixelSLIC { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SuperpixelSLICTraitConst for SuperpixelSLIC { + #[inline] fn as_raw_SuperpixelSLIC(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SuperpixelSLICTrait for SuperpixelSLIC { + #[inline] fn as_raw_mut_SuperpixelSLIC(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SuperpixelSLIC { + } + + boxed_cast_base! { SuperpixelSLIC, core::Algorithm, cv_SuperpixelSLIC_to_Algorithm } + /// Constant methods for [crate::ximgproc::GraphSegmentation] - pub trait GraphSegmentationConst: core::AlgorithmTraitConst { + pub trait GraphSegmentationTraitConst: core::AlgorithmTraitConst { fn as_raw_GraphSegmentation(&self) -> *const c_void; } - /// Graph Based Segmentation Algorithm. - /// The class implements the algorithm described in [PFF2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_PFF2004) . - pub trait GraphSegmentation: core::AlgorithmTrait + crate::ximgproc::GraphSegmentationConst { + /// Mutable methods for [crate::ximgproc::GraphSegmentation] + pub trait GraphSegmentationTrait: core::AlgorithmTrait + crate::ximgproc::GraphSegmentationTraitConst { fn as_raw_mut_GraphSegmentation(&mut self) -> *mut c_void; /// Segment an image and store output in dst @@ -4617,15 +5396,53 @@ pub mod ximgproc { } + /// Graph Based Segmentation Algorithm. + /// The class implements the algorithm described in [PFF2004](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_PFF2004) . + pub struct GraphSegmentation { + ptr: *mut c_void + } + + opencv_type_boxed! { GraphSegmentation } + + impl Drop for GraphSegmentation { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_GraphSegmentation_delete(instance: *mut c_void); } + unsafe { cv_GraphSegmentation_delete(self.as_raw_mut_GraphSegmentation()) }; + } + } + + unsafe impl Send for GraphSegmentation {} + + impl core::AlgorithmTraitConst for GraphSegmentation { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GraphSegmentation { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::GraphSegmentationTraitConst for GraphSegmentation { + #[inline] fn as_raw_GraphSegmentation(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::GraphSegmentationTrait for GraphSegmentation { + #[inline] fn as_raw_mut_GraphSegmentation(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GraphSegmentation { + } + + boxed_cast_base! { GraphSegmentation, core::Algorithm, cv_GraphSegmentation_to_Algorithm } + /// Constant methods for [crate::ximgproc::SelectiveSearchSegmentation] - pub trait SelectiveSearchSegmentationConst: core::AlgorithmTraitConst { + pub trait SelectiveSearchSegmentationTraitConst: core::AlgorithmTraitConst { fn as_raw_SelectiveSearchSegmentation(&self) -> *const c_void; } - /// Selective search segmentation algorithm - /// The class implements the algorithm described in [uijlings2013selective](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_uijlings2013selective). - pub trait SelectiveSearchSegmentation: core::AlgorithmTrait + crate::ximgproc::SelectiveSearchSegmentationConst { + /// Mutable methods for [crate::ximgproc::SelectiveSearchSegmentation] + pub trait SelectiveSearchSegmentationTrait: core::AlgorithmTrait + crate::ximgproc::SelectiveSearchSegmentationTraitConst { fn as_raw_mut_SelectiveSearchSegmentation(&mut self) -> *mut c_void; /// Set a image used by switch* functions to initialize the class @@ -4723,7 +5540,7 @@ pub mod ximgproc { /// ## Parameters /// * g: The graph segmentation #[inline] - fn add_graph_segmentation(&mut self, mut g: core::Ptr) -> Result<()> { + fn add_graph_segmentation(&mut self, mut g: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_SelectiveSearchSegmentation_addGraphSegmentation_PtrLGraphSegmentationG(self.as_raw_mut_SelectiveSearchSegmentation(), g.as_raw_mut_PtrOfGraphSegmentation(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -4745,7 +5562,7 @@ pub mod ximgproc { /// ## Parameters /// * s: The strategy #[inline] - fn add_strategy(&mut self, mut s: core::Ptr) -> Result<()> { + fn add_strategy(&mut self, mut s: core::Ptr) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_SelectiveSearchSegmentation_addStrategy_PtrLSelectiveSearchSegmentationStrategyG(self.as_raw_mut_SelectiveSearchSegmentation(), s.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -4777,15 +5594,53 @@ pub mod ximgproc { } + /// Selective search segmentation algorithm + /// The class implements the algorithm described in [uijlings2013selective](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_uijlings2013selective). + pub struct SelectiveSearchSegmentation { + ptr: *mut c_void + } + + opencv_type_boxed! { SelectiveSearchSegmentation } + + impl Drop for SelectiveSearchSegmentation { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SelectiveSearchSegmentation_delete(instance: *mut c_void); } + unsafe { cv_SelectiveSearchSegmentation_delete(self.as_raw_mut_SelectiveSearchSegmentation()) }; + } + } + + unsafe impl Send for SelectiveSearchSegmentation {} + + impl core::AlgorithmTraitConst for SelectiveSearchSegmentation { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SelectiveSearchSegmentation { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationTraitConst for SelectiveSearchSegmentation { + #[inline] fn as_raw_SelectiveSearchSegmentation(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationTrait for SelectiveSearchSegmentation { + #[inline] fn as_raw_mut_SelectiveSearchSegmentation(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SelectiveSearchSegmentation { + } + + boxed_cast_base! { SelectiveSearchSegmentation, core::Algorithm, cv_SelectiveSearchSegmentation_to_Algorithm } + /// Constant methods for [crate::ximgproc::SelectiveSearchSegmentationStrategy] - pub trait SelectiveSearchSegmentationStrategyConst: core::AlgorithmTraitConst { + pub trait SelectiveSearchSegmentationStrategyTraitConst: core::AlgorithmTraitConst { fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void; } - /// Strategie for the selective search segmentation algorithm - /// The class implements a generic stragery for the algorithm described in [uijlings2013selective](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_uijlings2013selective). - pub trait SelectiveSearchSegmentationStrategy: core::AlgorithmTrait + crate::ximgproc::SelectiveSearchSegmentationStrategyConst { + /// Mutable methods for [crate::ximgproc::SelectiveSearchSegmentationStrategy] + pub trait SelectiveSearchSegmentationStrategyTrait: core::AlgorithmTrait + crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst { fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void; /// Set a initial image, with a segmentation. @@ -4837,40 +5692,171 @@ pub mod ximgproc { } + /// Strategie for the selective search segmentation algorithm + /// The class implements a generic stragery for the algorithm described in [uijlings2013selective](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_uijlings2013selective). + pub struct SelectiveSearchSegmentationStrategy { + ptr: *mut c_void + } + + opencv_type_boxed! { SelectiveSearchSegmentationStrategy } + + impl Drop for SelectiveSearchSegmentationStrategy { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SelectiveSearchSegmentationStrategy_delete(instance: *mut c_void); } + unsafe { cv_SelectiveSearchSegmentationStrategy_delete(self.as_raw_mut_SelectiveSearchSegmentationStrategy()) }; + } + } + + unsafe impl Send for SelectiveSearchSegmentationStrategy {} + + impl core::AlgorithmTraitConst for SelectiveSearchSegmentationStrategy { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SelectiveSearchSegmentationStrategy { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for SelectiveSearchSegmentationStrategy { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategy { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SelectiveSearchSegmentationStrategy { + } + + boxed_cast_base! { SelectiveSearchSegmentationStrategy, core::Algorithm, cv_SelectiveSearchSegmentationStrategy_to_Algorithm } + /// Constant methods for [crate::ximgproc::SelectiveSearchSegmentationStrategyColor] - pub trait SelectiveSearchSegmentationStrategyColorConst: crate::ximgproc::SelectiveSearchSegmentationStrategyConst { + pub trait SelectiveSearchSegmentationStrategyColorTraitConst: crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst { fn as_raw_SelectiveSearchSegmentationStrategyColor(&self) -> *const c_void; } + /// Mutable methods for [crate::ximgproc::SelectiveSearchSegmentationStrategyColor] + pub trait SelectiveSearchSegmentationStrategyColorTrait: crate::ximgproc::SelectiveSearchSegmentationStrategyColorTraitConst + crate::ximgproc::SelectiveSearchSegmentationStrategyTrait { + fn as_raw_mut_SelectiveSearchSegmentationStrategyColor(&mut self) -> *mut c_void; + + } + /// Color-based strategy for the selective search segmentation algorithm /// The class is implemented from the algorithm described in [uijlings2013selective](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_uijlings2013selective). - pub trait SelectiveSearchSegmentationStrategyColor: crate::ximgproc::SelectiveSearchSegmentationStrategy + crate::ximgproc::SelectiveSearchSegmentationStrategyColorConst { - fn as_raw_mut_SelectiveSearchSegmentationStrategyColor(&mut self) -> *mut c_void; + pub struct SelectiveSearchSegmentationStrategyColor { + ptr: *mut c_void + } + + opencv_type_boxed! { SelectiveSearchSegmentationStrategyColor } + + impl Drop for SelectiveSearchSegmentationStrategyColor { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SelectiveSearchSegmentationStrategyColor_delete(instance: *mut c_void); } + unsafe { cv_SelectiveSearchSegmentationStrategyColor_delete(self.as_raw_mut_SelectiveSearchSegmentationStrategyColor()) }; + } + } + + unsafe impl Send for SelectiveSearchSegmentationStrategyColor {} + + impl core::AlgorithmTraitConst for SelectiveSearchSegmentationStrategyColor { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SelectiveSearchSegmentationStrategyColor { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for SelectiveSearchSegmentationStrategyColor { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategyColor { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.as_raw_mut() } + } + impl crate::ximgproc::SelectiveSearchSegmentationStrategyColorTraitConst for SelectiveSearchSegmentationStrategyColor { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategyColor(&self) -> *const c_void { self.as_raw() } } + impl crate::ximgproc::SelectiveSearchSegmentationStrategyColorTrait for SelectiveSearchSegmentationStrategyColor { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategyColor(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SelectiveSearchSegmentationStrategyColor { + } + + boxed_cast_base! { SelectiveSearchSegmentationStrategyColor, core::Algorithm, cv_SelectiveSearchSegmentationStrategyColor_to_Algorithm } + /// Constant methods for [crate::ximgproc::SelectiveSearchSegmentationStrategyFill] - pub trait SelectiveSearchSegmentationStrategyFillConst: crate::ximgproc::SelectiveSearchSegmentationStrategyConst { + pub trait SelectiveSearchSegmentationStrategyFillTraitConst: crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst { fn as_raw_SelectiveSearchSegmentationStrategyFill(&self) -> *const c_void; } + /// Mutable methods for [crate::ximgproc::SelectiveSearchSegmentationStrategyFill] + pub trait SelectiveSearchSegmentationStrategyFillTrait: crate::ximgproc::SelectiveSearchSegmentationStrategyFillTraitConst + crate::ximgproc::SelectiveSearchSegmentationStrategyTrait { + fn as_raw_mut_SelectiveSearchSegmentationStrategyFill(&mut self) -> *mut c_void; + + } + /// Fill-based strategy for the selective search segmentation algorithm /// The class is implemented from the algorithm described in [uijlings2013selective](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_uijlings2013selective). - pub trait SelectiveSearchSegmentationStrategyFill: crate::ximgproc::SelectiveSearchSegmentationStrategy + crate::ximgproc::SelectiveSearchSegmentationStrategyFillConst { - fn as_raw_mut_SelectiveSearchSegmentationStrategyFill(&mut self) -> *mut c_void; + pub struct SelectiveSearchSegmentationStrategyFill { + ptr: *mut c_void + } + + opencv_type_boxed! { SelectiveSearchSegmentationStrategyFill } + + impl Drop for SelectiveSearchSegmentationStrategyFill { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SelectiveSearchSegmentationStrategyFill_delete(instance: *mut c_void); } + unsafe { cv_SelectiveSearchSegmentationStrategyFill_delete(self.as_raw_mut_SelectiveSearchSegmentationStrategyFill()) }; + } + } + + unsafe impl Send for SelectiveSearchSegmentationStrategyFill {} + + impl core::AlgorithmTraitConst for SelectiveSearchSegmentationStrategyFill { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SelectiveSearchSegmentationStrategyFill { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for SelectiveSearchSegmentationStrategyFill { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategyFill { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyFillTraitConst for SelectiveSearchSegmentationStrategyFill { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategyFill(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyFillTrait for SelectiveSearchSegmentationStrategyFill { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategyFill(&mut self) -> *mut c_void { self.as_raw_mut() } + } + impl SelectiveSearchSegmentationStrategyFill { } + boxed_cast_base! { SelectiveSearchSegmentationStrategyFill, core::Algorithm, cv_SelectiveSearchSegmentationStrategyFill_to_Algorithm } + /// Constant methods for [crate::ximgproc::SelectiveSearchSegmentationStrategyMultiple] - pub trait SelectiveSearchSegmentationStrategyMultipleConst: crate::ximgproc::SelectiveSearchSegmentationStrategyConst { + pub trait SelectiveSearchSegmentationStrategyMultipleTraitConst: crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst { fn as_raw_SelectiveSearchSegmentationStrategyMultiple(&self) -> *const c_void; } - /// Regroup multiple strategies for the selective search segmentation algorithm - pub trait SelectiveSearchSegmentationStrategyMultiple: crate::ximgproc::SelectiveSearchSegmentationStrategy + crate::ximgproc::SelectiveSearchSegmentationStrategyMultipleConst { + /// Mutable methods for [crate::ximgproc::SelectiveSearchSegmentationStrategyMultiple] + pub trait SelectiveSearchSegmentationStrategyMultipleTrait: crate::ximgproc::SelectiveSearchSegmentationStrategyMultipleTraitConst + crate::ximgproc::SelectiveSearchSegmentationStrategyTrait { fn as_raw_mut_SelectiveSearchSegmentationStrategyMultiple(&mut self) -> *mut c_void; /// Add a new sub-strategy @@ -4878,7 +5864,7 @@ pub mod ximgproc { /// * g: The strategy /// * weight: The weight of the strategy #[inline] - fn add_strategy(&mut self, mut g: core::Ptr, weight: f32) -> Result<()> { + fn add_strategy(&mut self, mut g: core::Ptr, weight: f32) -> Result<()> { return_send!(via ocvrs_return); unsafe { sys::cv_ximgproc_segmentation_SelectiveSearchSegmentationStrategyMultiple_addStrategy_PtrLSelectiveSearchSegmentationStrategyG_float(self.as_raw_mut_SelectiveSearchSegmentationStrategyMultiple(), g.as_raw_mut_PtrOfSelectiveSearchSegmentationStrategy(), weight, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); @@ -4898,29 +5884,167 @@ pub mod ximgproc { } + /// Regroup multiple strategies for the selective search segmentation algorithm + pub struct SelectiveSearchSegmentationStrategyMultiple { + ptr: *mut c_void + } + + opencv_type_boxed! { SelectiveSearchSegmentationStrategyMultiple } + + impl Drop for SelectiveSearchSegmentationStrategyMultiple { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SelectiveSearchSegmentationStrategyMultiple_delete(instance: *mut c_void); } + unsafe { cv_SelectiveSearchSegmentationStrategyMultiple_delete(self.as_raw_mut_SelectiveSearchSegmentationStrategyMultiple()) }; + } + } + + unsafe impl Send for SelectiveSearchSegmentationStrategyMultiple {} + + impl core::AlgorithmTraitConst for SelectiveSearchSegmentationStrategyMultiple { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SelectiveSearchSegmentationStrategyMultiple { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for SelectiveSearchSegmentationStrategyMultiple { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategyMultiple { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyMultipleTraitConst for SelectiveSearchSegmentationStrategyMultiple { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategyMultiple(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyMultipleTrait for SelectiveSearchSegmentationStrategyMultiple { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategyMultiple(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SelectiveSearchSegmentationStrategyMultiple { + } + + boxed_cast_base! { SelectiveSearchSegmentationStrategyMultiple, core::Algorithm, cv_SelectiveSearchSegmentationStrategyMultiple_to_Algorithm } + /// Constant methods for [crate::ximgproc::SelectiveSearchSegmentationStrategySize] - pub trait SelectiveSearchSegmentationStrategySizeConst: crate::ximgproc::SelectiveSearchSegmentationStrategyConst { + pub trait SelectiveSearchSegmentationStrategySizeTraitConst: crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst { fn as_raw_SelectiveSearchSegmentationStrategySize(&self) -> *const c_void; } + /// Mutable methods for [crate::ximgproc::SelectiveSearchSegmentationStrategySize] + pub trait SelectiveSearchSegmentationStrategySizeTrait: crate::ximgproc::SelectiveSearchSegmentationStrategySizeTraitConst + crate::ximgproc::SelectiveSearchSegmentationStrategyTrait { + fn as_raw_mut_SelectiveSearchSegmentationStrategySize(&mut self) -> *mut c_void; + + } + /// Size-based strategy for the selective search segmentation algorithm /// The class is implemented from the algorithm described in [uijlings2013selective](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_uijlings2013selective). - pub trait SelectiveSearchSegmentationStrategySize: crate::ximgproc::SelectiveSearchSegmentationStrategy + crate::ximgproc::SelectiveSearchSegmentationStrategySizeConst { - fn as_raw_mut_SelectiveSearchSegmentationStrategySize(&mut self) -> *mut c_void; + pub struct SelectiveSearchSegmentationStrategySize { + ptr: *mut c_void + } + + opencv_type_boxed! { SelectiveSearchSegmentationStrategySize } + impl Drop for SelectiveSearchSegmentationStrategySize { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SelectiveSearchSegmentationStrategySize_delete(instance: *mut c_void); } + unsafe { cv_SelectiveSearchSegmentationStrategySize_delete(self.as_raw_mut_SelectiveSearchSegmentationStrategySize()) }; + } } + unsafe impl Send for SelectiveSearchSegmentationStrategySize {} + + impl core::AlgorithmTraitConst for SelectiveSearchSegmentationStrategySize { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SelectiveSearchSegmentationStrategySize { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for SelectiveSearchSegmentationStrategySize { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategySize { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategySizeTraitConst for SelectiveSearchSegmentationStrategySize { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategySize(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategySizeTrait for SelectiveSearchSegmentationStrategySize { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategySize(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SelectiveSearchSegmentationStrategySize { + } + + boxed_cast_base! { SelectiveSearchSegmentationStrategySize, core::Algorithm, cv_SelectiveSearchSegmentationStrategySize_to_Algorithm } + /// Constant methods for [crate::ximgproc::SelectiveSearchSegmentationStrategyTexture] - pub trait SelectiveSearchSegmentationStrategyTextureConst: crate::ximgproc::SelectiveSearchSegmentationStrategyConst { + pub trait SelectiveSearchSegmentationStrategyTextureTraitConst: crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst { fn as_raw_SelectiveSearchSegmentationStrategyTexture(&self) -> *const c_void; } + /// Mutable methods for [crate::ximgproc::SelectiveSearchSegmentationStrategyTexture] + pub trait SelectiveSearchSegmentationStrategyTextureTrait: crate::ximgproc::SelectiveSearchSegmentationStrategyTextureTraitConst + crate::ximgproc::SelectiveSearchSegmentationStrategyTrait { + fn as_raw_mut_SelectiveSearchSegmentationStrategyTexture(&mut self) -> *mut c_void; + + } + /// Texture-based strategy for the selective search segmentation algorithm /// The class is implemented from the algorithm described in [uijlings2013selective](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_uijlings2013selective). - pub trait SelectiveSearchSegmentationStrategyTexture: crate::ximgproc::SelectiveSearchSegmentationStrategy + crate::ximgproc::SelectiveSearchSegmentationStrategyTextureConst { - fn as_raw_mut_SelectiveSearchSegmentationStrategyTexture(&mut self) -> *mut c_void; + pub struct SelectiveSearchSegmentationStrategyTexture { + ptr: *mut c_void + } + + opencv_type_boxed! { SelectiveSearchSegmentationStrategyTexture } + + impl Drop for SelectiveSearchSegmentationStrategyTexture { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SelectiveSearchSegmentationStrategyTexture_delete(instance: *mut c_void); } + unsafe { cv_SelectiveSearchSegmentationStrategyTexture_delete(self.as_raw_mut_SelectiveSearchSegmentationStrategyTexture()) }; + } + } + + unsafe impl Send for SelectiveSearchSegmentationStrategyTexture {} + + impl core::AlgorithmTraitConst for SelectiveSearchSegmentationStrategyTexture { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + impl core::AlgorithmTrait for SelectiveSearchSegmentationStrategyTexture { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTraitConst for SelectiveSearchSegmentationStrategyTexture { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategy(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTrait for SelectiveSearchSegmentationStrategyTexture { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategy(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTextureTraitConst for SelectiveSearchSegmentationStrategyTexture { + #[inline] fn as_raw_SelectiveSearchSegmentationStrategyTexture(&self) -> *const c_void { self.as_raw() } + } + + impl crate::ximgproc::SelectiveSearchSegmentationStrategyTextureTrait for SelectiveSearchSegmentationStrategyTexture { + #[inline] fn as_raw_mut_SelectiveSearchSegmentationStrategyTexture(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SelectiveSearchSegmentationStrategyTexture { + } + + boxed_cast_base! { SelectiveSearchSegmentationStrategyTexture, core::Algorithm, cv_SelectiveSearchSegmentationStrategyTexture_to_Algorithm } } diff --git a/docs/xobjdetect.rs b/docs/xobjdetect.rs index 9b8b6ec83..217faf4af 100644 --- a/docs/xobjdetect.rs +++ b/docs/xobjdetect.rs @@ -2,11 +2,11 @@ pub mod xobjdetect { //! # Extended object detection use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::WBDetectorConst, super::WBDetector }; + pub use { super::WBDetectorTraitConst, super::WBDetectorTrait }; } /// Constant methods for [crate::xobjdetect::WBDetector] - pub trait WBDetectorConst { + pub trait WBDetectorTraitConst { fn as_raw_WBDetector(&self) -> *const c_void; /// Write detector to FileStorage. @@ -23,8 +23,8 @@ pub mod xobjdetect { } - /// WaldBoost detector - pub trait WBDetector: crate::xobjdetect::WBDetectorConst { + /// Mutable methods for [crate::xobjdetect::WBDetector] + pub trait WBDetectorTrait: crate::xobjdetect::WBDetectorTraitConst { fn as_raw_mut_WBDetector(&mut self) -> *mut c_void; /// Read detector from FileNode. @@ -70,16 +70,42 @@ pub mod xobjdetect { } - impl dyn WBDetector + '_ { + /// WaldBoost detector + pub struct WBDetector { + ptr: *mut c_void + } + + opencv_type_boxed! { WBDetector } + + impl Drop for WBDetector { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_WBDetector_delete(instance: *mut c_void); } + unsafe { cv_WBDetector_delete(self.as_raw_mut_WBDetector()) }; + } + } + + unsafe impl Send for WBDetector {} + + impl crate::xobjdetect::WBDetectorTraitConst for WBDetector { + #[inline] fn as_raw_WBDetector(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xobjdetect::WBDetectorTrait for WBDetector { + #[inline] fn as_raw_mut_WBDetector(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl WBDetector { /// Create instance of WBDetector #[inline] - pub fn create() -> Result> { + pub fn create() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xobjdetect_WBDetector_create(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } - }} + } +} diff --git a/docs/xphoto.rs b/docs/xphoto.rs index 55f461e8f..64b5d6b70 100644 --- a/docs/xphoto.rs +++ b/docs/xphoto.rs @@ -2,7 +2,7 @@ pub mod xphoto { //! # Additional photo processing algorithms use crate::{mod_prelude::*, core, sys, types}; pub mod prelude { - pub use { super::WhiteBalancerConst, super::WhiteBalancer, super::SimpleWBConst, super::SimpleWB, super::GrayworldWBConst, super::GrayworldWB, super::LearningBasedWBConst, super::LearningBasedWB, super::TonemapDurandConst, super::TonemapDurand }; + pub use { super::WhiteBalancerTraitConst, super::WhiteBalancerTrait, super::SimpleWBTraitConst, super::SimpleWBTrait, super::GrayworldWBTraitConst, super::GrayworldWBTrait, super::LearningBasedWBTraitConst, super::LearningBasedWBTrait, super::TonemapDurandTraitConst, super::TonemapDurandTrait }; } /// Execute only first step of the algorithm @@ -240,12 +240,12 @@ pub mod xphoto { /// Creates an instance of GrayworldWB #[inline] - pub fn create_grayworld_wb() -> Result> { + pub fn create_grayworld_wb() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xphoto_createGrayworldWB(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -257,24 +257,24 @@ pub mod xphoto { /// ## C++ default parameters /// * path_to_model: String() #[inline] - pub fn create_learning_based_wb(path_to_model: &str) -> Result> { + pub fn create_learning_based_wb(path_to_model: &str) -> Result> { extern_container_arg!(path_to_model); return_send!(via ocvrs_return); unsafe { sys::cv_xphoto_createLearningBasedWB_const_StringR(path_to_model.opencv_as_extern(), ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } /// Creates an instance of SimpleWB #[inline] - pub fn create_simple_wb() -> Result> { + pub fn create_simple_wb() -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xphoto_createSimpleWB(ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -297,12 +297,12 @@ pub mod xphoto { /// * sigma_color: 2.0f /// * sigma_space: 2.0f #[inline] - pub fn create_tonemap_durand(gamma: f32, contrast: f32, saturation: f32, sigma_color: f32, sigma_space: f32) -> Result> { + pub fn create_tonemap_durand(gamma: f32, contrast: f32, saturation: f32, sigma_color: f32, sigma_space: f32) -> Result> { return_send!(via ocvrs_return); unsafe { sys::cv_xphoto_createTonemapDurand_float_float_float_float_float(gamma, contrast, saturation, sigma_color, sigma_space, ocvrs_return.as_mut_ptr()) }; return_receive!(unsafe ocvrs_return => ret); let ret = ret.into_result()?; - let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; + let ret = unsafe { core::Ptr::::opencv_from_extern(ret) }; Ok(ret) } @@ -390,7 +390,7 @@ pub mod xphoto { } /// Constant methods for [crate::xphoto::GrayworldWB] - pub trait GrayworldWBConst: crate::xphoto::WhiteBalancerConst { + pub trait GrayworldWBTraitConst: crate::xphoto::WhiteBalancerTraitConst { fn as_raw_GrayworldWB(&self) -> *const c_void; /// Maximum saturation for a pixel to be included in the @@ -408,6 +408,25 @@ pub mod xphoto { } + /// Mutable methods for [crate::xphoto::GrayworldWB] + pub trait GrayworldWBTrait: crate::xphoto::GrayworldWBTraitConst + crate::xphoto::WhiteBalancerTrait { + fn as_raw_mut_GrayworldWB(&mut self) -> *mut c_void; + + /// Maximum saturation for a pixel to be included in the + /// gray-world assumption + /// ## See also + /// setSaturationThreshold getSaturationThreshold + #[inline] + fn set_saturation_threshold(&mut self, val: f32) -> Result<()> { + return_send!(via ocvrs_return); + unsafe { sys::cv_xphoto_GrayworldWB_setSaturationThreshold_float(self.as_raw_mut_GrayworldWB(), val, ocvrs_return.as_mut_ptr()) }; + return_receive!(unsafe ocvrs_return => ret); + let ret = ret.into_result()?; + Ok(ret) + } + + } + /// Gray-world white balance algorithm /// /// This algorithm scales the values of pixels based on a @@ -428,26 +447,53 @@ pub mod xphoto { /// white-balancing saturated images. /// /// Currently supports images of type [CV_8UC3] and [CV_16UC3]. - pub trait GrayworldWB: crate::xphoto::GrayworldWBConst + crate::xphoto::WhiteBalancer { - fn as_raw_mut_GrayworldWB(&mut self) -> *mut c_void; + pub struct GrayworldWB { + ptr: *mut c_void + } - /// Maximum saturation for a pixel to be included in the - /// gray-world assumption - /// ## See also - /// setSaturationThreshold getSaturationThreshold + opencv_type_boxed! { GrayworldWB } + + impl Drop for GrayworldWB { #[inline] - fn set_saturation_threshold(&mut self, val: f32) -> Result<()> { - return_send!(via ocvrs_return); - unsafe { sys::cv_xphoto_GrayworldWB_setSaturationThreshold_float(self.as_raw_mut_GrayworldWB(), val, ocvrs_return.as_mut_ptr()) }; - return_receive!(unsafe ocvrs_return => ret); - let ret = ret.into_result()?; - Ok(ret) + fn drop(&mut self) { + extern "C" { fn cv_GrayworldWB_delete(instance: *mut c_void); } + unsafe { cv_GrayworldWB_delete(self.as_raw_mut_GrayworldWB()) }; } - } + unsafe impl Send for GrayworldWB {} + + impl core::AlgorithmTraitConst for GrayworldWB { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for GrayworldWB { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xphoto::WhiteBalancerTraitConst for GrayworldWB { + #[inline] fn as_raw_WhiteBalancer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xphoto::WhiteBalancerTrait for GrayworldWB { + #[inline] fn as_raw_mut_WhiteBalancer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xphoto::GrayworldWBTraitConst for GrayworldWB { + #[inline] fn as_raw_GrayworldWB(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xphoto::GrayworldWBTrait for GrayworldWB { + #[inline] fn as_raw_mut_GrayworldWB(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl GrayworldWB { + } + + boxed_cast_base! { GrayworldWB, core::Algorithm, cv_GrayworldWB_to_Algorithm } + /// Constant methods for [crate::xphoto::LearningBasedWB] - pub trait LearningBasedWBConst: crate::xphoto::WhiteBalancerConst { + pub trait LearningBasedWBTraitConst: crate::xphoto::WhiteBalancerTraitConst { fn as_raw_LearningBasedWB(&self) -> *const c_void; /// Maximum possible value of the input image (e.g. 255 for 8 bit images, @@ -492,20 +538,8 @@ pub mod xphoto { } - /// More sophisticated learning-based automatic white balance algorithm. - /// - /// As [GrayworldWB], this algorithm works by applying different gains to the input - /// image channels, but their computation is a bit more involved compared to the - /// simple gray-world assumption. More details about the algorithm can be found in - /// [Cheng2015](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Cheng2015) . - /// - /// To mask out saturated pixels this function uses only pixels that satisfy the - /// following condition: - /// - /// ![block formula](https://latex.codecogs.com/png.latex?%20%5Cfrac%7B%5Ctextrm%7Bmax%7D%28R%2CG%2CB%29%7D%7B%5Ctexttt%7Brange%5Fmax%5Fval%7D%7D%20%3C%20%5Ctexttt%7Bsaturation%5Fthresh%7D%20) - /// - /// Currently supports images of type [CV_8UC3] and [CV_16UC3]. - pub trait LearningBasedWB: crate::xphoto::LearningBasedWBConst + crate::xphoto::WhiteBalancer { + /// Mutable methods for [crate::xphoto::LearningBasedWB] + pub trait LearningBasedWBTrait: crate::xphoto::LearningBasedWBTraitConst + crate::xphoto::WhiteBalancerTrait { fn as_raw_mut_LearningBasedWB(&mut self) -> *mut c_void; /// Implements the feature extraction part of the algorithm. @@ -575,8 +609,66 @@ pub mod xphoto { } + /// More sophisticated learning-based automatic white balance algorithm. + /// + /// As [GrayworldWB], this algorithm works by applying different gains to the input + /// image channels, but their computation is a bit more involved compared to the + /// simple gray-world assumption. More details about the algorithm can be found in + /// [Cheng2015](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_Cheng2015) . + /// + /// To mask out saturated pixels this function uses only pixels that satisfy the + /// following condition: + /// + /// ![block formula](https://latex.codecogs.com/png.latex?%20%5Cfrac%7B%5Ctextrm%7Bmax%7D%28R%2CG%2CB%29%7D%7B%5Ctexttt%7Brange%5Fmax%5Fval%7D%7D%20%3C%20%5Ctexttt%7Bsaturation%5Fthresh%7D%20) + /// + /// Currently supports images of type [CV_8UC3] and [CV_16UC3]. + pub struct LearningBasedWB { + ptr: *mut c_void + } + + opencv_type_boxed! { LearningBasedWB } + + impl Drop for LearningBasedWB { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_LearningBasedWB_delete(instance: *mut c_void); } + unsafe { cv_LearningBasedWB_delete(self.as_raw_mut_LearningBasedWB()) }; + } + } + + unsafe impl Send for LearningBasedWB {} + + impl core::AlgorithmTraitConst for LearningBasedWB { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for LearningBasedWB { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xphoto::WhiteBalancerTraitConst for LearningBasedWB { + #[inline] fn as_raw_WhiteBalancer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xphoto::WhiteBalancerTrait for LearningBasedWB { + #[inline] fn as_raw_mut_WhiteBalancer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xphoto::LearningBasedWBTraitConst for LearningBasedWB { + #[inline] fn as_raw_LearningBasedWB(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xphoto::LearningBasedWBTrait for LearningBasedWB { + #[inline] fn as_raw_mut_LearningBasedWB(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl LearningBasedWB { + } + + boxed_cast_base! { LearningBasedWB, core::Algorithm, cv_LearningBasedWB_to_Algorithm } + /// Constant methods for [crate::xphoto::SimpleWB] - pub trait SimpleWBConst: crate::xphoto::WhiteBalancerConst { + pub trait SimpleWBTraitConst: crate::xphoto::WhiteBalancerTraitConst { fn as_raw_SimpleWB(&self) -> *const c_void; /// Input image range minimum value @@ -641,10 +733,8 @@ pub mod xphoto { } - /// A simple white balance algorithm that works by independently stretching - /// each of the input image channels to the specified range. For increased robustness - /// it ignores the top and bottom ![inline formula](https://latex.codecogs.com/png.latex?p%5C%25) of pixel values. - pub trait SimpleWB: crate::xphoto::SimpleWBConst + crate::xphoto::WhiteBalancer { + /// Mutable methods for [crate::xphoto::SimpleWB] + pub trait SimpleWBTrait: crate::xphoto::SimpleWBTraitConst + crate::xphoto::WhiteBalancerTrait { fn as_raw_mut_SimpleWB(&mut self) -> *mut c_void; /// Input image range minimum value @@ -709,8 +799,56 @@ pub mod xphoto { } + /// A simple white balance algorithm that works by independently stretching + /// each of the input image channels to the specified range. For increased robustness + /// it ignores the top and bottom ![inline formula](https://latex.codecogs.com/png.latex?p%5C%25) of pixel values. + pub struct SimpleWB { + ptr: *mut c_void + } + + opencv_type_boxed! { SimpleWB } + + impl Drop for SimpleWB { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_SimpleWB_delete(instance: *mut c_void); } + unsafe { cv_SimpleWB_delete(self.as_raw_mut_SimpleWB()) }; + } + } + + unsafe impl Send for SimpleWB {} + + impl core::AlgorithmTraitConst for SimpleWB { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for SimpleWB { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xphoto::WhiteBalancerTraitConst for SimpleWB { + #[inline] fn as_raw_WhiteBalancer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xphoto::WhiteBalancerTrait for SimpleWB { + #[inline] fn as_raw_mut_WhiteBalancer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xphoto::SimpleWBTraitConst for SimpleWB { + #[inline] fn as_raw_SimpleWB(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xphoto::SimpleWBTrait for SimpleWB { + #[inline] fn as_raw_mut_SimpleWB(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl SimpleWB { + } + + boxed_cast_base! { SimpleWB, core::Algorithm, cv_SimpleWB_to_Algorithm } + /// Constant methods for [crate::xphoto::TonemapDurand] - pub trait TonemapDurandConst: crate::photo::TonemapConst { + pub trait TonemapDurandTraitConst: crate::photo::TonemapTraitConst { fn as_raw_TonemapDurand(&self) -> *const c_void; #[inline] @@ -751,15 +889,8 @@ pub mod xphoto { } - /// This algorithm decomposes image into two layers: base layer and detail layer using bilateral filter - /// and compresses contrast of the base layer thus preserving all the details. - /// - /// This implementation uses regular bilateral filter from OpenCV. - /// - /// Saturation enhancement is possible as in cv::TonemapDrago. - /// - /// For more information see [DD02](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_DD02) . - pub trait TonemapDurand: crate::photo::Tonemap + crate::xphoto::TonemapDurandConst { + /// Mutable methods for [crate::xphoto::TonemapDurand] + pub trait TonemapDurandTrait: crate::photo::TonemapTrait + crate::xphoto::TonemapDurandTraitConst { fn as_raw_mut_TonemapDurand(&mut self) -> *mut c_void; #[inline] @@ -800,14 +931,67 @@ pub mod xphoto { } + /// This algorithm decomposes image into two layers: base layer and detail layer using bilateral filter + /// and compresses contrast of the base layer thus preserving all the details. + /// + /// This implementation uses regular bilateral filter from OpenCV. + /// + /// Saturation enhancement is possible as in cv::TonemapDrago. + /// + /// For more information see [DD02](https://docs.opencv.org/4.7.0/d0/de3/citelist.html#CITEREF_DD02) . + pub struct TonemapDurand { + ptr: *mut c_void + } + + opencv_type_boxed! { TonemapDurand } + + impl Drop for TonemapDurand { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_TonemapDurand_delete(instance: *mut c_void); } + unsafe { cv_TonemapDurand_delete(self.as_raw_mut_TonemapDurand()) }; + } + } + + unsafe impl Send for TonemapDurand {} + + impl core::AlgorithmTraitConst for TonemapDurand { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for TonemapDurand { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::photo::TonemapTraitConst for TonemapDurand { + #[inline] fn as_raw_Tonemap(&self) -> *const c_void { self.as_raw() } + } + + impl crate::photo::TonemapTrait for TonemapDurand { + #[inline] fn as_raw_mut_Tonemap(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xphoto::TonemapDurandTraitConst for TonemapDurand { + #[inline] fn as_raw_TonemapDurand(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xphoto::TonemapDurandTrait for TonemapDurand { + #[inline] fn as_raw_mut_TonemapDurand(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl TonemapDurand { + } + + boxed_cast_base! { TonemapDurand, core::Algorithm, cv_TonemapDurand_to_Algorithm } + /// Constant methods for [crate::xphoto::WhiteBalancer] - pub trait WhiteBalancerConst: core::AlgorithmTraitConst { + pub trait WhiteBalancerTraitConst: core::AlgorithmTraitConst { fn as_raw_WhiteBalancer(&self) -> *const c_void; } - /// The base class for auto white balance algorithms. - pub trait WhiteBalancer: core::AlgorithmTrait + crate::xphoto::WhiteBalancerConst { + /// Mutable methods for [crate::xphoto::WhiteBalancer] + pub trait WhiteBalancerTrait: core::AlgorithmTrait + crate::xphoto::WhiteBalancerTraitConst { fn as_raw_mut_WhiteBalancer(&mut self) -> *mut c_void; /// Applies white balancing to the input image @@ -829,4 +1013,42 @@ pub mod xphoto { } } + + /// The base class for auto white balance algorithms. + pub struct WhiteBalancer { + ptr: *mut c_void + } + + opencv_type_boxed! { WhiteBalancer } + + impl Drop for WhiteBalancer { + #[inline] + fn drop(&mut self) { + extern "C" { fn cv_WhiteBalancer_delete(instance: *mut c_void); } + unsafe { cv_WhiteBalancer_delete(self.as_raw_mut_WhiteBalancer()) }; + } + } + + unsafe impl Send for WhiteBalancer {} + + impl core::AlgorithmTraitConst for WhiteBalancer { + #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() } + } + + impl core::AlgorithmTrait for WhiteBalancer { + #[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl crate::xphoto::WhiteBalancerTraitConst for WhiteBalancer { + #[inline] fn as_raw_WhiteBalancer(&self) -> *const c_void { self.as_raw() } + } + + impl crate::xphoto::WhiteBalancerTrait for WhiteBalancer { + #[inline] fn as_raw_mut_WhiteBalancer(&mut self) -> *mut c_void { self.as_raw_mut() } + } + + impl WhiteBalancer { + } + + boxed_cast_base! { WhiteBalancer, core::Algorithm, cv_WhiteBalancer_to_Algorithm } } diff --git a/examples/video_features.rs b/examples/video_features.rs index c42871eff..6adde2b34 100644 --- a/examples/video_features.rs +++ b/examples/video_features.rs @@ -1,4 +1,5 @@ -use opencv::{core, features2d, highgui, imgproc, prelude::*, videoio, Result}; +use opencv::prelude::*; +use opencv::{core, features2d, highgui, imgproc, videoio, Result}; fn main() -> Result<()> { let window = "video capture"; @@ -8,7 +9,7 @@ fn main() -> Result<()> { if !opened { panic!("Unable to open default camera!"); } - let mut orb = ::default()?; + let mut orb = features2d::ORB::default()?; loop { let mut frame = Mat::default(); cam.read(&mut frame)?; diff --git a/src/manual/features2d.rs b/src/manual/features2d.rs index 1c936c961..edb83e655 100644 --- a/src/manual/features2d.rs +++ b/src/manual/features2d.rs @@ -1,8 +1,10 @@ use std::ffi::c_void; -use crate::{features2d::ORB, sys, traits::Boxed, types, Result}; +use crate::features2d::ORB; +use crate::traits::Boxed; +use crate::{sys, types, Result}; -impl dyn ORB + '_ { +impl ORB { #[allow(clippy::should_implement_trait)] pub fn default() -> Result { extern "C" { diff --git a/tests/boxed.rs b/tests/boxed.rs index aaa15feac..eb872e35e 100644 --- a/tests/boxed.rs +++ b/tests/boxed.rs @@ -71,9 +71,9 @@ fn smart_ptr_crate_and_cast_to_base_class() -> Result<()> { let est_ptr = Ptr::new(est); let mut estimator = KeypointBasedMotionEstimator::new(est_ptr.into()).unwrap(); #[cfg(ocvrs_opencv_branch_4)] - let detector_ptr = ::create(10, true, FastFeatureDetector_DetectorType::TYPE_9_16).unwrap(); + let detector_ptr = FastFeatureDetector::create(10, true, FastFeatureDetector_DetectorType::TYPE_9_16).unwrap(); #[cfg(not(ocvrs_opencv_branch_4))] - let detector_ptr = ::create(10, true, 2).unwrap(); + let detector_ptr = FastFeatureDetector::create(10, true, 2).unwrap(); let base_detector_ptr: Ptr = detector_ptr.into(); estimator.set_detector(base_detector_ptr).unwrap(); @@ -84,11 +84,11 @@ fn smart_ptr_crate_and_cast_to_base_class() -> Result<()> { fn smart_ptr_cast_base() -> Result<()> { #![cfg(ocvrs_has_module_features2d)] #[cfg(ocvrs_opencv_branch_4)] - use opencv::features2d::{AKAZE_DescriptorType::DESCRIPTOR_MLDB, KAZE_DiffusivityType::DIFF_PM_G2}; + use opencv::features2d::{AKAZE_DescriptorType::DESCRIPTOR_MLDB, KAZE_DiffusivityType::DIFF_PM_G2, AKAZE}; #[cfg(not(ocvrs_opencv_branch_4))] - use opencv::features2d::{AKAZE_DESCRIPTOR_MLDB as DESCRIPTOR_MLDB, KAZE_DIFF_PM_G2 as DIFF_PM_G2}; + use opencv::features2d::{AKAZE, AKAZE_DESCRIPTOR_MLDB as DESCRIPTOR_MLDB, KAZE_DIFF_PM_G2 as DIFF_PM_G2}; - let d = ::create(DESCRIPTOR_MLDB, 0, 3, 0.001, 4, 4, DIFF_PM_G2)?; + let d = AKAZE::create(DESCRIPTOR_MLDB, 0, 3, 0.001, 4, 4, DIFF_PM_G2)?; assert!(Feature2DTraitConst::empty(&d)?); assert_eq!("Feature2D.AKAZE", Feature2DTraitConst::get_default_name(&d)?); let a = PtrOfFeature2D::from(d); diff --git a/tests/features2d.rs b/tests/features2d.rs index 9bc424975..9becc7247 100644 --- a/tests/features2d.rs +++ b/tests/features2d.rs @@ -2,13 +2,16 @@ use std::path::PathBuf; -use opencv::{core::Size, features2d::ORB, imgcodecs, prelude::*, types::VectorOfKeyPoint, Result}; +use opencv::core::Size; +use opencv::prelude::*; +use opencv::types::VectorOfKeyPoint; +use opencv::{features2d, imgcodecs, Result}; #[test] fn orb() -> Result<()> { let blox_path = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/blox.jpg"); let img = imgcodecs::imread(blox_path.to_str().unwrap(), imgcodecs::IMREAD_COLOR)?; - let mut orb = ::default()?; + let mut orb = features2d::ORB::default()?; let mut kp = VectorOfKeyPoint::new(); let mut des = Mat::default(); orb.detect_and_compute(&img, &Mat::default(), &mut kp, &mut des, false)?; diff --git a/tests/ml.rs b/tests/ml.rs index d4111d572..55b0e274e 100644 --- a/tests/ml.rs +++ b/tests/ml.rs @@ -1,16 +1,13 @@ #![cfg(ocvrs_has_module_ml)] -use opencv::{ - core::{Scalar, Size}, - ml, - prelude::*, - Result, -}; +use opencv::core::{Scalar, Size}; +use opencv::prelude::*; +use opencv::{ml, Result}; #[test] fn knn() -> Result<()> { - let mut knn = ::create()?; - assert!(StatModelConst::empty(&knn)?); + let mut knn = ml::KNearest::create()?; + assert!(ml::StatModelTraitConst::empty(&knn)?); let samp = Mat::new_rows_cols_with_default(1, 1, f32::opencv_type(), Scalar::all(1.))?; let resp = Mat::new_rows_cols_with_default(1, 1, f32::opencv_type(), Scalar::all(2.))?; knn.train(&samp, ml::ROW_SAMPLE, &resp)?;