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
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750

use libc::{ c_void, c_char, size_t };
use std::ffi::{ CStr, CString };
pub const CMP_EQ:i32 = 0;
pub const CMP_GE:i32 = 2;
pub const CMP_GT:i32 = 1;
pub const CMP_LE:i32 = 4;
pub const CMP_LT:i32 = 3;
pub const CMP_NE:i32 = 5;
pub const COVAR_COLS:i32 = 16;
pub const COVAR_NORMAL:i32 = 1;
pub const COVAR_ROWS:i32 = 8;
pub const COVAR_SCALE:i32 = 4;
pub const COVAR_SCRAMBLED:i32 = 0;
pub const COVAR_USE_AVG:i32 = 2;
pub const CV_16S:i32 = 3;
pub const CV_16U:i32 = 2;
pub const CV_32F:i32 = 5;
pub const CV_32S:i32 = 4;
pub const CV_64F:i32 = 6;
pub const CV_8S:i32 = 1;
pub const CV_8U:i32 = 0;
pub const CV_BadAlign:i32 = -21;
pub const CV_BadAlphaChannel:i32 = -18;
pub const CV_BadCOI:i32 = -24;
pub const CV_BadCallBack:i32 = -22;
pub const CV_BadDataPtr:i32 = -12;
pub const CV_BadDepth:i32 = -17;
pub const CV_BadImageSize:i32 = -10;
pub const CV_BadModelOrChSeq:i32 = -14;
pub const CV_BadNumChannel1U:i32 = -16;
pub const CV_BadNumChannels:i32 = -15;
pub const CV_BadOffset:i32 = -11;
pub const CV_BadOrder:i32 = -19;
pub const CV_BadOrigin:i32 = -20;
pub const CV_BadROISize:i32 = -25;
pub const CV_BadStep:i32 = -13;
pub const CV_BadTileSize:i32 = -23;
pub const CV_CN_MAX:i32 = 512;
pub const CV_CN_SHIFT:i32 = 3;
pub const CV_GpuApiCallError:i32 = -217;
pub const CV_GpuNotSupported:i32 = -216;
pub const CV_HIST_ARRAY:i32 = 0;
pub const CV_HIST_MAGIC_VAL:i32 = 0x42450000;
pub const CV_HIST_SPARSE:i32 = 1;
pub const CV_HIST_UNIFORM:i32 = 1;
pub const CV_HeaderIsNull:i32 = -9;
pub const CV_MAGIC_MASK:i32 = 0xFFFF0000;
pub const CV_MATND_MAGIC_VAL:i32 = 0x42430000;
pub const CV_MAT_CONT_FLAG_SHIFT:i32 = 14;
pub const CV_MAT_MAGIC_VAL:i32 = 0x42420000;
pub const CV_MAX_DIM:i32 = 32;
pub const CV_MAX_DIM_HEAP:i32 = 1024;
pub const CV_MaskIsTiled:i32 = -26;
pub const CV_NODE_EMPTY:i32 = 32;
pub const CV_NODE_INT:i32 = 1;
pub const CV_NODE_MAP:i32 = 6;
pub const CV_NODE_NAMED:i32 = 64;
pub const CV_NODE_NONE:i32 = 0;
pub const CV_NODE_REAL:i32 = 2;
pub const CV_NODE_SEQ:i32 = 5;
pub const CV_NODE_SEQ_SIMPLE:i32 = 256;
pub const CV_NODE_STR:i32 = 3;
pub const CV_NODE_TYPE_MASK:i32 = 7;
pub const CV_NODE_USER:i32 = 16;
pub const CV_OpenCLDoubleNotSupported:i32 = -220;
pub const CV_OpenCLInitError:i32 = -221;
pub const CV_OpenCLNoAMDBlasFft:i32 = -222;
pub const CV_OpenGlApiCallError:i32 = -219;
pub const CV_OpenGlNotSupported:i32 = -218;
pub const CV_SEQ_ELTYPE_BITS:i32 = 12;
pub const CV_SEQ_ELTYPE_GENERIC:i32 = 0;
pub const CV_SEQ_KIND_BITS:i32 = 2;
pub const CV_SEQ_MAGIC_VAL:i32 = 0x42990000;
pub const CV_SET_MAGIC_VAL:i32 = 0x42980000;
pub const CV_SPARSE_MAT_MAGIC_VAL:i32 = 0x42440000;
pub const CV_STORAGE_APPEND:i32 = 2;
pub const CV_STORAGE_FORMAT_AUTO:i32 = 0;
pub const CV_STORAGE_FORMAT_XML:i32 = 8;
pub const CV_STORAGE_FORMAT_YAML:i32 = 16;
pub const CV_STORAGE_MAGIC_VAL:i32 = 0x42890000;
pub const CV_STORAGE_MEMORY:i32 = 4;
pub const CV_STORAGE_READ:i32 = 0;
pub const CV_STORAGE_WRITE:i32 = 1;
pub const CV_SUBMAT_FLAG_SHIFT:i32 = 15;
pub const CV_StsAssert:i32 = -215;
pub const CV_StsAutoTrace:i32 = -8;
pub const CV_StsBackTrace:i32 = -1;
pub const CV_StsBadArg:i32 = -5;
pub const CV_StsBadFlag:i32 = -206;
pub const CV_StsBadFunc:i32 = -6;
pub const CV_StsBadMask:i32 = -208;
pub const CV_StsBadMemBlock:i32 = -214;
pub const CV_StsBadPoint:i32 = -207;
pub const CV_StsBadSize:i32 = -201;
pub const CV_StsDivByZero:i32 = -202;
pub const CV_StsError:i32 = -2;
pub const CV_StsFilterOffsetErr:i32 = -31;
pub const CV_StsFilterStructContentErr:i32 = -29;
pub const CV_StsInplaceNotSupported:i32 = -203;
pub const CV_StsInternal:i32 = -3;
pub const CV_StsKernelStructContentErr:i32 = -30;
pub const CV_StsNoConv:i32 = -7;
pub const CV_StsNoMem:i32 = -4;
pub const CV_StsNotImplemented:i32 = -213;
pub const CV_StsNullPtr:i32 = -27;
pub const CV_StsObjectNotFound:i32 = -204;
pub const CV_StsOk:i32 = 0;
pub const CV_StsOutOfRange:i32 = -211;
pub const CV_StsParseError:i32 = -212;
pub const CV_StsUnmatchedFormats:i32 = -205;
pub const CV_StsUnmatchedSizes:i32 = -209;
pub const CV_StsUnsupportedFormat:i32 = -210;
pub const CV_StsVecLengthErr:i32 = -28;
pub const CV_TERMCRIT_EPS:i32 = 2;
pub const CV_TERMCRIT_ITER:i32 = 1;
pub const CV_TYPE_NAME_GRAPH:&'static str = "opencv-graph";
pub const CV_TYPE_NAME_MAT:&'static str = "opencv-matrix";
pub const CV_TYPE_NAME_MATND:&'static str = "opencv-nd-matrix";
pub const CV_TYPE_NAME_SEQ:&'static str = "opencv-sequence";
pub const CV_TYPE_NAME_SEQ_TREE:&'static str = "opencv-sequence-tree";
pub const CV_TYPE_NAME_SPARSE_MAT:&'static str = "opencv-sparse-matrix";
pub const CV_USRTYPE1:i32 = 7;
pub const DECOMP_CHOLESKY:i32 = 3;
pub const DECOMP_EIG:i32 = 2;
pub const DECOMP_LU:i32 = 0;
pub const DECOMP_NORMAL:i32 = 16;
pub const DECOMP_QR:i32 = 4;
pub const DECOMP_SVD:i32 = 1;
pub const DEPTH_MASK:i32 = 7;
pub const DFT_COMPLEX_OUTPUT:i32 = 16;
pub const DFT_INVERSE:i32 = 1;
pub const DFT_REAL_OUTPUT:i32 = 32;
pub const DFT_ROWS:i32 = 4;
pub const DFT_SCALE:i32 = 2;
pub const FONT_HERSHEY_COMPLEX:i32 = 3;
pub const FONT_HERSHEY_COMPLEX_SMALL:i32 = 5;
pub const FONT_HERSHEY_DUPLEX:i32 = 2;
pub const FONT_HERSHEY_PLAIN:i32 = 1;
pub const FONT_HERSHEY_SCRIPT_COMPLEX:i32 = 7;
pub const FONT_HERSHEY_SCRIPT_SIMPLEX:i32 = 6;
pub const FONT_HERSHEY_SIMPLEX:i32 = 0;
pub const FONT_HERSHEY_TRIPLEX:i32 = 4;
pub const FONT_ITALIC:i32 = 16;
pub const FileNode_EMPTY:i32 = 32;
pub const FileNode_FLOW:i32 = 8;
pub const FileNode_INT:i32 = 1;
pub const FileNode_MAP:i32 = 6;
pub const FileNode_NAMED:i32 = 64;
pub const FileNode_REAL:i32 = 2;
pub const FileNode_REF:i32 = 4;
pub const FileNode_SEQ:i32 = 5;
pub const FileNode_STR:i32 = 3;
pub const FileNode_USER:i32 = 16;
pub const FileStorage_APPEND:i32 = 2;
pub const FileStorage_FORMAT_AUTO:i32 = 0;
pub const FileStorage_INSIDE_MAP:i32 = 4;
pub const FileStorage_MEMORY:i32 = 4;
pub const FileStorage_NAME_EXPECTED:i32 = 2;
pub const FileStorage_READ:i32 = 0;
pub const FileStorage_UNDEFINED:i32 = 0;
pub const FileStorage_VALUE_EXPECTED:i32 = 1;
pub const FileStorage_WRITE:i32 = 1;
pub const GEMM_1_T:i32 = 1;
pub const GEMM_2_T:i32 = 2;
pub const GEMM_3_T:i32 = 4;
pub const IPL_ALIGN_16BYTES:i32 = 16;
pub const IPL_ALIGN_32BYTES:i32 = 32;
pub const IPL_ALIGN_4BYTES:i32 = 4;
pub const IPL_ALIGN_8BYTES:i32 = 8;
pub const IPL_BORDER_CONSTANT:i32 = 0;
pub const IPL_BORDER_REFLECT:i32 = 2;
pub const IPL_BORDER_REFLECT_101:i32 = 4;
pub const IPL_BORDER_REPLICATE:i32 = 1;
pub const IPL_BORDER_TRANSPARENT:i32 = 5;
pub const IPL_BORDER_WRAP:i32 = 3;
pub const IPL_DATA_ORDER_PIXEL:i32 = 0;
pub const IPL_DATA_ORDER_PLANE:i32 = 1;
pub const IPL_DEPTH_16U:i32 = 16;
pub const IPL_DEPTH_1U:i32 = 1;
pub const IPL_DEPTH_32F:i32 = 32;
pub const IPL_DEPTH_64F:i32 = 64;
pub const IPL_DEPTH_8U:i32 = 8;
pub const IPL_DEPTH_SIGN:i32 = 0x80000000;
pub const IPL_IMAGE_DATA:i32 = 2;
pub const IPL_IMAGE_HEADER:i32 = 1;
pub const IPL_IMAGE_ROI:i32 = 4;
pub const IPL_ORIGIN_BL:i32 = 1;
pub const IPL_ORIGIN_TL:i32 = 0;
pub const KMEANS_PP_CENTERS:i32 = 2;
pub const KMEANS_RANDOM_CENTERS:i32 = 0;
pub const KMEANS_USE_INITIAL_LABELS:i32 = 1;
pub const MAGIC_MASK:i32 = 0xFFFF0000;
pub const Mat_AUTO_STEP:i32 = 0;
pub const Mat_MAGIC_VAL:i32 = 0x42FF0000;
pub const NORM_HAMMING:i32 = 6;
pub const NORM_HAMMING2:i32 = 7;
pub const NORM_INF:i32 = 1;
pub const NORM_L1:i32 = 2;
pub const NORM_L2:i32 = 4;
pub const NORM_L2SQR:i32 = 5;
pub const NORM_MINMAX:i32 = 32;
pub const NORM_RELATIVE:i32 = 8;
pub const NORM_TYPE_MASK:i32 = 7;
pub const Param_ALGORITHM:i32 = 6;
pub const Param_BOOLEAN:i32 = 1;
pub const Param_MAT_VECTOR:i32 = 5;
pub const Param_SHORT:i32 = 10;
pub const Param_UCHAR:i32 = 11;
pub const Param_UINT64:i32 = 9;
pub const Param_UNSIGNED_INT:i32 = 8;
pub const RNG_NORMAL:i32 = 1;
pub const RNG_UNIFORM:i32 = 0;
pub const SORT_ASCENDING:i32 = 0;
pub const SORT_DESCENDING:i32 = 16;
pub const SORT_EVERY_COLUMN:i32 = 1;
pub const SORT_EVERY_ROW:i32 = 0;
pub const SVD_FULL_UV:i32 = 4;
pub const SVD_MODIFY_A:i32 = 1;
pub const SVD_NO_UV:i32 = 2;
pub const SparseMat_HASH_BIT:i32 = 0x80000000;
pub const TYPE_MASK:i32 = 0x00000FFF;
pub const TermCriteria_COUNT:i32 = 1;
pub const TermCriteria_EPS:i32 = 2;
pub const _InputArray_KIND_SHIFT:i32 = 16;

