opencv 0.46.2

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
#include "ocvrs_common.hpp"
#include <opencv2/highgui.hpp>
#include "highgui_types.hpp"

extern "C" {
	Result_void cv_addText_const_MatR_const_StringR_Point_const_QtFontR(const cv::Mat* img, const char* text, cv::Point* org, const cv::QtFont* font) {
		try {
			cv::addText(*img, cv::String(text), *org, *font);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_addText_const_MatR_const_StringR_Point_const_StringR_int_Scalar_int_int_int(const cv::Mat* img, const char* text, cv::Point* org, const char* nameFont, int pointSize, cv::Scalar* color, int weight, int style, int spacing) {
		try {
			cv::addText(*img, cv::String(text), *org, cv::String(nameFont), pointSize, *color, weight, style, spacing);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<int> cv_createButton_const_StringR_ButtonCallback_voidX_int_bool(const char* bar_name, cv::ButtonCallback on_change, void* userdata, int type, bool initial_button_state) {
		try {
			int ret = cv::createButton(cv::String(bar_name), on_change, userdata, type, initial_button_state);
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result<int> cv_createTrackbar_const_StringR_const_StringR_intX_int_TrackbarCallback_voidX(const char* trackbarname, const char* winname, int* value, int count, cv::TrackbarCallback onChange, void* userdata) {
		try {
			int ret = cv::createTrackbar(cv::String(trackbarname), cv::String(winname), value, count, onChange, userdata);
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result_void cv_destroyAllWindows() {
		try {
			cv::destroyAllWindows();
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_destroyWindow_const_StringR(const char* winname) {
		try {
			cv::destroyWindow(cv::String(winname));
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_displayOverlay_const_StringR_const_StringR_int(const char* winname, const char* text, int delayms) {
		try {
			cv::displayOverlay(cv::String(winname), cv::String(text), delayms);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_displayStatusBar_const_StringR_const_StringR_int(const char* winname, const char* text, int delayms) {
		try {
			cv::displayStatusBar(cv::String(winname), cv::String(text), delayms);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<cv::QtFont*> cv_fontQt_const_StringR_int_Scalar_int_int_int(const char* nameFont, int pointSize, cv::Scalar* color, int weight, int style, int spacing) {
		try {
			cv::QtFont ret = cv::fontQt(cv::String(nameFont), pointSize, *color, weight, style, spacing);
			return Ok(new cv::QtFont(ret));
		} OCVRS_CATCH(OCVRS_TYPE(Result<cv::QtFont*>))
	}
	
	Result<int> cv_getMouseWheelDelta_int(int flags) {
		try {
			int ret = cv::getMouseWheelDelta(flags);
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result<int> cv_getTrackbarPos_const_StringR_const_StringR(const char* trackbarname, const char* winname) {
		try {
			int ret = cv::getTrackbarPos(cv::String(trackbarname), cv::String(winname));
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result<cv::Rect> cv_getWindowImageRect_const_StringR(const char* winname) {
		try {
			cv::Rect ret = cv::getWindowImageRect(cv::String(winname));
			return Ok<cv::Rect>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<cv::Rect>))
	}
	
	Result<double> cv_getWindowProperty_const_StringR_int(const char* winname, int prop_id) {
		try {
			double ret = cv::getWindowProperty(cv::String(winname), prop_id);
			return Ok<double>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<double>))
	}
	
	Result_void cv_imshow_const_StringR_const__InputArrayR(const char* winname, const cv::_InputArray* mat) {
		try {
			cv::imshow(cv::String(winname), *mat);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_loadWindowParameters_const_StringR(const char* windowName) {
		try {
			cv::loadWindowParameters(cv::String(windowName));
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_moveWindow_const_StringR_int_int(const char* winname, int x, int y) {
		try {
			cv::moveWindow(cv::String(winname), x, y);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_namedWindow_const_StringR_int(const char* winname, int flags) {
		try {
			cv::namedWindow(cv::String(winname), flags);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_resizeWindow_const_StringR_const_SizeR(const char* winname, const cv::Size* size) {
		try {
			cv::resizeWindow(cv::String(winname), *size);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_resizeWindow_const_StringR_int_int(const char* winname, int width, int height) {
		try {
			cv::resizeWindow(cv::String(winname), width, height);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_saveWindowParameters_const_StringR(const char* windowName) {
		try {
			cv::saveWindowParameters(cv::String(windowName));
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<cv::Rect> cv_selectROI_const_StringR_const__InputArrayR_bool_bool(const char* windowName, const cv::_InputArray* img, bool showCrosshair, bool fromCenter) {
		try {
			cv::Rect ret = cv::selectROI(cv::String(windowName), *img, showCrosshair, fromCenter);
			return Ok<cv::Rect>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<cv::Rect>))
	}
	
	Result<cv::Rect> cv_selectROI_const__InputArrayR_bool_bool(const cv::_InputArray* img, bool showCrosshair, bool fromCenter) {
		try {
			cv::Rect ret = cv::selectROI(*img, showCrosshair, fromCenter);
			return Ok<cv::Rect>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<cv::Rect>))
	}
	
	Result_void cv_selectROIs_const_StringR_const__InputArrayR_vector_Rect_R_bool_bool(const char* windowName, const cv::_InputArray* img, std::vector<cv::Rect>* boundingBoxes, bool showCrosshair, bool fromCenter) {
		try {
			cv::selectROIs(cv::String(windowName), *img, *boundingBoxes, showCrosshair, fromCenter);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_setMouseCallback_const_StringR_MouseCallback_voidX(const char* winname, cv::MouseCallback onMouse, void* userdata) {
		try {
			cv::setMouseCallback(cv::String(winname), onMouse, userdata);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_setOpenGlContext_const_StringR(const char* winname) {
		try {
			cv::setOpenGlContext(cv::String(winname));
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_setOpenGlDrawCallback_const_StringR_OpenGlDrawCallback_voidX(const char* winname, cv::OpenGlDrawCallback onOpenGlDraw, void* userdata) {
		try {
			cv::setOpenGlDrawCallback(cv::String(winname), onOpenGlDraw, userdata);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_setTrackbarMax_const_StringR_const_StringR_int(const char* trackbarname, const char* winname, int maxval) {
		try {
			cv::setTrackbarMax(cv::String(trackbarname), cv::String(winname), maxval);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_setTrackbarMin_const_StringR_const_StringR_int(const char* trackbarname, const char* winname, int minval) {
		try {
			cv::setTrackbarMin(cv::String(trackbarname), cv::String(winname), minval);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_setTrackbarPos_const_StringR_const_StringR_int(const char* trackbarname, const char* winname, int pos) {
		try {
			cv::setTrackbarPos(cv::String(trackbarname), cv::String(winname), pos);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_setWindowProperty_const_StringR_int_double(const char* winname, int prop_id, double prop_value) {
		try {
			cv::setWindowProperty(cv::String(winname), prop_id, prop_value);
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_setWindowTitle_const_StringR_const_StringR(const char* winname, const char* title) {
		try {
			cv::setWindowTitle(cv::String(winname), cv::String(title));
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<int> cv_startLoop_int__X__int__charXX__int_charXX(int (*pt2Func)(int, char**), int argc, char** argv) {
		try {
			int ret = cv::startLoop(pt2Func, argc, argv);
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result<int> cv_startWindowThread() {
		try {
			int ret = cv::startWindowThread();
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result_void cv_stopLoop() {
		try {
			cv::stopLoop();
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result_void cv_updateWindow_const_StringR(const char* winname) {
		try {
			cv::updateWindow(cv::String(winname));
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<int> cv_waitKeyEx_int(int delay) {
		try {
			int ret = cv::waitKeyEx(delay);
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result<int> cv_waitKey_int(int delay) {
		try {
			int ret = cv::waitKey(delay);
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result<void*> cv_QtFont_getPropNameFont_const(const cv::QtFont* instance) {
		try {
			const char* ret = instance->nameFont;
			return Ok(ocvrs_create_string(ret));
		} OCVRS_CATCH(OCVRS_TYPE(Result<void*>))
	}
	
	Result<cv::Scalar> cv_QtFont_getPropColor_const(const cv::QtFont* instance) {
		try {
			cv::Scalar ret = instance->color;
			return Ok<cv::Scalar>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<cv::Scalar>))
	}
	
	Result_void cv_QtFont_setPropColor_Scalar(cv::QtFont* instance, cv::Scalar* val) {
		try {
			instance->color = *val;
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<int> cv_QtFont_getPropFont_face_const(const cv::QtFont* instance) {
		try {
			int ret = instance->font_face;
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result_void cv_QtFont_setPropFont_face_int(cv::QtFont* instance, int val) {
		try {
			instance->font_face = val;
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<const int*> cv_QtFont_getPropAscii_const(const cv::QtFont* instance) {
		try {
			const int* ret = instance->ascii;
			return Ok<const int*>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<const int*>))
	}
	
	Result<const int*> cv_QtFont_getPropGreek_const(const cv::QtFont* instance) {
		try {
			const int* ret = instance->greek;
			return Ok<const int*>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<const int*>))
	}
	
	Result<const int*> cv_QtFont_getPropCyrillic_const(const cv::QtFont* instance) {
		try {
			const int* ret = instance->cyrillic;
			return Ok<const int*>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<const int*>))
	}
	
	Result<float> cv_QtFont_getPropHscale_const(const cv::QtFont* instance) {
		try {
			float ret = instance->hscale;
			return Ok<float>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<float>))
	}
	
	Result_void cv_QtFont_setPropHscale_float(cv::QtFont* instance, float val) {
		try {
			instance->hscale = val;
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<float> cv_QtFont_getPropVscale_const(const cv::QtFont* instance) {
		try {
			float ret = instance->vscale;
			return Ok<float>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<float>))
	}
	
	Result_void cv_QtFont_setPropVscale_float(cv::QtFont* instance, float val) {
		try {
			instance->vscale = val;
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<float> cv_QtFont_getPropShear_const(const cv::QtFont* instance) {
		try {
			float ret = instance->shear;
			return Ok<float>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<float>))
	}
	
	Result_void cv_QtFont_setPropShear_float(cv::QtFont* instance, float val) {
		try {
			instance->shear = val;
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<int> cv_QtFont_getPropThickness_const(const cv::QtFont* instance) {
		try {
			int ret = instance->thickness;
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result_void cv_QtFont_setPropThickness_int(cv::QtFont* instance, int val) {
		try {
			instance->thickness = val;
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<float> cv_QtFont_getPropDx_const(const cv::QtFont* instance) {
		try {
			float ret = instance->dx;
			return Ok<float>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<float>))
	}
	
	Result_void cv_QtFont_setPropDx_float(cv::QtFont* instance, float val) {
		try {
			instance->dx = val;
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	Result<int> cv_QtFont_getPropLine_type_const(const cv::QtFont* instance) {
		try {
			int ret = instance->line_type;
			return Ok<int>(ret);
		} OCVRS_CATCH(OCVRS_TYPE(Result<int>))
	}
	
	Result_void cv_QtFont_setPropLine_type_int(cv::QtFont* instance, int val) {
		try {
			instance->line_type = val;
			return Ok();
		} OCVRS_CATCH(OCVRS_TYPE(Result_void))
	}
	
	void cv_QtFont_delete(cv::QtFont* instance) {
		delete instance;
	}
}