1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
#![allow(
unused_parens,
clippy::excessive_precision,
clippy::missing_safety_doc,
clippy::should_implement_trait,
clippy::too_many_arguments,
clippy::unused_unit,
clippy::let_unit_value,
clippy::derive_partial_eq_without_eq,
)]
use crate::{mod_prelude::*, core, sys, types};
pub mod prelude {
pub use { super::ImgHashBaseTraitConst, super::ImgHashBaseTrait, super::AverageHashTraitConst, super::AverageHashTrait, super::BlockMeanHashTraitConst, super::BlockMeanHashTrait, super::ColorMomentHashTraitConst, super::ColorMomentHashTrait, super::MarrHildrethHashTraitConst, super::MarrHildrethHashTrait, super::PHashTraitConst, super::PHashTrait, super::RadialVarianceHashTraitConst, super::RadialVarianceHashTrait };
}
pub const BLOCK_MEAN_HASH_MODE_0: i32 = 0;
pub const BLOCK_MEAN_HASH_MODE_1: i32 = 1;
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum BlockMeanHashMode {
BLOCK_MEAN_HASH_MODE_0 = 0,
BLOCK_MEAN_HASH_MODE_1 = 1,
}
opencv_type_enum! { crate::img_hash::BlockMeanHashMode }
#[inline]
pub fn average_hash(input_arr: &dyn core::ToInputArray, output_arr: &mut dyn core::ToOutputArray) -> Result<()> {
input_array_arg!(input_arr);
output_array_arg!(output_arr);
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_averageHash_const__InputArrayR_const__OutputArrayR(input_arr.as_raw__InputArray(), output_arr.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn block_mean_hash(input_arr: &dyn core::ToInputArray, output_arr: &mut dyn core::ToOutputArray, mode: i32) -> Result<()> {
input_array_arg!(input_arr);
output_array_arg!(output_arr);
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_blockMeanHash_const__InputArrayR_const__OutputArrayR_int(input_arr.as_raw__InputArray(), output_arr.as_raw__OutputArray(), mode, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn color_moment_hash(input_arr: &dyn core::ToInputArray, output_arr: &mut dyn core::ToOutputArray) -> Result<()> {
input_array_arg!(input_arr);
output_array_arg!(output_arr);
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_colorMomentHash_const__InputArrayR_const__OutputArrayR(input_arr.as_raw__InputArray(), output_arr.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn marr_hildreth_hash(input_arr: &dyn core::ToInputArray, output_arr: &mut dyn core::ToOutputArray, alpha: f32, scale: f32) -> Result<()> {
input_array_arg!(input_arr);
output_array_arg!(output_arr);
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_marrHildrethHash_const__InputArrayR_const__OutputArrayR_float_float(input_arr.as_raw__InputArray(), output_arr.as_raw__OutputArray(), alpha, scale, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn p_hash(input_arr: &dyn core::ToInputArray, output_arr: &mut dyn core::ToOutputArray) -> Result<()> {
input_array_arg!(input_arr);
output_array_arg!(output_arr);
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_pHash_const__InputArrayR_const__OutputArrayR(input_arr.as_raw__InputArray(), output_arr.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn radial_variance_hash(input_arr: &dyn core::ToInputArray, output_arr: &mut dyn core::ToOutputArray, sigma: f64, num_of_angle_line: i32) -> Result<()> {
input_array_arg!(input_arr);
output_array_arg!(output_arr);
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_radialVarianceHash_const__InputArrayR_const__OutputArrayR_double_int(input_arr.as_raw__InputArray(), output_arr.as_raw__OutputArray(), sigma, num_of_angle_line, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
pub trait AverageHashTraitConst: crate::img_hash::ImgHashBaseTraitConst {
fn as_raw_AverageHash(&self) -> *const c_void;
}
pub trait AverageHashTrait: crate::img_hash::AverageHashTraitConst + crate::img_hash::ImgHashBaseTrait {
fn as_raw_mut_AverageHash(&mut self) -> *mut c_void;
}
pub struct AverageHash {
ptr: *mut c_void
}
opencv_type_boxed! { AverageHash }
impl Drop for AverageHash {
fn drop(&mut self) {
extern "C" { fn cv_AverageHash_delete(instance: *mut c_void); }
unsafe { cv_AverageHash_delete(self.as_raw_mut_AverageHash()) };
}
}
unsafe impl Send for AverageHash {}
impl core::AlgorithmTraitConst for AverageHash {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for AverageHash {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::ImgHashBaseTraitConst for AverageHash {
#[inline] fn as_raw_ImgHashBase(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::ImgHashBaseTrait for AverageHash {
#[inline] fn as_raw_mut_ImgHashBase(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::AverageHashTraitConst for AverageHash {
#[inline] fn as_raw_AverageHash(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::AverageHashTrait for AverageHash {
#[inline] fn as_raw_mut_AverageHash(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl AverageHash {
#[inline]
pub fn create() -> Result<core::Ptr<crate::img_hash::AverageHash>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_AverageHash_create(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::img_hash::AverageHash>::opencv_from_extern(ret) };
Ok(ret)
}
}
boxed_cast_base! { AverageHash, core::Algorithm, cv_AverageHash_to_Algorithm }
boxed_cast_base! { AverageHash, crate::img_hash::ImgHashBase, cv_AverageHash_to_ImgHashBase }
pub trait BlockMeanHashTraitConst: crate::img_hash::ImgHashBaseTraitConst {
fn as_raw_BlockMeanHash(&self) -> *const c_void;
#[inline]
fn get_mean(&self) -> Result<core::Vector<f64>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_BlockMeanHash_getMean_const(self.as_raw_BlockMeanHash(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<f64>::opencv_from_extern(ret) };
Ok(ret)
}
}
pub trait BlockMeanHashTrait: crate::img_hash::BlockMeanHashTraitConst + crate::img_hash::ImgHashBaseTrait {
fn as_raw_mut_BlockMeanHash(&mut self) -> *mut c_void;
#[inline]
fn set_mode(&mut self, mode: i32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_BlockMeanHash_setMode_int(self.as_raw_mut_BlockMeanHash(), mode, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct BlockMeanHash {
ptr: *mut c_void
}
opencv_type_boxed! { BlockMeanHash }
impl Drop for BlockMeanHash {
fn drop(&mut self) {
extern "C" { fn cv_BlockMeanHash_delete(instance: *mut c_void); }
unsafe { cv_BlockMeanHash_delete(self.as_raw_mut_BlockMeanHash()) };
}
}
unsafe impl Send for BlockMeanHash {}
impl core::AlgorithmTraitConst for BlockMeanHash {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for BlockMeanHash {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::ImgHashBaseTraitConst for BlockMeanHash {
#[inline] fn as_raw_ImgHashBase(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::ImgHashBaseTrait for BlockMeanHash {
#[inline] fn as_raw_mut_ImgHashBase(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::BlockMeanHashTraitConst for BlockMeanHash {
#[inline] fn as_raw_BlockMeanHash(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::BlockMeanHashTrait for BlockMeanHash {
#[inline] fn as_raw_mut_BlockMeanHash(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl BlockMeanHash {
#[inline]
pub fn create(mode: i32) -> Result<core::Ptr<crate::img_hash::BlockMeanHash>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_BlockMeanHash_create_int(mode, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::img_hash::BlockMeanHash>::opencv_from_extern(ret) };
Ok(ret)
}
}
boxed_cast_base! { BlockMeanHash, core::Algorithm, cv_BlockMeanHash_to_Algorithm }
boxed_cast_base! { BlockMeanHash, crate::img_hash::ImgHashBase, cv_BlockMeanHash_to_ImgHashBase }
pub trait ColorMomentHashTraitConst: crate::img_hash::ImgHashBaseTraitConst {
fn as_raw_ColorMomentHash(&self) -> *const c_void;
}
pub trait ColorMomentHashTrait: crate::img_hash::ColorMomentHashTraitConst + crate::img_hash::ImgHashBaseTrait {
fn as_raw_mut_ColorMomentHash(&mut self) -> *mut c_void;
}
pub struct ColorMomentHash {
ptr: *mut c_void
}
opencv_type_boxed! { ColorMomentHash }
impl Drop for ColorMomentHash {
fn drop(&mut self) {
extern "C" { fn cv_ColorMomentHash_delete(instance: *mut c_void); }
unsafe { cv_ColorMomentHash_delete(self.as_raw_mut_ColorMomentHash()) };
}
}
unsafe impl Send for ColorMomentHash {}
impl core::AlgorithmTraitConst for ColorMomentHash {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for ColorMomentHash {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::ImgHashBaseTraitConst for ColorMomentHash {
#[inline] fn as_raw_ImgHashBase(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::ImgHashBaseTrait for ColorMomentHash {
#[inline] fn as_raw_mut_ImgHashBase(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::ColorMomentHashTraitConst for ColorMomentHash {
#[inline] fn as_raw_ColorMomentHash(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::ColorMomentHashTrait for ColorMomentHash {
#[inline] fn as_raw_mut_ColorMomentHash(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl ColorMomentHash {
#[inline]
pub fn create() -> Result<core::Ptr<crate::img_hash::ColorMomentHash>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_ColorMomentHash_create(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::img_hash::ColorMomentHash>::opencv_from_extern(ret) };
Ok(ret)
}
}
boxed_cast_base! { ColorMomentHash, core::Algorithm, cv_ColorMomentHash_to_Algorithm }
boxed_cast_base! { ColorMomentHash, crate::img_hash::ImgHashBase, cv_ColorMomentHash_to_ImgHashBase }
pub trait ImgHashBaseTraitConst: core::AlgorithmTraitConst {
fn as_raw_ImgHashBase(&self) -> *const c_void;
#[inline]
fn compare(&self, hash_one: &dyn core::ToInputArray, hash_two: &dyn core::ToInputArray) -> Result<f64> {
input_array_arg!(hash_one);
input_array_arg!(hash_two);
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_ImgHashBase_compare_const_const__InputArrayR_const__InputArrayR(self.as_raw_ImgHashBase(), hash_one.as_raw__InputArray(), hash_two.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait ImgHashBaseTrait: core::AlgorithmTrait + crate::img_hash::ImgHashBaseTraitConst {
fn as_raw_mut_ImgHashBase(&mut self) -> *mut c_void;
#[inline]
fn compute(&mut self, input_arr: &dyn core::ToInputArray, output_arr: &mut dyn core::ToOutputArray) -> Result<()> {
input_array_arg!(input_arr);
output_array_arg!(output_arr);
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_ImgHashBase_compute_const__InputArrayR_const__OutputArrayR(self.as_raw_mut_ImgHashBase(), input_arr.as_raw__InputArray(), output_arr.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct ImgHashBase {
ptr: *mut c_void
}
opencv_type_boxed! { ImgHashBase }
impl Drop for ImgHashBase {
fn drop(&mut self) {
extern "C" { fn cv_ImgHashBase_delete(instance: *mut c_void); }
unsafe { cv_ImgHashBase_delete(self.as_raw_mut_ImgHashBase()) };
}
}
unsafe impl Send for ImgHashBase {}
impl core::AlgorithmTraitConst for ImgHashBase {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for ImgHashBase {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::ImgHashBaseTraitConst for ImgHashBase {
#[inline] fn as_raw_ImgHashBase(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::ImgHashBaseTrait for ImgHashBase {
#[inline] fn as_raw_mut_ImgHashBase(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl ImgHashBase {
}
boxed_cast_base! { ImgHashBase, core::Algorithm, cv_ImgHashBase_to_Algorithm }
pub trait MarrHildrethHashTraitConst: crate::img_hash::ImgHashBaseTraitConst {
fn as_raw_MarrHildrethHash(&self) -> *const c_void;
#[inline]
fn get_alpha(&self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_MarrHildrethHash_getAlpha_const(self.as_raw_MarrHildrethHash(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_scale(&self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_MarrHildrethHash_getScale_const(self.as_raw_MarrHildrethHash(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait MarrHildrethHashTrait: crate::img_hash::ImgHashBaseTrait + crate::img_hash::MarrHildrethHashTraitConst {
fn as_raw_mut_MarrHildrethHash(&mut self) -> *mut c_void;
#[inline]
fn set_kernel_param(&mut self, alpha: f32, scale: f32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_MarrHildrethHash_setKernelParam_float_float(self.as_raw_mut_MarrHildrethHash(), alpha, scale, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct MarrHildrethHash {
ptr: *mut c_void
}
opencv_type_boxed! { MarrHildrethHash }
impl Drop for MarrHildrethHash {
fn drop(&mut self) {
extern "C" { fn cv_MarrHildrethHash_delete(instance: *mut c_void); }
unsafe { cv_MarrHildrethHash_delete(self.as_raw_mut_MarrHildrethHash()) };
}
}
unsafe impl Send for MarrHildrethHash {}
impl core::AlgorithmTraitConst for MarrHildrethHash {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for MarrHildrethHash {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::ImgHashBaseTraitConst for MarrHildrethHash {
#[inline] fn as_raw_ImgHashBase(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::ImgHashBaseTrait for MarrHildrethHash {
#[inline] fn as_raw_mut_ImgHashBase(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::MarrHildrethHashTraitConst for MarrHildrethHash {
#[inline] fn as_raw_MarrHildrethHash(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::MarrHildrethHashTrait for MarrHildrethHash {
#[inline] fn as_raw_mut_MarrHildrethHash(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl MarrHildrethHash {
#[inline]
pub fn create(alpha: f32, scale: f32) -> Result<core::Ptr<crate::img_hash::MarrHildrethHash>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_MarrHildrethHash_create_float_float(alpha, scale, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::img_hash::MarrHildrethHash>::opencv_from_extern(ret) };
Ok(ret)
}
}
boxed_cast_base! { MarrHildrethHash, core::Algorithm, cv_MarrHildrethHash_to_Algorithm }
boxed_cast_base! { MarrHildrethHash, crate::img_hash::ImgHashBase, cv_MarrHildrethHash_to_ImgHashBase }
pub trait PHashTraitConst: crate::img_hash::ImgHashBaseTraitConst {
fn as_raw_PHash(&self) -> *const c_void;
}
pub trait PHashTrait: crate::img_hash::ImgHashBaseTrait + crate::img_hash::PHashTraitConst {
fn as_raw_mut_PHash(&mut self) -> *mut c_void;
}
pub struct PHash {
ptr: *mut c_void
}
opencv_type_boxed! { PHash }
impl Drop for PHash {
fn drop(&mut self) {
extern "C" { fn cv_PHash_delete(instance: *mut c_void); }
unsafe { cv_PHash_delete(self.as_raw_mut_PHash()) };
}
}
unsafe impl Send for PHash {}
impl core::AlgorithmTraitConst for PHash {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for PHash {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::ImgHashBaseTraitConst for PHash {
#[inline] fn as_raw_ImgHashBase(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::ImgHashBaseTrait for PHash {
#[inline] fn as_raw_mut_ImgHashBase(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::PHashTraitConst for PHash {
#[inline] fn as_raw_PHash(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::PHashTrait for PHash {
#[inline] fn as_raw_mut_PHash(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl PHash {
#[inline]
pub fn create() -> Result<core::Ptr<crate::img_hash::PHash>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_PHash_create(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::img_hash::PHash>::opencv_from_extern(ret) };
Ok(ret)
}
}
boxed_cast_base! { PHash, core::Algorithm, cv_PHash_to_Algorithm }
boxed_cast_base! { PHash, crate::img_hash::ImgHashBase, cv_PHash_to_ImgHashBase }
pub trait RadialVarianceHashTraitConst: crate::img_hash::ImgHashBaseTraitConst {
fn as_raw_RadialVarianceHash(&self) -> *const c_void;
#[inline]
fn get_num_of_angle_line(&self) -> Result<i32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_getNumOfAngleLine_const(self.as_raw_RadialVarianceHash(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_sigma(&self) -> Result<f64> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_getSigma_const(self.as_raw_RadialVarianceHash(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait RadialVarianceHashTrait: crate::img_hash::ImgHashBaseTrait + crate::img_hash::RadialVarianceHashTraitConst {
fn as_raw_mut_RadialVarianceHash(&mut self) -> *mut c_void;
#[inline]
fn set_num_of_angle_line(&mut self, value: i32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_setNumOfAngleLine_int(self.as_raw_mut_RadialVarianceHash(), value, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_sigma(&mut self, value: f64) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_setSigma_double(self.as_raw_mut_RadialVarianceHash(), value, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_features(&mut self) -> Result<core::Vector<f64>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_getFeatures(self.as_raw_mut_RadialVarianceHash(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<f64>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_hash(&mut self) -> Result<core::Mat> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_getHash(self.as_raw_mut_RadialVarianceHash(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_pix_per_line(&mut self, input: &core::Mat) -> Result<core::Mat> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_getPixPerLine_const_MatR(self.as_raw_mut_RadialVarianceHash(), input.as_raw_Mat(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_projection(&mut self) -> Result<core::Mat> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_getProjection(self.as_raw_mut_RadialVarianceHash(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
Ok(ret)
}
}
pub struct RadialVarianceHash {
ptr: *mut c_void
}
opencv_type_boxed! { RadialVarianceHash }
impl Drop for RadialVarianceHash {
fn drop(&mut self) {
extern "C" { fn cv_RadialVarianceHash_delete(instance: *mut c_void); }
unsafe { cv_RadialVarianceHash_delete(self.as_raw_mut_RadialVarianceHash()) };
}
}
unsafe impl Send for RadialVarianceHash {}
impl core::AlgorithmTraitConst for RadialVarianceHash {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for RadialVarianceHash {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::ImgHashBaseTraitConst for RadialVarianceHash {
#[inline] fn as_raw_ImgHashBase(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::ImgHashBaseTrait for RadialVarianceHash {
#[inline] fn as_raw_mut_ImgHashBase(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::img_hash::RadialVarianceHashTraitConst for RadialVarianceHash {
#[inline] fn as_raw_RadialVarianceHash(&self) -> *const c_void { self.as_raw() }
}
impl crate::img_hash::RadialVarianceHashTrait for RadialVarianceHash {
#[inline] fn as_raw_mut_RadialVarianceHash(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl RadialVarianceHash {
#[inline]
pub fn create(sigma: f64, num_of_angle_line: i32) -> Result<core::Ptr<crate::img_hash::RadialVarianceHash>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_img_hash_RadialVarianceHash_create_double_int(sigma, num_of_angle_line, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::img_hash::RadialVarianceHash>::opencv_from_extern(ret) };
Ok(ret)
}
}
boxed_cast_base! { RadialVarianceHash, core::Algorithm, cv_RadialVarianceHash_to_Algorithm }
boxed_cast_base! { RadialVarianceHash, crate::img_hash::ImgHashBase, cv_RadialVarianceHash_to_ImgHashBase }