include!(concat!(env!("OUT_DIR"), "/core.consts.rs"));

// manually defined value struct CvRNG
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct CvRNG {
    pub data: i64,
}

// manually defined value struct Point2f
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Point2f {
    pub x: f32,
    pub y: f32,
}

// manually defined value struct Point2d
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Point2d {
    pub x: f64,
    pub y: f64,
}

// manually defined value struct Point
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Point {
    pub x: i32,
    pub y: i32,
}

// manually defined value struct Rect
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Rect {
    pub x: i32,
    pub y: i32,
    pub width: i32,
    pub height: i32,
}

// manually defined value struct Size2f
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Size2f {
    pub width: f32,
    pub height: f32,
}

// manually defined value struct Scalar
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Scalar {
    pub data: [f64;4],
}

// manually defined value struct Size
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Size {
    pub width: i32,
    pub height: i32,
}

// manually defined value struct Vec6f
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec6f {
    pub data: [f32;6],
}

// manually defined value struct Vec4f
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec4f {
    pub data: [f32;4],
}

// manually defined value struct Vec4d
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec4d {
    pub data: [f64;4],
}

// manually defined value struct Vec4b
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec4b {
    pub data: [u8;4],
}

// manually defined value struct Vec4i
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec4i {
    pub data: [i32;4],
}

// manually defined value struct Vec4s
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec4s {
    pub data: [u16;4],
}

// manually defined value struct Vec6i
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec6i {
    pub data: [i32;6],
}

// manually defined value struct Vec6b
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec6b {
    pub data: [u8;6],
}

// manually defined value struct Vec3s
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec3s {
    pub data: [u16;3],
}

// manually defined value struct Vec2s
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec2s {
    pub data: [u16;2],
}

// manually defined value struct Vec6s
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec6s {
    pub data: [u16;6],
}

// manually defined value struct Vec3d
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec3d {
    pub data: [f64;3],
}

// manually defined value struct Vec3f
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec3f {
    pub data: [f32;3],
}

// manually defined value struct Vec2d
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec2d {
    pub data: [f64;2],
}

// manually defined value struct Vec2f
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec2f {
    pub data: [f32;2],
}

// manually defined value struct Vec3b
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec3b {
    pub data: [u8;3],
}

// manually defined value struct Vec2b
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec2b {
    pub data: [u8;2],
}

// manually defined value struct Vec3i
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec3i {
    pub data: [i32;3],
}

// manually defined value struct Vec2i
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec2i {
    pub data: [i32;2],
}

// manually defined value struct Vec6d
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Vec6d {
    pub data: [f64;6],
}

