#[allow(dead_code, clippy::all)]
pub mod wasm {
pub mod cv {
#[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)]
pub mod types {
#[used]
#[doc(hidden)]
static __FORCE_SECTION_REF: fn() =
super::super::super::__link_custom_section_describing_imports;
use super::super::super::_rt;
pub type ErrorResult = _rt::String;
#[repr(C)]
#[derive(Clone, Copy)]
pub struct Size {
pub x: i32,
pub y: i32,
}
impl ::core::fmt::Debug for Size {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Size").field("x", &self.x).field("y", &self.y).finish()
}
}
pub type Point = Size;
#[repr(C)]
#[derive(Clone, Copy)]
pub struct Scalar {
pub val1: f32,
pub val2: f32,
pub val3: f32,
pub val4: f32,
}
impl ::core::fmt::Debug for Scalar {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Scalar").field("val1", &self.val1).field("val2", &self.val2).field("val3", &self.val3).field("val4", &self.val4).finish()
}
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct Rect {
pub min: Size,
pub max: Size,
}
impl ::core::fmt::Debug for Rect {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Rect").field("min", &self.min).field("max", &self.max).finish()
}
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct Rgba {
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}
impl ::core::fmt::Debug for Rgba {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("Rgba").field("r", &self.r).field("g", &self.g).field("b", &self.b).field("a", &self.a).finish()
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum BorderType {
BorderConstant,
BorderReplicate,
BorderReflect,
BorderWrap,
BorderReflect101,
BorderTransparent,
BorderDefault,
BorderIsolated,
}
impl ::core::fmt::Debug for BorderType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
BorderType::BorderConstant => {
f.debug_tuple("BorderType::BorderConstant").finish()
}
BorderType::BorderReplicate => {
f.debug_tuple("BorderType::BorderReplicate").finish()
}
BorderType::BorderReflect => {
f.debug_tuple("BorderType::BorderReflect").finish()
}
BorderType::BorderWrap => {
f.debug_tuple("BorderType::BorderWrap").finish()
}
BorderType::BorderReflect101 => {
f.debug_tuple("BorderType::BorderReflect101").finish()
}
BorderType::BorderTransparent => {
f.debug_tuple("BorderType::BorderTransparent").finish()
}
BorderType::BorderDefault => {
f.debug_tuple("BorderType::BorderDefault").finish()
}
BorderType::BorderIsolated => {
f.debug_tuple("BorderType::BorderIsolated").finish()
}
}
}
}
impl BorderType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> BorderType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => BorderType::BorderConstant,
1 => BorderType::BorderReplicate,
2 => BorderType::BorderReflect,
3 => BorderType::BorderWrap,
4 => BorderType::BorderReflect101,
5 => BorderType::BorderTransparent,
6 => BorderType::BorderDefault,
7 => BorderType::BorderIsolated,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum AdaptiveThresholdType {
AdaptiveThresholdMean,
AdaptiveThresholdGaussian,
}
impl ::core::fmt::Debug for AdaptiveThresholdType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
AdaptiveThresholdType::AdaptiveThresholdMean => {
f.debug_tuple("AdaptiveThresholdType::AdaptiveThresholdMean").finish()
}
AdaptiveThresholdType::AdaptiveThresholdGaussian => {
f.debug_tuple("AdaptiveThresholdType::AdaptiveThresholdGaussian").finish()
}
}
}
}
impl AdaptiveThresholdType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> AdaptiveThresholdType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => AdaptiveThresholdType::AdaptiveThresholdMean,
1 => AdaptiveThresholdType::AdaptiveThresholdGaussian,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum ThresholdType {
ThresholdBinary,
ThresholdBinaryInv,
ThresholdTrunc,
ThresholdToZero,
ThresholdToZeroInv,
ThresholdMask,
ThresholdOtsu,
TthresholdTriangle,
}
impl ::core::fmt::Debug for ThresholdType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
ThresholdType::ThresholdBinary => {
f.debug_tuple("ThresholdType::ThresholdBinary").finish()
}
ThresholdType::ThresholdBinaryInv => {
f.debug_tuple("ThresholdType::ThresholdBinaryInv").finish()
}
ThresholdType::ThresholdTrunc => {
f.debug_tuple("ThresholdType::ThresholdTrunc").finish()
}
ThresholdType::ThresholdToZero => {
f.debug_tuple("ThresholdType::ThresholdToZero").finish()
}
ThresholdType::ThresholdToZeroInv => {
f.debug_tuple("ThresholdType::ThresholdToZeroInv").finish()
}
ThresholdType::ThresholdMask => {
f.debug_tuple("ThresholdType::ThresholdMask").finish()
}
ThresholdType::ThresholdOtsu => {
f.debug_tuple("ThresholdType::ThresholdOtsu").finish()
}
ThresholdType::TthresholdTriangle => {
f.debug_tuple("ThresholdType::TthresholdTriangle").finish()
}
}
}
}
impl ThresholdType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> ThresholdType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => ThresholdType::ThresholdBinary,
1 => ThresholdType::ThresholdBinaryInv,
2 => ThresholdType::ThresholdTrunc,
3 => ThresholdType::ThresholdToZero,
4 => ThresholdType::ThresholdToZeroInv,
5 => ThresholdType::ThresholdMask,
6 => ThresholdType::ThresholdOtsu,
7 => ThresholdType::TthresholdTriangle,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum DataLayoutType {
DataLayoutUnknown,
DataLayoutNd,
DataLayoutNchw,
DataLayoutNcdhw,
DataLayoutNhwc,
DataLayoutNdhwc,
DataLayoutPlanar,
}
impl ::core::fmt::Debug for DataLayoutType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
DataLayoutType::DataLayoutUnknown => {
f.debug_tuple("DataLayoutType::DataLayoutUnknown").finish()
}
DataLayoutType::DataLayoutNd => {
f.debug_tuple("DataLayoutType::DataLayoutNd").finish()
}
DataLayoutType::DataLayoutNchw => {
f.debug_tuple("DataLayoutType::DataLayoutNchw").finish()
}
DataLayoutType::DataLayoutNcdhw => {
f.debug_tuple("DataLayoutType::DataLayoutNcdhw").finish()
}
DataLayoutType::DataLayoutNhwc => {
f.debug_tuple("DataLayoutType::DataLayoutNhwc").finish()
}
DataLayoutType::DataLayoutNdhwc => {
f.debug_tuple("DataLayoutType::DataLayoutNdhwc").finish()
}
DataLayoutType::DataLayoutPlanar => {
f.debug_tuple("DataLayoutType::DataLayoutPlanar").finish()
}
}
}
}
impl DataLayoutType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> DataLayoutType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => DataLayoutType::DataLayoutUnknown,
1 => DataLayoutType::DataLayoutNd,
2 => DataLayoutType::DataLayoutNchw,
3 => DataLayoutType::DataLayoutNcdhw,
4 => DataLayoutType::DataLayoutNhwc,
5 => DataLayoutType::DataLayoutNdhwc,
6 => DataLayoutType::DataLayoutPlanar,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum PaddingModeType {
PaddingModeNull,
PaddingModeCropCenter,
PaddingModeLetterbox,
}
impl ::core::fmt::Debug for PaddingModeType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
PaddingModeType::PaddingModeNull => {
f.debug_tuple("PaddingModeType::PaddingModeNull").finish()
}
PaddingModeType::PaddingModeCropCenter => {
f.debug_tuple("PaddingModeType::PaddingModeCropCenter").finish()
}
PaddingModeType::PaddingModeLetterbox => {
f.debug_tuple("PaddingModeType::PaddingModeLetterbox").finish()
}
}
}
}
impl PaddingModeType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> PaddingModeType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => PaddingModeType::PaddingModeNull,
1 => PaddingModeType::PaddingModeCropCenter,
2 => PaddingModeType::PaddingModeLetterbox,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct BlobParams {
pub scale_factor: f32,
pub size: Size,
pub mean: Scalar,
pub swap_rb: bool,
pub ddepth: u8,
pub data_layout: DataLayoutType,
pub padding_mode: PaddingModeType,
pub border: Scalar,
}
impl ::core::fmt::Debug for BlobParams {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("BlobParams").field("scale-factor", &self.scale_factor).field("size", &self.size).field("mean", &self.mean).field("swap-RB", &self.swap_rb).field("ddepth", &self.ddepth).field("data-layout", &self.data_layout).field("padding-mode", &self.padding_mode).field("border", &self.border).finish()
}
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct MixMaxLocResult {
pub min_val: f32,
pub max_val: f32,
pub min_loc: Size,
pub max_loc: Size,
}
impl ::core::fmt::Debug for MixMaxLocResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("MixMaxLocResult").field("min-val", &self.min_val).field("max-val", &self.max_val).field("min-loc", &self.min_loc).field("max-loc", &self.max_loc).finish()
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum HersheyFontType {
HersheyFontSimplex,
HersheyFontPlain,
HersheyFontDuplex,
HersheyFontComplex,
HersheyFontTriplex,
HersheyFontComplexSmall,
HersheyFontScriptSimplex,
HersheyFontScriptComplex,
HersheyFontItalic,
}
impl ::core::fmt::Debug for HersheyFontType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
HersheyFontType::HersheyFontSimplex => {
f.debug_tuple("HersheyFontType::HersheyFontSimplex").finish()
}
HersheyFontType::HersheyFontPlain => {
f.debug_tuple("HersheyFontType::HersheyFontPlain").finish()
}
HersheyFontType::HersheyFontDuplex => {
f.debug_tuple("HersheyFontType::HersheyFontDuplex").finish()
}
HersheyFontType::HersheyFontComplex => {
f.debug_tuple("HersheyFontType::HersheyFontComplex").finish()
}
HersheyFontType::HersheyFontTriplex => {
f.debug_tuple("HersheyFontType::HersheyFontTriplex").finish()
}
HersheyFontType::HersheyFontComplexSmall => {
f.debug_tuple("HersheyFontType::HersheyFontComplexSmall").finish()
}
HersheyFontType::HersheyFontScriptSimplex => {
f.debug_tuple("HersheyFontType::HersheyFontScriptSimplex").finish()
}
HersheyFontType::HersheyFontScriptComplex => {
f.debug_tuple("HersheyFontType::HersheyFontScriptComplex").finish()
}
HersheyFontType::HersheyFontItalic => {
f.debug_tuple("HersheyFontType::HersheyFontItalic").finish()
}
}
}
}
impl HersheyFontType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> HersheyFontType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => HersheyFontType::HersheyFontSimplex,
1 => HersheyFontType::HersheyFontPlain,
2 => HersheyFontType::HersheyFontDuplex,
3 => HersheyFontType::HersheyFontComplex,
4 => HersheyFontType::HersheyFontTriplex,
5 => HersheyFontType::HersheyFontComplexSmall,
6 => HersheyFontType::HersheyFontScriptSimplex,
7 => HersheyFontType::HersheyFontScriptComplex,
8 => HersheyFontType::HersheyFontItalic,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum InterpolationType {
InterpolationNearest,
InterpolationLinear,
InterpolationCubic,
InterpolationArea,
InterpolationLanczos4,
}
impl ::core::fmt::Debug for InterpolationType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
InterpolationType::InterpolationNearest => {
f.debug_tuple("InterpolationType::InterpolationNearest").finish()
}
InterpolationType::InterpolationLinear => {
f.debug_tuple("InterpolationType::InterpolationLinear").finish()
}
InterpolationType::InterpolationCubic => {
f.debug_tuple("InterpolationType::InterpolationCubic").finish()
}
InterpolationType::InterpolationArea => {
f.debug_tuple("InterpolationType::InterpolationArea").finish()
}
InterpolationType::InterpolationLanczos4 => {
f.debug_tuple("InterpolationType::InterpolationLanczos4").finish()
}
}
}
}
impl InterpolationType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> InterpolationType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => InterpolationType::InterpolationNearest,
1 => InterpolationType::InterpolationLinear,
2 => InterpolationType::InterpolationCubic,
3 => InterpolationType::InterpolationArea,
4 => InterpolationType::InterpolationLanczos4,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum ColorCoversionType {
ColorBgrToBgra,
ColorRgbToRgba,
ColorBgraToBgr,
ColorRgbaToRgb,
ColorBgrToRgba,
ColorRgbToBgra,
ColorRgbaToBgr,
ColorBgraToRgb,
ColorBgrToRgb,
ColorRgbToBgr,
ColorBgraToRgba,
ColorRgbaToBgra,
ColorBgrToGray,
ColorRgbToGray,
ColorGrayToBgr,
ColorGrayToRgb,
ColorGrayToBgra,
ColorGrayToRgba,
ColorBgraToGray,
ColorRgbaToGray,
}
impl ::core::fmt::Debug for ColorCoversionType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
ColorCoversionType::ColorBgrToBgra => {
f.debug_tuple("ColorCoversionType::ColorBgrToBgra").finish()
}
ColorCoversionType::ColorRgbToRgba => {
f.debug_tuple("ColorCoversionType::ColorRgbToRgba").finish()
}
ColorCoversionType::ColorBgraToBgr => {
f.debug_tuple("ColorCoversionType::ColorBgraToBgr").finish()
}
ColorCoversionType::ColorRgbaToRgb => {
f.debug_tuple("ColorCoversionType::ColorRgbaToRgb").finish()
}
ColorCoversionType::ColorBgrToRgba => {
f.debug_tuple("ColorCoversionType::ColorBgrToRgba").finish()
}
ColorCoversionType::ColorRgbToBgra => {
f.debug_tuple("ColorCoversionType::ColorRgbToBgra").finish()
}
ColorCoversionType::ColorRgbaToBgr => {
f.debug_tuple("ColorCoversionType::ColorRgbaToBgr").finish()
}
ColorCoversionType::ColorBgraToRgb => {
f.debug_tuple("ColorCoversionType::ColorBgraToRgb").finish()
}
ColorCoversionType::ColorBgrToRgb => {
f.debug_tuple("ColorCoversionType::ColorBgrToRgb").finish()
}
ColorCoversionType::ColorRgbToBgr => {
f.debug_tuple("ColorCoversionType::ColorRgbToBgr").finish()
}
ColorCoversionType::ColorBgraToRgba => {
f.debug_tuple("ColorCoversionType::ColorBgraToRgba").finish()
}
ColorCoversionType::ColorRgbaToBgra => {
f.debug_tuple("ColorCoversionType::ColorRgbaToBgra").finish()
}
ColorCoversionType::ColorBgrToGray => {
f.debug_tuple("ColorCoversionType::ColorBgrToGray").finish()
}
ColorCoversionType::ColorRgbToGray => {
f.debug_tuple("ColorCoversionType::ColorRgbToGray").finish()
}
ColorCoversionType::ColorGrayToBgr => {
f.debug_tuple("ColorCoversionType::ColorGrayToBgr").finish()
}
ColorCoversionType::ColorGrayToRgb => {
f.debug_tuple("ColorCoversionType::ColorGrayToRgb").finish()
}
ColorCoversionType::ColorGrayToBgra => {
f.debug_tuple("ColorCoversionType::ColorGrayToBgra").finish()
}
ColorCoversionType::ColorGrayToRgba => {
f.debug_tuple("ColorCoversionType::ColorGrayToRgba").finish()
}
ColorCoversionType::ColorBgraToGray => {
f.debug_tuple("ColorCoversionType::ColorBgraToGray").finish()
}
ColorCoversionType::ColorRgbaToGray => {
f.debug_tuple("ColorCoversionType::ColorRgbaToGray").finish()
}
}
}
}
impl ColorCoversionType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> ColorCoversionType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => ColorCoversionType::ColorBgrToBgra,
1 => ColorCoversionType::ColorRgbToRgba,
2 => ColorCoversionType::ColorBgraToBgr,
3 => ColorCoversionType::ColorRgbaToRgb,
4 => ColorCoversionType::ColorBgrToRgba,
5 => ColorCoversionType::ColorRgbToBgra,
6 => ColorCoversionType::ColorRgbaToBgr,
7 => ColorCoversionType::ColorBgraToRgb,
8 => ColorCoversionType::ColorBgrToRgb,
9 => ColorCoversionType::ColorRgbToBgr,
10 => ColorCoversionType::ColorBgraToRgba,
11 => ColorCoversionType::ColorRgbaToBgra,
12 => ColorCoversionType::ColorBgrToGray,
13 => ColorCoversionType::ColorRgbToGray,
14 => ColorCoversionType::ColorGrayToBgr,
15 => ColorCoversionType::ColorGrayToRgb,
16 => ColorCoversionType::ColorGrayToBgra,
17 => ColorCoversionType::ColorGrayToRgba,
18 => ColorCoversionType::ColorBgraToGray,
19 => ColorCoversionType::ColorRgbaToGray,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum MorphShape {
MorphRect,
MorphCross,
MorphEllipse,
}
impl ::core::fmt::Debug for MorphShape {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
MorphShape::MorphRect => {
f.debug_tuple("MorphShape::MorphRect").finish()
}
MorphShape::MorphCross => {
f.debug_tuple("MorphShape::MorphCross").finish()
}
MorphShape::MorphEllipse => {
f.debug_tuple("MorphShape::MorphEllipse").finish()
}
}
}
}
impl MorphShape{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> MorphShape{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => MorphShape::MorphRect,
1 => MorphShape::MorphCross,
2 => MorphShape::MorphEllipse,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct KeyPoint {
pub x: f32,
pub y: f32,
pub size: f32,
pub angle: f32,
pub response: f32,
pub octave: i32,
pub class_id: i32,
}
impl ::core::fmt::Debug for KeyPoint {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("KeyPoint").field("x", &self.x).field("y", &self.y).field("size", &self.size).field("angle", &self.angle).field("response", &self.response).field("octave", &self.octave).field("class-id", &self.class_id).finish()
}
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct DMatch {
pub query_idx: u32,
pub train_idx: u32,
pub img_idx: u32,
pub distance: f64,
}
impl ::core::fmt::Debug for DMatch {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("DMatch").field("query-idx", &self.query_idx).field("train-idx", &self.train_idx).field("img-idx", &self.img_idx).field("distance", &self.distance).finish()
}
}
}
#[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)]
pub mod mat {
#[used]
#[doc(hidden)]
static __FORCE_SECTION_REF: fn() =
super::super::super::__link_custom_section_describing_imports;
use super::super::super::_rt;
pub type ErrorResult = super::super::super::wasm::cv::types::ErrorResult;
pub type MixMaxLocResult = super::super::super::wasm::cv::types::MixMaxLocResult;
pub type Rect = super::super::super::wasm::cv::types::Rect;
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum Mattype {
Cv8u,
Cv8s,
Cv16u,
Cv16s,
Cv32s,
Cv32f,
Cv64f,
}
impl ::core::fmt::Debug for Mattype {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Mattype::Cv8u => {
f.debug_tuple("Mattype::Cv8u").finish()
}
Mattype::Cv8s => {
f.debug_tuple("Mattype::Cv8s").finish()
}
Mattype::Cv16u => {
f.debug_tuple("Mattype::Cv16u").finish()
}
Mattype::Cv16s => {
f.debug_tuple("Mattype::Cv16s").finish()
}
Mattype::Cv32s => {
f.debug_tuple("Mattype::Cv32s").finish()
}
Mattype::Cv32f => {
f.debug_tuple("Mattype::Cv32f").finish()
}
Mattype::Cv64f => {
f.debug_tuple("Mattype::Cv64f").finish()
}
}
}
}
impl Mattype{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> Mattype{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => Mattype::Cv8u,
1 => Mattype::Cv8s,
2 => Mattype::Cv16u,
3 => Mattype::Cv16s,
4 => Mattype::Cv32s,
5 => Mattype::Cv32f,
6 => Mattype::Cv64f,
_ => panic!("invalid enum discriminant"),
}
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct Mat{
handle: _rt::Resource<Mat>,
}
impl Mat{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for Mat{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[resource-drop]mat"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(id: u32,) -> Self{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[constructor]mat"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0(_rt::as_i32(&id));
Mat::from_handle(ret as u32)
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new_with_size(cols: u32,rows: u32,mattype: Mattype,) -> Mat{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[static]mat.new-with-size"]
fn wit_import0(_: i32, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import0(_rt::as_i32(&cols), _rt::as_i32(&rows), mattype.clone() as i32);
Mat::from_handle(ret as u32)
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn clone(&self,) -> Mat{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.clone"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
Mat::from_handle(ret as u32)
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn cols(&self,) -> u32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.cols"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
ret as u32
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn rows(&self,) -> u32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.rows"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
ret as u32
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn region(&self,rect: Rect,) -> Mat{
unsafe {
let super::super::super::wasm::cv::types::Rect{ min:min0, max:max0, } = rect;
let super::super::super::wasm::cv::types::Size{ x:x1, y:y1, } = min0;
let super::super::super::wasm::cv::types::Size{ x:x2, y:y2, } = max0;
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.region"]
fn wit_import3(_: i32, _: i32, _: i32, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: i32, _: i32, _: i32, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import3((self).handle() as i32, _rt::as_i32(x1), _rt::as_i32(y1), _rt::as_i32(x2), _rt::as_i32(y2));
Mat::from_handle(ret as u32)
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn copy_to(&self,dst: &Mat,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.copy-to"]
fn wit_import0(_: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, (dst).handle() as i32);
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn convert_to(&self,mattype: Mattype,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.convert-to"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, mattype.clone() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn convert_to_with_params(&self,mattype: Mattype,alpha: f32,beta: f32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.convert-to-with-params"]
fn wit_import1(_: i32, _: i32, _: f32, _: f32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: f32, _: f32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, mattype.clone() as i32, _rt::as_f32(&alpha), _rt::as_f32(&beta), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn mattype(&self,) -> Mattype{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.mattype"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
Mattype::_lift(ret as u8)
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn size(&self,) -> _rt::Vec::<u32>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 2*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.size"]
fn wit_import1(_: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, ptr0);
let l2 = *ptr0.add(0).cast::<*mut u8>();
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<usize>();
let len4 = l3;
let result5 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4);
result5
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn step(&self,) -> u32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.step"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
ret as u32
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn elemsize(&self,) -> u32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.elemsize"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
ret as u32
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn empty(&self,) -> bool{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.empty"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
_rt::bool_lift(ret as u8)
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_float_at(&self,row: u32,col: u32,) -> f32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-float-at"]
fn wit_import0(_: i32, _: i32, _: i32, ) -> f32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, ) -> f32 { unreachable!() }
let ret = wit_import0((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col));
ret
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_float_at(&self,row: u32,col: u32,val: f32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.set-float-at"]
fn wit_import0(_: i32, _: i32, _: i32, _: f32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: f32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col), _rt::as_f32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_uchar_at(&self,row: u32,col: u32,) -> u8{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-uchar-at"]
fn wit_import0(_: i32, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col));
ret as u8
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_uchar_at(&self,row: u32,col: u32,val: u8,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.set-uchar-at"]
fn wit_import0(_: i32, _: i32, _: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col), _rt::as_i32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_int_at(&self,row: u32,col: u32,) -> i32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-int-at"]
fn wit_import0(_: i32, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col));
ret
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_int_at(&self,row: u32,col: u32,val: i32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.set-int-at"]
fn wit_import0(_: i32, _: i32, _: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col), _rt::as_i32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_float_at3(&self,x: u32,y: u32,z: u32,) -> f32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-float-at3"]
fn wit_import0(_: i32, _: i32, _: i32, _: i32, ) -> f32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: i32, ) -> f32 { unreachable!() }
let ret = wit_import0((self).handle() as i32, _rt::as_i32(&x), _rt::as_i32(&y), _rt::as_i32(&z));
ret
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_float_at3(&self,x: u32,y: u32,z: u32,val: f32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.set-float-at3"]
fn wit_import0(_: i32, _: i32, _: i32, _: i32, _: f32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: i32, _: f32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&x), _rt::as_i32(&y), _rt::as_i32(&z), _rt::as_f32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_uchar_at3(&self,x: u32,y: u32,z: u32,) -> u8{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-uchar-at3"]
fn wit_import0(_: i32, _: i32, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32, _rt::as_i32(&x), _rt::as_i32(&y), _rt::as_i32(&z));
ret as u8
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_uchar_at3(&self,x: u32,y: u32,z: u32,val: u8,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.set-uchar-at3"]
fn wit_import0(_: i32, _: i32, _: i32, _: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&x), _rt::as_i32(&y), _rt::as_i32(&z), _rt::as_i32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_int_at3(&self,x: u32,y: u32,z: u32,) -> i32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-int-at3"]
fn wit_import0(_: i32, _: i32, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32, _rt::as_i32(&x), _rt::as_i32(&y), _rt::as_i32(&z));
ret
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_int_at3(&self,x: u32,y: u32,z: u32,val: i32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.set-int-at3"]
fn wit_import0(_: i32, _: i32, _: i32, _: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, _: i32, _: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&x), _rt::as_i32(&y), _rt::as_i32(&z), _rt::as_i32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_vecb_at(&self,row: u32,col: u32,) -> _rt::Vec::<u8>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 2*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-vecb-at"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col), ptr0);
let l2 = *ptr0.add(0).cast::<*mut u8>();
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<usize>();
let len4 = l3;
let result5 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4);
result5
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_vecf_at(&self,row: u32,col: u32,) -> _rt::Vec::<f32>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 2*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-vecf-at"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col), ptr0);
let l2 = *ptr0.add(0).cast::<*mut u8>();
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<usize>();
let len4 = l3;
let result5 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4);
result5
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_veci_at(&self,row: u32,col: u32,) -> _rt::Vec::<i32>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 2*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 2*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.get-veci-at"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&row), _rt::as_i32(&col), ptr0);
let l2 = *ptr0.add(0).cast::<*mut u8>();
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<usize>();
let len4 = l3;
let result5 = _rt::Vec::from_raw_parts(l2.cast(), len4, len4);
result5
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn add_uchar(&self,val: u8,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.add-uchar"]
fn wit_import0(_: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn subtract_uchar(&self,val: u8,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.subtract-uchar"]
fn wit_import0(_: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn multiply_uchar(&self,val: u8,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.multiply-uchar"]
fn wit_import0(_: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn divide_uchar(&self,val: u8,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.divide-uchar"]
fn wit_import0(_: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn add_float(&self,val: f32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.add-float"]
fn wit_import0(_: i32, _: f32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: f32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_f32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn subtract_float(&self,val: f32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.subtract-float"]
fn wit_import0(_: i32, _: f32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: f32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_f32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn multiply_float(&self,val: f32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.multiply-float"]
fn wit_import0(_: i32, _: f32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: f32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_f32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn divide_float(&self,val: f32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.divide-float"]
fn wit_import0(_: i32, _: f32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: f32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_f32(&val));
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn reshape(&self,channels: u32,rows: u32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.reshape"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&channels), _rt::as_i32(&rows), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn row_range(&self,start: u32,end: u32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.row-range"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&start), _rt::as_i32(&end), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn col_range(&self,start: u32,end: u32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.col-range"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&start), _rt::as_i32(&end), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn min_max_loc(&self,) -> Result<MixMaxLocResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 24+1*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 24+1*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.min-max-loc"]
fn wit_import1(_: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result12 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<f32>();
let l4 = *ptr0.add(4+1*::core::mem::size_of::<*const u8>()).cast::<f32>();
let l5 = *ptr0.add(8+1*::core::mem::size_of::<*const u8>()).cast::<i32>();
let l6 = *ptr0.add(12+1*::core::mem::size_of::<*const u8>()).cast::<i32>();
let l7 = *ptr0.add(16+1*::core::mem::size_of::<*const u8>()).cast::<i32>();
let l8 = *ptr0.add(20+1*::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::types::MixMaxLocResult{
min_val: l3,
max_val: l4,
min_loc: super::super::super::wasm::cv::types::Size{
x: l5,
y: l6,
},
max_loc: super::super::super::wasm::cv::types::Size{
x: l7,
y: l8,
},
}
};
Ok(e)
}
1 => {
let e = {
let l9 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l10 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len11 = l10;
let bytes11 = _rt::Vec::from_raw_parts(l9.cast(), len11, len11);
_rt::string_lift(bytes11)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result12
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn col(&self,col: u32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.col"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&col), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn row(&self,row: u32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[method]mat.row"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&row), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn merge(mv: _rt::Vec::<Mat>,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec0 = &mv;
let len0 = vec0.len();
let layout0 = _rt::alloc::Layout::from_size_align(vec0.len() * 4, 4).unwrap();
let (result0, _cleanup0) = wit_bindgen::rt::Cleanup::new(layout0);for (i, e) in vec0.into_iter().enumerate() {
let base = result0.add(i * 4);
{
*base.add(0).cast::<i32>() = (e).take_handle() as i32;
}
}
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[static]mat.merge"]
fn wit_import2(_: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2(result0, len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn zeros(cols: u32,rows: u32,mattype: Mattype,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[static]mat.zeros"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1(_rt::as_i32(&cols), _rt::as_i32(&rows), mattype.clone() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Mat {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn ones(cols: u32,rows: u32,mattype: Mattype,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/mat")]
unsafe extern "C" {
#[link_name = "[static]mat.ones"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1(_rt::as_i32(&cols), _rt::as_i32(&rows), mattype.clone() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
}
#[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)]
pub mod cv {
#[used]
#[doc(hidden)]
static __FORCE_SECTION_REF: fn() =
super::super::super::__link_custom_section_describing_imports;
use super::super::super::_rt;
pub type ErrorResult = super::super::super::wasm::cv::types::ErrorResult;
pub type BorderType = super::super::super::wasm::cv::types::BorderType;
pub type Size = super::super::super::wasm::cv::types::Size;
pub type Point = super::super::super::wasm::cv::types::Point;
pub type AdaptiveThresholdType = super::super::super::wasm::cv::types::AdaptiveThresholdType;
pub type ThresholdType = super::super::super::wasm::cv::types::ThresholdType;
pub type Rect = super::super::super::wasm::cv::types::Rect;
pub type Rgba = super::super::super::wasm::cv::types::Rgba;
pub type HersheyFontType = super::super::super::wasm::cv::types::HersheyFontType;
pub type InterpolationType = super::super::super::wasm::cv::types::InterpolationType;
pub type ColorCoversionType = super::super::super::wasm::cv::types::ColorCoversionType;
pub type MorphShape = super::super::super::wasm::cv::types::MorphShape;
pub type Mat = super::super::super::wasm::cv::mat::Mat;
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn arrowed_line(img: &Mat,point1: Point,point2: Point,c: Rgba,thickness: u8,) -> Result<(),ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = point1;
let super::super::super::wasm::cv::types::Size{ x:x1, y:y1, } = point2;
let super::super::super::wasm::cv::types::Rgba{ r:r2, g:g2, b:b2, a:a2, } = c;
let ptr3 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "arrowed-line"]
fn wit_import4(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import4(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import4((img).handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0), _rt::as_i32(x1), _rt::as_i32(y1), _rt::as_i32(r2), _rt::as_i32(g2), _rt::as_i32(b2), _rt::as_i32(a2), _rt::as_i32(&thickness), ptr3);
let l5 = i32::from(*ptr3.add(0).cast::<u8>());
let result9 = match l5 {
0 => {
let e = ();
Ok(e)
}
1 => {
let e = {
let l6 = *ptr3.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr3.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn rectangle(img: &Mat,r: Rect,c: Rgba,thickness: u8,) -> Result<(),ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Rect{ min:min0, max:max0, } = r;
let super::super::super::wasm::cv::types::Size{ x:x1, y:y1, } = min0;
let super::super::super::wasm::cv::types::Size{ x:x2, y:y2, } = max0;
let super::super::super::wasm::cv::types::Rgba{ r:r3, g:g3, b:b3, a:a3, } = c;
let ptr4 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "rectangle"]
fn wit_import5(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import5(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import5((img).handle() as i32, _rt::as_i32(x1), _rt::as_i32(y1), _rt::as_i32(x2), _rt::as_i32(y2), _rt::as_i32(r3), _rt::as_i32(g3), _rt::as_i32(b3), _rt::as_i32(a3), _rt::as_i32(&thickness), ptr4);
let l6 = i32::from(*ptr4.add(0).cast::<u8>());
let result10 = match l6 {
0 => {
let e = ();
Ok(e)
}
1 => {
let e = {
let l7 = *ptr4.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l8 = *ptr4.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len9 = l8;
let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9);
_rt::string_lift(bytes9)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result10
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn circle(img: &Mat,center: Point,radius: u32,c: Rgba,thickness: u8,) -> Result<(),ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = center;
let super::super::super::wasm::cv::types::Rgba{ r:r1, g:g1, b:b1, a:a1, } = c;
let ptr2 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "circle"]
fn wit_import3(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import3((img).handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0), _rt::as_i32(&radius), _rt::as_i32(r1), _rt::as_i32(g1), _rt::as_i32(b1), _rt::as_i32(a1), _rt::as_i32(&thickness), ptr2);
let l4 = i32::from(*ptr2.add(0).cast::<u8>());
let result8 = match l4 {
0 => {
let e = ();
Ok(e)
}
1 => {
let e = {
let l5 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn line(img: &Mat,point1: Point,point2: Point,c: Rgba,thickness: u8,) -> Result<(),ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = point1;
let super::super::super::wasm::cv::types::Size{ x:x1, y:y1, } = point2;
let super::super::super::wasm::cv::types::Rgba{ r:r2, g:g2, b:b2, a:a2, } = c;
let ptr3 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "line"]
fn wit_import4(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import4(_: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import4((img).handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0), _rt::as_i32(x1), _rt::as_i32(y1), _rt::as_i32(r2), _rt::as_i32(g2), _rt::as_i32(b2), _rt::as_i32(a2), _rt::as_i32(&thickness), ptr3);
let l5 = i32::from(*ptr3.add(0).cast::<u8>());
let result9 = match l5 {
0 => {
let e = ();
Ok(e)
}
1 => {
let e = {
let l6 = *ptr3.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr3.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn put_text(img: &Mat,text: &str,org: Point,font_face: HersheyFontType,font_scale: f64,c: Rgba,thickness: i32,) -> Result<(),ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec0 = text;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let super::super::super::wasm::cv::types::Size{ x:x1, y:y1, } = org;
let super::super::super::wasm::cv::types::Rgba{ r:r2, g:g2, b:b2, a:a2, } = c;
let ptr3 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "put-text"]
fn wit_import4(_: i32, _: *mut u8, _: usize, _: i32, _: i32, _: i32, _: f64, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import4(_: i32, _: *mut u8, _: usize, _: i32, _: i32, _: i32, _: f64, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import4((img).handle() as i32, ptr0.cast_mut(), len0, _rt::as_i32(x1), _rt::as_i32(y1), font_face.clone() as i32, _rt::as_f64(&font_scale), _rt::as_i32(r2), _rt::as_i32(g2), _rt::as_i32(b2), _rt::as_i32(a2), _rt::as_i32(&thickness), ptr3);
let l5 = i32::from(*ptr3.add(0).cast::<u8>());
let result9 = match l5 {
0 => {
let e = ();
Ok(e)
}
1 => {
let e = {
let l6 = *ptr3.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr3.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn adaptive_threshold(src: Mat,max_value: f32,adaptive_type: AdaptiveThresholdType,threshold_type: ThresholdType,block_size: u32,c: f32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "adaptive-threshold"]
fn wit_import1(_: i32, _: f32, _: i32, _: i32, _: i32, _: f32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: f32, _: i32, _: i32, _: i32, _: f32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_f32(&max_value), adaptive_type.clone() as i32, threshold_type.clone() as i32, _rt::as_i32(&block_size), _rt::as_f32(&c), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn blur(src: Mat,k_size: Size,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = k_size;
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "blur"]
fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import2((&src).take_handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0), ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn box_filter(src: Mat,depth: u32,k_size: Size,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = k_size;
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "box-filter"]
fn wit_import2(_: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import2((&src).take_handle() as i32, _rt::as_i32(&depth), _rt::as_i32(x0), _rt::as_i32(y0), ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn canny(src: Mat,threshold1: f32,threshold2: f32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "canny"]
fn wit_import1(_: i32, _: f32, _: f32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: f32, _: f32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_f32(&threshold1), _rt::as_f32(&threshold2), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn cvt_color(src: Mat,code: ColorCoversionType,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "cvt-color"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, code.clone() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn dilate(src: Mat,kernel: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "dilate"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, (&kernel).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn erode(src: Mat,kernel: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "erode"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, (&kernel).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn equalize_hist(src: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "equalize-hist"]
fn wit_import1(_: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn gaussian_blur(src: Mat,size: Size,sigma_x: f32,sigma_y: f32,border: BorderType,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = size;
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "gaussian-blur"]
fn wit_import2(_: i32, _: i32, _: i32, _: f32, _: f32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: f32, _: f32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import2((&src).take_handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0), _rt::as_f32(&sigma_x), _rt::as_f32(&sigma_y), border.clone() as i32, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_structuring_element(shape: MorphShape,size: Size,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = size;
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "get-structuring-element"]
fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import2(shape.clone() as i32, _rt::as_i32(x0), _rt::as_i32(y0), ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn hough_lines(src: Mat,rho: f64,theta: f64,threshold: i32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "hough-lines"]
fn wit_import1(_: i32, _: f64, _: f64, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: f64, _: f64, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_f64(&rho), _rt::as_f64(&theta), _rt::as_i32(&threshold), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn hough_lines_p(src: Mat,rho: f64,theta: f64,threshold: i32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "hough-lines-p"]
fn wit_import1(_: i32, _: f64, _: f64, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: f64, _: f64, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_f64(&rho), _rt::as_f64(&theta), _rt::as_i32(&threshold), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn median_blur(src: Mat,k_size: Size,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = k_size;
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "median-blur"]
fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import2((&src).take_handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0), ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn resize(src: Mat,size: Size,fx: f32,fy: f32,interp: InterpolationType,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = size;
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "resize"]
fn wit_import2(_: i32, _: i32, _: i32, _: f32, _: f32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: f32, _: f32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import2((&src).take_handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0), _rt::as_f32(&fx), _rt::as_f32(&fy), interp.clone() as i32, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn threshold(src: Mat,thresh: f32,max_value: f32,threshold_type: ThresholdType,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "threshold"]
fn wit_import1(_: i32, _: f32, _: f32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: f32, _: f32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_f32(&thresh), _rt::as_f32(&max_value), threshold_type.clone() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn transpose_nd(src: Mat,order: &[i32],) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec0 = order;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "transpose-ND"]
fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2((&src).take_handle() as i32, ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn estimate_affine2d(frm: Mat,to: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "estimate-affine2d"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&frm).take_handle() as i32, (&to).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn warp_affine(src: Mat,m: Mat,size: Size,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = size;
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "warp-affine"]
fn wit_import2(_: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import2((&src).take_handle() as i32, (&m).take_handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0), ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_rotation_matrix2d(center: Point,angle: f64,scale: f64,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = center;
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "get-rotation-matrix2d"]
fn wit_import2(_: i32, _: i32, _: f64, _: f64, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: f64, _: f64, _: *mut u8, ) { unreachable!() }
wit_import2(_rt::as_i32(x0), _rt::as_i32(y0), _rt::as_f64(&angle), _rt::as_f64(&scale), ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn add(src1: Mat,src2: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "add"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src1).take_handle() as i32, (&src2).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn add_weighted(src1: Mat,alpha: f64,src2: Mat,beta: f64,gamma: f64,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "add-weighted"]
fn wit_import1(_: i32, _: f64, _: i32, _: f64, _: f64, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: f64, _: i32, _: f64, _: f64, _: *mut u8, ) { unreachable!() }
wit_import1((&src1).take_handle() as i32, _rt::as_f64(&alpha), (&src2).take_handle() as i32, _rt::as_f64(&beta), _rt::as_f64(&gamma), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn divide(src1: Mat,src2: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "divide"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src1).take_handle() as i32, (&src2).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn exp(src: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "exp"]
fn wit_import1(_: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn hconcat(src1: Mat,src2: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "hconcat"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src1).take_handle() as i32, (&src2).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn vconcat(src1: Mat,src2: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "vconcat"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src1).take_handle() as i32, (&src2).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn lut(src: Mat,wblut: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "lut"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, (&wblut).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn multiply(src1: Mat,src2: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "multiply"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src1).take_handle() as i32, (&src2).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn reduce(src: Mat,dim: u32,reduce_type: u32,depth_type: u32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "reduce"]
fn wit_import1(_: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_i32(&dim), _rt::as_i32(&reduce_type), _rt::as_i32(&depth_type), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn reduce_arg_max(src: Mat,axis: u32,last_index: bool,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "reduce-arg-max"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_i32(&axis), match &last_index { true => 1, false => 0 }, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn subtract(src1: Mat,src2: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "subtract"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src1).take_handle() as i32, (&src2).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn normalize(src: Mat,alpha: f32,beta: f32,norm_type: u32,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "normalize"]
fn wit_import1(_: i32, _: f32, _: f32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: f32, _: f32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_f32(&alpha), _rt::as_f32(&beta), _rt::as_i32(&norm_type), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn norm(src: Mat,norm_type: u32,) -> Result<f32,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/cv")]
unsafe extern "C" {
#[link_name = "norm"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((&src).take_handle() as i32, _rt::as_i32(&norm_type), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<f32>();
l3
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
#[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)]
pub mod dnn {
#[used]
#[doc(hidden)]
static __FORCE_SECTION_REF: fn() =
super::super::super::__link_custom_section_describing_imports;
use super::super::super::_rt;
pub type Mat = super::super::super::wasm::cv::mat::Mat;
pub type ErrorResult = super::super::super::wasm::cv::types::ErrorResult;
pub type Size = super::super::super::wasm::cv::types::Size;
pub type Scalar = super::super::super::wasm::cv::types::Scalar;
pub type Rect = super::super::super::wasm::cv::types::Rect;
pub type BlobParams = super::super::super::wasm::cv::types::BlobParams;
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum NetBackendType {
NetBackendDefault,
NetBackendHalide,
NetBackendOpenvino,
NetBackendOpencv,
NetBackendVkcom,
NetBackendCuda,
}
impl ::core::fmt::Debug for NetBackendType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
NetBackendType::NetBackendDefault => {
f.debug_tuple("NetBackendType::NetBackendDefault").finish()
}
NetBackendType::NetBackendHalide => {
f.debug_tuple("NetBackendType::NetBackendHalide").finish()
}
NetBackendType::NetBackendOpenvino => {
f.debug_tuple("NetBackendType::NetBackendOpenvino").finish()
}
NetBackendType::NetBackendOpencv => {
f.debug_tuple("NetBackendType::NetBackendOpencv").finish()
}
NetBackendType::NetBackendVkcom => {
f.debug_tuple("NetBackendType::NetBackendVkcom").finish()
}
NetBackendType::NetBackendCuda => {
f.debug_tuple("NetBackendType::NetBackendCuda").finish()
}
}
}
}
impl NetBackendType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> NetBackendType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => NetBackendType::NetBackendDefault,
1 => NetBackendType::NetBackendHalide,
2 => NetBackendType::NetBackendOpenvino,
3 => NetBackendType::NetBackendOpencv,
4 => NetBackendType::NetBackendVkcom,
5 => NetBackendType::NetBackendCuda,
_ => panic!("invalid enum discriminant"),
}
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum NetTargetType {
NetTargetCpu,
NetTargetFp32,
NetTargetFp16,
NetTargetVpu,
NetTargetVulkan,
NetTargetFpga,
NetTargetCuda,
NetTargetCudaFp16,
}
impl ::core::fmt::Debug for NetTargetType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
NetTargetType::NetTargetCpu => {
f.debug_tuple("NetTargetType::NetTargetCpu").finish()
}
NetTargetType::NetTargetFp32 => {
f.debug_tuple("NetTargetType::NetTargetFp32").finish()
}
NetTargetType::NetTargetFp16 => {
f.debug_tuple("NetTargetType::NetTargetFp16").finish()
}
NetTargetType::NetTargetVpu => {
f.debug_tuple("NetTargetType::NetTargetVpu").finish()
}
NetTargetType::NetTargetVulkan => {
f.debug_tuple("NetTargetType::NetTargetVulkan").finish()
}
NetTargetType::NetTargetFpga => {
f.debug_tuple("NetTargetType::NetTargetFpga").finish()
}
NetTargetType::NetTargetCuda => {
f.debug_tuple("NetTargetType::NetTargetCuda").finish()
}
NetTargetType::NetTargetCudaFp16 => {
f.debug_tuple("NetTargetType::NetTargetCudaFp16").finish()
}
}
}
}
impl NetTargetType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> NetTargetType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => NetTargetType::NetTargetCpu,
1 => NetTargetType::NetTargetFp32,
2 => NetTargetType::NetTargetFp16,
3 => NetTargetType::NetTargetVpu,
4 => NetTargetType::NetTargetVulkan,
5 => NetTargetType::NetTargetFpga,
6 => NetTargetType::NetTargetCuda,
7 => NetTargetType::NetTargetCudaFp16,
_ => panic!("invalid enum discriminant"),
}
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct Layer{
handle: _rt::Resource<Layer>,
}
impl Layer{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for Layer{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[resource-drop]layer"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct Net{
handle: _rt::Resource<Net>,
}
impl Net{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for Net{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[resource-drop]net"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
impl Layer {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new() -> Self{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[constructor]layer"]
fn wit_import0() -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0() -> i32 { unreachable!() }
let ret = wit_import0();
Layer::from_handle(ret as u32)
}
}
}
impl Layer {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]layer.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl Layer {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_name(&self,) -> Result<_rt::String,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]layer.get-name"]
fn wit_import1(_: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
let bytes5 = _rt::Vec::from_raw_parts(l3.cast(), len5, len5);
_rt::string_lift(bytes5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn read(model: &str,config: &str,) -> Result<Net,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec0 = model;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let vec1 = config;
let ptr1 = vec1.as_ptr().cast::<u8>();
let len1 = vec1.len();
let ptr2 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[static]net.read"]
fn wit_import3(_: *mut u8, _: usize, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: *mut u8, _: usize, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import3(ptr0.cast_mut(), len0, ptr1.cast_mut(), len1, ptr2);
let l4 = i32::from(*ptr2.add(0).cast::<u8>());
let result9 = match l4 {
0 => {
let e = {
let l5 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Net::from_handle(l5 as u32)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn read_from_onnx(model: &str,) -> Result<Net,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec0 = model;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[static]net.read-from-ONNX"]
fn wit_import2(_: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2(ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Net::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]net.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn empty(&self,) -> bool{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]net.empty"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
_rt::bool_lift(ret as u8)
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_input(&self,input: Mat,name: &str,) -> Result<(),ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]net.set-input"]
fn wit_import2(_: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2((self).handle() as i32, (&input).take_handle() as i32, ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result7 = match l3 {
0 => {
let e = ();
Ok(e)
}
1 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn forward(&self,output_name: &str,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec0 = output_name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]net.forward"]
fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2((self).handle() as i32, ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result8 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l4 as u32)
};
Ok(e)
}
1 => {
let e = {
let l5 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result8
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn forward_layers(&self,output_names: &[_rt::String],) -> Result<_rt::Vec::<Mat>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec1 = output_names;
let len1 = vec1.len();
let layout1 = _rt::alloc::Layout::from_size_align(vec1.len() * (2*::core::mem::size_of::<*const u8>()), ::core::mem::size_of::<*const u8>()).unwrap();
let (result1, _cleanup1) = wit_bindgen::rt::Cleanup::new(layout1);for (i, e) in vec1.into_iter().enumerate() {
let base = result1.add(i * (2*::core::mem::size_of::<*const u8>()));
{
let vec0 = e;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
*base.add(::core::mem::size_of::<*const u8>()).cast::<usize>() = len0;
*base.add(0).cast::<*mut u8>() = ptr0.cast_mut();
}
}
let ptr2 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]net.forward-layers"]
fn wit_import3(_: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import3((self).handle() as i32, result1, len1, ptr2);
let l4 = i32::from(*ptr2.add(0).cast::<u8>());
let result12 = match l4 {
0 => {
let e = {
let l5 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let base8 = l5;
let len8 = l6;
let mut result8 = _rt::Vec::with_capacity(len8);
for i in 0..len8 {
let base = base8.add(i * 4);
let e8 = {
let l7 = *base.add(0).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l7 as u32)
};
result8.push(e8);
}
_rt::cabi_dealloc(base8, len8 * 4, 4);
result8
};
Ok(e)
}
1 => {
let e = {
let l9 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l10 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len11 = l10;
let bytes11 = _rt::Vec::from_raw_parts(l9.cast(), len11, len11);
_rt::string_lift(bytes11)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result12
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_unconnected_out_layers(&self,) -> Result<_rt::Vec::<u32>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]net.get-unconnected-out-layers"]
fn wit_import1(_: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_layer_names(&self,) -> Result<_rt::Vec::<_rt::String>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]net.get-layer-names"]
fn wit_import1(_: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result12 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let base8 = l3;
let len8 = l4;
let mut result8 = _rt::Vec::with_capacity(len8);
for i in 0..len8 {
let base = base8.add(i * (2*::core::mem::size_of::<*const u8>()));
let e8 = {
let l5 = *base.add(0).cast::<*mut u8>();
let l6 = *base.add(::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
let bytes7 = _rt::Vec::from_raw_parts(l5.cast(), len7, len7);
_rt::string_lift(bytes7)
};
result8.push(e8);
}
_rt::cabi_dealloc(base8, len8 * (2*::core::mem::size_of::<*const u8>()), ::core::mem::size_of::<*const u8>());
result8
};
Ok(e)
}
1 => {
let e = {
let l9 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l10 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len11 = l10;
let bytes11 = _rt::Vec::from_raw_parts(l9.cast(), len11, len11);
_rt::string_lift(bytes11)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result12
}
}
}
impl Net {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_layer(&self,id: u32,) -> Result<Layer,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "[method]net.get-layer"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(&id), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
Layer::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn blob_from_image(image: Mat,scale_factor: f32,size: Size,mean: Scalar,swap_rb: bool,crop: bool,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = size;
let super::super::super::wasm::cv::types::Scalar{ val1:val11, val2:val21, val3:val31, val4:val41, } = mean;
let ptr2 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "blob-from-image"]
fn wit_import3(_: i32, _: f32, _: i32, _: i32, _: f32, _: f32, _: f32, _: f32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: i32, _: f32, _: i32, _: i32, _: f32, _: f32, _: f32, _: f32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import3((&image).take_handle() as i32, _rt::as_f32(&scale_factor), _rt::as_i32(x0), _rt::as_i32(y0), _rt::as_f32(val11), _rt::as_f32(val21), _rt::as_f32(val31), _rt::as_f32(val41), match &swap_rb { true => 1, false => 0 }, match &crop { true => 1, false => 0 }, ptr2);
let l4 = i32::from(*ptr2.add(0).cast::<u8>());
let result9 = match l4 {
0 => {
let e = {
let l5 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l5 as u32)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn blob_from_image_with_params(image: Mat,params: BlobParams,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::BlobParams{ scale_factor:scale_factor0, size:size0, mean:mean0, swap_rb:swap_rb0, ddepth:ddepth0, data_layout:data_layout0, padding_mode:padding_mode0, border:border0, } = params;
let super::super::super::wasm::cv::types::Size{ x:x1, y:y1, } = size0;
let super::super::super::wasm::cv::types::Scalar{ val1:val12, val2:val22, val3:val32, val4:val42, } = mean0;
let super::super::super::wasm::cv::types::Scalar{ val1:val13, val2:val23, val3:val33, val4:val43, } = border0;
let ptr4 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "blob-from-image-with-params"]
fn wit_import5(_: i32, _: f32, _: i32, _: i32, _: f32, _: f32, _: f32, _: f32, _: i32, _: i32, _: i32, _: i32, _: f32, _: f32, _: f32, _: f32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import5(_: i32, _: f32, _: i32, _: i32, _: f32, _: f32, _: f32, _: f32, _: i32, _: i32, _: i32, _: i32, _: f32, _: f32, _: f32, _: f32, _: *mut u8, ) { unreachable!() }
wit_import5((&image).take_handle() as i32, _rt::as_f32(scale_factor0), _rt::as_i32(x1), _rt::as_i32(y1), _rt::as_f32(val12), _rt::as_f32(val22), _rt::as_f32(val32), _rt::as_f32(val42), match swap_rb0 { true => 1, false => 0 }, _rt::as_i32(ddepth0), data_layout0.clone() as i32, padding_mode0.clone() as i32, _rt::as_f32(val13), _rt::as_f32(val23), _rt::as_f32(val33), _rt::as_f32(val43), ptr4);
let l6 = i32::from(*ptr4.add(0).cast::<u8>());
let result11 = match l6 {
0 => {
let e = {
let l7 = *ptr4.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l7 as u32)
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr4.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr4.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn blob_rects_to_image_rects(params: BlobParams,blob_rects: &[Rect],image_size: Size,) -> Result<_rt::Vec::<Rect>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 56+2*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 56+2*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();let super::super::super::wasm::cv::types::BlobParams{ scale_factor:scale_factor1, size:size1, mean:mean1, swap_rb:swap_rb1, ddepth:ddepth1, data_layout:data_layout1, padding_mode:padding_mode1, border:border1, } = params;
*ptr0.add(0).cast::<f32>() = _rt::as_f32(scale_factor1);
let super::super::super::wasm::cv::types::Size{ x:x2, y:y2, } = size1;
*ptr0.add(4).cast::<i32>() = _rt::as_i32(x2);
*ptr0.add(8).cast::<i32>() = _rt::as_i32(y2);
let super::super::super::wasm::cv::types::Scalar{ val1:val13, val2:val23, val3:val33, val4:val43, } = mean1;
*ptr0.add(12).cast::<f32>() = _rt::as_f32(val13);
*ptr0.add(16).cast::<f32>() = _rt::as_f32(val23);
*ptr0.add(20).cast::<f32>() = _rt::as_f32(val33);
*ptr0.add(24).cast::<f32>() = _rt::as_f32(val43);
*ptr0.add(28).cast::<u8>() = (match swap_rb1 { true => 1, false => 0 }) as u8;
*ptr0.add(29).cast::<u8>() = (_rt::as_i32(ddepth1)) as u8;
*ptr0.add(30).cast::<u8>() = (data_layout1.clone() as i32) as u8;
*ptr0.add(31).cast::<u8>() = (padding_mode1.clone() as i32) as u8;
let super::super::super::wasm::cv::types::Scalar{ val1:val14, val2:val24, val3:val34, val4:val44, } = border1;
*ptr0.add(32).cast::<f32>() = _rt::as_f32(val14);
*ptr0.add(36).cast::<f32>() = _rt::as_f32(val24);
*ptr0.add(40).cast::<f32>() = _rt::as_f32(val34);
*ptr0.add(44).cast::<f32>() = _rt::as_f32(val44);
let vec5 = blob_rects;
let ptr5 = vec5.as_ptr().cast::<u8>();
let len5 = vec5.len();
*ptr0.add(48+1*::core::mem::size_of::<*const u8>()).cast::<usize>() = len5;
*ptr0.add(48).cast::<*mut u8>() = ptr5.cast_mut();
let super::super::super::wasm::cv::types::Size{ x:x6, y:y6, } = image_size;
*ptr0.add(48+2*::core::mem::size_of::<*const u8>()).cast::<i32>() = _rt::as_i32(x6);
*ptr0.add(52+2*::core::mem::size_of::<*const u8>()).cast::<i32>() = _rt::as_i32(y6);
let ptr7 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "blob-rects-to-image-rects"]
fn wit_import8(_: *mut u8, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import8(_: *mut u8, _: *mut u8, ) { unreachable!() }
wit_import8(ptr0, ptr7);
let l9 = i32::from(*ptr7.add(0).cast::<u8>());
let result16 = match l9 {
0 => {
let e = {
let l10 = *ptr7.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l11 = *ptr7.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len12 = l11;
_rt::Vec::from_raw_parts(l10.cast(), len12, len12)
};
Ok(e)
}
1 => {
let e = {
let l13 = *ptr7.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l14 = *ptr7.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len15 = l14;
let bytes15 = _rt::Vec::from_raw_parts(l13.cast(), len15, len15);
_rt::string_lift(bytes15)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result16
}
}
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn nms_boxes(bboxes: &[Rect],scores: &[f32],score_threshold: f32,nms_threshold: f32,) -> Result<_rt::Vec::<u32>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let vec0 = bboxes;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let vec1 = scores;
let ptr1 = vec1.as_ptr().cast::<u8>();
let len1 = vec1.len();
let ptr2 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/dnn")]
unsafe extern "C" {
#[link_name = "NMS-boxes"]
fn wit_import3(_: *mut u8, _: usize, _: *mut u8, _: usize, _: f32, _: f32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: *mut u8, _: usize, _: *mut u8, _: usize, _: f32, _: f32, _: *mut u8, ) { unreachable!() }
wit_import3(ptr0.cast_mut(), len0, ptr1.cast_mut(), len1, _rt::as_f32(&score_threshold), _rt::as_f32(&nms_threshold), ptr2);
let l4 = i32::from(*ptr2.add(0).cast::<u8>());
let result11 = match l4 {
0 => {
let e = {
let l5 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
_rt::Vec::from_raw_parts(l5.cast(), len7, len7)
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
}
#[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)]
pub mod objdetect {
#[used]
#[doc(hidden)]
static __FORCE_SECTION_REF: fn() =
super::super::super::__link_custom_section_describing_imports;
use super::super::super::_rt;
pub type Mat = super::super::super::wasm::cv::mat::Mat;
pub type ErrorResult = super::super::super::wasm::cv::types::ErrorResult;
pub type Size = super::super::super::wasm::cv::types::Size;
pub type Rect = super::super::super::wasm::cv::types::Rect;
#[derive(Debug)]
#[repr(transparent)]
pub struct CascadeClassifier{
handle: _rt::Resource<CascadeClassifier>,
}
impl CascadeClassifier{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for CascadeClassifier{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[resource-drop]cascade-classifier"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct HogDescriptor{
handle: _rt::Resource<HogDescriptor>,
}
impl HogDescriptor{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for HogDescriptor{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[resource-drop]HOG-descriptor"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct FaceDetectorYn{
handle: _rt::Resource<FaceDetectorYn>,
}
impl FaceDetectorYn{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for FaceDetectorYn{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[resource-drop]face-detector-YN"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum FaceDistanceType {
FaceDistanceTypeCosine,
FaceDistanceNormL2,
}
impl ::core::fmt::Debug for FaceDistanceType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
FaceDistanceType::FaceDistanceTypeCosine => {
f.debug_tuple("FaceDistanceType::FaceDistanceTypeCosine").finish()
}
FaceDistanceType::FaceDistanceNormL2 => {
f.debug_tuple("FaceDistanceType::FaceDistanceNormL2").finish()
}
}
}
}
impl FaceDistanceType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> FaceDistanceType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => FaceDistanceType::FaceDistanceTypeCosine,
1 => FaceDistanceType::FaceDistanceNormL2,
_ => panic!("invalid enum discriminant"),
}
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct FaceRecognizerSf{
handle: _rt::Resource<FaceRecognizerSf>,
}
impl FaceRecognizerSf{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for FaceRecognizerSf{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[resource-drop]face-recognizer-SF"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
impl CascadeClassifier {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[constructor]cascade-classifier"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
CascadeClassifier::from_handle(ret as u32)
}
}
}
impl CascadeClassifier {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]cascade-classifier.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl CascadeClassifier {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn load(&self,file: &str,) -> bool{
unsafe {
let vec0 = file;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]cascade-classifier.load"]
fn wit_import1(_: i32, _: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1((self).handle() as i32, ptr0.cast_mut(), len0);
_rt::bool_lift(ret as u8)
}
}
}
impl CascadeClassifier {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_multi_scale(&self,image: Mat,) -> Result<_rt::Vec::<Rect>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]cascade-classifier.detect-multi-scale"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&image).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl CascadeClassifier {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_multi_scale_with_params(&self,image: Mat,scale: f64,min_neighbors: u32,flags: u32,min_size: Size,max_size: Size,) -> Result<_rt::Vec::<Rect>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = min_size;
let super::super::super::wasm::cv::types::Size{ x:x1, y:y1, } = max_size;
let ptr2 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]cascade-classifier.detect-multi-scale-with-params"]
fn wit_import3(_: i32, _: i32, _: f64, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: i32, _: i32, _: f64, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import3((self).handle() as i32, (&image).take_handle() as i32, _rt::as_f64(&scale), _rt::as_i32(&min_neighbors), _rt::as_i32(&flags), _rt::as_i32(x0), _rt::as_i32(y0), _rt::as_i32(x1), _rt::as_i32(y1), ptr2);
let l4 = i32::from(*ptr2.add(0).cast::<u8>());
let result11 = match l4 {
0 => {
let e = {
let l5 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
_rt::Vec::from_raw_parts(l5.cast(), len7, len7)
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
}
impl HogDescriptor {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[constructor]HOG-descriptor"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
HogDescriptor::from_handle(ret as u32)
}
}
}
impl HogDescriptor {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]HOG-descriptor.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl HogDescriptor {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_multi_scale(&self,image: Mat,) -> Result<_rt::Vec::<Rect>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]HOG-descriptor.detect-multi-scale"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&image).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl HogDescriptor {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_multi_scale_with_params(&self,image: Mat,hit_threshold: f64,win_stride: Size,padding: Size,scale: f64,final_threshold: f64,use_meanshift_grouping: bool,) -> Result<_rt::Vec::<Rect>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = win_stride;
let super::super::super::wasm::cv::types::Size{ x:x1, y:y1, } = padding;
let ptr2 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]HOG-descriptor.detect-multi-scale-with-params"]
fn wit_import3(_: i32, _: i32, _: f64, _: i32, _: i32, _: i32, _: i32, _: f64, _: f64, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: i32, _: i32, _: f64, _: i32, _: i32, _: i32, _: i32, _: f64, _: f64, _: i32, _: *mut u8, ) { unreachable!() }
wit_import3((self).handle() as i32, (&image).take_handle() as i32, _rt::as_f64(&hit_threshold), _rt::as_i32(x0), _rt::as_i32(y0), _rt::as_i32(x1), _rt::as_i32(y1), _rt::as_f64(&scale), _rt::as_f64(&final_threshold), match &use_meanshift_grouping { true => 1, false => 0 }, ptr2);
let l4 = i32::from(*ptr2.add(0).cast::<u8>());
let result11 = match l4 {
0 => {
let e = {
let l5 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l6 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
_rt::Vec::from_raw_parts(l5.cast(), len7, len7)
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr2.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr2.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(model: &str,config: &str,input_size: Size,) -> Self{
unsafe {
let vec0 = model;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let vec1 = config;
let ptr1 = vec1.as_ptr().cast::<u8>();
let len1 = vec1.len();
let super::super::super::wasm::cv::types::Size{ x:x2, y:y2, } = input_size;
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[constructor]face-detector-YN"]
fn wit_import3(_: *mut u8, _: usize, _: *mut u8, _: usize, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: *mut u8, _: usize, _: *mut u8, _: usize, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import3(ptr0.cast_mut(), len0, ptr1.cast_mut(), len1, _rt::as_i32(x2), _rt::as_i32(y2));
FaceDetectorYn::from_handle(ret as u32)
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new_with_params(model: &str,config: &str,input_size: Size,score_threshold: f32,nms_threshold: f32,top_k: u32,backend_id: u32,target_id: u32,) -> FaceDetectorYn{
unsafe {
let vec0 = model;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let vec1 = config;
let ptr1 = vec1.as_ptr().cast::<u8>();
let len1 = vec1.len();
let super::super::super::wasm::cv::types::Size{ x:x2, y:y2, } = input_size;
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[static]face-detector-YN.new-with-params"]
fn wit_import3(_: *mut u8, _: usize, _: *mut u8, _: usize, _: i32, _: i32, _: f32, _: f32, _: i32, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import3(_: *mut u8, _: usize, _: *mut u8, _: usize, _: i32, _: i32, _: f32, _: f32, _: i32, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import3(ptr0.cast_mut(), len0, ptr1.cast_mut(), len1, _rt::as_i32(x2), _rt::as_i32(y2), _rt::as_f32(&score_threshold), _rt::as_f32(&nms_threshold), _rt::as_i32(&top_k), _rt::as_i32(&backend_id), _rt::as_i32(&target_id));
FaceDetectorYn::from_handle(ret as u32)
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect(&self,input: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.detect"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&input).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_input_size(&self,) -> Size{
unsafe {
#[repr(align(4))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 8]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.get-input-size"]
fn wit_import1(_: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, ptr0);
let l2 = *ptr0.add(0).cast::<i32>();
let l3 = *ptr0.add(4).cast::<i32>();
let result4 = super::super::super::wasm::cv::types::Size{
x: l2,
y: l3,
};
result4
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_nms_threshold(&self,) -> f32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.get-nms-threshold"]
fn wit_import0(_: i32, ) -> f32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> f32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
ret
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_score_threshold(&self,) -> f32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.get-score-threshold"]
fn wit_import0(_: i32, ) -> f32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> f32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
ret
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn get_topk(&self,) -> u32{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.get-topk"]
fn wit_import0(_: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) -> i32 { unreachable!() }
let ret = wit_import0((self).handle() as i32);
ret as u32
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_input_size(&self,size: Size,) -> (){
unsafe {
let super::super::super::wasm::cv::types::Size{ x:x0, y:y0, } = size;
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.set-input-size"]
fn wit_import1(_: i32, _: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, ) { unreachable!() }
wit_import1((self).handle() as i32, _rt::as_i32(x0), _rt::as_i32(y0));
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_nms_threshold(&self,threshold: f32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.set-nms-threshold"]
fn wit_import0(_: i32, _: f32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: f32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_f32(&threshold));
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_score_threshold(&self,threshold: f32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.set-score-threshold"]
fn wit_import0(_: i32, _: f32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: f32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_f32(&threshold));
}
}
}
impl FaceDetectorYn {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn set_topk(&self,topk: u32,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-detector-YN.set-topk"]
fn wit_import0(_: i32, _: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, ) { unreachable!() }
wit_import0((self).handle() as i32, _rt::as_i32(&topk));
}
}
}
impl FaceRecognizerSf {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(model: &str,config: &str,) -> Self{
unsafe {
let vec0 = model;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let vec1 = config;
let ptr1 = vec1.as_ptr().cast::<u8>();
let len1 = vec1.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[constructor]face-recognizer-SF"]
fn wit_import2(_: *mut u8, _: usize, _: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: *mut u8, _: usize, _: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import2(ptr0.cast_mut(), len0, ptr1.cast_mut(), len1);
FaceRecognizerSf::from_handle(ret as u32)
}
}
}
impl FaceRecognizerSf {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new_with_params(model: &str,config: &str,backend_id: u32,target_id: u32,) -> FaceRecognizerSf{
unsafe {
let vec0 = model;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let vec1 = config;
let ptr1 = vec1.as_ptr().cast::<u8>();
let len1 = vec1.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[static]face-recognizer-SF.new-with-params"]
fn wit_import2(_: *mut u8, _: usize, _: *mut u8, _: usize, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: *mut u8, _: usize, _: *mut u8, _: usize, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import2(ptr0.cast_mut(), len0, ptr1.cast_mut(), len1, _rt::as_i32(&backend_id), _rt::as_i32(&target_id));
FaceRecognizerSf::from_handle(ret as u32)
}
}
}
impl FaceRecognizerSf {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-recognizer-SF.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl FaceRecognizerSf {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn align_crop(&self,src: Mat,face_box: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-recognizer-SF.align-crop"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, (&face_box).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl FaceRecognizerSf {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn feature(&self,aligned: Mat,) -> Result<Mat,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-recognizer-SF.feature"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&aligned).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<i32>();
super::super::super::wasm::cv::mat::Mat::from_handle(l3 as u32)
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl FaceRecognizerSf {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn match_(&self,face1: Mat,face2: Mat,) -> Result<f32,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-recognizer-SF.match"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&face1).take_handle() as i32, (&face2).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<f32>();
l3
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
impl FaceRecognizerSf {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn match_with_params(&self,face1: Mat,face2: Mat,distance: FaceDistanceType,) -> Result<f32,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/objdetect")]
unsafe extern "C" {
#[link_name = "[method]face-recognizer-SF.match-with-params"]
fn wit_import1(_: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&face1).take_handle() as i32, (&face2).take_handle() as i32, distance.clone() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result7 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<f32>();
l3
};
Ok(e)
}
1 => {
let e = {
let l4 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let bytes6 = _rt::Vec::from_raw_parts(l4.cast(), len6, len6);
_rt::string_lift(bytes6)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result7
}
}
}
}
#[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)]
pub mod features2d {
#[used]
#[doc(hidden)]
static __FORCE_SECTION_REF: fn() =
super::super::super::__link_custom_section_describing_imports;
use super::super::super::_rt;
pub type Mat = super::super::super::wasm::cv::mat::Mat;
pub type ErrorResult = super::super::super::wasm::cv::types::ErrorResult;
pub type KeyPoint = super::super::super::wasm::cv::types::KeyPoint;
pub type DMatch = super::super::super::wasm::cv::types::DMatch;
pub struct DetectorResult {
pub kps: _rt::Vec::<KeyPoint>,
pub desc: Mat,
}
impl ::core::fmt::Debug for DetectorResult {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_struct("DetectorResult").field("kps", &self.kps).field("desc", &self.desc).finish()
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct AkazeDetector{
handle: _rt::Resource<AkazeDetector>,
}
impl AkazeDetector{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for AkazeDetector{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[resource-drop]AKAZE-detector"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct BriskDetector{
handle: _rt::Resource<BriskDetector>,
}
impl BriskDetector{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for BriskDetector{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[resource-drop]BRISK-detector"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct KazeDetector{
handle: _rt::Resource<KazeDetector>,
}
impl KazeDetector{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for KazeDetector{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[resource-drop]KAZE-detector"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum OrbScoreType {
OrbHarris,
OrbFast,
}
impl ::core::fmt::Debug for OrbScoreType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
OrbScoreType::OrbHarris => {
f.debug_tuple("OrbScoreType::OrbHarris").finish()
}
OrbScoreType::OrbFast => {
f.debug_tuple("OrbScoreType::OrbFast").finish()
}
}
}
}
impl OrbScoreType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> OrbScoreType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => OrbScoreType::OrbHarris,
1 => OrbScoreType::OrbFast,
_ => panic!("invalid enum discriminant"),
}
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct OrbDetector{
handle: _rt::Resource<OrbDetector>,
}
impl OrbDetector{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for OrbDetector{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[resource-drop]ORB-detector"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct SiftDetector{
handle: _rt::Resource<SiftDetector>,
}
impl SiftDetector{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for SiftDetector{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[resource-drop]SIFT-detector"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[repr(u8)]
#[derive(Clone, Copy, Eq, Ord, PartialEq, PartialOrd)]
pub enum NormType {
NormNone,
NoneInf,
NormL1,
NormNone2,
NormL2,
NormL2sqr,
NormHamming,
NormHamming2,
NormRelative,
}
impl ::core::fmt::Debug for NormType {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
NormType::NormNone => {
f.debug_tuple("NormType::NormNone").finish()
}
NormType::NoneInf => {
f.debug_tuple("NormType::NoneInf").finish()
}
NormType::NormL1 => {
f.debug_tuple("NormType::NormL1").finish()
}
NormType::NormNone2 => {
f.debug_tuple("NormType::NormNone2").finish()
}
NormType::NormL2 => {
f.debug_tuple("NormType::NormL2").finish()
}
NormType::NormL2sqr => {
f.debug_tuple("NormType::NormL2sqr").finish()
}
NormType::NormHamming => {
f.debug_tuple("NormType::NormHamming").finish()
}
NormType::NormHamming2 => {
f.debug_tuple("NormType::NormHamming2").finish()
}
NormType::NormRelative => {
f.debug_tuple("NormType::NormRelative").finish()
}
}
}
}
impl NormType{
#[doc(hidden)]
pub unsafe fn _lift(val: u8) -> NormType{
if !cfg!(debug_assertions) {
return unsafe { ::core::mem::transmute(val) };
}
match val {
0 => NormType::NormNone,
1 => NormType::NoneInf,
2 => NormType::NormL1,
3 => NormType::NormNone2,
4 => NormType::NormL2,
5 => NormType::NormL2sqr,
6 => NormType::NormHamming,
7 => NormType::NormHamming2,
8 => NormType::NormRelative,
_ => panic!("invalid enum discriminant"),
}
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct BfMatcher{
handle: _rt::Resource<BfMatcher>,
}
impl BfMatcher{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for BfMatcher{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[resource-drop]BF-matcher"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
#[derive(Debug)]
#[repr(transparent)]
pub struct FlannBasedMatcher{
handle: _rt::Resource<FlannBasedMatcher>,
}
impl FlannBasedMatcher{
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
Self {
handle: unsafe { _rt::Resource::from_handle(handle) },
}
}
#[doc(hidden)]
pub fn take_handle(&self) -> u32 {
_rt::Resource::take_handle(&self.handle)
}
#[doc(hidden)]
pub fn handle(&self) -> u32 {
_rt::Resource::handle(&self.handle)
}
}
unsafe impl _rt::WasmResource for FlannBasedMatcher{
#[inline]
unsafe fn drop(_handle: u32) {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[resource-drop]flann-based-matcher"]
fn drop(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn drop(_: i32, ) { unreachable!() }
unsafe { drop(_handle as i32); }
}
}
impl AkazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[constructor]AKAZE-detector"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
AkazeDetector::from_handle(ret as u32)
}
}
}
impl AkazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]AKAZE-detector.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl AkazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect(&self,src: Mat,) -> Result<_rt::Vec::<KeyPoint>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]AKAZE-detector.detect"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl AkazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn compute(&self,src: Mat,mask: Mat,kps: &[KeyPoint],) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let vec0 = kps;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]AKAZE-detector.compute"]
fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result11 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let l7 = *ptr1.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l4.cast(), len6, len6),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l7 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
}
impl AkazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_and_compute(&self,src: Mat,mask: Mat,) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]AKAZE-detector.detect-and-compute"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result10 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
let l6 = *ptr0.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l3.cast(), len5, len5),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l6 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l7 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l8 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len9 = l8;
let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9);
_rt::string_lift(bytes9)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result10
}
}
}
impl BriskDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[constructor]BRISK-detector"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
BriskDetector::from_handle(ret as u32)
}
}
}
impl BriskDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]BRISK-detector.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl BriskDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect(&self,src: Mat,) -> Result<_rt::Vec::<KeyPoint>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]BRISK-detector.detect"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl BriskDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn compute(&self,src: Mat,mask: Mat,kps: &[KeyPoint],) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let vec0 = kps;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]BRISK-detector.compute"]
fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result11 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let l7 = *ptr1.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l4.cast(), len6, len6),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l7 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
}
impl BriskDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_and_compute(&self,src: Mat,mask: Mat,) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]BRISK-detector.detect-and-compute"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result10 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
let l6 = *ptr0.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l3.cast(), len5, len5),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l6 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l7 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l8 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len9 = l8;
let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9);
_rt::string_lift(bytes9)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result10
}
}
}
impl KazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[constructor]KAZE-detector"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
KazeDetector::from_handle(ret as u32)
}
}
}
impl KazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]KAZE-detector.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl KazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect(&self,src: Mat,) -> Result<_rt::Vec::<KeyPoint>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]KAZE-detector.detect"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl KazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn compute(&self,src: Mat,mask: Mat,kps: &[KeyPoint],) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let vec0 = kps;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]KAZE-detector.compute"]
fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result11 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let l7 = *ptr1.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l4.cast(), len6, len6),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l7 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
}
impl KazeDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_and_compute(&self,src: Mat,mask: Mat,) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]KAZE-detector.detect-and-compute"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result10 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
let l6 = *ptr0.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l3.cast(), len5, len5),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l6 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l7 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l8 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len9 = l8;
let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9);
_rt::string_lift(bytes9)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result10
}
}
}
impl OrbDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[constructor]ORB-detector"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
OrbDetector::from_handle(ret as u32)
}
}
}
impl OrbDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new_with_params(features: u32,scale: f32,levels: u32,edge_threshold: u32,first: u32,wtak: u32,score_type: OrbScoreType,patch_size: u32,fast_threshold: u32,) -> OrbDetector{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[static]ORB-detector.new-with-params"]
fn wit_import0(_: i32, _: f32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: f32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import0(_rt::as_i32(&features), _rt::as_f32(&scale), _rt::as_i32(&levels), _rt::as_i32(&edge_threshold), _rt::as_i32(&first), _rt::as_i32(&wtak), score_type.clone() as i32, _rt::as_i32(&patch_size), _rt::as_i32(&fast_threshold));
OrbDetector::from_handle(ret as u32)
}
}
}
impl OrbDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]ORB-detector.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl OrbDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect(&self,src: Mat,) -> Result<_rt::Vec::<KeyPoint>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]ORB-detector.detect"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl OrbDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn compute(&self,src: Mat,mask: Mat,kps: &[KeyPoint],) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let vec0 = kps;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]ORB-detector.compute"]
fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result11 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let l7 = *ptr1.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l4.cast(), len6, len6),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l7 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
}
impl OrbDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_and_compute(&self,src: Mat,mask: Mat,) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]ORB-detector.detect-and-compute"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result10 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
let l6 = *ptr0.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l3.cast(), len5, len5),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l6 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l7 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l8 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len9 = l8;
let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9);
_rt::string_lift(bytes9)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result10
}
}
}
impl SiftDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[constructor]SIFT-detector"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
SiftDetector::from_handle(ret as u32)
}
}
}
impl SiftDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]SIFT-detector.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl SiftDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect(&self,src: Mat,) -> Result<_rt::Vec::<KeyPoint>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]SIFT-detector.detect"]
fn wit_import1(_: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl SiftDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn compute(&self,src: Mat,mask: Mat,kps: &[KeyPoint],) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let vec0 = kps;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
let ptr1 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]SIFT-detector.compute"]
fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import2(_: i32, _: i32, _: i32, _: *mut u8, _: usize, _: *mut u8, ) { unreachable!() }
wit_import2((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0.cast_mut(), len0, ptr1);
let l3 = i32::from(*ptr1.add(0).cast::<u8>());
let result11 = match l3 {
0 => {
let e = {
let l4 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l5 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len6 = l5;
let l7 = *ptr1.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l4.cast(), len6, len6),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l7 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l8 = *ptr1.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l9 = *ptr1.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len10 = l9;
let bytes10 = _rt::Vec::from_raw_parts(l8.cast(), len10, len10);
_rt::string_lift(bytes10)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result11
}
}
}
impl SiftDetector {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn detect_and_compute(&self,src: Mat,mask: Mat,) -> Result<DetectorResult,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 4*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 4*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]SIFT-detector.detect-and-compute"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&src).take_handle() as i32, (&mask).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result10 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
let l6 = *ptr0.add(3*::core::mem::size_of::<*const u8>()).cast::<i32>();
DetectorResult{
kps: _rt::Vec::from_raw_parts(l3.cast(), len5, len5),
desc: super::super::super::wasm::cv::mat::Mat::from_handle(l6 as u32),
}
};
Ok(e)
}
1 => {
let e = {
let l7 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l8 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len9 = l8;
let bytes9 = _rt::Vec::from_raw_parts(l7.cast(), len9, len9);
_rt::string_lift(bytes9)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result10
}
}
}
impl BfMatcher {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[constructor]BF-matcher"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
BfMatcher::from_handle(ret as u32)
}
}
}
impl BfMatcher {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new_with_params(norm: NormType,cross_check: bool,) -> BfMatcher{
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[static]BF-matcher.new-with-params"]
fn wit_import0(_: i32, _: i32, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, _: i32, ) -> i32 { unreachable!() }
let ret = wit_import0(norm.clone() as i32, match &cross_check { true => 1, false => 0 });
BfMatcher::from_handle(ret as u32)
}
}
}
impl BfMatcher {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]BF-matcher.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl BfMatcher {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn match_(&self,query: Mat,train: Mat,) -> Result<_rt::Vec::<DMatch>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]BF-matcher.match"]
fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&query).take_handle() as i32, (&train).take_handle() as i32, ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result9 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len5 = l4;
_rt::Vec::from_raw_parts(l3.cast(), len5, len5)
};
Ok(e)
}
1 => {
let e = {
let l6 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l7 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len8 = l7;
let bytes8 = _rt::Vec::from_raw_parts(l6.cast(), len8, len8);
_rt::string_lift(bytes8)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result9
}
}
}
impl BfMatcher {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn knn_match(&self,query: Mat,train: Mat,k: u32,) -> Result<_rt::Vec::<_rt::Vec::<DMatch>>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]BF-matcher.KNN-match"]
fn wit_import1(_: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&query).take_handle() as i32, (&train).take_handle() as i32, _rt::as_i32(&k), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result12 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let base8 = l3;
let len8 = l4;
let mut result8 = _rt::Vec::with_capacity(len8);
for i in 0..len8 {
let base = base8.add(i * (2*::core::mem::size_of::<*const u8>()));
let e8 = {
let l5 = *base.add(0).cast::<*mut u8>();
let l6 = *base.add(::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
_rt::Vec::from_raw_parts(l5.cast(), len7, len7)
};
result8.push(e8);
}
_rt::cabi_dealloc(base8, len8 * (2*::core::mem::size_of::<*const u8>()), ::core::mem::size_of::<*const u8>());
result8
};
Ok(e)
}
1 => {
let e = {
let l9 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l10 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len11 = l10;
let bytes11 = _rt::Vec::from_raw_parts(l9.cast(), len11, len11);
_rt::string_lift(bytes11)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result12
}
}
}
impl FlannBasedMatcher {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn new(name: &str,) -> Self{
unsafe {
let vec0 = name;
let ptr0 = vec0.as_ptr().cast::<u8>();
let len0 = vec0.len();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[constructor]flann-based-matcher"]
fn wit_import1(_: *mut u8, _: usize, ) -> i32;
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: *mut u8, _: usize, ) -> i32 { unreachable!() }
let ret = wit_import1(ptr0.cast_mut(), len0);
FlannBasedMatcher::from_handle(ret as u32)
}
}
}
impl FlannBasedMatcher {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn close(&self,) -> (){
unsafe {
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]flann-based-matcher.close"]
fn wit_import0(_: i32, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import0(_: i32, ) { unreachable!() }
wit_import0((self).handle() as i32);
}
}
}
impl FlannBasedMatcher {
#[allow(unused_unsafe, clippy::all)]
#[allow(async_fn_in_trait)]
pub fn knn_match(&self,query: Mat,train: Mat,k: u32,) -> Result<_rt::Vec::<_rt::Vec::<DMatch>>,ErrorResult>{
unsafe {
#[cfg_attr(target_pointer_width="64", repr(align(8)))]
#[cfg_attr(target_pointer_width="32", repr(align(4)))]
struct RetArea([::core::mem::MaybeUninit::<u8>; 3*::core::mem::size_of::<*const u8>()]);
let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 3*::core::mem::size_of::<*const u8>()]);
let ptr0 = ret_area.0.as_mut_ptr().cast::<u8>();
#[cfg(target_arch = "wasm32")]
#[link(wasm_import_module = "wasm:cv/features2d")]
unsafe extern "C" {
#[link_name = "[method]flann-based-matcher.KNN-match"]
fn wit_import1(_: i32, _: i32, _: i32, _: i32, _: *mut u8, );
}
#[cfg(not(target_arch = "wasm32"))]
unsafe extern "C" fn wit_import1(_: i32, _: i32, _: i32, _: i32, _: *mut u8, ) { unreachable!() }
wit_import1((self).handle() as i32, (&query).take_handle() as i32, (&train).take_handle() as i32, _rt::as_i32(&k), ptr0);
let l2 = i32::from(*ptr0.add(0).cast::<u8>());
let result12 = match l2 {
0 => {
let e = {
let l3 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l4 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let base8 = l3;
let len8 = l4;
let mut result8 = _rt::Vec::with_capacity(len8);
for i in 0..len8 {
let base = base8.add(i * (2*::core::mem::size_of::<*const u8>()));
let e8 = {
let l5 = *base.add(0).cast::<*mut u8>();
let l6 = *base.add(::core::mem::size_of::<*const u8>()).cast::<usize>();
let len7 = l6;
_rt::Vec::from_raw_parts(l5.cast(), len7, len7)
};
result8.push(e8);
}
_rt::cabi_dealloc(base8, len8 * (2*::core::mem::size_of::<*const u8>()), ::core::mem::size_of::<*const u8>());
result8
};
Ok(e)
}
1 => {
let e = {
let l9 = *ptr0.add(::core::mem::size_of::<*const u8>()).cast::<*mut u8>();
let l10 = *ptr0.add(2*::core::mem::size_of::<*const u8>()).cast::<usize>();
let len11 = l10;
let bytes11 = _rt::Vec::from_raw_parts(l9.cast(), len11, len11);
_rt::string_lift(bytes11)
};
Err(e)
}
_ => _rt::invalid_enum_discriminant(),
};
result12
}
}
}
}
}
}
#[allow(dead_code, clippy::all)]
pub mod exports {
pub mod wasm {
pub mod cv {
#[allow(dead_code, async_fn_in_trait, unused_imports, clippy::all)]
pub mod request {
#[used]
#[doc(hidden)]
static __FORCE_SECTION_REF: fn() =
super::super::super::super::__link_custom_section_describing_imports;
use super::super::super::super::_rt;
pub type Mat = super::super::super::super::wasm::cv::mat::Mat;
#[doc(hidden)]
#[allow(non_snake_case, unused_unsafe)]
pub unsafe fn _export_process_cabi<T: Guest>(arg0: i32,) -> i32 { unsafe {#[cfg(target_arch="wasm32")]
_rt::run_ctors_once();let result0 = {
T::process(super::super::super::super::wasm::cv::mat::Mat::from_handle(arg0 as u32))
};
(result0).take_handle() as i32
} }
pub trait Guest {
#[allow(async_fn_in_trait)]
fn process(image: Mat,) -> Mat;
}
#[doc(hidden)]
macro_rules! __export_wasm_cv_request_cabi{
($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = {
#[unsafe(export_name = "wasm:cv/request#process")]
unsafe extern "C" fn export_process(arg0: i32,) -> i32 {
unsafe { $($path_to_types)*::_export_process_cabi::<$ty>(arg0) }
}
};);
}
#[doc(hidden)]
pub(crate) use __export_wasm_cv_request_cabi;
}
}
}
}
mod _rt {
#![allow(dead_code, clippy::all)]
pub use alloc_crate::string::String;
use core::fmt;
use core::marker;
use core::sync::atomic::{AtomicU32, Ordering::Relaxed};
#[repr(transparent)]
pub struct Resource<T: WasmResource> {
handle: AtomicU32,
_marker: marker::PhantomData<T>,
}
#[allow(clippy::missing_safety_doc)]
pub unsafe trait WasmResource {
unsafe fn drop(handle: u32);
}
impl<T: WasmResource> Resource<T> {
#[doc(hidden)]
pub unsafe fn from_handle(handle: u32) -> Self {
debug_assert!(handle != 0 && handle != u32::MAX);
Self {
handle: AtomicU32::new(handle),
_marker: marker::PhantomData,
}
}
#[doc(hidden)]
pub fn take_handle(resource: &Resource<T>) -> u32 {
resource.handle.swap(u32::MAX, Relaxed)
}
#[doc(hidden)]
pub fn handle(resource: &Resource<T>) -> u32 {
resource.handle.load(Relaxed)
}
}
impl<T: WasmResource> fmt::Debug for Resource<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Resource")
.field("handle", &self.handle)
.finish()
}
}
impl<T: WasmResource> Drop for Resource<T> {
fn drop(&mut self) {
unsafe {
match self.handle.load(Relaxed) {
u32::MAX => {}
other => T::drop(other),
}
}
}
}
pub fn as_i32<T: AsI32>(t: T) -> i32 {
t.as_i32()
}
pub trait AsI32 {
fn as_i32(self) -> i32;
}
impl<'a, T: Copy + AsI32> AsI32 for &'a T {
fn as_i32(self) -> i32 {
(*self).as_i32()
}
}
impl AsI32 for i32 {
#[inline]
fn as_i32(self) -> i32 {
self as i32
}
}
impl AsI32 for u32 {
#[inline]
fn as_i32(self) -> i32 {
self as i32
}
}
impl AsI32 for i16 {
#[inline]
fn as_i32(self) -> i32 {
self as i32
}
}
impl AsI32 for u16 {
#[inline]
fn as_i32(self) -> i32 {
self as i32
}
}
impl AsI32 for i8 {
#[inline]
fn as_i32(self) -> i32 {
self as i32
}
}
impl AsI32 for u8 {
#[inline]
fn as_i32(self) -> i32 {
self as i32
}
}
impl AsI32 for char {
#[inline]
fn as_i32(self) -> i32 {
self as i32
}
}
impl AsI32 for usize {
#[inline]
fn as_i32(self) -> i32 {
self as i32
}
}
pub use alloc_crate::vec::Vec;
pub unsafe fn string_lift(bytes: Vec<u8>) -> String {
if cfg!(debug_assertions) {
String::from_utf8(bytes).unwrap()
} else {
unsafe { String::from_utf8_unchecked(bytes) }
}
}
pub unsafe fn invalid_enum_discriminant<T>() -> T {
if cfg!(debug_assertions) {
panic!("invalid enum discriminant")
} else {
unsafe { core::hint::unreachable_unchecked() }
}
}
pub fn as_f32<T: AsF32>(t: T) -> f32 {
t.as_f32()
}
pub trait AsF32 {
fn as_f32(self) -> f32;
}
impl<'a, T: Copy + AsF32> AsF32 for &'a T {
fn as_f32(self) -> f32 {
(*self).as_f32()
}
}
impl AsF32 for f32 {
#[inline]
fn as_f32(self) -> f32 {
self as f32
}
}
pub unsafe fn bool_lift(val: u8) -> bool {
if cfg!(debug_assertions) {
match val {
0 => false,
1 => true,
_ => panic!("invalid bool discriminant"),
}
} else {
val != 0
}
}
pub use alloc_crate::alloc;
pub fn as_f64<T: AsF64>(t: T) -> f64 {
t.as_f64()
}
pub trait AsF64 {
fn as_f64(self) -> f64;
}
impl<'a, T: Copy + AsF64> AsF64 for &'a T {
fn as_f64(self) -> f64 {
(*self).as_f64()
}
}
impl AsF64 for f64 {
#[inline]
fn as_f64(self) -> f64 {
self as f64
}
}
pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) {
if size == 0 {
return;
}
unsafe {
let layout = alloc::Layout::from_size_align_unchecked(size, align);
alloc::dealloc(ptr, layout);
}
}
#[cfg(target_arch = "wasm32")]
pub fn run_ctors_once() {
wit_bindgen::rt::run_ctors_once();
}
extern crate alloc as alloc_crate;
}
#[allow(unused_macros)]
#[doc(hidden)]
macro_rules! __export_imports_impl {
($ty:ident) => (self::export!($ty with_types_in self););
($ty:ident with_types_in $($path_to_types_root:tt)*) => (
$($path_to_types_root)*::exports::wasm::cv::request::__export_wasm_cv_request_cabi!($ty with_types_in $($path_to_types_root)*::exports::wasm::cv::request);
)
}
#[doc(inline)]
pub(crate) use __export_imports_impl as export;
#[cfg(target_arch = "wasm32")]
#[unsafe(link_section = "component-type:wit-bindgen:0.43.0:wasm:cv:imports:encoded world")]
#[doc(hidden)]
#[allow(clippy::octal_escapes)]
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 12197] = *b"\
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xa7^\x01A\x02\x01A#\x01\
B%\x01s\x04\0\x0cerror-result\x03\0\0\x01r\x02\x01xz\x01yz\x04\0\x04size\x03\0\x02\
\x04\0\x05point\x03\0\x03\x01r\x04\x04val1v\x04val2v\x04val3v\x04val4v\x04\0\x06\
scalar\x03\0\x05\x01r\x02\x03min\x03\x03max\x03\x04\0\x04rect\x03\0\x07\x01r\x04\
\x01r}\x01g}\x01b}\x01a}\x04\0\x04RGBA\x03\0\x09\x01m\x08\x0fborder-constant\x10\
border-replicate\x0eborder-reflect\x0bborder-wrap\x11border-reflect101\x12border\
-transparent\x0eborder-default\x0fborder-isolated\x04\0\x0bborder-type\x03\0\x0b\
\x01m\x02\x17adaptive-threshold-mean\x1badaptive-threshold-gaussian\x04\0\x17ada\
ptive-threshold-type\x03\0\x0d\x01m\x08\x10threshold-binary\x14threshold-binary-\
inv\x0fthreshold-trunc\x11threshold-to-zero\x15threshold-to-zero-inv\x0ethreshol\
d-mask\x0ethreshold-otsu\x13tthreshold-triangle\x04\0\x0ethreshold-type\x03\0\x0f\
\x01m\x07\x13data-layout-unknown\x0edata-layout-nd\x10data-layout-nchw\x11data-l\
ayout-ncdhw\x10data-layout-nhwc\x11data-layout-ndhwc\x12data-layout-planar\x04\0\
\x10data-layout-type\x03\0\x11\x01m\x03\x11padding-mode-null\x18padding-mode-cro\
p-center\x16padding-mode-letterbox\x04\0\x11padding-mode-type\x03\0\x13\x01r\x08\
\x0cscale-factorv\x04size\x03\x04mean\x06\x07swap-RB\x7f\x06ddepth}\x0bdata-layo\
ut\x12\x0cpadding-mode\x14\x06border\x06\x04\0\x0bblob-params\x03\0\x15\x01r\x04\
\x07min-valv\x07max-valv\x07min-loc\x03\x07max-loc\x03\x04\0\x12mix-max-loc-resu\
lt\x03\0\x17\x01m\x09\x14hershey-font-simplex\x12hershey-font-plain\x13hershey-f\
ont-duplex\x14hershey-font-complex\x14hershey-font-triplex\x1ahershey-font-compl\
ex-small\x1bhershey-font-script-simplex\x1bhershey-font-script-complex\x13hershe\
y-font-italic\x04\0\x11hershey-font-type\x03\0\x19\x01m\x05\x15interpolation-nea\
rest\x14interpolation-linear\x13interpolation-cubic\x12interpolation-area\x16int\
erpolation-lanczos4\x04\0\x12interpolation-type\x03\0\x1b\x01m\x14\x11color-BGR-\
to-BGRA\x11color-RGB-to-RGBA\x11color-BGRA-to-BGR\x11color-RGBA-to-RGB\x11color-\
BGR-to-RGBA\x11color-RGB-to-BGRA\x11color-RGBA-to-BGR\x11color-BGRA-to-RGB\x10co\
lor-BGR-to-RGB\x10color-RGB-to-BGR\x12color-BGRA-to-RGBA\x12color-RGBA-to-BGRA\x11\
color-BGR-to-gray\x11color-RGB-to-gray\x11color-gray-to-BGR\x11color-gray-to-RGB\
\x12color-gray-to-BGRA\x12color-gray-to-RGBA\x12color-BGRA-to-gray\x12color-RGBA\
-to-gray\x04\0\x14color-coversion-type\x03\0\x1d\x01m\x03\x0amorph-rect\x0bmorph\
-cross\x0dmorph-ellipse\x04\0\x0bmorph-shape\x03\0\x1f\x01r\x07\x01xv\x01yv\x04s\
izev\x05anglev\x08responsev\x06octavez\x08class-idz\x04\0\x09key-point\x03\0!\x01\
r\x04\x09query-idxy\x09train-idxy\x07img-idxy\x08distanceu\x04\0\x07d-match\x03\0\
#\x03\0\x0dwasm:cv/types\x05\0\x02\x03\0\0\x0cerror-result\x02\x03\0\0\x12mix-ma\
x-loc-result\x02\x03\0\0\x04rect\x01Be\x02\x03\x02\x01\x01\x04\0\x0cerror-result\
\x03\0\0\x02\x03\x02\x01\x02\x04\0\x12mix-max-loc-result\x03\0\x02\x02\x03\x02\x01\
\x03\x04\0\x04rect\x03\0\x04\x01m\x07\x04cv8u\x04cv8s\x05cv16u\x05cv16s\x05cv32s\
\x05cv32f\x05cv64f\x04\0\x07mattype\x03\0\x06\x04\0\x03mat\x03\x01\x01i\x08\x01@\
\x01\x02idy\0\x09\x04\0\x10[constructor]mat\x01\x0a\x01@\x03\x04colsy\x04rowsy\x07\
mattype\x07\0\x09\x04\0\x19[static]mat.new-with-size\x01\x0b\x01h\x08\x01@\x01\x04\
self\x0c\0\x09\x04\0\x11[method]mat.clone\x01\x0d\x01@\x01\x04self\x0c\x01\0\x04\
\0\x11[method]mat.close\x01\x0e\x01@\x01\x04self\x0c\0y\x04\0\x10[method]mat.col\
s\x01\x0f\x04\0\x10[method]mat.rows\x01\x0f\x01@\x02\x04self\x0c\x04rect\x05\0\x09\
\x04\0\x12[method]mat.region\x01\x10\x01@\x02\x04self\x0c\x03dst\x0c\x01\0\x04\0\
\x13[method]mat.copy-to\x01\x11\x01j\x01\x09\x01\x01\x01@\x02\x04self\x0c\x07mat\
type\x07\0\x12\x04\0\x16[method]mat.convert-to\x01\x13\x01@\x04\x04self\x0c\x07m\
attype\x07\x05alphav\x04betav\0\x12\x04\0\"[method]mat.convert-to-with-params\x01\
\x14\x01@\x01\x04self\x0c\0\x07\x04\0\x13[method]mat.mattype\x01\x15\x01py\x01@\x01\
\x04self\x0c\0\x16\x04\0\x10[method]mat.size\x01\x17\x04\0\x10[method]mat.step\x01\
\x0f\x04\0\x14[method]mat.elemsize\x01\x0f\x01@\x01\x04self\x0c\0\x7f\x04\0\x11[\
method]mat.empty\x01\x18\x01@\x03\x04self\x0c\x03rowy\x03coly\0v\x04\0\x18[metho\
d]mat.get-float-at\x01\x19\x01@\x04\x04self\x0c\x03rowy\x03coly\x03valv\x01\0\x04\
\0\x18[method]mat.set-float-at\x01\x1a\x01@\x03\x04self\x0c\x03rowy\x03coly\0}\x04\
\0\x18[method]mat.get-uchar-at\x01\x1b\x01@\x04\x04self\x0c\x03rowy\x03coly\x03v\
al}\x01\0\x04\0\x18[method]mat.set-uchar-at\x01\x1c\x01@\x03\x04self\x0c\x03rowy\
\x03coly\0z\x04\0\x16[method]mat.get-int-at\x01\x1d\x01@\x04\x04self\x0c\x03rowy\
\x03coly\x03valz\x01\0\x04\0\x16[method]mat.set-int-at\x01\x1e\x01@\x04\x04self\x0c\
\x01xy\x01yy\x01zy\0v\x04\0\x19[method]mat.get-float-at3\x01\x1f\x01@\x05\x04sel\
f\x0c\x01xy\x01yy\x01zy\x03valv\x01\0\x04\0\x19[method]mat.set-float-at3\x01\x20\
\x01@\x04\x04self\x0c\x01xy\x01yy\x01zy\0}\x04\0\x19[method]mat.get-uchar-at3\x01\
!\x01@\x05\x04self\x0c\x01xy\x01yy\x01zy\x03val}\x01\0\x04\0\x19[method]mat.set-\
uchar-at3\x01\"\x01@\x04\x04self\x0c\x01xy\x01yy\x01zy\0z\x04\0\x17[method]mat.g\
et-int-at3\x01#\x01@\x05\x04self\x0c\x01xy\x01yy\x01zy\x03valz\x01\0\x04\0\x17[m\
ethod]mat.set-int-at3\x01$\x01p}\x01@\x03\x04self\x0c\x03rowy\x03coly\0%\x04\0\x17\
[method]mat.get-vecb-at\x01&\x01pv\x01@\x03\x04self\x0c\x03rowy\x03coly\0'\x04\0\
\x17[method]mat.get-vecf-at\x01(\x01pz\x01@\x03\x04self\x0c\x03rowy\x03coly\0)\x04\
\0\x17[method]mat.get-veci-at\x01*\x01@\x02\x04self\x0c\x03val}\x01\0\x04\0\x15[\
method]mat.add-uchar\x01+\x04\0\x1a[method]mat.subtract-uchar\x01+\x04\0\x1a[met\
hod]mat.multiply-uchar\x01+\x04\0\x18[method]mat.divide-uchar\x01+\x01@\x02\x04s\
elf\x0c\x03valv\x01\0\x04\0\x15[method]mat.add-float\x01,\x04\0\x1a[method]mat.s\
ubtract-float\x01,\x04\0\x1a[method]mat.multiply-float\x01,\x04\0\x18[method]mat\
.divide-float\x01,\x01@\x03\x04self\x0c\x08channelsy\x04rowsy\0\x12\x04\0\x13[me\
thod]mat.reshape\x01-\x01@\x03\x04self\x0c\x05starty\x03endy\0\x12\x04\0\x15[met\
hod]mat.row-range\x01.\x04\0\x15[method]mat.col-range\x01.\x01j\x01\x03\x01\x01\x01\
@\x01\x04self\x0c\0/\x04\0\x17[method]mat.min-max-loc\x010\x01@\x02\x04self\x0c\x03\
coly\0\x12\x04\0\x0f[method]mat.col\x011\x01@\x02\x04self\x0c\x03rowy\0\x12\x04\0\
\x0f[method]mat.row\x012\x01p\x09\x01@\x01\x02mv3\0\x12\x04\0\x11[static]mat.mer\
ge\x014\x01@\x03\x04colsy\x04rowsy\x07mattype\x07\0\x12\x04\0\x11[static]mat.zer\
os\x015\x04\0\x10[static]mat.ones\x015\x03\0\x0bwasm:cv/mat\x05\x04\x02\x03\0\0\x0b\
border-type\x02\x03\0\0\x04size\x02\x03\0\0\x05point\x02\x03\0\0\x17adaptive-thr\
eshold-type\x02\x03\0\0\x0ethreshold-type\x02\x03\0\0\x06scalar\x02\x03\0\0\x04R\
GBA\x02\x03\0\0\x11hershey-font-type\x02\x03\0\0\x12interpolation-type\x02\x03\0\
\0\x14color-coversion-type\x02\x03\0\0\x0bmorph-shape\x02\x03\0\x01\x03mat\x02\x03\
\0\x01\x07mattype\x01Bd\x02\x03\x02\x01\x01\x04\0\x0cerror-result\x03\0\0\x02\x03\
\x02\x01\x05\x04\0\x0bborder-type\x03\0\x02\x02\x03\x02\x01\x06\x04\0\x04size\x03\
\0\x04\x02\x03\x02\x01\x07\x04\0\x05point\x03\0\x06\x02\x03\x02\x01\x08\x04\0\x17\
adaptive-threshold-type\x03\0\x08\x02\x03\x02\x01\x09\x04\0\x0ethreshold-type\x03\
\0\x0a\x02\x03\x02\x01\x0a\x04\0\x06scalar\x03\0\x0c\x02\x03\x02\x01\x03\x04\0\x04\
rect\x03\0\x0e\x02\x03\x02\x01\x0b\x04\0\x04RGBA\x03\0\x10\x02\x03\x02\x01\x0c\x04\
\0\x11hershey-font-type\x03\0\x12\x02\x03\x02\x01\x0d\x04\0\x12interpolation-typ\
e\x03\0\x14\x02\x03\x02\x01\x0e\x04\0\x14color-coversion-type\x03\0\x16\x02\x03\x02\
\x01\x0f\x04\0\x0bmorph-shape\x03\0\x18\x02\x03\x02\x01\x10\x04\0\x03mat\x03\0\x1a\
\x02\x03\x02\x01\x11\x04\0\x07mattype\x03\0\x1c\x01h\x1b\x01j\0\x01\x01\x01@\x05\
\x03img\x1e\x06point1\x07\x06point2\x07\x01c\x11\x09thickness}\0\x1f\x04\0\x0car\
rowed-line\x01\x20\x01@\x04\x03img\x1e\x01r\x0f\x01c\x11\x09thickness}\0\x1f\x04\
\0\x09rectangle\x01!\x01@\x05\x03img\x1e\x06center\x07\x06radiusy\x01c\x11\x09th\
ickness}\0\x1f\x04\0\x06circle\x01\"\x04\0\x04line\x01\x20\x01@\x07\x03img\x1e\x04\
texts\x03org\x07\x09font-face\x13\x0afont-scaleu\x01c\x11\x09thicknessz\0\x1f\x04\
\0\x08put-text\x01#\x01i\x1b\x01j\x01$\x01\x01\x01@\x06\x03src$\x09max-valuev\x0d\
adaptive-type\x09\x0ethreshold-type\x0b\x0ablock-sizey\x01cv\0%\x04\0\x12adaptiv\
e-threshold\x01&\x01@\x02\x03src$\x06k-size\x05\0%\x04\0\x04blur\x01'\x01@\x03\x03\
src$\x05depthy\x06k-size\x05\0%\x04\0\x0abox-filter\x01(\x01@\x03\x03src$\x0athr\
eshold1v\x0athreshold2v\0%\x04\0\x05canny\x01)\x01@\x02\x03src$\x04code\x17\0%\x04\
\0\x09cvt-color\x01*\x01@\x02\x03src$\x06kernel$\0%\x04\0\x06dilate\x01+\x04\0\x05\
erode\x01+\x01@\x01\x03src$\0%\x04\0\x0dequalize-hist\x01,\x01@\x05\x03src$\x04s\
ize\x05\x07sigma-xv\x07sigma-yv\x06border\x03\0%\x04\0\x0dgaussian-blur\x01-\x01\
@\x02\x05shape\x19\x04size\x05\0%\x04\0\x17get-structuring-element\x01.\x01@\x04\
\x03src$\x03rhou\x05thetau\x09thresholdz\0%\x04\0\x0bhough-lines\x01/\x04\0\x0dh\
ough-lines-p\x01/\x04\0\x0bmedian-blur\x01'\x01@\x05\x03src$\x04size\x05\x02fxv\x02\
fyv\x06interp\x15\0%\x04\0\x06resize\x010\x01@\x04\x03src$\x06threshv\x09max-val\
uev\x0ethreshold-type\x0b\0%\x04\0\x09threshold\x011\x01pz\x01@\x02\x03src$\x05o\
rder2\0%\x04\0\x0ctranspose-ND\x013\x01@\x02\x03frm$\x02to$\0%\x04\0\x11estimate\
-affine2d\x014\x01@\x03\x03src$\x01m$\x04size\x05\0%\x04\0\x0bwarp-affine\x015\x01\
@\x03\x06center\x07\x05angleu\x05scaleu\0%\x04\0\x15get-rotation-matrix2d\x016\x01\
@\x02\x04src1$\x04src2$\0%\x04\0\x03add\x017\x01@\x05\x04src1$\x05alphau\x04src2\
$\x04betau\x05gammau\0%\x04\0\x0cadd-weighted\x018\x04\0\x06divide\x017\x04\0\x03\
exp\x01,\x04\0\x07hconcat\x017\x04\0\x07vconcat\x017\x01@\x02\x03src$\x05wblut$\0\
%\x04\0\x03lut\x019\x04\0\x08multiply\x017\x01@\x04\x03src$\x03dimy\x0breduce-ty\
pey\x0adepth-typey\0%\x04\0\x06reduce\x01:\x01@\x03\x03src$\x04axisy\x0alast-ind\
ex\x7f\0%\x04\0\x0ereduce-arg-max\x01;\x04\0\x08subtract\x017\x01@\x04\x03src$\x05\
alphav\x04betav\x09norm-typey\0%\x04\0\x09normalize\x01<\x01j\x01v\x01\x01\x01@\x02\
\x03src$\x09norm-typey\0=\x04\0\x04norm\x01>\x03\0\x0awasm:cv/cv\x05\x12\x02\x03\
\0\0\x0bblob-params\x02\x03\0\0\x10data-layout-type\x02\x03\0\0\x11padding-mode-\
type\x01BK\x02\x03\x02\x01\x10\x04\0\x03mat\x03\0\0\x02\x03\x02\x01\x01\x04\0\x0c\
error-result\x03\0\x02\x02\x03\x02\x01\x06\x04\0\x04size\x03\0\x04\x02\x03\x02\x01\
\x0a\x04\0\x06scalar\x03\0\x06\x02\x03\x02\x01\x03\x04\0\x04rect\x03\0\x08\x02\x03\
\x02\x01\x13\x04\0\x0bblob-params\x03\0\x0a\x02\x03\x02\x01\x14\x04\0\x10data-la\
yout-type\x03\0\x0c\x02\x03\x02\x01\x15\x04\0\x11padding-mode-type\x03\0\x0e\x01\
m\x06\x13net-backend-default\x12net-backend-halide\x14net-backend-openvino\x12ne\
t-backend-opencv\x11net-backend-vkcom\x10net-backend-cuda\x04\0\x10net-backend-t\
ype\x03\0\x10\x01m\x08\x0enet-target-cpu\x0fnet-target-fp32\x0fnet-target-fp16\x0e\
net-target-vpu\x11net-target-vulkan\x0fnet-target-fpga\x0fnet-target-cuda\x14net\
-target-cuda-fp16\x04\0\x0fnet-target-type\x03\0\x12\x04\0\x05layer\x03\x01\x04\0\
\x03net\x03\x01\x01i\x14\x01@\0\0\x16\x04\0\x12[constructor]layer\x01\x17\x01h\x14\
\x01@\x01\x04self\x18\x01\0\x04\0\x13[method]layer.close\x01\x19\x01j\x01s\x01\x03\
\x01@\x01\x04self\x18\0\x1a\x04\0\x16[method]layer.get-name\x01\x1b\x01i\x15\x01\
j\x01\x1c\x01\x03\x01@\x02\x05models\x06configs\0\x1d\x04\0\x10[static]net.read\x01\
\x1e\x01@\x01\x05models\0\x1d\x04\0\x1a[static]net.read-from-ONNX\x01\x1f\x01h\x15\
\x01@\x01\x04self\x20\x01\0\x04\0\x11[method]net.close\x01!\x01@\x01\x04self\x20\
\0\x7f\x04\0\x11[method]net.empty\x01\"\x01i\x01\x01j\0\x01\x03\x01@\x03\x04self\
\x20\x05input#\x04names\0$\x04\0\x15[method]net.set-input\x01%\x01j\x01#\x01\x03\
\x01@\x02\x04self\x20\x0boutput-names\0&\x04\0\x13[method]net.forward\x01'\x01ps\
\x01p#\x01j\x01)\x01\x03\x01@\x02\x04self\x20\x0coutput-names(\0*\x04\0\x1a[meth\
od]net.forward-layers\x01+\x01py\x01j\x01,\x01\x03\x01@\x01\x04self\x20\0-\x04\0\
&[method]net.get-unconnected-out-layers\x01.\x01j\x01(\x01\x03\x01@\x01\x04self\x20\
\0/\x04\0\x1b[method]net.get-layer-names\x010\x01j\x01\x16\x01\x03\x01@\x02\x04s\
elf\x20\x02idy\01\x04\0\x15[method]net.get-layer\x012\x01@\x06\x05image#\x0cscal\
e-factorv\x04size\x05\x04mean\x07\x07swap-rb\x7f\x04crop\x7f\0&\x04\0\x0fblob-fr\
om-image\x013\x01@\x02\x05image#\x06params\x0b\0&\x04\0\x1bblob-from-image-with-\
params\x014\x01p\x09\x01j\x015\x01\x03\x01@\x03\x06params\x0b\x0ablob-rects5\x0a\
image-size\x05\06\x04\0\x19blob-rects-to-image-rects\x017\x01pv\x01@\x04\x06bbox\
es5\x06scores8\x0fscore-thresholdv\x0dnms-thresholdv\0-\x04\0\x09NMS-boxes\x019\x03\
\0\x0bwasm:cv/dnn\x05\x16\x01BQ\x02\x03\x02\x01\x10\x04\0\x03mat\x03\0\0\x02\x03\
\x02\x01\x01\x04\0\x0cerror-result\x03\0\x02\x02\x03\x02\x01\x06\x04\0\x04size\x03\
\0\x04\x02\x03\x02\x01\x03\x04\0\x04rect\x03\0\x06\x04\0\x12cascade-classifier\x03\
\x01\x04\0\x0eHOG-descriptor\x03\x01\x04\0\x10face-detector-YN\x03\x01\x01m\x02\x19\
face-distance-type-cosine\x15face-distance-norm-l2\x04\0\x12face-distance-type\x03\
\0\x0b\x04\0\x12face-recognizer-SF\x03\x01\x01i\x08\x01@\x01\x04names\0\x0e\x04\0\
\x1f[constructor]cascade-classifier\x01\x0f\x01h\x08\x01@\x01\x04self\x10\x01\0\x04\
\0\x20[method]cascade-classifier.close\x01\x11\x01@\x02\x04self\x10\x04files\0\x7f\
\x04\0\x1f[method]cascade-classifier.load\x01\x12\x01i\x01\x01p\x07\x01j\x01\x14\
\x01\x03\x01@\x02\x04self\x10\x05image\x13\0\x15\x04\0-[method]cascade-classifie\
r.detect-multi-scale\x01\x16\x01@\x07\x04self\x10\x05image\x13\x05scaleu\x0dmin-\
neighborsy\x05flagsy\x08min-size\x05\x08max-size\x05\0\x15\x04\09[method]cascade\
-classifier.detect-multi-scale-with-params\x01\x17\x01i\x09\x01@\x01\x04names\0\x18\
\x04\0\x1b[constructor]HOG-descriptor\x01\x19\x01h\x09\x01@\x01\x04self\x1a\x01\0\
\x04\0\x1c[method]HOG-descriptor.close\x01\x1b\x01@\x02\x04self\x1a\x05image\x13\
\0\x15\x04\0)[method]HOG-descriptor.detect-multi-scale\x01\x1c\x01@\x08\x04self\x1a\
\x05image\x13\x0dhit-thresholdu\x0awin-stride\x05\x07padding\x05\x05scaleu\x0ffi\
nal-thresholdu\x16use-meanshift-grouping\x7f\0\x15\x04\05[method]HOG-descriptor.\
detect-multi-scale-with-params\x01\x1d\x01i\x0a\x01@\x03\x05models\x06configs\x0a\
input-size\x05\0\x1e\x04\0\x1d[constructor]face-detector-YN\x01\x1f\x01@\x08\x05\
models\x06configs\x0ainput-size\x05\x0fscore-thresholdv\x0dnms-thresholdv\x05top\
-ky\x0abackend-idy\x09target-idy\0\x1e\x04\0([static]face-detector-YN.new-with-p\
arams\x01\x20\x01h\x0a\x01@\x01\x04self!\x01\0\x04\0\x1e[method]face-detector-YN\
.close\x01\"\x01j\x01\x13\x01\x03\x01@\x02\x04self!\x05input\x13\0#\x04\0\x1f[me\
thod]face-detector-YN.detect\x01$\x01@\x01\x04self!\0\x05\x04\0'[method]face-det\
ector-YN.get-input-size\x01%\x01@\x01\x04self!\0v\x04\0*[method]face-detector-YN\
.get-nms-threshold\x01&\x04\0,[method]face-detector-YN.get-score-threshold\x01&\x01\
@\x01\x04self!\0y\x04\0![method]face-detector-YN.get-topk\x01'\x01@\x02\x04self!\
\x04size\x05\x01\0\x04\0'[method]face-detector-YN.set-input-size\x01(\x01@\x02\x04\
self!\x09thresholdv\x01\0\x04\0*[method]face-detector-YN.set-nms-threshold\x01)\x04\
\0,[method]face-detector-YN.set-score-threshold\x01)\x01@\x02\x04self!\x04topky\x01\
\0\x04\0![method]face-detector-YN.set-topk\x01*\x01i\x0d\x01@\x02\x05models\x06c\
onfigs\0+\x04\0\x1f[constructor]face-recognizer-SF\x01,\x01@\x04\x05models\x06co\
nfigs\x0abackend-idy\x09target-idy\0+\x04\0*[static]face-recognizer-SF.new-with-\
params\x01-\x01h\x0d\x01@\x01\x04self.\x01\0\x04\0\x20[method]face-recognizer-SF\
.close\x01/\x01@\x03\x04self.\x03src\x13\x08face-box\x13\0#\x04\0%[method]face-r\
ecognizer-SF.align-crop\x010\x01@\x02\x04self.\x07aligned\x13\0#\x04\0\"[method]\
face-recognizer-SF.feature\x011\x01j\x01v\x01\x03\x01@\x03\x04self.\x05face1\x13\
\x05face2\x13\02\x04\0\x20[method]face-recognizer-SF.match\x013\x01@\x04\x04self\
.\x05face1\x13\x05face2\x13\x08distance\x0c\02\x04\0,[method]face-recognizer-SF.\
match-with-params\x014\x03\0\x11wasm:cv/objdetect\x05\x17\x02\x03\0\0\x09key-poi\
nt\x02\x03\0\0\x07d-match\x01Bo\x02\x03\x02\x01\x10\x04\0\x03mat\x03\0\0\x02\x03\
\x02\x01\x01\x04\0\x0cerror-result\x03\0\x02\x02\x03\x02\x01\x18\x04\0\x09key-po\
int\x03\0\x04\x02\x03\x02\x01\x19\x04\0\x07d-match\x03\0\x06\x01p\x05\x01i\x01\x01\
r\x02\x03kps\x08\x04desc\x09\x04\0\x0fdetector-result\x03\0\x0a\x04\0\x0eAKAZE-d\
etector\x03\x01\x04\0\x0eBRISK-detector\x03\x01\x04\0\x0dKAZE-detector\x03\x01\x01\
m\x02\x0aORB-HARRIS\x08ORB-FAST\x04\0\x0eORB-score-type\x03\0\x0f\x04\0\x0cORB-d\
etector\x03\x01\x04\0\x0dSIFT-detector\x03\x01\x01m\x09\x09NORM-NONE\x08NONE-INF\
\x07NORM-L1\x0aNORM-NONE2\x07NORM-L2\x0aNORM-L2SQR\x0cNORM-HAMMING\x0dNORM-HAMMI\
NG2\x0dNORM-RELATIVE\x04\0\x09norm-type\x03\0\x13\x04\0\x0aBF-matcher\x03\x01\x04\
\0\x13flann-based-matcher\x03\x01\x01i\x0c\x01@\x01\x04names\0\x17\x04\0\x1b[con\
structor]AKAZE-detector\x01\x18\x01h\x0c\x01@\x01\x04self\x19\x01\0\x04\0\x1c[me\
thod]AKAZE-detector.close\x01\x1a\x01j\x01\x08\x01\x03\x01@\x02\x04self\x19\x03s\
rc\x09\0\x1b\x04\0\x1d[method]AKAZE-detector.detect\x01\x1c\x01j\x01\x0b\x01\x03\
\x01@\x04\x04self\x19\x03src\x09\x04mask\x09\x03kps\x08\0\x1d\x04\0\x1e[method]A\
KAZE-detector.compute\x01\x1e\x01@\x03\x04self\x19\x03src\x09\x04mask\x09\0\x1d\x04\
\0)[method]AKAZE-detector.detect-and-compute\x01\x1f\x01i\x0d\x01@\x01\x04names\0\
\x20\x04\0\x1b[constructor]BRISK-detector\x01!\x01h\x0d\x01@\x01\x04self\"\x01\0\
\x04\0\x1c[method]BRISK-detector.close\x01#\x01@\x02\x04self\"\x03src\x09\0\x1b\x04\
\0\x1d[method]BRISK-detector.detect\x01$\x01@\x04\x04self\"\x03src\x09\x04mask\x09\
\x03kps\x08\0\x1d\x04\0\x1e[method]BRISK-detector.compute\x01%\x01@\x03\x04self\"\
\x03src\x09\x04mask\x09\0\x1d\x04\0)[method]BRISK-detector.detect-and-compute\x01\
&\x01i\x0e\x01@\x01\x04names\0'\x04\0\x1a[constructor]KAZE-detector\x01(\x01h\x0e\
\x01@\x01\x04self)\x01\0\x04\0\x1b[method]KAZE-detector.close\x01*\x01@\x02\x04s\
elf)\x03src\x09\0\x1b\x04\0\x1c[method]KAZE-detector.detect\x01+\x01@\x04\x04sel\
f)\x03src\x09\x04mask\x09\x03kps\x08\0\x1d\x04\0\x1d[method]KAZE-detector.comput\
e\x01,\x01@\x03\x04self)\x03src\x09\x04mask\x09\0\x1d\x04\0([method]KAZE-detecto\
r.detect-and-compute\x01-\x01i\x11\x01@\x01\x04names\0.\x04\0\x19[constructor]OR\
B-detector\x01/\x01@\x09\x08featuresy\x05scalev\x06levelsy\x0eedge-thresholdy\x05\
firsty\x04WTAKy\x0ascore-type\x10\x0apatch-sizey\x0efast-thresholdy\0.\x04\0$[st\
atic]ORB-detector.new-with-params\x010\x01h\x11\x01@\x01\x04self1\x01\0\x04\0\x1a\
[method]ORB-detector.close\x012\x01@\x02\x04self1\x03src\x09\0\x1b\x04\0\x1b[met\
hod]ORB-detector.detect\x013\x01@\x04\x04self1\x03src\x09\x04mask\x09\x03kps\x08\
\0\x1d\x04\0\x1c[method]ORB-detector.compute\x014\x01@\x03\x04self1\x03src\x09\x04\
mask\x09\0\x1d\x04\0'[method]ORB-detector.detect-and-compute\x015\x01i\x12\x01@\x01\
\x04names\06\x04\0\x1a[constructor]SIFT-detector\x017\x01h\x12\x01@\x01\x04self8\
\x01\0\x04\0\x1b[method]SIFT-detector.close\x019\x01@\x02\x04self8\x03src\x09\0\x1b\
\x04\0\x1c[method]SIFT-detector.detect\x01:\x01@\x04\x04self8\x03src\x09\x04mask\
\x09\x03kps\x08\0\x1d\x04\0\x1d[method]SIFT-detector.compute\x01;\x01@\x03\x04se\
lf8\x03src\x09\x04mask\x09\0\x1d\x04\0([method]SIFT-detector.detect-and-compute\x01\
<\x01i\x15\x01@\x01\x04names\0=\x04\0\x17[constructor]BF-matcher\x01>\x01@\x02\x04\
norm\x14\x0bcross-check\x7f\0=\x04\0\"[static]BF-matcher.new-with-params\x01?\x01\
h\x15\x01@\x01\x04self\xc0\0\x01\0\x04\0\x18[method]BF-matcher.close\x01A\x01p\x07\
\x01j\x01\xc2\0\x01\x03\x01@\x03\x04self\xc0\0\x05query\x09\x05train\x09\0\xc3\0\
\x04\0\x18[method]BF-matcher.match\x01D\x01p\xc2\0\x01j\x01\xc5\0\x01\x03\x01@\x04\
\x04self\xc0\0\x05query\x09\x05train\x09\x01ky\0\xc6\0\x04\0\x1c[method]BF-match\
er.KNN-match\x01G\x01i\x16\x01@\x01\x04names\0\xc8\0\x04\0\x20[constructor]flann\
-based-matcher\x01I\x01h\x16\x01@\x01\x04self\xca\0\x01\0\x04\0![method]flann-ba\
sed-matcher.close\x01K\x01@\x04\x04self\xca\0\x05query\x09\x05train\x09\x01ky\0\xc6\
\0\x04\0%[method]flann-based-matcher.KNN-match\x01L\x03\0\x12wasm:cv/features2d\x05\
\x1a\x01B\x05\x02\x03\x02\x01\x10\x04\0\x03mat\x03\0\0\x01i\x01\x01@\x01\x05imag\
e\x02\0\x02\x04\0\x07process\x01\x03\x04\0\x0fwasm:cv/request\x05\x1b\x04\0\x0fw\
asm:cv/imports\x04\0\x0b\x0d\x01\0\x07imports\x03\0\0\0G\x09producers\x01\x0cpro\
cessed-by\x02\x0dwit-component\x070.235.0\x10wit-bindgen-rust\x060.43.0";
#[inline(never)]
#[doc(hidden)]
pub fn __link_custom_section_describing_imports() {
wit_bindgen::rt::maybe_link_cabi_realloc();
}