opencv 0.94.4

Rust bindings for OpenCV
Documentation
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
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
pub mod ovis {
	//! # OGRE 3D Visualiser
	//!
	//! ovis is a simplified rendering wrapper around [ogre3d](https://www.ogre3d.org/).
	//! The [Ogre terminology](https://ogrecave.github.io/ogre/api/latest/_the-_core-_objects.html) is used in the API
	//! and [Ogre Script](https://ogrecave.github.io/ogre/api/latest/_scripts.html) is assumed to be used for advanced customization.
	//!
	//! Besides the API you see here, there are several environment variables that control the behavior of ovis.
	//! They are documented in [createWindow].
	//!
	//! ## Loading geometry
	//!
	//! You can create geometry [on the fly]([createTriangleMesh]) or by loading Ogre `.mesh` files.
	//!
	//! ### Blender
	//! For converting/ creating geometry [Blender](https://www.blender.org/) is recommended.
	//! - Blender 2.7x is better tested, but Blender 2.8x should work too
	//! - install [blender2ogre](https://github.com/OGRECave/blender2ogre) matching your Blender version
	//! - download the [Ogre MSVC SDK](https://www.ogre3d.org/download/sdk/sdk-ogre) which contains `OgreXMLConverter.exe` (in `bin/`) and set the path in the blender2ogre settings
	//! - get [ogre-meshviewer](https://github.com/OGRECave/ogre-meshviewer) to enable the preview function in blender2ogre as well as for verifying the exported files
	//! - in case the exported materials are not exactly how you want them, consult the [Ogre Manual](https://ogrecave.github.io/ogre/api/latest/_material-_scripts.html)
	//!
	//! ### Assimp
	//! When using Ogre 1.12.9 or later, enabling the Assimp plugin allows to load arbitrary geometry.
	//! Simply pass `bunny.obj` instead of `bunny.mesh` as `meshname` in [WindowScene::createEntity].
	//!
	//! You should still use ogre-meshviewer to verify that the geometry is converted correctly.
	use crate::mod_prelude::*;
	use crate::{core, sys, types};
	pub mod prelude {
		pub use super::{WindowSceneTrait, WindowSceneTraitConst};
	}

	pub const ENTITY_AABB_WORLD: i32 = 2;
	pub const ENTITY_ANIMBLEND_MODE: i32 = 3;
	pub const ENTITY_CAST_SHADOWS: i32 = 4;
	pub const ENTITY_MATERIAL: i32 = 0;
	pub const ENTITY_SCALE: i32 = 1;
	pub const MATERIAL_DIFFUSE: i32 = 4;
	pub const MATERIAL_EMISSIVE: i32 = 3;
	pub const MATERIAL_LINE_WIDTH: i32 = 1;
	pub const MATERIAL_OPACITY: i32 = 2;
	pub const MATERIAL_POINT_SIZE: i32 = 0;
	pub const MATERIAL_TEXTURE: i32 = 5;
	pub const MATERIAL_TEXTURE0: i32 = 5;
	pub const MATERIAL_TEXTURE1: i32 = 6;
	pub const MATERIAL_TEXTURE2: i32 = 7;
	pub const MATERIAL_TEXTURE3: i32 = 8;
	/// Apply anti-aliasing. The first window determines the setting for all windows.
	pub const SCENE_AA: i32 = 8;
	/// allow the user to control the camera.
	pub const SCENE_INTERACTIVE: i32 = 2;
	/// Render off-screen without a window. Allows separate AA setting. Requires manual update via [WindowScene::update]
	pub const SCENE_OFFSCREEN: i32 = 16;
	/// the window will use a separate scene. The scene will be shared otherwise.
	pub const SCENE_SEPARATE: i32 = 1;
	/// Enable real-time shadows in the scene. All entities cast shadows by default. Control via [ENTITY_CAST_SHADOWS]
	pub const SCENE_SHADOWS: i32 = 32;
	/// draw coordinate system crosses for debugging
	pub const SCENE_SHOW_CS_CROSS: i32 = 4;
	#[repr(C)]
	#[derive(Copy, Clone, Debug, PartialEq, Eq)]
	pub enum EntityProperty {
		ENTITY_MATERIAL = 0,
		ENTITY_SCALE = 1,
		ENTITY_AABB_WORLD = 2,
		ENTITY_ANIMBLEND_MODE = 3,
		ENTITY_CAST_SHADOWS = 4,
	}

	impl TryFrom<i32> for EntityProperty {
		type Error = crate::Error;

		fn try_from(value: i32) -> Result<Self, Self::Error> {
			match value {
				0 => Ok(Self::ENTITY_MATERIAL),
				1 => Ok(Self::ENTITY_SCALE),
				2 => Ok(Self::ENTITY_AABB_WORLD),
				3 => Ok(Self::ENTITY_ANIMBLEND_MODE),
				4 => Ok(Self::ENTITY_CAST_SHADOWS),
				_ => Err(crate::Error::new(crate::core::StsBadArg, format!("Value: {value} is not valid for enum: crate::ovis::EntityProperty"))),
			}
		}
	}

	opencv_type_enum! { crate::ovis::EntityProperty }

	#[repr(C)]
	#[derive(Copy, Clone, Debug, PartialEq, Eq)]
	pub enum MaterialProperty {
		MATERIAL_POINT_SIZE = 0,
		MATERIAL_LINE_WIDTH = 1,
		MATERIAL_OPACITY = 2,
		MATERIAL_EMISSIVE = 3,
		MATERIAL_DIFFUSE = 4,
		MATERIAL_TEXTURE0 = 5,
		// Duplicate, use MATERIAL_TEXTURE0 instead
		// MATERIAL_TEXTURE = 5,
		MATERIAL_TEXTURE1 = 6,
		MATERIAL_TEXTURE2 = 7,
		MATERIAL_TEXTURE3 = 8,
	}