// identifier: cvCeil_double_value
pub fn cv_ceil(value: f64) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cvCeil_double_value(value);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cvFloor_double_value
pub fn cv_floor(value: f64) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cvFloor_double_value(value);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cvIplDepth_int_type
pub fn cv_ipl_depth(_type: i32) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cvIplDepth_int_type(_type);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cvIsInf_double_value
pub fn cv_is_inf(value: f64) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cvIsInf_double_value(value);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cvIsNaN_double_value
pub fn cv_is_na_n(value: f64) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cvIsNaN_double_value(value);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cvRNG_int64_seed
///
/// default value for arguments:
///   - seed: default -1
pub fn cv_rng(seed: i64) -> Result<::core::CvRNG,String> {
  unsafe {
    let rv = ::sys::cv_core_cvRNG_int64_seed(seed);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cvRound_double_value
pub fn cv_round(value: f64) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cvRound_double_value(value);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_LUT_InputArray_src_InputArray_lut_OutputArray_dst_int_interpolation
/// transforms array of numbers using a lookup table: dst(i)=lut(src(i))
///
/// default value for arguments:
///   - interpolation: default 0
pub fn lut(src:& ::core::Mat, lut:& ::core::Mat, dst:& ::core::Mat, interpolation: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_LUT_InputArray_src_InputArray_lut_OutputArray_dst_int_interpolation(src.as_raw_Mat(), lut.as_raw_Mat(), dst.as_raw_Mat(), interpolation);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_Mahalanobis_InputArray_v1_InputArray_v2_InputArray_icovar
/// computes Mahalanobis distance between two vectors: sqrt((v1-v2)'*icovar*(v1-v2)), where icovar is the inverse covariation matrix
pub fn mahalanobis(v1:& ::core::Mat, v2:& ::core::Mat, icovar:& ::core::Mat) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_Mahalanobis_InputArray_v1_InputArray_v2_InputArray_icovar(v1.as_raw_Mat(), v2.as_raw_Mat(), icovar.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_Mahalonobis_InputArray_v1_InputArray_v2_InputArray_icovar
/// a synonym for Mahalanobis
pub fn mahalonobis(v1:& ::core::Mat, v2:& ::core::Mat, icovar:& ::core::Mat) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_Mahalonobis_InputArray_v1_InputArray_v2_InputArray_icovar(v1.as_raw_Mat(), v2.as_raw_Mat(), icovar.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_PCABackProject_InputArray_data_InputArray_mean_InputArray_eigenvectors_OutputArray_result
pub fn pca_back_project(data:& ::core::Mat, mean:& ::core::Mat, eigenvectors:& ::core::Mat, result:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_PCABackProject_InputArray_data_InputArray_mean_InputArray_eigenvectors_OutputArray_result(data.as_raw_Mat(), mean.as_raw_Mat(), eigenvectors.as_raw_Mat(), result.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_PCAProject_InputArray_data_InputArray_mean_InputArray_eigenvectors_OutputArray_result
pub fn pca_project(data:& ::core::Mat, mean:& ::core::Mat, eigenvectors:& ::core::Mat, result:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_PCAProject_InputArray_data_InputArray_mean_InputArray_eigenvectors_OutputArray_result(data.as_raw_Mat(), mean.as_raw_Mat(), eigenvectors.as_raw_Mat(), result.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_SVBackSubst_InputArray_w_InputArray_u_InputArray_vt_InputArray_rhs_OutputArray_dst
/// performs back substitution for the previously computed SVD
pub fn sv_back_subst(w:& ::core::Mat, u:& ::core::Mat, vt:& ::core::Mat, rhs:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_SVBackSubst_InputArray_w_InputArray_u_InputArray_vt_InputArray_rhs_OutputArray_dst(w.as_raw_Mat(), u.as_raw_Mat(), vt.as_raw_Mat(), rhs.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_SVDecomp_InputArray_src_OutputArray_w_OutputArray_u_OutputArray_vt_int_flags
/// computes SVD of src
///
/// default value for arguments:
///   - flags: default 0
pub fn sv_decomp(src:& ::core::Mat, w:& ::core::Mat, u:& ::core::Mat, vt:& ::core::Mat, flags: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_SVDecomp_InputArray_src_OutputArray_w_OutputArray_u_OutputArray_vt_int_flags(src.as_raw_Mat(), w.as_raw_Mat(), u.as_raw_Mat(), vt.as_raw_Mat(), flags);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_absdiff_InputArray_src1_InputArray_src2_OutputArray_dst
/// computes element-wise absolute difference of two arrays (dst = abs(src1 - src2))
pub fn absdiff(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_absdiff_InputArray_src1_InputArray_src2_OutputArray_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_addWeighted_InputArray_src1_double_alpha_InputArray_src2_double_beta_double_gamma_OutputArray_dst_int_dtype
/// computes weighted sum of two arrays (dst = alpha*src1 + beta*src2 + gamma)
///
/// default value for arguments:
///   - dtype: default -1
pub fn add_weighted(src1:& ::core::Mat, alpha: f64, src2:& ::core::Mat, beta: f64, gamma: f64, dst:& ::core::Mat, dtype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_addWeighted_InputArray_src1_double_alpha_InputArray_src2_double_beta_double_gamma_OutputArray_dst_int_dtype(src1.as_raw_Mat(), alpha, src2.as_raw_Mat(), beta, gamma, dst.as_raw_Mat(), dtype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_add_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask_int_dtype
/// adds one matrix to another (dst = src1 + src2)
///
/// default value for arguments:
///   - mask: default noArray()
///   - dtype: default -1
pub fn add(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, mask:& ::core::Mat, dtype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_add_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask_int_dtype(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat(), dtype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_alignSize_size_t_sz_int_n
/// Aligns buffer size by the certain number of bytes
/// 
/// This small inline function aligns a buffer size by the certian number of bytes by enlarging it.
pub fn align_size(sz: size_t, n: i32) -> Result<size_t,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_alignSize_size_t_sz_int_n(sz, n);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_arrowedLine_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_line_type_int_shift_double_tipLength
/// draws an arrow from pt1 to pt2 in the image
///
/// default value for arguments:
///   - thickness: default 1
///   - line_type: default 8
///   - shift: default 0
///   - tipLength: default 0.1
pub fn arrowed_line(img:& ::core::Mat, pt1: ::core::Point, pt2: ::core::Point, color: ::core::Scalar, thickness: i32, line_type: i32, shift: i32, tipLength: f64) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_arrowedLine_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_line_type_int_shift_double_tipLength(img.as_raw_Mat(), pt1, pt2, color, thickness, line_type, shift, tipLength);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_batchDistance_InputArray_src1_InputArray_src2_OutputArray_dist_int_dtype_OutputArray_nidx_int_normType_int_K_InputArray_mask_int_update_bool_crosscheck
/// naive nearest neighbor finder
///
/// default value for arguments:
///   - normType: default NORM_L2
///   - K: default 0
///   - mask: default noArray()
///   - update: default 0
///   - crosscheck: default false
pub fn batch_distance(src1:& ::core::Mat, src2:& ::core::Mat, dist:& ::core::Mat, dtype: i32, nidx:& ::core::Mat, normType: i32, K: i32, mask:& ::core::Mat, update: i32, crosscheck: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_batchDistance_InputArray_src1_InputArray_src2_OutputArray_dist_int_dtype_OutputArray_nidx_int_normType_int_K_InputArray_mask_int_update_bool_crosscheck(src1.as_raw_Mat(), src2.as_raw_Mat(), dist.as_raw_Mat(), dtype, nidx.as_raw_Mat(), normType, K, mask.as_raw_Mat(), update, crosscheck);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_bitwise_and_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask
/// computes bitwise conjunction of the two arrays (dst = src1 & src2)
///
/// default value for arguments:
///   - mask: default noArray()
pub fn bitwise_and(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, mask:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_bitwise_and_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_bitwise_not_InputArray_src_OutputArray_dst_InputArray_mask
/// inverts each bit of array (dst = ~src)
///
/// default value for arguments:
///   - mask: default noArray()
pub fn bitwise_not(src:& ::core::Mat, dst:& ::core::Mat, mask:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_bitwise_not_InputArray_src_OutputArray_dst_InputArray_mask(src.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_bitwise_or_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask
/// computes bitwise disjunction of the two arrays (dst = src1 | src2)
///
/// default value for arguments:
///   - mask: default noArray()
pub fn bitwise_or(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, mask:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_bitwise_or_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_bitwise_xor_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask
/// computes bitwise exclusive-or of the two arrays (dst = src1 ^ src2)
///
/// default value for arguments:
///   - mask: default noArray()
pub fn bitwise_xor(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, mask:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_bitwise_xor_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_calcCovarMatrix_Mat_samples_int_nsamples_Mat_covar_Mat_mean_int_flags_int_ctype
/// computes covariation matrix of a set of samples
///
/// default value for arguments:
///   - ctype: default CV_64F
pub fn calc_covar_matrix(samples:& ::core::Mat, nsamples: i32, covar:& ::core::Mat, mean:& ::core::Mat, flags: i32, ctype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_calcCovarMatrix_Mat_samples_int_nsamples_Mat_covar_Mat_mean_int_flags_int_ctype(samples.as_raw_Mat(), nsamples, covar.as_raw_Mat(), mean.as_raw_Mat(), flags, ctype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_cartToPolar_InputArray_x_InputArray_y_OutputArray_magnitude_OutputArray_angle_bool_angleInDegrees
/// converts Cartesian coordinates to polar
///
/// default value for arguments:
///   - angleInDegrees: default false
pub fn cart_to_polar(x:& ::core::Mat, y:& ::core::Mat, magnitude:& ::core::Mat, angle:& ::core::Mat, angleInDegrees: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_cartToPolar_InputArray_x_InputArray_y_OutputArray_magnitude_OutputArray_angle_bool_angleInDegrees(x.as_raw_Mat(), y.as_raw_Mat(), magnitude.as_raw_Mat(), angle.as_raw_Mat(), angleInDegrees);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_checkHardwareSupport_int_feature
/// Returns SSE etc. support status
/// 
/// The function returns true if certain hardware features are available.
/// Currently, the following features are recognized:
/// - CV_CPU_MMX - MMX
/// - CV_CPU_SSE - SSE
/// - CV_CPU_SSE2 - SSE 2
/// - CV_CPU_SSE3 - SSE 3
/// - CV_CPU_SSSE3 - SSSE 3
/// - CV_CPU_SSE4_1 - SSE 4.1
/// - CV_CPU_SSE4_2 - SSE 4.2
/// - CV_CPU_POPCNT - POPCOUNT
/// - CV_CPU_AVX - AVX
/// - CV_CPU_AVX2 - AVX2
/// 
/// \note {Note that the function output is not static. Once you called cv::useOptimized(false),
/// most of the hardware acceleration is disabled and thus the function will returns false,
/// until you call cv::useOptimized(true)}
pub fn check_hardware_support(feature: i32) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_checkHardwareSupport_int_feature(feature);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_circle_Mat_img_Point_center_int_radius_Scalar_color_int_thickness_int_lineType_int_shift
/// draws the circle outline or a solid circle in the image
///
/// default value for arguments:
///   - thickness: default 1
///   - lineType: default 8
///   - shift: default 0
pub fn circle(img:& ::core::Mat, center: ::core::Point, radius: i32, color: ::core::Scalar, thickness: i32, lineType: i32, shift: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_circle_Mat_img_Point_center_int_radius_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), center, radius, color, thickness, lineType, shift);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_clipLine_Rect_imgRect_Point_pt1_Point_pt2
/// clips the line segment by the rectangle imgRect
pub fn clip_line(imgRect: ::core::Rect, pt1: ::core::Point, pt2: ::core::Point) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_clipLine_Rect_imgRect_Point_pt1_Point_pt2(imgRect, pt1, pt2);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_clipLine_Size_imgSize_Point_pt1_Point_pt2
/// clips the line segment by the rectangle Rect(0, 0, imgSize.width, imgSize.height)
pub fn clip_line_size(imgSize: ::core::Size, pt1: ::core::Point, pt2: ::core::Point) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_clipLine_Size_imgSize_Point_pt1_Point_pt2(imgSize, pt1, pt2);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_compare_InputArray_src1_InputArray_src2_OutputArray_dst_int_cmpop
/// compares elements of two arrays (dst = src1 \<cmpop\> src2)
pub fn compare(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, cmpop: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_compare_InputArray_src1_InputArray_src2_OutputArray_dst_int_cmpop(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), cmpop);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_convertScaleAbs_InputArray_src_OutputArray_dst_double_alpha_double_beta
/// scales array elements, computes absolute values and converts the results to 8-bit unsigned integers: dst(i)=saturate_cast<uchar>abs(src(i)*alpha+beta)
///
/// default value for arguments:
///   - alpha: default 1
///   - beta: default 0
pub fn convert_scale_abs(src:& ::core::Mat, dst:& ::core::Mat, alpha: f64, beta: f64) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_convertScaleAbs_InputArray_src_OutputArray_dst_double_alpha_double_beta(src.as_raw_Mat(), dst.as_raw_Mat(), alpha, beta);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_countNonZero_InputArray_src
/// computes the number of nonzero array elements
pub fn count_non_zero(src:& ::core::Mat) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_countNonZero_InputArray_src(src.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_cubeRoot_float_val
/// computes cube root of the argument
pub fn cube_root(val: f32) -> Result<f32,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_cubeRoot_float_val(val);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_dct_InputArray_src_OutputArray_dst_int_flags
/// performs forward or inverse 1D or 2D Discrete Cosine Transformation
///
/// default value for arguments:
///   - flags: default 0
pub fn dct(src:& ::core::Mat, dst:& ::core::Mat, flags: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_dct_InputArray_src_OutputArray_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_determinant_InputArray_mtx
/// computes determinant of a square matrix
pub fn determinant(mtx:& ::core::Mat) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_determinant_InputArray_mtx(mtx.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_dft_InputArray_src_OutputArray_dst_int_flags_int_nonzeroRows
/// performs forward or inverse 1D or 2D Discrete Fourier Transformation
///
/// default value for arguments:
///   - flags: default 0
///   - nonzeroRows: default 0
pub fn dft(src:& ::core::Mat, dst:& ::core::Mat, flags: i32, nonzeroRows: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_dft_InputArray_src_OutputArray_dst_int_flags_int_nonzeroRows(src.as_raw_Mat(), dst.as_raw_Mat(), flags, nonzeroRows);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_divide_InputArray_src1_InputArray_src2_OutputArray_dst_double_scale_int_dtype
/// computes element-wise weighted quotient of the two arrays (dst = scale*src1/src2)
///
/// default value for arguments:
///   - scale: default 1
///   - dtype: default -1
pub fn divide_mat(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, scale: f64, dtype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_divide_InputArray_src1_InputArray_src2_OutputArray_dst_double_scale_int_dtype(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), scale, dtype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_divide_double_scale_InputArray_src2_OutputArray_dst_int_dtype
/// computes element-wise weighted reciprocal of an array (dst = scale/src2)
///
/// default value for arguments:
///   - dtype: default -1
pub fn divide(scale: f64, src2:& ::core::Mat, dst:& ::core::Mat, dtype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_divide_double_scale_InputArray_src2_OutputArray_dst_int_dtype(scale, src2.as_raw_Mat(), dst.as_raw_Mat(), dtype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_eigen_InputArray_src_OutputArray_eigenvalues_OutputArray_eigenvectors_int_lowindex_int_highindex
/// finds eigenvalues and eigenvectors of a symmetric matrix
///
/// default value for arguments:
///   - lowindex: default -1
///   - highindex: default -1
pub fn eigen_vectors(src:& ::core::Mat, eigenvalues:& ::core::Mat, eigenvectors:& ::core::Mat, lowindex: i32, highindex: i32) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_eigen_InputArray_src_OutputArray_eigenvalues_OutputArray_eigenvectors_int_lowindex_int_highindex(src.as_raw_Mat(), eigenvalues.as_raw_Mat(), eigenvectors.as_raw_Mat(), lowindex, highindex);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_eigen_InputArray_src_OutputArray_eigenvalues_int_lowindex_int_highindex
/// finds eigenvalues of a symmetric matrix
///
/// default value for arguments:
///   - lowindex: default -1
///   - highindex: default -1
pub fn eigen_indexes(src:& ::core::Mat, eigenvalues:& ::core::Mat, lowindex: i32, highindex: i32) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_eigen_InputArray_src_OutputArray_eigenvalues_int_lowindex_int_highindex(src.as_raw_Mat(), eigenvalues.as_raw_Mat(), lowindex, highindex);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_eigen_InputArray_src_bool_computeEigenvectors_OutputArray_eigenvalues_OutputArray_eigenvectors
pub fn eigen(src:& ::core::Mat, computeEigenvectors: bool, eigenvalues:& ::core::Mat, eigenvectors:& ::core::Mat) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_eigen_InputArray_src_bool_computeEigenvectors_OutputArray_eigenvalues_OutputArray_eigenvectors(src.as_raw_Mat(), computeEigenvectors, eigenvalues.as_raw_Mat(), eigenvectors.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_ellipse2Poly_Point_center_Size_axes_int_angle_int_arcStart_int_arcEnd_int_delta_VectorOfPoint_pts
/// converts elliptic arc to a polygonal curve
pub fn ellipse2_poly(center: ::core::Point, axes: ::core::Size, angle: i32, arcStart: i32, arcEnd: i32, delta: i32, pts:& ::types::VectorOfPoint) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_ellipse2Poly_Point_center_Size_axes_int_angle_int_arcStart_int_arcEnd_int_delta_VectorOfPoint_pts(center, axes, angle, arcStart, arcEnd, delta, pts.as_raw_VectorOfPoint());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_ellipse_Mat_img_Point_center_Size_axes_double_angle_double_startAngle_double_endAngle_Scalar_color_int_thickness_int_lineType_int_shift
/// draws an elliptic arc, ellipse sector or a rotated ellipse in the image
///
/// default value for arguments:
///   - thickness: default 1
///   - lineType: default 8
///   - shift: default 0
pub fn ellipse(img:& ::core::Mat, center: ::core::Point, axes: ::core::Size, angle: f64, startAngle: f64, endAngle: f64, color: ::core::Scalar, thickness: i32, lineType: i32, shift: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_ellipse_Mat_img_Point_center_Size_axes_double_angle_double_startAngle_double_endAngle_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), center, axes, angle, startAngle, endAngle, color, thickness, lineType, shift);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_ellipse_Mat_img_RotatedRect_box_Scalar_color_int_thickness_int_lineType
/// draws a rotated ellipse in the image
///
/// default value for arguments:
///   - thickness: default 1
///   - lineType: default 8
pub fn ellipse_new_rotated_rect(img:& ::core::Mat, _box:& ::core::RotatedRect, color: ::core::Scalar, thickness: i32, lineType: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_ellipse_Mat_img_RotatedRect_box_Scalar_color_int_thickness_int_lineType(img.as_raw_Mat(), _box.as_raw_RotatedRect(), color, thickness, lineType);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_exp_InputArray_src_OutputArray_dst
/// computes exponent of each matrix element (dst = e**src)
pub fn exp(src:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_exp_InputArray_src_OutputArray_dst(src.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_extractChannel_InputArray_src_OutputArray_dst_int_coi
/// extracts a single channel from src (coi is 0-based index)
pub fn extract_channel(src:& ::core::Mat, dst:& ::core::Mat, coi: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_extractChannel_InputArray_src_OutputArray_dst_int_coi(src.as_raw_Mat(), dst.as_raw_Mat(), coi);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_fastAtan2_float_y_float_x
/// computes the angle in degrees (0..360) of the vector (x,y)
pub fn fast_atan2(y: f32, x: f32) -> Result<f32,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_fastAtan2_float_y_float_x(y, x);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_findNonZero_InputArray_src_OutputArray_idx
/// returns the list of locations of non-zero pixels
pub fn find_non_zero(src:& ::core::Mat, idx:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_findNonZero_InputArray_src_OutputArray_idx(src.as_raw_Mat(), idx.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_flip_InputArray_src_OutputArray_dst_int_flipCode
/// reverses the order of the rows, columns or both in a matrix
pub fn flip(src:& ::core::Mat, dst:& ::core::Mat, flipCode: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_flip_InputArray_src_OutputArray_dst_int_flipCode(src.as_raw_Mat(), dst.as_raw_Mat(), flipCode);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_gemm_InputArray_src1_InputArray_src2_double_alpha_InputArray_src3_double_beta_OutputArray_dst_int_flags
/// implements generalized matrix product algorithm GEMM from BLAS
///
/// default value for arguments:
///   - flags: default 0
pub fn gemm(src1:& ::core::Mat, src2:& ::core::Mat, alpha: f64, src3:& ::core::Mat, beta: f64, dst:& ::core::Mat, flags: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_gemm_InputArray_src1_InputArray_src2_double_alpha_InputArray_src3_double_beta_OutputArray_dst_int_flags(src1.as_raw_Mat(), src2.as_raw_Mat(), alpha, src3.as_raw_Mat(), beta, dst.as_raw_Mat(), flags);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_getBuildInformation
pub fn get_build_information() -> Result<String,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getBuildInformation();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    let v = CStr::from_ptr(rv.result).to_bytes().to_vec();
    ::libc::free(rv.result as *mut c_void);
    Ok(String::from_utf8(v).unwrap())
  }
}

// identifier: cv_getCPUTickCount
/// Returns the number of CPU ticks.
/// 
/// On platforms where the feature is available, the function returns the number of CPU ticks
/// since the certain event (normally, the system power-on moment). Using this function
/// one can accurately measure the execution time of very small code fragments,
/// for which cv::getTickCount() granularity is not enough.
pub fn get_cpu_tick_count() -> Result<i64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getCPUTickCount();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_getElemSize_int_type
pub fn get_elem_size(_type: i32) -> Result<size_t,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getElemSize_int_type(_type);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_getNumThreads
pub fn get_num_threads() -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getNumThreads();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_getNumberOfCPUs
/// returns the number of CPUs (including hyper-threading)
pub fn get_number_of_cp_us() -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getNumberOfCPUs();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_getOptimalDFTSize_int_vecsize
/// computes the minimal vector size vecsize1 >= vecsize so that the dft() of the vector of length vecsize1 can be computed efficiently
pub fn get_optimal_dft_size(vecsize: i32) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getOptimalDFTSize_int_vecsize(vecsize);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_getThreadNum
pub fn get_thread_num() -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getThreadNum();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_getTickCount
/// The function returns the number of ticks since the certain event (e.g. when the machine was turned on).
/// It can be used to initialize cv::RNG or to measure a function execution time by reading the tick count
/// before and after the function call. The granularity of ticks depends on the hardware and OS used. Use
/// cv::getTickFrequency() to convert ticks to seconds.
pub fn get_tick_count() -> Result<i64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getTickCount();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_getTickFrequency
/// Returns the number of ticks per seconds.
/// 
/// The function returns the number of ticks (as returned by cv::getTickCount()) per second.
/// The following code computes the execution time in milliseconds:
/// 
/// \code
/// double exec_time = (double)getTickCount();
/// // do something ...
/// exec_time = ((double)getTickCount() - exec_time)*1000./getTickFrequency();
/// \endcode
pub fn get_tick_frequency() -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_getTickFrequency();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_hconcat_InputArray_src1_InputArray_src2_OutputArray_dst
pub fn hconcat(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_hconcat_InputArray_src1_InputArray_src2_OutputArray_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_idct_InputArray_src_OutputArray_dst_int_flags
/// performs inverse 1D or 2D Discrete Cosine Transformation
///
/// default value for arguments:
///   - flags: default 0
pub fn idct(src:& ::core::Mat, dst:& ::core::Mat, flags: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_idct_InputArray_src_OutputArray_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_idft_InputArray_src_OutputArray_dst_int_flags_int_nonzeroRows
/// performs inverse 1D or 2D Discrete Fourier Transformation
///
/// default value for arguments:
///   - flags: default 0
///   - nonzeroRows: default 0
pub fn idft(src:& ::core::Mat, dst:& ::core::Mat, flags: i32, nonzeroRows: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_idft_InputArray_src_OutputArray_dst_int_flags_int_nonzeroRows(src.as_raw_Mat(), dst.as_raw_Mat(), flags, nonzeroRows);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_inRange_InputArray_src_InputArray_lowerb_InputArray_upperb_OutputArray_dst
/// set mask elements for those array elements which are within the element-specific bounding box (dst = lowerb <= src && src < upperb)
pub fn in_range(src:& ::core::Mat, lowerb:& ::core::Mat, upperb:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_inRange_InputArray_src_InputArray_lowerb_InputArray_upperb_OutputArray_dst(src.as_raw_Mat(), lowerb.as_raw_Mat(), upperb.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_invert_InputArray_src_OutputArray_dst_int_flags
/// computes inverse or pseudo-inverse matrix
///
/// default value for arguments:
///   - flags: default DECOMP_LU
pub fn invert(src:& ::core::Mat, dst:& ::core::Mat, flags: i32) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_invert_InputArray_src_OutputArray_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_line_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_lineType_int_shift
/// draws the line segment (pt1, pt2) in the image
///
/// default value for arguments:
///   - thickness: default 1
///   - lineType: default 8
///   - shift: default 0
pub fn line(img:& ::core::Mat, pt1: ::core::Point, pt2: ::core::Point, color: ::core::Scalar, thickness: i32, lineType: i32, shift: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_line_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), pt1, pt2, color, thickness, lineType, shift);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_log_InputArray_src_OutputArray_dst
/// computes natural logarithm of absolute value of each matrix element: dst = log(abs(src))
pub fn log(src:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_log_InputArray_src_OutputArray_dst(src.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_magnitude_InputArray_x_InputArray_y_OutputArray_magnitude
/// computes magnitude (magnitude(i)) of each (x(i), y(i)) vector
pub fn magnitude(x:& ::core::Mat, y:& ::core::Mat, magnitude:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_magnitude_InputArray_x_InputArray_y_OutputArray_magnitude(x.as_raw_Mat(), y.as_raw_Mat(), magnitude.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_max_InputArray_src1_InputArray_src2_OutputArray_dst
/// computes per-element maximum of two arrays (dst = max(src1, src2))
pub fn max(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_max_InputArray_src1_InputArray_src2_OutputArray_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_max_Mat_src1_Mat_src2_Mat_dst
/// computes per-element maximum of two arrays (dst = max(src1, src2))
pub fn max_mat_mat(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_max_Mat_src1_Mat_src2_Mat_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_max_Mat_src1_double_src2_Mat_dst
/// computes per-element maximum of array and scalar (dst = max(src1, src2))
pub fn max_mat(src1:& ::core::Mat, src2: f64, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_max_Mat_src1_double_src2_Mat_dst(src1.as_raw_Mat(), src2, dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_meanStdDev_InputArray_src_OutputArray_mean_OutputArray_stddev_InputArray_mask
/// computes mean value and standard deviation of all or selected array elements
///
/// default value for arguments:
///   - mask: default noArray()
pub fn mean_std_dev(src:& ::core::Mat, mean:& ::core::Mat, stddev:& ::core::Mat, mask:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_meanStdDev_InputArray_src_OutputArray_mean_OutputArray_stddev_InputArray_mask(src.as_raw_Mat(), mean.as_raw_Mat(), stddev.as_raw_Mat(), mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_mean_InputArray_src_InputArray_mask
/// computes mean value of selected array elements
///
/// default value for arguments:
///   - mask: default noArray()
pub fn mean(src:& ::core::Mat, mask:& ::core::Mat) -> Result<::core::Scalar,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_mean_InputArray_src_InputArray_mask(src.as_raw_Mat(), mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_merge_VectorOfMat_mv_OutputArray_dst
pub fn merge(mv:& ::types::VectorOfMat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_merge_VectorOfMat_mv_OutputArray_dst(mv.as_raw_VectorOfMat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_min_InputArray_src1_InputArray_src2_OutputArray_dst
/// computes per-element minimum of two arrays (dst = min(src1, src2))
pub fn min(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_min_InputArray_src1_InputArray_src2_OutputArray_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_min_Mat_src1_Mat_src2_Mat_dst
/// computes per-element minimum of two arrays (dst = min(src1, src2))
pub fn min_mat_mat(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_min_Mat_src1_Mat_src2_Mat_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_min_Mat_src1_double_src2_Mat_dst
/// computes per-element minimum of array and scalar (dst = min(src1, src2))
pub fn min_mat(src1:& ::core::Mat, src2: f64, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_min_Mat_src1_double_src2_Mat_dst(src1.as_raw_Mat(), src2, dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_mulSpectrums_InputArray_a_InputArray_b_OutputArray_c_int_flags_bool_conjB
/// computes element-wise product of the two Fourier spectrums. The second spectrum can optionally be conjugated before the multiplication
///
/// default value for arguments:
///   - conjB: default false
pub fn mul_spectrums(a:& ::core::Mat, b:& ::core::Mat, c:& ::core::Mat, flags: i32, conjB: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_mulSpectrums_InputArray_a_InputArray_b_OutputArray_c_int_flags_bool_conjB(a.as_raw_Mat(), b.as_raw_Mat(), c.as_raw_Mat(), flags, conjB);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_mulTransposed_InputArray_src_OutputArray_dst_bool_aTa_InputArray_delta_double_scale_int_dtype
/// multiplies matrix by its transposition from the left or from the right
///
/// default value for arguments:
///   - delta: default noArray()
///   - scale: default 1
///   - dtype: default -1
pub fn mul_transposed(src:& ::core::Mat, dst:& ::core::Mat, aTa: bool, delta:& ::core::Mat, scale: f64, dtype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_mulTransposed_InputArray_src_OutputArray_dst_bool_aTa_InputArray_delta_double_scale_int_dtype(src.as_raw_Mat(), dst.as_raw_Mat(), aTa, delta.as_raw_Mat(), scale, dtype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_multiply_InputArray_src1_InputArray_src2_OutputArray_dst_double_scale_int_dtype
/// computes element-wise weighted product of the two arrays (dst = scale*src1*src2)
///
/// default value for arguments:
///   - scale: default 1
///   - dtype: default -1
pub fn multiply(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, scale: f64, dtype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_multiply_InputArray_src1_InputArray_src2_OutputArray_dst_double_scale_int_dtype(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), scale, dtype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_norm_InputArray_src1_InputArray_src2_int_normType_InputArray_mask
/// computes norm of selected part of the difference between two arrays
///
/// default value for arguments:
///   - normType: default NORM_L2
///   - mask: default noArray()
pub fn norm_with_type(src1:& ::core::Mat, src2:& ::core::Mat, normType: i32, mask:& ::core::Mat) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_norm_InputArray_src1_InputArray_src2_int_normType_InputArray_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), normType, mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_norm_InputArray_src1_int_normType_InputArray_mask
/// computes norm of the selected array part
///
/// default value for arguments:
///   - normType: default NORM_L2
///   - mask: default noArray()
pub fn norm(src1:& ::core::Mat, normType: i32, mask:& ::core::Mat) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_norm_InputArray_src1_int_normType_InputArray_mask(src1.as_raw_Mat(), normType, mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_normalize_InputArray_src_OutputArray_dst_double_alpha_double_beta_int_norm_type_int_dtype_InputArray_mask
/// scales and shifts array elements so that either the specified norm (alpha) or the minimum (alpha) and maximum (beta) array values get the specified values
///
/// default value for arguments:
///   - alpha: default 1
///   - beta: default 0
///   - norm_type: default NORM_L2
///   - dtype: default -1
///   - mask: default noArray()
pub fn normalize(src:& ::core::Mat, dst:& ::core::Mat, alpha: f64, beta: f64, norm_type: i32, dtype: i32, mask:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_normalize_InputArray_src_OutputArray_dst_double_alpha_double_beta_int_norm_type_int_dtype_InputArray_mask(src.as_raw_Mat(), dst.as_raw_Mat(), alpha, beta, norm_type, dtype, mask.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_parallel_for__Range_range_ParallelLoopBody_body_double_nstripes
///
/// default value for arguments:
///   - nstripes: default -1.
pub fn parallel_for_(range:& ::core::Range, body:& ::core::ParallelLoopBody, nstripes: f64) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_parallel_for__Range_range_ParallelLoopBody_body_double_nstripes(range.as_raw_Range(), body.as_raw_ParallelLoopBody(), nstripes);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_perspectiveTransform_InputArray_src_OutputArray_dst_InputArray_m
/// performs perspective transformation of each element of multi-channel input matrix
pub fn perspective_transform(src:& ::core::Mat, dst:& ::core::Mat, m:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_perspectiveTransform_InputArray_src_OutputArray_dst_InputArray_m(src.as_raw_Mat(), dst.as_raw_Mat(), m.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_phase_InputArray_x_InputArray_y_OutputArray_angle_bool_angleInDegrees
/// computes angle (angle(i)) of each (x(i), y(i)) vector
///
/// default value for arguments:
///   - angleInDegrees: default false
pub fn phase(x:& ::core::Mat, y:& ::core::Mat, angle:& ::core::Mat, angleInDegrees: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_phase_InputArray_x_InputArray_y_OutputArray_angle_bool_angleInDegrees(x.as_raw_Mat(), y.as_raw_Mat(), angle.as_raw_Mat(), angleInDegrees);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_polarToCart_InputArray_magnitude_InputArray_angle_OutputArray_x_OutputArray_y_bool_angleInDegrees
/// converts polar coordinates to Cartesian
///
/// default value for arguments:
///   - angleInDegrees: default false
pub fn polar_to_cart(magnitude:& ::core::Mat, angle:& ::core::Mat, x:& ::core::Mat, y:& ::core::Mat, angleInDegrees: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_polarToCart_InputArray_magnitude_InputArray_angle_OutputArray_x_OutputArray_y_bool_angleInDegrees(magnitude.as_raw_Mat(), angle.as_raw_Mat(), x.as_raw_Mat(), y.as_raw_Mat(), angleInDegrees);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_pow_InputArray_src_double_power_OutputArray_dst
/// raises the input matrix elements to the specified power (b = a**power)
pub fn pow(src:& ::core::Mat, power: f64, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_pow_InputArray_src_double_power_OutputArray_dst(src.as_raw_Mat(), power, dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_putText_Mat_img_String_text_Point_org_int_fontFace_double_fontScale_Scalar_color_int_thickness_int_lineType_bool_bottomLeftOrigin
/// renders text string in the image
///
/// default value for arguments:
///   - thickness: default 1
///   - lineType: default 8
///   - bottomLeftOrigin: default false
pub fn put_text(img:& ::core::Mat, text:&str, org: ::core::Point, fontFace: i32, fontScale: f64, color: ::core::Scalar, thickness: i32, lineType: i32, bottomLeftOrigin: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_putText_Mat_img_String_text_Point_org_int_fontFace_double_fontScale_Scalar_color_int_thickness_int_lineType_bool_bottomLeftOrigin(img.as_raw_Mat(), CString::new(text).unwrap().as_ptr(), org, fontFace, fontScale, color, thickness, lineType, bottomLeftOrigin);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_rectangle_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_lineType_int_shift
/// draws the rectangle outline or a solid rectangle with the opposite corners pt1 and pt2 in the image
///
/// default value for arguments:
///   - thickness: default 1
///   - lineType: default 8
///   - shift: default 0
pub fn rectangle_points(img:& ::core::Mat, pt1: ::core::Point, pt2: ::core::Point, color: ::core::Scalar, thickness: i32, lineType: i32, shift: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_rectangle_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), pt1, pt2, color, thickness, lineType, shift);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_rectangle_Mat_img_Rect_rec_Scalar_color_int_thickness_int_lineType_int_shift
/// draws the rectangle outline or a solid rectangle covering rec in the image
///
/// default value for arguments:
///   - thickness: default 1
///   - lineType: default 8
///   - shift: default 0
pub fn rectangle(img:& ::core::Mat, rec: ::core::Rect, color: ::core::Scalar, thickness: i32, lineType: i32, shift: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_rectangle_Mat_img_Rect_rec_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), rec, color, thickness, lineType, shift);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_reduce_InputArray_src_OutputArray_dst_int_dim_int_rtype_int_dtype
/// transforms 2D matrix to 1D row or column vector by taking sum, minimum, maximum or mean value over all the rows
///
/// default value for arguments:
///   - dtype: default -1
pub fn reduce(src:& ::core::Mat, dst:& ::core::Mat, dim: i32, rtype: i32, dtype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_reduce_InputArray_src_OutputArray_dst_int_dim_int_rtype_int_dtype(src.as_raw_Mat(), dst.as_raw_Mat(), dim, rtype, dtype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_repeat_InputArray_src_int_ny_int_nx_OutputArray_dst
/// replicates the input matrix the specified number of times in the horizontal and/or vertical direction
pub fn repeat_to(src:& ::core::Mat, ny: i32, nx: i32, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_repeat_InputArray_src_int_ny_int_nx_OutputArray_dst(src.as_raw_Mat(), ny, nx, dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_repeat_Mat_src_int_ny_int_nx
pub fn repeat(src:& ::core::Mat, ny: i32, nx: i32) -> Result<::core::Mat,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_repeat_Mat_src_int_ny_int_nx(src.as_raw_Mat(), ny, nx);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(::core::Mat{ ptr: rv.result })
  }
}

// identifier: cv_scaleAdd_InputArray_src1_double_alpha_InputArray_src2_OutputArray_dst
/// adds scaled array to another one (dst = alpha*src1 + src2)
pub fn scale_add(src1:& ::core::Mat, alpha: f64, src2:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_scaleAdd_InputArray_src1_double_alpha_InputArray_src2_OutputArray_dst(src1.as_raw_Mat(), alpha, src2.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_setBreakOnError_bool_flag
/// When the break-on-error mode is set, the default error handler
/// issues a hardware exception, which can make debugging more convenient.
/// 
/// \return the previous state
pub fn set_break_on_error(flag: bool) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_setBreakOnError_bool_flag(flag);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_setNumThreads_int_nthreads
pub fn set_num_threads(nthreads: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_setNumThreads_int_nthreads(nthreads);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_setUseOptimized_bool_onoff
/// Turns on/off available optimization
/// 
/// The function turns on or off the optimized code in OpenCV. Some optimization can not be enabled
/// or disabled, but, for example, most of SSE code in OpenCV can be temporarily turned on or off this way.
/// 
/// \note{Since optimization may imply using special data structures, it may be unsafe
/// to call this function anywhere in the code. Instead, call it somewhere at the top level.}
pub fn set_use_optimized(onoff: bool) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_setUseOptimized_bool_onoff(onoff);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_solveCubic_InputArray_coeffs_OutputArray_roots
/// finds real roots of a cubic polynomial
pub fn solve_cubic(coeffs:& ::core::Mat, roots:& ::core::Mat) -> Result<i32,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_solveCubic_InputArray_coeffs_OutputArray_roots(coeffs.as_raw_Mat(), roots.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_solvePoly_InputArray_coeffs_OutputArray_roots_int_maxIters
/// finds real and complex roots of a polynomial
///
/// default value for arguments:
///   - maxIters: default 300
pub fn solve_poly(coeffs:& ::core::Mat, roots:& ::core::Mat, maxIters: i32) -> Result<f64,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_solvePoly_InputArray_coeffs_OutputArray_roots_int_maxIters(coeffs.as_raw_Mat(), roots.as_raw_Mat(), maxIters);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_solve_InputArray_src1_InputArray_src2_OutputArray_dst_int_flags
/// solves linear system or a least-square problem
///
/// default value for arguments:
///   - flags: default DECOMP_LU
pub fn solve(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, flags: i32) -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_solve_InputArray_src1_InputArray_src2_OutputArray_dst_int_flags(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), flags);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_sortIdx_InputArray_src_OutputArray_dst_int_flags
/// sorts independently each matrix row or each matrix column
pub fn sort_idx(src:& ::core::Mat, dst:& ::core::Mat, flags: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_sortIdx_InputArray_src_OutputArray_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_sort_InputArray_src_OutputArray_dst_int_flags
/// sorts independently each matrix row or each matrix column
pub fn sort(src:& ::core::Mat, dst:& ::core::Mat, flags: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_sort_InputArray_src_OutputArray_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_split_Mat_m_VectorOfMat_mv
pub fn split(m:& ::core::Mat, mv:& ::types::VectorOfMat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_split_Mat_m_VectorOfMat_mv(m.as_raw_Mat(), mv.as_raw_VectorOfMat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_split_Mat_src_Mat_mvbegin
/// copies each plane of a multi-channel array to a dedicated array
pub fn split_at(src:& ::core::Mat, mvbegin:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_split_Mat_src_Mat_mvbegin(src.as_raw_Mat(), mvbegin.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_sqrt_InputArray_src_OutputArray_dst
/// computes square root of each matrix element (dst = src**0.5)
pub fn sqrt(src:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_sqrt_InputArray_src_OutputArray_dst(src.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_subtract_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask_int_dtype
/// subtracts one matrix from another (dst = src1 - src2)
///
/// default value for arguments:
///   - mask: default noArray()
///   - dtype: default -1
pub fn subtract(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat, mask:& ::core::Mat, dtype: i32) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_subtract_InputArray_src1_InputArray_src2_OutputArray_dst_InputArray_mask_int_dtype(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat(), dtype);
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_sum_InputArray_src
/// computes sum of array elements
pub fn sum(src:& ::core::Mat) -> Result<::core::Scalar,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_sum_InputArray_src(src.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_swap_Mat_a_Mat_b
/// swaps two matrices
pub fn swap(a:& ::core::Mat, b:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_swap_Mat_a_Mat_b(a.as_raw_Mat(), b.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_trace_InputArray_mtx
/// computes trace of a matrix
pub fn trace(mtx:& ::core::Mat) -> Result<::core::Scalar,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_trace_InputArray_mtx(mtx.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_transform_InputArray_src_OutputArray_dst_InputArray_m
/// performs affine transformation of each element of multi-channel input matrix
pub fn transform(src:& ::core::Mat, dst:& ::core::Mat, m:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_transform_InputArray_src_OutputArray_dst_InputArray_m(src.as_raw_Mat(), dst.as_raw_Mat(), m.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_transpose_InputArray_src_OutputArray_dst
/// transposes the matrix
pub fn transpose(src:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_transpose_InputArray_src_OutputArray_dst(src.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// identifier: cv_useOptimized
/// Returns the current optimization status
/// 
/// The function returns the current optimization status, which is controlled by cv::setUseOptimized().
pub fn use_optimized() -> Result<bool,String> {
  unsafe {
    let rv = ::sys::cv_core_cv_useOptimized();
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(rv.result)
  }
}

// identifier: cv_vconcat_InputArray_src1_InputArray_src2_OutputArray_dst
pub fn vconcat(src1:& ::core::Mat, src2:& ::core::Mat, dst:& ::core::Mat) -> Result<(),String> {
  unsafe {
    let rv = ::sys::cv_core_cv_vconcat_InputArray_src1_InputArray_src2_OutputArray_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat());
    if rv.error_msg as i32 != 0i32 {
        let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
        ::libc::free(rv.error_msg as *mut c_void);
        return Err(String::from_utf8(v).unwrap())
    }
    Ok(())
  }
}

// Generating impl for trait cv::Algorithm
pub trait Algorithm {
  fn as_raw_Algorithm(&self) -> *mut c_void;
  // identifier: cv_Algorithm_name
  fn name(&self) -> Result<String,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_name(self.as_raw_Algorithm());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      let v = CStr::from_ptr(rv.result).to_bytes().to_vec();
      ::libc::free(rv.result as *mut c_void);
      Ok(String::from_utf8(v).unwrap())
    }
  }

  // identifier: cv_Algorithm_getInt_String_name
  fn get_int(&self, name:&str) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_getInt_String_name(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Algorithm_getDouble_String_name
  fn get_double(&self, name:&str) -> Result<f64,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_getDouble_String_name(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Algorithm_getBool_String_name
  fn get_bool(&self, name:&str) -> Result<bool,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_getBool_String_name(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Algorithm_getString_String_name
  fn get_string(&self, name:&str) -> Result<String,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_getString_String_name(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      let v = CStr::from_ptr(rv.result).to_bytes().to_vec();
      ::libc::free(rv.result as *mut c_void);
      Ok(String::from_utf8(v).unwrap())
    }
  }

  // identifier: cv_Algorithm_getMat_String_name
  fn get_mat(&self, name:&str) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_getMat_String_name(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Algorithm_getMatVector_String_name
  fn get_mat_vector(&self, name:&str) -> Result<::types::VectorOfMat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_getMatVector_String_name(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::types::VectorOfMat{ ptr: rv.result })
    }
  }

  // identifier: cv_Algorithm_set_String_name_int_value
  fn set_int(&mut self, name:&str, value: i32) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_set_String_name_int_value(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr(), value);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Algorithm_set_String_name_double_value
  fn set_double(&mut self, name:&str, value: f64) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_set_String_name_double_value(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr(), value);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Algorithm_set_String_name_bool_value
  fn set_bool(&mut self, name:&str, value: bool) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_set_String_name_bool_value(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr(), value);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Algorithm_set_String_name_String_value
  fn set_string(&mut self, name:&str, value:&str) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_set_String_name_String_value(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr(), CString::new(value).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Algorithm_set_String_name_Mat_value
  fn set_mat(&mut self, name:&str, value:& ::core::Mat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_set_String_name_Mat_value(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr(), value.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Algorithm_set_String_name_VectorOfMat_value
  fn set_VectorOfMat(&mut self, name:&str, value:& ::types::VectorOfMat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_set_String_name_VectorOfMat_value(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr(), value.as_raw_VectorOfMat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Algorithm_paramHelp_String_name
  fn param_help(&self, name:&str) -> Result<String,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_paramHelp_String_name(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      let v = CStr::from_ptr(rv.result).to_bytes().to_vec();
      ::libc::free(rv.result as *mut c_void);
      Ok(String::from_utf8(v).unwrap())
    }
  }

  // identifier: cv_Algorithm_paramType_String_name
  fn param_type(&self, name:&str) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_paramType_String_name(self.as_raw_Algorithm(), CString::new(name).unwrap().as_ptr());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Algorithm_getParams_VectorOfString_names
  fn get_params(&self, names:& ::types::VectorOfString) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_getParams_VectorOfString_names(self.as_raw_Algorithm(), names.as_raw_VectorOfString());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Algorithm_getList_VectorOfString_algorithms
  fn get_list(&mut self, algorithms:& ::types::VectorOfString) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Algorithm_getList_VectorOfString_algorithms(self.as_raw_Algorithm(), algorithms.as_raw_VectorOfString());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

}


// boxed class cv::AutoLock
#[allow(dead_code)]
pub struct AutoLock {
    pub ptr: *mut c_void
}
impl Drop for ::core::AutoLock {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_AutoLock(self.ptr) };
    }
}
impl ::core::AutoLock {
    pub fn as_raw_AutoLock(&self) -> *mut c_void { self.ptr }
}
impl AutoLock {

}

// boxed class cv::LineIterator
#[allow(dead_code)]
pub struct LineIterator {
    pub ptr: *mut c_void
}
impl Drop for ::core::LineIterator {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_LineIterator(self.ptr) };
    }
}
impl ::core::LineIterator {
    pub fn as_raw_LineIterator(&self) -> *mut c_void { self.ptr }
}
impl LineIterator {

  // identifier: cv_LineIterator_LineIterator_Mat_img_Point_pt1_Point_pt2_int_connectivity_bool_leftToRight
  /// intializes the iterator
  ///
  /// default value for arguments:
  ///   - connectivity: default 8
  ///   - leftToRight: default false
  pub fn new(img:& ::core::Mat, pt1: ::core::Point, pt2: ::core::Point, connectivity: i32, leftToRight: bool) -> Result<::core::LineIterator,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_LineIterator_LineIterator_Mat_img_Point_pt1_Point_pt2_int_connectivity_bool_leftToRight(img.as_raw_Mat(), pt1, pt2, connectivity, leftToRight);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::LineIterator{ ptr: rv.result })
    }
  }

  // identifier: cv_LineIterator_pos
  /// returns coordinates of the current pixel
  pub fn pos(&self) -> Result<::core::Point,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_LineIterator_pos(self.as_raw_LineIterator());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

}

// boxed class cv::Mat
#[allow(dead_code)]
pub struct Mat {
    pub ptr: *mut c_void
}
impl Drop for ::core::Mat {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Mat(self.ptr) };
    }
}
impl ::core::Mat {
    pub fn as_raw_Mat(&self) -> *mut c_void { self.ptr }
}
impl Mat {

  // identifier: cv_Mat_Mat
  /// default constructor
  pub fn new() -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_Mat_int_rows_int_cols_int_type
  /// constructs 2D matrix of the specified size and type
  pub fn new_rows_cols(rows: i32, cols: i32, _type: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat_int_rows_int_cols_int_type(rows, cols, _type);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_Mat_Size_size_int_type
  pub fn new_size(size: ::core::Size, _type: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat_Size_size_int_type(size, _type);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_Mat_int_rows_int_cols_int_type_Scalar_s
  /// constucts 2D matrix and fills it with the specified value _s.
  pub fn new_rows_cols_with_default(rows: i32, cols: i32, _type: i32, s: ::core::Scalar) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat_int_rows_int_cols_int_type_Scalar_s(rows, cols, _type, s);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_Mat_Size_size_int_type_Scalar_s
  pub fn new_size_with_default(size: ::core::Size, _type: i32, s: ::core::Scalar) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat_Size_size_int_type_Scalar_s(size, _type, s);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_Mat_Mat_m
  /// copy constructor
  pub fn copy(m:& ::core::Mat) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat_Mat_m(m.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_Mat_Mat_m_Range_rowRange_Range_colRange
  /// creates a matrix header for a part of the bigger matrix
  ///
  /// default value for arguments:
  ///   - colRange: default Range::all()
  pub fn rowscols(m:& ::core::Mat, rowRange:& ::core::Range, colRange:& ::core::Range) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat_Mat_m_Range_rowRange_Range_colRange(m.as_raw_Mat(), rowRange.as_raw_Range(), colRange.as_raw_Range());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_Mat_Mat_m_Rect_roi
  pub fn rect(m:& ::core::Mat, roi: ::core::Rect) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat_Mat_m_Rect_roi(m.as_raw_Mat(), roi);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_Mat_Mat_m_Range_ranges
  pub fn ranges(m:& ::core::Mat, ranges:& ::core::Range) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_Mat_Mat_m_Range_ranges(m.as_raw_Mat(), ranges.as_raw_Range());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_row_int_y
  /// returns a new matrix header for the specified row
  pub fn row(&self, y: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_row_int_y(self.as_raw_Mat(), y);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_col_int_x
  /// returns a new matrix header for the specified column
  pub fn col(&self, x: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_col_int_x(self.as_raw_Mat(), x);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_rowRange_int_startrow_int_endrow
  /// ... for the specified row span
  pub fn rowbounds(&self, startrow: i32, endrow: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_rowRange_int_startrow_int_endrow(self.as_raw_Mat(), startrow, endrow);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_rowRange_Range_r
  pub fn rowRange(&self, r:& ::core::Range) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_rowRange_Range_r(self.as_raw_Mat(), r.as_raw_Range());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_colRange_int_startcol_int_endcol
  /// ... for the specified column span
  pub fn colbounds(&self, startcol: i32, endcol: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_colRange_int_startcol_int_endcol(self.as_raw_Mat(), startcol, endcol);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_colRange_Range_r
  pub fn colrange(&self, r:& ::core::Range) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_colRange_Range_r(self.as_raw_Mat(), r.as_raw_Range());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_diag_int_d
  /// ... for the specified diagonal
  ///
  /// default value for arguments:
  ///   - d: default 0
  pub fn diag(&self, d: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_diag_int_d(self.as_raw_Mat(), d);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_diag_Mat_d
  /// constructs a square diagonal matrix which main diagonal is vector "d"
  pub fn diag_new_mat(&mut self, d:& ::core::Mat) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_diag_Mat_d(self.as_raw_Mat(), d.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_clone
  /// returns deep copy of the matrix, i.e. the data is copied
  pub fn clone(&self) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_clone(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_copyTo_OutputArray_m
  /// copies the matrix content to "m".
  pub fn copy_to(&self, m:& ::core::Mat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_copyTo_OutputArray_m(self.as_raw_Mat(), m.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_copyTo_OutputArray_m_InputArray_mask
  /// copies those matrix elements to "m" that are marked with non-zero mask elements.
  pub fn copy_to_masked(&self, m:& ::core::Mat, mask:& ::core::Mat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_copyTo_OutputArray_m_InputArray_mask(self.as_raw_Mat(), m.as_raw_Mat(), mask.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_convertTo_OutputArray_m_int_rtype_double_alpha_double_beta
  /// converts matrix to another datatype with optional scalng. See cvConvertScale.
  ///
  /// default value for arguments:
  ///   - alpha: default 1
  ///   - beta: default 0
  pub fn convert_to(&self, m:& ::core::Mat, rtype: i32, alpha: f64, beta: f64) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_convertTo_OutputArray_m_int_rtype_double_alpha_double_beta(self.as_raw_Mat(), m.as_raw_Mat(), rtype, alpha, beta);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_assignTo_Mat_m_int_type
  ///
  /// default value for arguments:
  ///   - _type: default -1
  pub fn assign_to(&self, m:& ::core::Mat, _type: i32) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_assignTo_Mat_m_int_type(self.as_raw_Mat(), m.as_raw_Mat(), _type);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_setTo_InputArray_value_InputArray_mask
  /// sets some of the matrix elements to s, according to the mask
  ///
  /// default value for arguments:
  ///   - mask: default noArray()
  pub fn set_to(&mut self, value:& ::core::Mat, mask:& ::core::Mat) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_setTo_InputArray_value_InputArray_mask(self.as_raw_Mat(), value.as_raw_Mat(), mask.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_reshape_int_cn_int_rows
  /// creates alternative matrix header for the same data, with different
  ///
  /// default value for arguments:
  ///   - rows: default 0
  pub fn reshape(&self, cn: i32, rows: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_reshape_int_cn_int_rows(self.as_raw_Mat(), cn, rows);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_cross_InputArray_m
  /// computes cross-product of 2 3D vectors
  pub fn cross(&self, m:& ::core::Mat) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_cross_InputArray_m(self.as_raw_Mat(), m.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_dot_InputArray_m
  /// computes dot-product
  pub fn dot(&self, m:& ::core::Mat) -> Result<f64,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_dot_InputArray_m(self.as_raw_Mat(), m.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_addref
  /// increases the reference counter; use with care to avoid memleaks
  pub fn addref(&mut self) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_addref(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_release
  /// decreases reference counter;
  pub fn release(&mut self) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_release(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_deallocate
  /// deallocates the matrix data
  pub fn deallocate(&mut self) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_deallocate(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_copySize_Mat_m
  /// internal use function; properly re-allocates _size, _step arrays
  pub fn copy_size(&mut self, m:& ::core::Mat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_copySize_Mat_m(self.as_raw_Mat(), m.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_reserve_size_t_sz
  /// reserves enough space to fit sz hyper-planes
  pub fn reserve(&mut self, sz: size_t) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_reserve_size_t_sz(self.as_raw_Mat(), sz);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_resize_size_t_sz
  /// resizes matrix to the specified number of hyper-planes
  pub fn resize(&mut self, sz: size_t) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_resize_size_t_sz(self.as_raw_Mat(), sz);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_resize_size_t_sz_Scalar_s
  /// resizes matrix to the specified number of hyper-planes; initializes the newly added elements
  pub fn resize_with_default(&mut self, sz: size_t, s: ::core::Scalar) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_resize_size_t_sz_Scalar_s(self.as_raw_Mat(), sz, s);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_push_back_Mat_m
  pub fn push_back(&mut self, m:& ::core::Mat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_push_back_Mat_m(self.as_raw_Mat(), m.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_pop_back_size_t_nelems
  /// removes several hyper-planes from bottom of the matrix
  ///
  /// default value for arguments:
  ///   - nelems: default 1
  pub fn pop_back(&mut self, nelems: size_t) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_pop_back_size_t_nelems(self.as_raw_Mat(), nelems);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_locateROI_Size_wholeSize_Point_ofs
  /// locates matrix header within a parent matrix. See below
  pub fn locate_roi(&self, wholeSize: ::core::Size, ofs: ::core::Point) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_locateROI_Size_wholeSize_Point_ofs(self.as_raw_Mat(), wholeSize, ofs);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_Mat_adjustROI_int_dtop_int_dbottom_int_dleft_int_dright
  /// moves/resizes the current matrix ROI inside the parent matrix.
  pub fn adjust_roi(&mut self, dtop: i32, dbottom: i32, dleft: i32, dright: i32) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_adjustROI_int_dtop_int_dbottom_int_dleft_int_dright(self.as_raw_Mat(), dtop, dbottom, dleft, dright);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_Mat_isContinuous
  /// returns true iff the matrix data is continuous
  pub fn is_continuous(&self) -> Result<bool,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_isContinuous(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_isSubmatrix
  /// returns true if the matrix is a submatrix of another matrix
  pub fn is_submatrix(&self) -> Result<bool,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_isSubmatrix(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_elemSize
  /// returns element size in bytes,
  pub fn elem_size(&self) -> Result<size_t,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_elemSize(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_elemSize1
  /// returns the size of element channel in bytes.
  pub fn elem_size1(&self) -> Result<size_t,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_elemSize1(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_type
  /// returns element type, similar to CV_MAT_TYPE(cvmat->type)
  pub fn typ(&self) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_type(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_depth
  /// returns element type, similar to CV_MAT_DEPTH(cvmat->type)
  pub fn depth(&self) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_depth(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_channels
  /// returns element type, similar to CV_MAT_CN(cvmat->type)
  pub fn channels(&self) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_channels(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_step1_int_i
  /// returns step/elemSize1()
  ///
  /// default value for arguments:
  ///   - i: default 0
  pub fn step1(&self, i: i32) -> Result<size_t,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_step1_int_i(self.as_raw_Mat(), i);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_empty
  /// returns true if matrix data is NULL
  pub fn empty(&self) -> Result<bool,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_empty(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_total
  /// returns the total number of matrix elements
  pub fn total(&self) -> Result<size_t,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_total(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_checkVector_int_elemChannels_int_depth_bool_requireContinuous
  /// returns N if the matrix is 1-channel (N x ptdim) or ptdim-channel (1 x N) or (N x 1); negative number otherwise
  ///
  /// default value for arguments:
  ///   - depth: default -1
  ///   - requireContinuous: default true
  pub fn check_vector(&self, elemChannels: i32, depth: i32, requireContinuous: bool) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_checkVector_int_elemChannels_int_depth_bool_requireContinuous(self.as_raw_Mat(), elemChannels, depth, requireContinuous);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_ptr_int_i0
  /// returns pointer to i0-th submatrix along the dimension #0
  ///
  /// default value for arguments:
  ///   - i0: default 0
  pub fn ptr0(&mut self, i0: i32) -> Result<*mut u8,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_ptr_int_i0(self.as_raw_Mat(), i0);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_ptr_int_i0_int_i1
  /// returns pointer to (i0,i1) submatrix along the dimensions #0 and #1
  pub fn ptr1(&mut self, i0: i32, i1: i32) -> Result<*mut u8,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_ptr_int_i0_int_i1(self.as_raw_Mat(), i0, i1);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_ptr_int_i0_int_i1_int_i2
  /// returns pointer to (i0,i1,i3) submatrix along the dimensions #0, #1, #2
  pub fn ptr2(&mut self, i0: i32, i1: i32, i2: i32) -> Result<*mut u8,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_ptr_int_i0_int_i1_int_i2(self.as_raw_Mat(), i0, i1, i2);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Mat_size
  pub fn size(&self) -> Result<::core::Size,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Mat_size(self.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

}

// boxed class cv::Matx_AddOp
#[allow(dead_code)]
pub struct Matx_AddOp {
    pub ptr: *mut c_void
}
impl Drop for ::core::Matx_AddOp {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Matx_AddOp(self.ptr) };
    }
}
impl ::core::Matx_AddOp {
    pub fn as_raw_Matx_AddOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_AddOp {

}

// boxed class cv::Matx_MatMulOp
#[allow(dead_code)]
pub struct Matx_MatMulOp {
    pub ptr: *mut c_void
}
impl Drop for ::core::Matx_MatMulOp {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Matx_MatMulOp(self.ptr) };
    }
}
impl ::core::Matx_MatMulOp {
    pub fn as_raw_Matx_MatMulOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_MatMulOp {

}

// boxed class cv::Matx_MulOp
#[allow(dead_code)]
pub struct Matx_MulOp {
    pub ptr: *mut c_void
}
impl Drop for ::core::Matx_MulOp {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Matx_MulOp(self.ptr) };
    }
}
impl ::core::Matx_MulOp {
    pub fn as_raw_Matx_MulOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_MulOp {

}

// boxed class cv::Matx_ScaleOp
#[allow(dead_code)]
pub struct Matx_ScaleOp {
    pub ptr: *mut c_void
}
impl Drop for ::core::Matx_ScaleOp {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Matx_ScaleOp(self.ptr) };
    }
}
impl ::core::Matx_ScaleOp {
    pub fn as_raw_Matx_ScaleOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_ScaleOp {

}

// boxed class cv::Matx_SubOp
#[allow(dead_code)]
pub struct Matx_SubOp {
    pub ptr: *mut c_void
}
impl Drop for ::core::Matx_SubOp {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Matx_SubOp(self.ptr) };
    }
}
impl ::core::Matx_SubOp {
    pub fn as_raw_Matx_SubOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_SubOp {

}

// boxed class cv::Matx_TOp
#[allow(dead_code)]
pub struct Matx_TOp {
    pub ptr: *mut c_void
}
impl Drop for ::core::Matx_TOp {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Matx_TOp(self.ptr) };
    }
}
impl ::core::Matx_TOp {
    pub fn as_raw_Matx_TOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_TOp {

}

// boxed class cv::NAryMatIterator
#[allow(dead_code)]
pub struct NAryMatIterator {
    pub ptr: *mut c_void
}
impl Drop for ::core::NAryMatIterator {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_NAryMatIterator(self.ptr) };
    }
}
impl ::core::NAryMatIterator {
    pub fn as_raw_NAryMatIterator(&self) -> *mut c_void { self.ptr }
}
impl NAryMatIterator {

  // identifier: cv_NAryMatIterator_NAryMatIterator
  /// the default constructor
  pub fn new() -> Result<::core::NAryMatIterator,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_NAryMatIterator_NAryMatIterator();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::NAryMatIterator{ ptr: rv.result })
    }
  }

}

// boxed class cv::PCA
#[allow(dead_code)]
pub struct PCA {
    pub ptr: *mut c_void
}
impl Drop for ::core::PCA {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_PCA(self.ptr) };
    }
}
impl ::core::PCA {
    pub fn as_raw_PCA(&self) -> *mut c_void { self.ptr }
}
impl PCA {

  // identifier: cv_PCA_PCA
  /// default constructor
  pub fn default() -> Result<::core::PCA,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_PCA_PCA();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::PCA{ ptr: rv.result })
    }
  }

  // identifier: cv_PCA_PCA_InputArray_data_InputArray_mean_int_flags_int_maxComponents
  /// the constructor that performs PCA
  ///
  /// default value for arguments:
  ///   - maxComponents: default 0
  pub fn new_mat_max(data:& ::core::Mat, mean:& ::core::Mat, flags: i32, maxComponents: i32) -> Result<::core::PCA,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_PCA_PCA_InputArray_data_InputArray_mean_int_flags_int_maxComponents(data.as_raw_Mat(), mean.as_raw_Mat(), flags, maxComponents);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::PCA{ ptr: rv.result })
    }
  }

  // identifier: cv_PCA_PCA_InputArray_data_InputArray_mean_int_flags_double_retainedVariance
  pub fn new_mat_variance(data:& ::core::Mat, mean:& ::core::Mat, flags: i32, retainedVariance: f64) -> Result<::core::PCA,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_PCA_PCA_InputArray_data_InputArray_mean_int_flags_double_retainedVariance(data.as_raw_Mat(), mean.as_raw_Mat(), flags, retainedVariance);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::PCA{ ptr: rv.result })
    }
  }

  // identifier: cv_PCA_computeVar_InputArray_data_InputArray_mean_int_flags_double_retainedVariance
  pub fn compute_var(&mut self, data:& ::core::Mat, mean:& ::core::Mat, flags: i32, retainedVariance: f64) -> Result<::core::PCA,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_PCA_computeVar_InputArray_data_InputArray_mean_int_flags_double_retainedVariance(self.as_raw_PCA(), data.as_raw_Mat(), mean.as_raw_Mat(), flags, retainedVariance);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::PCA{ ptr: rv.result })
    }
  }

  // identifier: cv_PCA_project_InputArray_vec
  /// projects vector from the original space to the principal components subspace
  pub fn project(&self, vec:& ::core::Mat) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_PCA_project_InputArray_vec(self.as_raw_PCA(), vec.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_PCA_project_InputArray_vec_OutputArray_result
  /// projects vector from the original space to the principal components subspace
  pub fn project_to(&self, vec:& ::core::Mat, result:& ::core::Mat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_PCA_project_InputArray_vec_OutputArray_result(self.as_raw_PCA(), vec.as_raw_Mat(), result.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

  // identifier: cv_PCA_backProject_InputArray_vec
  /// reconstructs the original vector from the projection
  pub fn back_project(&self, vec:& ::core::Mat) -> Result<::core::Mat,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_PCA_backProject_InputArray_vec(self.as_raw_PCA(), vec.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Mat{ ptr: rv.result })
    }
  }

  // identifier: cv_PCA_backProject_InputArray_vec_OutputArray_result
  /// reconstructs the original vector from the projection
  pub fn back_project_to(&self, vec:& ::core::Mat, result:& ::core::Mat) -> Result<(),String> {
    unsafe {
      let rv = ::sys::cv_core_cv_PCA_backProject_InputArray_vec_OutputArray_result(self.as_raw_PCA(), vec.as_raw_Mat(), result.as_raw_Mat());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(())
    }
  }

}
// Generating impl for trait cv::ParallelLoopBody
pub trait ParallelLoopBody {
  fn as_raw_ParallelLoopBody(&self) -> *mut c_void;
}


// boxed class cv::Range
#[allow(dead_code)]
pub struct Range {
    pub ptr: *mut c_void
}
impl Drop for ::core::Range {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_Range(self.ptr) };
    }
}
impl ::core::Range {
    pub fn as_raw_Range(&self) -> *mut c_void { self.ptr }
}
impl Range {

  // identifier: cv_Range_Range
  pub fn default() -> Result<::core::Range,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Range_Range();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Range{ ptr: rv.result })
    }
  }

  // identifier: cv_Range_Range_int__start_int__end
  pub fn new(_start: i32, _end: i32) -> Result<::core::Range,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Range_Range_int__start_int__end(_start, _end);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Range{ ptr: rv.result })
    }
  }

  // identifier: cv_Range_size
  pub fn size(&self) -> Result<i32,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Range_size(self.as_raw_Range());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Range_empty
  pub fn empty(&self) -> Result<bool,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Range_empty(self.as_raw_Range());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

  // identifier: cv_Range_all
  pub fn all(&mut self) -> Result<::core::Range,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_Range_all(self.as_raw_Range());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::Range{ ptr: rv.result })
    }
  }

}

// boxed class cv::RotatedRect
#[allow(dead_code)]
pub struct RotatedRect {
    pub ptr: *mut c_void
}
impl Drop for ::core::RotatedRect {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_RotatedRect(self.ptr) };
    }
}
impl ::core::RotatedRect {
    pub fn as_raw_RotatedRect(&self) -> *mut c_void { self.ptr }
}
impl RotatedRect {

  // identifier: cv_RotatedRect_RotatedRect
  /// various constructors
  pub fn default() -> Result<::core::RotatedRect,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_RotatedRect_RotatedRect();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::RotatedRect{ ptr: rv.result })
    }
  }

  // identifier: cv_RotatedRect_RotatedRect_Point2f_center_Size2f_size_float_angle
  pub fn new(center: ::core::Point2f, size: ::core::Size2f, angle: f32) -> Result<::core::RotatedRect,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_RotatedRect_RotatedRect_Point2f_center_Size2f_size_float_angle(center, size, angle);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::RotatedRect{ ptr: rv.result })
    }
  }

  // identifier: cv_RotatedRect_boundingRect
  /// returns the minimal up-right rectangle containing the rotated rectangle
  pub fn bounding_rect(&self) -> Result<::core::Rect,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_RotatedRect_boundingRect(self.as_raw_RotatedRect());
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(rv.result)
    }
  }

}

// boxed class cv::TermCriteria
#[allow(dead_code)]
pub struct TermCriteria {
    pub ptr: *mut c_void
}
impl Drop for ::core::TermCriteria {
    fn drop(&mut self) {
        unsafe { ::sys::cv_delete_TermCriteria(self.ptr) };
    }
}
impl ::core::TermCriteria {
    pub fn as_raw_TermCriteria(&self) -> *mut c_void { self.ptr }
}
impl TermCriteria {

  // identifier: cv_TermCriteria_TermCriteria
  /// default constructor
  pub fn default() -> Result<::core::TermCriteria,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_TermCriteria_TermCriteria();
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::TermCriteria{ ptr: rv.result })
    }
  }

  // identifier: cv_TermCriteria_TermCriteria_int_type_int_maxCount_double_epsilon
  /// full constructor
  pub fn new(_type: i32, maxCount: i32, epsilon: f64) -> Result<::core::TermCriteria,String> {
    unsafe {
      let rv = ::sys::cv_core_cv_TermCriteria_TermCriteria_int_type_int_maxCount_double_epsilon(_type, maxCount, epsilon);
      if rv.error_msg as i32 != 0i32 {
          let v = CStr::from_ptr(rv.error_msg).to_bytes().to_vec();
          ::libc::free(rv.error_msg as *mut c_void);
          return Err(String::from_utf8(v).unwrap())
      }
      Ok(::core::TermCriteria{ ptr: rv.result })
    }
  }

}