	impl TryFrom<i32> for MaterialProperty {
		type Error = crate::Error;

		fn try_from(value: i32) -> Result<Self, Self::Error> {
			match value {
				0 => Ok(Self::MATERIAL_POINT_SIZE),
				1 => Ok(Self::MATERIAL_LINE_WIDTH),
				2 => Ok(Self::MATERIAL_OPACITY),
				3 => Ok(Self::MATERIAL_EMISSIVE),
				4 => Ok(Self::MATERIAL_DIFFUSE),
				5 => Ok(Self::MATERIAL_TEXTURE0),
				// Duplicate of MATERIAL_TEXTURE0
				// 5 => Ok(Self::MATERIAL_TEXTURE),
				6 => Ok(Self::MATERIAL_TEXTURE1),
				7 => Ok(Self::MATERIAL_TEXTURE2),
				8 => Ok(Self::MATERIAL_TEXTURE3),
				_ => Err(crate::Error::new(crate::core::StsBadArg, format!("Value: {value} is not valid for enum: crate::ovis::MaterialProperty"))),
			}
		}
	}

	opencv_type_enum! { crate::ovis::MaterialProperty }

	#[repr(C)]
	#[derive(Copy, Clone, Debug, PartialEq, Eq)]
	pub enum SceneSettings {
		/// the window will use a separate scene. The scene will be shared otherwise.
		SCENE_SEPARATE = 1,
		/// allow the user to control the camera.
		SCENE_INTERACTIVE = 2,
		/// draw coordinate system crosses for debugging
		SCENE_SHOW_CS_CROSS = 4,
		/// Apply anti-aliasing. The first window determines the setting for all windows.
		SCENE_AA = 8,
		/// Render off-screen without a window. Allows separate AA setting. Requires manual update via [WindowScene::update]
		SCENE_OFFSCREEN = 16,
		/// Enable real-time shadows in the scene. All entities cast shadows by default. Control via [ENTITY_CAST_SHADOWS]
		SCENE_SHADOWS = 32,
	}

	impl TryFrom<i32> for SceneSettings {
		type Error = crate::Error;

		fn try_from(value: i32) -> Result<Self, Self::Error> {
			match value {
				1 => Ok(Self::SCENE_SEPARATE),
				2 => Ok(Self::SCENE_INTERACTIVE),
				4 => Ok(Self::SCENE_SHOW_CS_CROSS),
				8 => Ok(Self::SCENE_AA),
				16 => Ok(Self::SCENE_OFFSCREEN),
				32 => Ok(Self::SCENE_SHADOWS),
				_ => Err(crate::Error::new(crate::core::StsBadArg, format!("Value: {value} is not valid for enum: crate::ovis::SceneSettings"))),
			}
		}
	}

	opencv_type_enum! { crate::ovis::SceneSettings }

	/// Add an additional resource location that is search for meshes, textures and materials
	///
	/// must be called before the first createWindow. If give path does not exist, retries inside
	/// Ogre Media Directory.
	/// ## Parameters
	/// * path: folder or Zip archive.
	#[inline]
	pub fn add_resource_location(path: &str) -> Result<()> {
		extern_container_arg!(path);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_addResourceLocation_const_StringR(path.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// creates a grid
	///
	/// creates a material with the same name
	/// ## Parameters
	/// * name: name of the mesh
	/// * size: extents of the grid
	/// * segments: number of segments per side
	///
	/// ## Note
	/// This alternative version of [create_grid_mesh] function uses the following default values for its arguments:
	/// * segments: Size(1,1)
	#[inline]
	pub fn create_grid_mesh_def(name: &str, size: core::Size2f) -> Result<()> {
		extern_container_arg!(name);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createGridMesh_const_StringR_const_Size2fR(name.opencv_as_extern(), &size, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// creates a grid
	///
	/// creates a material with the same name
	/// ## Parameters
	/// * name: name of the mesh
	/// * size: extents of the grid
	/// * segments: number of segments per side
	///
	/// ## C++ default parameters
	/// * segments: Size(1,1)
	#[inline]
	pub fn create_grid_mesh(name: &str, size: core::Size2f, segments: core::Size) -> Result<()> {
		extern_container_arg!(name);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createGridMesh_const_StringR_const_Size2fR_const_SizeR(name.opencv_as_extern(), &size, &segments, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// create a 2D plane, X right, Y down, Z up
	///
	/// creates a material with the same name
	/// ## Parameters
	/// * name: name of the mesh
	/// * size: size in world units
	/// * image: optional texture
	///
	/// ## Note
	/// This alternative version of [create_plane_mesh] function uses the following default values for its arguments:
	/// * image: noArray()
	#[inline]
	pub fn create_plane_mesh_def(name: &str, size: core::Size2f) -> Result<()> {
		extern_container_arg!(name);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createPlaneMesh_const_StringR_const_Size2fR(name.opencv_as_extern(), &size, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// create a 2D plane, X right, Y down, Z up
	///
	/// creates a material with the same name
	/// ## Parameters
	/// * name: name of the mesh
	/// * size: size in world units
	/// * image: optional texture
	///
	/// ## C++ default parameters
	/// * image: noArray()
	#[inline]
	pub fn create_plane_mesh(name: &str, size: core::Size2f, image: &impl ToInputArray) -> Result<()> {
		extern_container_arg!(name);
		input_array_arg!(image);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createPlaneMesh_const_StringR_const_Size2fR_const__InputArrayR(name.opencv_as_extern(), &size, image.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// creates a point cloud mesh
	///
	/// creates a material with the same name
	/// ## Parameters
	/// * name: name of the mesh
	/// * vertices: float vector of positions
	/// * colors: uchar vector of colors
	///
	/// ## Note
	/// This alternative version of [create_point_cloud_mesh] function uses the following default values for its arguments:
	/// * colors: noArray()
	#[inline]
	pub fn create_point_cloud_mesh_def(name: &str, vertices: &impl ToInputArray) -> Result<()> {
		extern_container_arg!(name);
		input_array_arg!(vertices);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createPointCloudMesh_const_StringR_const__InputArrayR(name.opencv_as_extern(), vertices.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// creates a point cloud mesh
	///
	/// creates a material with the same name
	/// ## Parameters
	/// * name: name of the mesh
	/// * vertices: float vector of positions
	/// * colors: uchar vector of colors
	///
	/// ## C++ default parameters
	/// * colors: noArray()
	#[inline]
	pub fn create_point_cloud_mesh(name: &str, vertices: &impl ToInputArray, colors: &impl ToInputArray) -> Result<()> {
		extern_container_arg!(name);
		input_array_arg!(vertices);
		input_array_arg!(colors);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createPointCloudMesh_const_StringR_const__InputArrayR_const__InputArrayR(name.opencv_as_extern(), vertices.as_raw__InputArray(), colors.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// creates a triangle mesh from vertex-vertex or face-vertex representation
	///
	/// creates a material with the same name
	/// ## Parameters
	/// * name: name of the mesh
	/// * vertices: float vector of positions
	/// * normals: float vector of normals
	/// * indices: int vector of indices
	///
	/// ## Note
	/// This alternative version of [create_triangle_mesh] function uses the following default values for its arguments:
	/// * normals: noArray()
	/// * indices: noArray()
	#[inline]
	pub fn create_triangle_mesh_def(name: &str, vertices: &impl ToInputArray) -> Result<()> {
		extern_container_arg!(name);
		input_array_arg!(vertices);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createTriangleMesh_const_StringR_const__InputArrayR(name.opencv_as_extern(), vertices.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// creates a triangle mesh from vertex-vertex or face-vertex representation
	///
	/// creates a material with the same name
	/// ## Parameters
	/// * name: name of the mesh
	/// * vertices: float vector of positions
	/// * normals: float vector of normals
	/// * indices: int vector of indices
	///
	/// ## C++ default parameters
	/// * normals: noArray()
	/// * indices: noArray()
	#[inline]
	pub fn create_triangle_mesh(name: &str, vertices: &impl ToInputArray, normals: &impl ToInputArray, indices: &impl ToInputArray) -> Result<()> {
		extern_container_arg!(name);
		input_array_arg!(vertices);
		input_array_arg!(normals);
		input_array_arg!(indices);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createTriangleMesh_const_StringR_const__InputArrayR_const__InputArrayR_const__InputArrayR(name.opencv_as_extern(), vertices.as_raw__InputArray(), normals.as_raw__InputArray(), indices.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// create a new rendering window/ viewport
	/// ## Parameters
	/// * title: window title
	/// * size: size of the window
	/// * flags: a combination of [SceneSettings]
	///
	/// Furthermore, the behavior is controlled by the following environment variables
	/// - OPENCV_OVIS_VERBOSE_LOG: print all of OGRE log output
	/// - OPENCV_OVIS_RENDERSYSTEM: the name of the OGRE RenderSystem to use
	/// - OPENCV_OVIS_NOVSYNC: disable VSYNC for all windows
	///
	/// ## Note
	/// This alternative version of [create_window] function uses the following default values for its arguments:
	/// * flags: SCENE_INTERACTIVE|SCENE_AA
	#[inline]
	pub fn create_window_def(title: &str, size: core::Size) -> Result<core::Ptr<crate::ovis::WindowScene>> {
		extern_container_arg!(title);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createWindow_const_StringR_const_SizeR(title.opencv_as_extern(), &size, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		let ret = unsafe { core::Ptr::<crate::ovis::WindowScene>::opencv_from_extern(ret) };
		Ok(ret)
	}

	/// create a new rendering window/ viewport
	/// ## Parameters
	/// * title: window title
	/// * size: size of the window
	/// * flags: a combination of [SceneSettings]
	///
	/// Furthermore, the behavior is controlled by the following environment variables
	/// - OPENCV_OVIS_VERBOSE_LOG: print all of OGRE log output
	/// - OPENCV_OVIS_RENDERSYSTEM: the name of the OGRE RenderSystem to use
	/// - OPENCV_OVIS_NOVSYNC: disable VSYNC for all windows
	///
	/// ## C++ default parameters
	/// * flags: SCENE_INTERACTIVE|SCENE_AA
	#[inline]
	pub fn create_window(title: &str, size: core::Size, flags: i32) -> Result<core::Ptr<crate::ovis::WindowScene>> {
		extern_container_arg!(title);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_createWindow_const_StringR_const_SizeR_int(title.opencv_as_extern(), &size, flags, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		let ret = unsafe { core::Ptr::<crate::ovis::WindowScene>::opencv_from_extern(ret) };
		Ok(ret)
	}

	/// set the shader property of a material to the given value
	/// ## Parameters
	/// * name: material name
	/// * prop: property name
	/// * value: the value
	#[inline]
	pub fn set_material_property_2(name: &str, prop: &str, value: core::Scalar) -> Result<()> {
		extern_container_arg!(name);
		extern_container_arg!(prop);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_setMaterialProperty_const_StringR_const_StringR_const_ScalarR(name.opencv_as_extern(), prop.opencv_as_extern(), &value, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// set the property of a material to the given value
	/// ## Parameters
	/// * name: material name
	/// * prop: [MaterialProperty]
	/// * value: the value
	#[inline]
	pub fn set_material_property(name: &str, prop: i32, value: core::Scalar) -> Result<()> {
		extern_container_arg!(name);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_setMaterialProperty_const_StringR_int_const_ScalarR(name.opencv_as_extern(), prop, &value, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// set the property of a material to the given value
	/// ## Parameters
	/// * name: material name
	/// * prop: [MaterialProperty]
	/// * value: the value
	///
	/// ## Overloaded parameters
	#[inline]
	pub fn set_material_property_1(name: &str, prop: i32, value: &str) -> Result<()> {
		extern_container_arg!(name);
		extern_container_arg!(value);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_setMaterialProperty_const_StringR_int_const_StringR(name.opencv_as_extern(), prop, value.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// set the texture of a material to the given value
	/// ## Parameters
	/// * name: material name
	/// * prop: [MaterialProperty]
	/// * value: the texture data
	#[inline]
	pub fn set_material_texture(name: &str, prop: i32, value: &impl ToInputArray) -> Result<()> {
		extern_container_arg!(name);
		input_array_arg!(value);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_setMaterialProperty_const_StringR_int_const__InputArrayR(name.opencv_as_extern(), prop, value.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	///
	/// **Deprecated**: use setMaterialProperty
	#[deprecated = "use setMaterialProperty"]
	#[inline]
	pub fn update_texture(name: &str, image: &impl ToInputArray) -> Result<()> {
		extern_container_arg!(name);
		input_array_arg!(image);
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_updateTexture_const_StringR_const__InputArrayR(name.opencv_as_extern(), image.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// update all windows and wait for keyboard event
	///
	/// ## Parameters
	/// * delay: 0 is the special value that means "forever".
	///        Any positive number returns after sync to blank (typically 16ms).
	/// ## Returns
	/// the code of the pressed key or -1 if no key was pressed
	///
	/// ## Note
	/// This alternative version of [wait_key] function uses the following default values for its arguments:
	/// * delay: 0
	#[inline]
	pub fn wait_key_def() -> Result<i32> {
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_waitKey(ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// update all windows and wait for keyboard event
	///
	/// ## Parameters
	/// * delay: 0 is the special value that means "forever".
	///        Any positive number returns after sync to blank (typically 16ms).
	/// ## Returns
	/// the code of the pressed key or -1 if no key was pressed
	///
	/// ## C++ default parameters
	/// * delay: 0
	#[inline]
	pub fn wait_key(delay: i32) -> Result<i32> {
		return_send!(via ocvrs_return);
		unsafe { sys::cv_ovis_waitKey_int(delay, ocvrs_return.as_mut_ptr()) };
		return_receive!(ocvrs_return => ret);
		let ret = ret.into_result()?;
		Ok(ret)
	}

	/// A 3D viewport and the associated scene
	pub struct WindowScene {
		ptr: *mut c_void,
	}

	opencv_type_boxed! { WindowScene }

	impl Drop for WindowScene {
		#[inline]
		fn drop(&mut self) {
			unsafe { sys::cv_ovis_WindowScene_delete(self.as_raw_mut_WindowScene()) };
		}
	}

	unsafe impl Send for WindowScene {}

	/// Constant methods for [crate::ovis::WindowScene]
	pub trait WindowSceneTraitConst {
		fn as_raw_WindowScene(&self) -> *const c_void;

	}

	/// Mutable methods for [crate::ovis::WindowScene]
	pub trait WindowSceneTrait: crate::ovis::WindowSceneTraitConst {
		fn as_raw_mut_WindowScene(&mut self) -> *mut c_void;

		/// set window background to custom image/ color
		/// ## Parameters
		/// * image: 
		#[inline]
		fn set_background(&mut self, image: &impl ToInputArray) -> Result<()> {
			input_array_arg!(image);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setBackground_const__InputArrayR(self.as_raw_mut_WindowScene(), image.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// set window background to custom image/ color
		/// ## Parameters
		/// * image: 
		///
		/// ## Overloaded parameters
		#[inline]
		fn set_background_color(&mut self, color: core::Scalar) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setBackground_const_ScalarR(self.as_raw_mut_WindowScene(), &color, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// enable an ordered chain of full-screen post processing effects
		///
		/// this way you can add distortion or SSAO effects.
		/// The effects themselves must be defined inside Ogre .compositor scripts.
		/// ## Parameters
		/// * names: compositor names that will be applied in order of appearance
		/// ## See also
		/// addResourceLocation
		#[inline]
		fn set_compositors(&mut self, names: &core::Vector<String>) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setCompositors_const_vectorLStringGR(self.as_raw_mut_WindowScene(), names.as_raw_VectorOfString(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// place an entity of a mesh in the scene
		///
		/// the mesh needs to be created beforehand. Either programmatically
		/// by e.g. [createPointCloudMesh] or by placing the respective file in a resource location.
		/// ## Parameters
		/// * name: entity name
		/// * meshname: mesh name
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// ## See also
		/// addResourceLocation
		///
		/// ## C++ default parameters
		/// * tvec: noArray()
		/// * rot: noArray()
		#[inline]
		fn create_entity(&mut self, name: &str, meshname: &str, tvec: &impl ToInputArray, rot: &impl ToInputArray) -> Result<()> {
			extern_container_arg!(name);
			extern_container_arg!(meshname);
			input_array_arg!(tvec);
			input_array_arg!(rot);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_createEntity_const_StringR_const_StringR_const__InputArrayR_const__InputArrayR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), meshname.opencv_as_extern(), tvec.as_raw__InputArray(), rot.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// place an entity of a mesh in the scene
		///
		/// the mesh needs to be created beforehand. Either programmatically
		/// by e.g. [createPointCloudMesh] or by placing the respective file in a resource location.
		/// ## Parameters
		/// * name: entity name
		/// * meshname: mesh name
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// ## See also
		/// addResourceLocation
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::create_entity] function uses the following default values for its arguments:
		/// * tvec: noArray()
		/// * rot: noArray()
		#[inline]
		fn create_entity_def(&mut self, name: &str, meshname: &str) -> Result<()> {
			extern_container_arg!(name);
			extern_container_arg!(meshname);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_createEntity_const_StringR_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), meshname.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// remove an entity from the scene
		/// ## Parameters
		/// * name: entity name
		#[inline]
		fn remove_entity(&mut self, name: &str) -> Result<()> {
			extern_container_arg!(name);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_removeEntity_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// set the property of an entity to the given value
		/// ## Parameters
		/// * name: entity name
		/// * prop: [EntityProperty]
		/// * value: the value
		/// * subEntityIdx: index of the sub-entity (default: all)
		///
		/// ## C++ default parameters
		/// * sub_entity_idx: -1
		#[inline]
		fn set_entity_property(&mut self, name: &str, prop: i32, value: &str, sub_entity_idx: i32) -> Result<()> {
			extern_container_arg!(name);
			extern_container_arg!(value);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setEntityProperty_const_StringR_int_const_StringR_int(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), prop, value.opencv_as_extern(), sub_entity_idx, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// set the property of an entity to the given value
		/// ## Parameters
		/// * name: entity name
		/// * prop: [EntityProperty]
		/// * value: the value
		/// * subEntityIdx: index of the sub-entity (default: all)
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::set_entity_property] function uses the following default values for its arguments:
		/// * sub_entity_idx: -1
		#[inline]
		fn set_entity_property_def(&mut self, name: &str, prop: i32, value: &str) -> Result<()> {
			extern_container_arg!(name);
			extern_container_arg!(value);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setEntityProperty_const_StringR_int_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), prop, value.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// set the property of an entity to the given value
		/// ## Parameters
		/// * name: entity name
		/// * prop: [EntityProperty]
		/// * value: the value
		/// * subEntityIdx: index of the sub-entity (default: all)
		///
		/// ## Overloaded parameters
		#[inline]
		fn set_entity_property_1(&mut self, name: &str, prop: i32, value: core::Scalar) -> Result<()> {
			extern_container_arg!(name);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setEntityProperty_const_StringR_int_const_ScalarR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), prop, &value, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// get the property of an entity
		/// ## Parameters
		/// * name: entity name
		/// * prop: [EntityProperty]
		/// * value: the value
		#[inline]
		fn get_entity_property(&mut self, name: &str, prop: i32, value: &mut impl ToOutputArray) -> Result<()> {
			extern_container_arg!(name);
			output_array_arg!(value);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getEntityProperty_const_StringR_int_const__OutputArrayR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), prop, value.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// convenience method to visualize a camera position
		///
		/// ## Parameters
		/// * name: entity name
		/// * K: intrinsic matrix
		/// * imsize: image size
		/// * zFar: far plane in camera coordinates
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// * color: line color
		/// ## Returns
		/// the extents of the Frustum at far plane, where the top left corner denotes the principal
		/// point offset
		///
		/// ## C++ default parameters
		/// * tvec: noArray()
		/// * rot: noArray()
		/// * color: Scalar::all(1)
		#[inline]
		fn create_camera_entity(&mut self, name: &str, k: &impl ToInputArray, imsize: core::Size, z_far: f32, tvec: &impl ToInputArray, rot: &impl ToInputArray, color: core::Scalar) -> Result<core::Rect2d> {
			extern_container_arg!(name);
			input_array_arg!(k);
			input_array_arg!(tvec);
			input_array_arg!(rot);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_createCameraEntity_const_StringR_const__InputArrayR_const_SizeR_float_const__InputArrayR_const__InputArrayR_const_ScalarR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), k.as_raw__InputArray(), &imsize, z_far, tvec.as_raw__InputArray(), rot.as_raw__InputArray(), &color, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// convenience method to visualize a camera position
		///
		/// ## Parameters
		/// * name: entity name
		/// * K: intrinsic matrix
		/// * imsize: image size
		/// * zFar: far plane in camera coordinates
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// * color: line color
		/// ## Returns
		/// the extents of the Frustum at far plane, where the top left corner denotes the principal
		/// point offset
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::create_camera_entity] function uses the following default values for its arguments:
		/// * tvec: noArray()
		/// * rot: noArray()
		/// * color: Scalar::all(1)
		#[inline]
		fn create_camera_entity_def(&mut self, name: &str, k: &impl ToInputArray, imsize: core::Size, z_far: f32) -> Result<core::Rect2d> {
			extern_container_arg!(name);
			input_array_arg!(k);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_createCameraEntity_const_StringR_const__InputArrayR_const_SizeR_float(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), k.as_raw__InputArray(), &imsize, z_far, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// creates a point light in the scene
		/// ## Parameters
		/// * name: entity name
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// * diffuseColor: 
		/// * specularColor: 
		///
		/// ## C++ default parameters
		/// * tvec: noArray()
		/// * rot: noArray()
		/// * diffuse_color: Scalar::all(1)
		/// * specular_color: Scalar::all(1)
		#[inline]
		fn create_light_entity(&mut self, name: &str, tvec: &impl ToInputArray, rot: &impl ToInputArray, diffuse_color: core::Scalar, specular_color: core::Scalar) -> Result<()> {
			extern_container_arg!(name);
			input_array_arg!(tvec);
			input_array_arg!(rot);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_createLightEntity_const_StringR_const__InputArrayR_const__InputArrayR_const_ScalarR_const_ScalarR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), tvec.as_raw__InputArray(), rot.as_raw__InputArray(), &diffuse_color, &specular_color, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// creates a point light in the scene
		/// ## Parameters
		/// * name: entity name
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// * diffuseColor: 
		/// * specularColor: 
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::create_light_entity] function uses the following default values for its arguments:
		/// * tvec: noArray()
		/// * rot: noArray()
		/// * diffuse_color: Scalar::all(1)
		/// * specular_color: Scalar::all(1)
		#[inline]
		fn create_light_entity_def(&mut self, name: &str) -> Result<()> {
			extern_container_arg!(name);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_createLightEntity_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// update entity pose by transformation in the parent coordinate space. (pre-rotation)
		/// ## Parameters
		/// * name: entity name
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		///
		/// ## C++ default parameters
		/// * tvec: noArray()
		/// * rot: noArray()
		#[inline]
		fn update_entity_pose(&mut self, name: &str, tvec: &impl ToInputArray, rot: &impl ToInputArray) -> Result<()> {
			extern_container_arg!(name);
			input_array_arg!(tvec);
			input_array_arg!(rot);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_updateEntityPose_const_StringR_const__InputArrayR_const__InputArrayR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), tvec.as_raw__InputArray(), rot.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// update entity pose by transformation in the parent coordinate space. (pre-rotation)
		/// ## Parameters
		/// * name: entity name
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::update_entity_pose] function uses the following default values for its arguments:
		/// * tvec: noArray()
		/// * rot: noArray()
		#[inline]
		fn update_entity_pose_def(&mut self, name: &str) -> Result<()> {
			extern_container_arg!(name);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_updateEntityPose_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// set entity pose in the world coordinate space.
		/// ## Parameters
		/// * name: enitity name
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// * invert: use the inverse of the given pose
		///
		/// ## C++ default parameters
		/// * tvec: noArray()
		/// * rot: noArray()
		/// * invert: false
		#[inline]
		fn set_entity_pose(&mut self, name: &str, tvec: &impl ToInputArray, rot: &impl ToInputArray, invert: bool) -> Result<()> {
			extern_container_arg!(name);
			input_array_arg!(tvec);
			input_array_arg!(rot);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setEntityPose_const_StringR_const__InputArrayR_const__InputArrayR_bool(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), tvec.as_raw__InputArray(), rot.as_raw__InputArray(), invert, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// set entity pose in the world coordinate space.
		/// ## Parameters
		/// * name: enitity name
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// * invert: use the inverse of the given pose
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::set_entity_pose] function uses the following default values for its arguments:
		/// * tvec: noArray()
		/// * rot: noArray()
		/// * invert: false
		#[inline]
		fn set_entity_pose_def(&mut self, name: &str) -> Result<()> {
			extern_container_arg!(name);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setEntityPose_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Retrieves the current pose of an entity
		/// ## Parameters
		/// * name: entity name
		/// * R: 3x3 rotation matrix
		/// * tvec: translation vector
		/// * invert: return the inverted pose
		///
		/// ## C++ default parameters
		/// * r: noArray()
		/// * tvec: noArray()
		/// * invert: false
		#[inline]
		fn get_entity_pose(&mut self, name: &str, r: &mut impl ToOutputArray, tvec: &mut impl ToOutputArray, invert: bool) -> Result<()> {
			extern_container_arg!(name);
			output_array_arg!(r);
			output_array_arg!(tvec);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getEntityPose_const_StringR_const__OutputArrayR_const__OutputArrayR_bool(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), r.as_raw__OutputArray(), tvec.as_raw__OutputArray(), invert, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Retrieves the current pose of an entity
		/// ## Parameters
		/// * name: entity name
		/// * R: 3x3 rotation matrix
		/// * tvec: translation vector
		/// * invert: return the inverted pose
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::get_entity_pose] function uses the following default values for its arguments:
		/// * r: noArray()
		/// * tvec: noArray()
		/// * invert: false
		#[inline]
		fn get_entity_pose_def(&mut self, name: &str) -> Result<()> {
			extern_container_arg!(name);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getEntityPose_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// get a list of available entity animations
		/// ## Parameters
		/// * name: entity name
		/// * out: the animation names
		#[inline]
		fn get_entity_animations(&mut self, name: &str, out: &mut core::Vector<String>) -> Result<()> {
			extern_container_arg!(name);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getEntityAnimations_const_StringR_vectorLStringGR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), out.as_raw_mut_VectorOfString(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// play entity animation
		/// ## Parameters
		/// * name: entity name
		/// * animname: animation name
		/// * loop: enable or disable animation loop
		/// ## See also
		/// getEntityAnimations
		///
		/// ## C++ default parameters
		/// * loop_: true
		#[inline]
		fn play_entity_animation(&mut self, name: &str, animname: &str, loop_: bool) -> Result<()> {
			extern_container_arg!(name);
			extern_container_arg!(animname);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_playEntityAnimation_const_StringR_const_StringR_bool(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), animname.opencv_as_extern(), loop_, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// play entity animation
		/// ## Parameters
		/// * name: entity name
		/// * animname: animation name
		/// * loop: enable or disable animation loop
		/// ## See also
		/// getEntityAnimations
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::play_entity_animation] function uses the following default values for its arguments:
		/// * loop_: true
		#[inline]
		fn play_entity_animation_def(&mut self, name: &str, animname: &str) -> Result<()> {
			extern_container_arg!(name);
			extern_container_arg!(animname);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_playEntityAnimation_const_StringR_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), animname.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// stop entity animation
		/// ## Parameters
		/// * name: enitity name
		/// * animname: animation name
		#[inline]
		fn stop_entity_animation(&mut self, name: &str, animname: &str) -> Result<()> {
			extern_container_arg!(name);
			extern_container_arg!(animname);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_stopEntityAnimation_const_StringR_const_StringR(self.as_raw_mut_WindowScene(), name.opencv_as_extern(), animname.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// read back the image generated by the last call to [waitKey]
		#[inline]
		fn get_screenshot(&mut self, frame: &mut impl ToOutputArray) -> Result<()> {
			output_array_arg!(frame);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getScreenshot_const__OutputArrayR(self.as_raw_mut_WindowScene(), frame.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// read back the texture of an active compositor
		/// ## Parameters
		/// * compname: name of the compositor
		/// * texname: name of the texture inside the compositor
		/// * mrtIndex: if texture is a MRT, specifies the attachment
		/// * out: the texture contents
		///
		/// ## C++ default parameters
		/// * mrt_index: 0
		#[inline]
		fn get_compositor_texture(&mut self, compname: &str, texname: &str, out: &mut impl ToOutputArray, mrt_index: i32) -> Result<()> {
			extern_container_arg!(compname);
			extern_container_arg!(texname);
			output_array_arg!(out);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getCompositorTexture_const_StringR_const_StringR_const__OutputArrayR_int(self.as_raw_mut_WindowScene(), compname.opencv_as_extern(), texname.opencv_as_extern(), out.as_raw__OutputArray(), mrt_index, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// read back the texture of an active compositor
		/// ## Parameters
		/// * compname: name of the compositor
		/// * texname: name of the texture inside the compositor
		/// * mrtIndex: if texture is a MRT, specifies the attachment
		/// * out: the texture contents
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::get_compositor_texture] function uses the following default values for its arguments:
		/// * mrt_index: 0
		#[inline]
		fn get_compositor_texture_def(&mut self, compname: &str, texname: &str, out: &mut impl ToOutputArray) -> Result<()> {
			extern_container_arg!(compname);
			extern_container_arg!(texname);
			output_array_arg!(out);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getCompositorTexture_const_StringR_const_StringR_const__OutputArrayR(self.as_raw_mut_WindowScene(), compname.opencv_as_extern(), texname.opencv_as_extern(), out.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// get the depth for the current frame.
		///
		/// return the per pixel distance to the camera in world units
		#[inline]
		fn get_depth(&mut self, depth: &mut impl ToOutputArray) -> Result<()> {
			output_array_arg!(depth);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getDepth_const__OutputArrayR(self.as_raw_mut_WindowScene(), depth.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// convenience method to force the "up" axis to stay fixed
		///
		/// works with both programmatic changes and SCENE_INTERACTIVE
		/// ## Parameters
		/// * useFixed: whether to enforce the fixed yaw axis
		/// * up: the axis to be fixed
		///
		/// ## C++ default parameters
		/// * up: noArray()
		#[inline]
		fn fix_camera_yaw_axis(&mut self, use_fixed: bool, up: &impl ToInputArray) -> Result<()> {
			input_array_arg!(up);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_fixCameraYawAxis_bool_const__InputArrayR(self.as_raw_mut_WindowScene(), use_fixed, up.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// convenience method to force the "up" axis to stay fixed
		///
		/// works with both programmatic changes and SCENE_INTERACTIVE
		/// ## Parameters
		/// * useFixed: whether to enforce the fixed yaw axis
		/// * up: the axis to be fixed
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::fix_camera_yaw_axis] function uses the following default values for its arguments:
		/// * up: noArray()
		#[inline]
		fn fix_camera_yaw_axis_def(&mut self, use_fixed: bool) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_fixCameraYawAxis_bool(self.as_raw_mut_WindowScene(), use_fixed, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Sets the current camera pose
		/// ## Parameters
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// * invert: use the inverse of the given pose
		///
		/// ## C++ default parameters
		/// * tvec: noArray()
		/// * rot: noArray()
		/// * invert: false
		#[inline]
		fn set_camera_pose(&mut self, tvec: &impl ToInputArray, rot: &impl ToInputArray, invert: bool) -> Result<()> {
			input_array_arg!(tvec);
			input_array_arg!(rot);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setCameraPose_const__InputArrayR_const__InputArrayR_bool(self.as_raw_mut_WindowScene(), tvec.as_raw__InputArray(), rot.as_raw__InputArray(), invert, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Sets the current camera pose
		/// ## Parameters
		/// * tvec: translation
		/// * rot: [Rodrigues] vector or 3x3 rotation matrix
		/// * invert: use the inverse of the given pose
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::set_camera_pose] function uses the following default values for its arguments:
		/// * tvec: noArray()
		/// * rot: noArray()
		/// * invert: false
		#[inline]
		fn set_camera_pose_def(&mut self) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setCameraPose(self.as_raw_mut_WindowScene(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// convenience method to orient the camera to a specific entity
		/// ## Parameters
		/// * target: entity name
		/// * offset: offset from entity centre
		///
		/// ## C++ default parameters
		/// * offset: noArray()
		#[inline]
		fn set_camera_look_at(&mut self, target: &str, offset: &impl ToInputArray) -> Result<()> {
			extern_container_arg!(target);
			input_array_arg!(offset);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setCameraLookAt_const_StringR_const__InputArrayR(self.as_raw_mut_WindowScene(), target.opencv_as_extern(), offset.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// convenience method to orient the camera to a specific entity
		/// ## Parameters
		/// * target: entity name
		/// * offset: offset from entity centre
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::set_camera_look_at] function uses the following default values for its arguments:
		/// * offset: noArray()
		#[inline]
		fn set_camera_look_at_def(&mut self, target: &str) -> Result<()> {
			extern_container_arg!(target);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setCameraLookAt_const_StringR(self.as_raw_mut_WindowScene(), target.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// convenience method to orient an entity to a specific entity.
		/// If target is an empty string the entity looks at the given offset point
		/// ## Parameters
		/// * origin: entity to make look at
		/// * target: name of target entity
		/// * offset: offset from entity centre
		///
		/// ## C++ default parameters
		/// * offset: noArray()
		#[inline]
		fn set_entity_look_at(&mut self, origin: &str, target: &str, offset: &impl ToInputArray) -> Result<()> {
			extern_container_arg!(origin);
			extern_container_arg!(target);
			input_array_arg!(offset);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setEntityLookAt_const_StringR_const_StringR_const__InputArrayR(self.as_raw_mut_WindowScene(), origin.opencv_as_extern(), target.opencv_as_extern(), offset.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// convenience method to orient an entity to a specific entity.
		/// If target is an empty string the entity looks at the given offset point
		/// ## Parameters
		/// * origin: entity to make look at
		/// * target: name of target entity
		/// * offset: offset from entity centre
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::set_entity_look_at] function uses the following default values for its arguments:
		/// * offset: noArray()
		#[inline]
		fn set_entity_look_at_def(&mut self, origin: &str, target: &str) -> Result<()> {
			extern_container_arg!(origin);
			extern_container_arg!(target);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setEntityLookAt_const_StringR_const_StringR(self.as_raw_mut_WindowScene(), origin.opencv_as_extern(), target.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Retrieves the current camera pose
		/// ## Parameters
		/// * R: 3x3 rotation matrix
		/// * tvec: translation vector
		/// * invert: return the inverted pose
		///
		/// ## C++ default parameters
		/// * r: noArray()
		/// * tvec: noArray()
		/// * invert: false
		#[inline]
		fn get_camera_pose(&mut self, r: &mut impl ToOutputArray, tvec: &mut impl ToOutputArray, invert: bool) -> Result<()> {
			output_array_arg!(r);
			output_array_arg!(tvec);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getCameraPose_const__OutputArrayR_const__OutputArrayR_bool(self.as_raw_mut_WindowScene(), r.as_raw__OutputArray(), tvec.as_raw__OutputArray(), invert, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// Retrieves the current camera pose
		/// ## Parameters
		/// * R: 3x3 rotation matrix
		/// * tvec: translation vector
		/// * invert: return the inverted pose
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::get_camera_pose] function uses the following default values for its arguments:
		/// * r: noArray()
		/// * tvec: noArray()
		/// * invert: false
		#[inline]
		fn get_camera_pose_def(&mut self) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_getCameraPose(self.as_raw_mut_WindowScene(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// set intrinsics of the camera
		///
		/// ## Parameters
		/// * K: intrinsic matrix or noArray(). If noArray() is specified, imsize
		/// is ignored and zNear/ zFar can be set separately.
		/// * imsize: image size
		/// * zNear: near clip distance or -1 to keep the current
		/// * zFar: far clip distance or -1 to keep the current
		///
		/// ## C++ default parameters
		/// * z_near: -1
		/// * z_far: -1
		#[inline]
		fn set_camera_intrinsics(&mut self, k: &impl ToInputArray, imsize: core::Size, z_near: f32, z_far: f32) -> Result<()> {
			input_array_arg!(k);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setCameraIntrinsics_const__InputArrayR_const_SizeR_float_float(self.as_raw_mut_WindowScene(), k.as_raw__InputArray(), &imsize, z_near, z_far, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// set intrinsics of the camera
		///
		/// ## Parameters
		/// * K: intrinsic matrix or noArray(). If noArray() is specified, imsize
		/// is ignored and zNear/ zFar can be set separately.
		/// * imsize: image size
		/// * zNear: near clip distance or -1 to keep the current
		/// * zFar: far clip distance or -1 to keep the current
		///
		/// ## Note
		/// This alternative version of [WindowSceneTrait::set_camera_intrinsics] function uses the following default values for its arguments:
		/// * z_near: -1
		/// * z_far: -1
		#[inline]
		fn set_camera_intrinsics_def(&mut self, k: &impl ToInputArray, imsize: core::Size) -> Result<()> {
			input_array_arg!(k);
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_setCameraIntrinsics_const__InputArrayR_const_SizeR(self.as_raw_mut_WindowScene(), k.as_raw__InputArray(), &imsize, ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

		/// render this window, but do not swap buffers. Automatically called by [ovis::waitKey]
		#[inline]
		fn update(&mut self) -> Result<()> {
			return_send!(via ocvrs_return);
			unsafe { sys::cv_ovis_WindowScene_update(self.as_raw_mut_WindowScene(), ocvrs_return.as_mut_ptr()) };
			return_receive!(ocvrs_return => ret);
			let ret = ret.into_result()?;
			Ok(ret)
		}

	}

	impl std::fmt::Debug for WindowScene {
		#[inline]
		fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
			f.debug_struct("WindowScene")
				.finish()
		}
	}

	impl crate::ovis::WindowSceneTraitConst for WindowScene {
		#[inline] fn as_raw_WindowScene(&self) -> *const c_void { self.as_raw() }
	}

	impl crate::ovis::WindowSceneTrait for WindowScene {
		#[inline] fn as_raw_mut_WindowScene(&mut self) -> *mut c_void { self.as_raw_mut() }
	}

	boxed_ref! { WindowScene, crate::ovis::WindowSceneTraitConst, as_raw_WindowScene, crate::ovis::WindowSceneTrait, as_raw_mut_WindowScene }

}