summaryrefslogtreecommitdiffstats
path: root/tests/kinectsurface/QtKinectWrapper/OpenNI/Include/XnPrdNode.h
blob: 1c491be8ea3e9b76120748c76cfdbf80a3f38165 (plain)
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
/****************************************************************************
*                                                                           *
*  OpenNI 1.x Alpha                                                         *
*  Copyright (C) 2011 PrimeSense Ltd.                                       *
*                                                                           *
*  This file is part of OpenNI.                                             *
*                                                                           *
*  OpenNI is free software: you can redistribute it and/or modify           *
*  it under the terms of the GNU Lesser General Public License as published *
*  by the Free Software Foundation, either version 3 of the License, or     *
*  (at your option) any later version.                                      *
*                                                                           *
*  OpenNI is distributed in the hope that it will be useful,                *
*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
*  GNU Lesser General Public License for more details.                      *
*                                                                           *
*  You should have received a copy of the GNU Lesser General Public License *
*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
*                                                                           *
****************************************************************************/
#ifndef __XN_PRD_NODE_H__
#define __XN_PRD_NODE_H__

/**
 * @ingroup cref
 * @defgroup prd_node Production Nodes Functionality
 * This page details functions that can be run on production nodes.
 */

//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include <XnTypes.h>

//---------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------

/**
 * @ingroup prd_node
 * @defgroup node Production Node
 *
 * A production node is the most basic unit of processing in OpenNI. The following functions can be 
 * executed for every node in an OpenNI context.
 * @{
 */

/**
 * @brief Gets information about a specific node, like its description, and dependent nodes.
 *
 * @param	hNode	[in]	A handle to the node.
 */
XN_C_API XnNodeInfo* XN_C_DECL xnGetNodeInfo(XnNodeHandle hNode);

/**
 * @brief Gets the instance name of a node by its handle.
 *
 * @param	hNode	[in]	A handle to the node.
 */
XN_C_API const XnChar* XN_C_DECL xnGetNodeName(XnNodeHandle hNode);

/**
 * @brief Gets the context a node belongs to. The context ref count is increased. The user
 * is responsible for releasing the context when it's no longer used.
 *
 * @param	hNode	[in]	A handle to the node.
 */
XN_C_API XnContext* XN_C_DECL xnGetRefContextFromNodeHandle(XnNodeHandle hNode);

typedef XnContext* XnContextPtr;
XN_C_API XnContextPtr XN_API_DEPRECATED("Please use xnGetRefContextFromNodeHandle() instead") XN_C_DECL xnGetContextFromNodeHandle(XnNodeHandle hNode);

/**
 * @brief Checks if a production node supports specific capability.
 * 
 * @param	hInstance			[in]	A handle to the instance to be queried.
 * @param	strCapabilityName	[in]	The name of the capability to check.
 */
XN_C_API XnBool XN_C_DECL xnIsCapabilitySupported(XnNodeHandle hInstance, const XnChar* strCapabilityName);

/**
 * @brief Sets an integer property.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	strName		[in]	Property name
 * @param	nValue		[in]	New value
 */
XN_C_API XnStatus XN_C_DECL xnSetIntProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt64 nValue);
/**
 * @brief Sets a real property.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	strName		[in]	Property name
 * @param	dValue		[in]	New value
 */
XN_C_API XnStatus XN_C_DECL xnSetRealProperty(XnNodeHandle hInstance, const XnChar* strName, XnDouble dValue);
/**
 * @brief Sets a string property.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	strName		[in]	Property name
 * @param	strValue	[in]	New value
 */
XN_C_API XnStatus XN_C_DECL xnSetStringProperty(XnNodeHandle hInstance, const XnChar* strName, const XnChar* strValue);
/**
 * @brief Sets a buffer property.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	strName		[in]	Property name
 * @param	nBufferSize	[in]	The size of the buffer passed, in bytes.
 * @param	pBuffer		[in]	The data buffer.
 */
XN_C_API XnStatus XN_C_DECL xnSetGeneralProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer);

/**
 * @brief Gets an integer property.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	strName		[in]	Property name
 * @param	pnValue		[out]	Current value
 */
XN_C_API XnStatus XN_C_DECL xnGetIntProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt64* pnValue);
/**
 * @brief Gets a real property.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	strName		[in]	Property name
 * @param	pdValue		[out]	Current value
 */
XN_C_API XnStatus XN_C_DECL xnGetRealProperty(XnNodeHandle hInstance, const XnChar* strName, XnDouble* pdValue);
/**
 * @brief Gets a string property.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	strName		[in]	Property name
 * @param	csValue		[out]	Current value 
 * @param	nBufSize	[in]	The size of the csValue buffer. 
 */
XN_C_API XnStatus XN_C_DECL xnGetStringProperty(XnNodeHandle hInstance, const XnChar* strName, XnChar* csValue, XnUInt32 nBufSize);
/**
 * @brief Gets a buffer property.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	strName		[in]	Property name
 * @param	nBufferSize	[in]	The size of the buffer passed, in bytes.
 * @param	pBuffer		[in]	The data buffer to be filled.
 */
XN_C_API XnStatus XN_C_DECL xnGetGeneralProperty(XnNodeHandle hInstance, const XnChar* strName, XnUInt32 nBufferSize, void* pBuffer);

/**
 * @brief Locks a node, not allowing any changes (any "set" function).
 *
 * @param	hInstance	[in]	A handle to the node.
 * @param	phLock		[out]	A handle of the lock, that can be used to manage the lock.
 */
XN_C_API XnStatus XN_C_DECL xnLockNodeForChanges(XnNodeHandle hInstance, XnLockHandle* phLock);

/**
 * @brief Unlocks a previously locked node.
 *
 * @param	hInstance	[in]	A handle to the node.
 * @param	hLock		[in]	The handle of the lock, returned from @ref xnLockNodeForChanges().
 */
XN_C_API XnStatus XN_C_DECL xnUnlockNodeForChanges(XnNodeHandle hInstance, XnLockHandle hLock);

/**
 * @brief Start changes request on a locked node, without releasing that lock. 
 *
 * It allows "set" operations from the same context (same thread for that matter) until a call is made to 
 * @ref xnLockedNodeEndChanges().
 *
 * @param	hInstance	[in]	A handle to the node.
 * @param	hLock		[in]	The handle of the lock, returned from @ref xnLockNodeForChanges().
 */
XN_C_API XnStatus XN_C_DECL xnLockedNodeStartChanges(XnNodeHandle hInstance, XnLockHandle hLock);

/**
 * @brief Ends changes request on a locked node. 
 *
 * @param	hInstance	[in]	A handle to the node.
 * @param	hLock		[in]	The handle of the lock, returned from @ref xnLockNodeForChanges().
 */
XN_C_API XnStatus XN_C_DECL xnLockedNodeEndChanges(XnNodeHandle hInstance, XnLockHandle hLock);

/**
 * @brief Adds another node to the list of needed nodes for this node.
 *
 * @param	hInstance	[in]	A handle to the node.
 * @param	hNeededNode	[in]	The node that is needed by hInstance.
 */
XN_C_API XnStatus XN_C_DECL xnAddNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode);

/**
 * @brief Removes a needed node from the list of needed nodes. 
 *
 * If this node is no longer needed by any other node, and @ref xnRefProductionNode() was not called on it, 
 * it will be destroyed.
 *
 * @param	hInstance	[in]	A handle to the node.
 * @param	hNeededNode	[in]	The node to be removed from the list.
 */
XN_C_API XnStatus XN_C_DECL xnRemoveNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode);

/** @} */

//---------------------------------------------------------------------------
// Device
//---------------------------------------------------------------------------

/**
 * @ingroup prd_node
 * @defgroup device Device
 *
 * A device node represents a physical device. The following functions can be 
 * executed for device nodes in an OpenNI context.
 * @{
 */

/**
 * @brief Creates a device node.
 *
 * @param	pContext			[in]	The context in which to create the device
 * @param	phDevice			[out]	A handle to the created device
 * @param	pQuery				[in]	Optional. Can be used to select which device to create. If not specified, this function may create any device node that is available.
 * @param	pErrors				[in]	Optional. If provided, will be filled with information about device nodes that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateDevice(XnContext* pContext, XnNodeHandle* phDevice, XnNodeQuery* pQuery, XnEnumerationErrors* pErrors);

/** @} */

//---------------------------------------------------------------------------
// Device Identification Capability
//---------------------------------------------------------------------------

/**
 * @ingroup device
 * @defgroup device_id Device Identification Capability
 *
 * The Device Identification Capability (@ref XN_CAPABILITY_DEVICE_IDENTIFICATION) allows to identify
 * the device according to its name, to a vendor-specific string and its serial number.
 * @{
 */

/**
 * Gets the device name.
 *
 * @param	hInstance		[in]		A handle to the instance.
 * @param	strBuffer		[in]		A buffer to accept the device name.
 * @param	pnBufferSize	[in/out]	Size of the buffer.
 *
 * @returns XN_STATUS_OK if succeeded, or XN_STATUS_OUTPUT_BUFFER_OVERFLOW if buffer is not sufficient.
 * in such a case, the device name should be truncated to fit in the buffer, and pnBufferSize should be
 * updated to the required size.
 */
XN_C_API XnStatus XN_C_DECL xnGetDeviceName(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);

/**
 * Gets a vendor-specific string.
 *
 * @param	hInstance		[in]		A handle to the instance.
 * @param	strBuffer		[in]		A buffer to accept the string.
 * @param	pnBufferSize	[in/out]	Size of the buffer.
 *
 * @returns XN_STATUS_OK if succeeded, or XN_STATUS_OUTPUT_BUFFER_OVERFLOW if buffer is not sufficient.
 * in such a case, the string should be truncated to fit in the buffer, and pnBufferSize should be
 * updated to the required size.
 */
XN_C_API XnStatus XN_C_DECL xnGetVendorSpecificData(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);

/**
 * Gets the serial number of the device.
 *
 * @param	hInstance		[in]		A handle to the instance.
 * @param	strBuffer		[in]		A buffer to accept the string.
 * @param	pnBufferSize	[in/out]	Size of the buffer.
 *
 * @returns XN_STATUS_OK if succeeded, or XN_STATUS_OUTPUT_BUFFER_OVERFLOW if buffer is not sufficient.
 * in such a case, the string should be truncated to fit in the buffer, and pnBufferSize should be
 * updated to the required size.
 */
XN_C_API XnStatus XN_C_DECL xnGetSerialNumber(XnNodeHandle hInstance, XnChar* strBuffer, XnUInt32* pnBufferSize);

/** @} */

//---------------------------------------------------------------------------
// ErrorState Capability
//---------------------------------------------------------------------------

/** 
 * @ingroup node
 * @defgroup err_state Error State Capability
 *
 * The Error State capability (@ref XN_CAPABILITY_ERROR_STATE) allows a node to report it is now in
 * an error state, and so, might not function correctly. An application may, at all times, check the 
 * error state of a node, and it may also register a callback function to be called whenever that state
 * changes.
 *
 * The error state of a node is represented using @ref XnStatus. A value of XN_STATUS_OK means the node
 * is OK. Any other value represents some sort of error situation in the node.
 * @{
 */

/**
 * @brief Gets current error state of this node.
 *
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns The error state of this node.
 */
XN_C_API XnStatus XN_C_DECL xnGetNodeErrorState(XnNodeHandle hInstance);

/**
 * @brief Registers a callback function to error state changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when error state changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromNodeErrorStateChange().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToNodeErrorStateChange
	(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToNodeErrorStateChange().
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToNodeErrorStateChange().
 */
XN_C_API void XN_C_DECL xnUnregisterFromNodeErrorStateChange
	(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// GeneralIntCapability
//---------------------------------------------------------------------------

/** 
 * @ingroup node
 * @defgroup general_int General Int Capability
 *
 * The General Int Capability is a set of method that is used by several capabilities. It allows
 * a general range value to be changed. If supported by the node, the value can also be set to 
 * @ref XN_AUTO_CONTROL for automatic adjustment.
 *
 * The capabilities supporting this interface are:
 * - Brightness (@ref XN_CAPABILITY_BRIGHTNESS)
 * - Contrast (@ref XN_CAPABILITY_CONTRAST)
 * - Hue (@ref XN_CAPABILITY_HUE)
 * - Saturation (@ref XN_CAPABILITY_SATURATION)
 * - Sharpness (@ref XN_CAPABILITY_SHARPNESS)
 * - Gamma (@ref XN_CAPABILITY_GAMMA)
 * - WhiteBalance (@ref XN_CAPABILITY_COLOR_TEMPERATURE)
 * - BacklightCompensation (@ref XN_CAPABILITY_BACKLIGHT_COMPENSATION)
 * - Gain (@ref XN_CAPABILITY_GAIN)
 * - Pan (@ref XN_CAPABILITY_PAN)
 * - Tilt (@ref XN_CAPABILITY_TILT)
 * - Roll (@ref XN_CAPABILITY_ROLL)
 * - Zoom (@ref XN_CAPABILITY_ZOOM)
 * - Exposure (@ref XN_CAPABILITY_EXPOSURE)
 * - Iris (@ref XN_CAPABILITY_IRIS)
 * - Focus (@ref XN_CAPABILITY_FOCUS)
 * - Low Light Compensation (@ref XN_CAPABILITY_LOW_LIGHT_COMPENSATION)
 * @{
 */

/**
 * @brief Gets the range of this capability values
 *
 * @param	hNode				[in]	A handle to the instance
 * @param	strCap				[in]	Name of the capability
 * @param	pnMin				[out]	Minimum value
 * @param	pnMax				[out]	Maximum value	
 * @param	pnStep				[out]	Step size
 * @param	pnDefault			[out]	Default value
 * @param	pbIsAutoSupported	[out]	TRUE if auto adjustment is supported, FALSE otherwise
 */
XN_C_API XnStatus XN_C_DECL xnGetGeneralIntRange(XnNodeHandle hNode, const XnChar* strCap, XnInt32* pnMin, XnInt32* pnMax, XnInt32* pnStep, XnInt32* pnDefault, XnBool* pbIsAutoSupported);

/**
 * @brief Gets the current value of this capability
 *
 * @param	hNode				[in]	A handle to the instance
 * @param	strCap				[in]	Name of the capability
 * @param	pnValue				[out]	Current value
 */
XN_C_API XnStatus XN_C_DECL xnGetGeneralIntValue(XnNodeHandle hNode, const XnChar* strCap, XnInt32* pnValue);

/**
 * @brief Sets the current value of this capability
 *
 * @param	hNode				[in]	A handle to the instance
 * @param	strCap				[in]	Name of the capability
 * @param	nValue				[in]	Value to set
 */
XN_C_API XnStatus XN_C_DECL xnSetGeneralIntValue(XnNodeHandle hNode, const XnChar* strCap, XnInt32 nValue);

/**
 * @brief Registers a callback function to values changes.
 *
 * @param	hNode		[in]	A handle to the instance.
 * @param	strCap		[in]	Name of the capability
 * @param	handler		[in]	A pointer to a function that will be called when value changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromGeneralIntValueChange().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToGeneralIntValueChange
	(XnNodeHandle hNode, const XnChar* strCap, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToGeneralIntValueChange().
 *
 * @param	hNode		[in]	A handle to the instance.
 * @param	strCap		[in]	Name of the capability
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToGeneralIntValueChange().
 */
XN_C_API void XN_C_DECL xnUnregisterFromGeneralIntValueChange
	(XnNodeHandle hNode, const XnChar* strCap, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// Generators
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup generator Generator
 * 
 * A Generator node is a production node that also generates continuous data. It supports all @ref node functions,
 * and adds additional functions.
 * @{
 */

/**
 * @name Controlling Generation
 * The following functions allows controlling if a node is currently generating data or not.
 * @{
 */

/** 
 * @brief Starts generation of the output. This will also cause all dependencies to start generating.
 * 
 * @param	hInstance	[in]	A handle to the instance to start generating.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a generator.
 */
XN_C_API XnStatus XN_C_DECL xnStartGenerating(XnNodeHandle hInstance);

/** 
 * @brief Checks if this node is currently generating.
 * 
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns FALSE if this production node is not a generator.
 */
XN_C_API XnBool XN_C_DECL xnIsGenerating(XnNodeHandle hInstance);

/** 
 * @brief Stops generation of the output.
 * 
 * @param	hInstance	[in]	A handle to the instance to stop generating.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a generator.
 */
XN_C_API XnStatus XN_C_DECL xnStopGenerating(XnNodeHandle hInstance);

/**
 * @brief Registers a callback function to be called when generation starts or stops.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when generation starts/stops.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromGenerationRunningChange().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToGenerationRunningChange
	(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToGenerationRunningChange().
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToGenerationRunningChange().
 */
XN_C_API void XN_C_DECL xnUnregisterFromGenerationRunningChange
	(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/// @}

/**
 * @name Checking if new data is available
 * The following functions allows an application to know if and when a node has new data available.
 * When new data is available, the node data is still not replaced, until explicitly done so using one
 * of the update data functions.
 * @{
 */

/**
 * @brief Registers a callback function to be called when new data is available.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when new data is available.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromNewDataAvailable().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToNewDataAvailable
	(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToNewDataAvailable().
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToNewDataAvailable().
 */
XN_C_API void XN_C_DECL xnUnregisterFromNewDataAvailable
	(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
 * @brief Checks whether this node has new data (and so a call to @ref xnWaitAndUpdateData() will not block).
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	pnTimestamp	[out]	[Optional] If not NULL, will be filled with that data timestamp.
 */
XN_C_API XnBool XN_C_DECL xnIsNewDataAvailable(XnNodeHandle hInstance, XnUInt64* pnTimestamp);

/// @}

/**
 * @name Getting new data
 * @{
 */

/** 
 * @brief Updates the data to the latest available one. If needed, the call will block until new data is available.
 *
 * @param	hInstance	[in]	A handle to the instance to be updated.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a generator.
 */
XN_C_API XnStatus XN_C_DECL xnWaitAndUpdateData(XnNodeHandle hInstance);

/// @}

/**
 * @name Data properties
 * @{
 */

/**
 * @brief Checks whether current data is new. Meaning, did the data change on the last call to @ref xnWaitAndUpdateAll(),
 * @ref xnWaitOneUpdateAll() or @ref xnWaitAndUpdateData().
 *
 * @param	hInstance	[in]	A handle to the instance.
 */
XN_C_API XnBool XN_C_DECL xnIsDataNew(XnNodeHandle hInstance);

/**
 * @brief Gets the current data.
 *
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns	NULL if this production node is not a generator.
 */
XN_C_API const void* XN_C_DECL xnGetData(XnNodeHandle hInstance);

/**
 * @brief Gets the size of current data, in bytes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns	(XnUInt32)-1 if this production node is not a generator.
 */
XN_C_API XnUInt32 XN_C_DECL xnGetDataSize(XnNodeHandle hInstance);

/**
 * @brief Gets the timestamp of current data, in microseconds.
 *
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns	(XnUInt64)-1 if this production node is not a generator.
 */
XN_C_API XnUInt64 XN_C_DECL xnGetTimestamp(XnNodeHandle hInstance);

/**
 * @brief Gets the frame ID of current data.
 *
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns	(XnUInt32)-1 if this production node is not a generator.
 */
XN_C_API XnUInt32 XN_C_DECL xnGetFrameID(XnNodeHandle hInstance);

/** @} */

/** @} */

//---------------------------------------------------------------------------
// Mirror Capability
//---------------------------------------------------------------------------

/** 
 * @ingroup generator
 * @defgroup mirror Mirror Capability
 * The mirror capability (@ref XN_CAPABILITY_MIRROR) allows mirroring of the data produced by a @ref generator.
 * Mirroring is useful if the sensor is placed in front of the user (so that it sees the user right hand as the
 * left one), but applications want user to get a more natural feeling of control.
 * @{
 */

/**
 * @brief Sets current mirror configuration.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	bMirror		[in]	TRUE for mirroring output, FALSE otherwise.
 */
XN_C_API XnStatus XN_C_DECL xnSetMirror(XnNodeHandle hInstance, XnBool bMirror);

/**
 * @brief Gets current mirroring configuration.
 *
 * @param	hInstance	[in]	A handle to the instance.
 */
XN_C_API XnBool XN_C_DECL xnIsMirrored(XnNodeHandle hInstance);

/**
 * @brief Registers a callback function to mirror changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when mirror changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromMirrorChange().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToMirrorChange
	(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToMirrorChange().
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToMirrorChange().
 */
XN_C_API void XN_C_DECL xnUnregisterFromMirrorChange
	(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// Alternative View Point Capability
//---------------------------------------------------------------------------

/** 
 * @ingroup generator
 * @defgroup altviewpoint Alternative View Point Capability
 * The Alternative View Point capability (@ref XN_CAPABILITY_ALTERNATIVE_VIEW_POINT) allows a @ref generator
 * to transform its data to appear as if the sensor is placed in another location. For example, when more
 * than one sensor is active (or one sensor that produces several outputs coming from close locations, yet not
 * the same one), one sensor can change its data to appear as if coming from the location of the other sensor,
 * so that both data buffers represent the same (for example depth and image maps, where the same coordinates
 * in the map represent the same location is the scene).
 * @{
 */

/**
 * @brief Checks if this generator can change its output to look like it was taken from a different location, represented by another generator.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hOther		[in]	The view point to be checked.
 *
 * @returns TRUE if view point is supported, FALSE otherwise.
 */
XN_C_API XnBool XN_C_DECL xnIsViewPointSupported(XnNodeHandle hInstance, XnNodeHandle hOther);

/**
 * @brief Sets the view point of this generator to look like as if placed at another generator location.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hOther		[in]	The view point to be set.
 */
XN_C_API XnStatus XN_C_DECL xnSetViewPoint(XnNodeHandle hInstance, XnNodeHandle hOther);

/**
 * @brief Sets the view point of this generator to its normal one.
 *
 * @param	hInstance	[in]	A handle to the instance.
 */
XN_C_API XnStatus XN_C_DECL xnResetViewPoint(XnNodeHandle hInstance);

/**
 * @brief Checks if current view point is as if coming from the other node view point.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hOther		[in]	The view point to be checked.
 */
XN_C_API XnBool XN_C_DECL xnIsViewPointAs(XnNodeHandle hInstance, XnNodeHandle hOther);

/**
 * @brief Registers a callback function to view point changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when view point changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromViewPointChange().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToViewPointChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToViewPointChange().
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToViewPointChange().
 */
XN_C_API void XN_C_DECL xnUnregisterFromViewPointChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// FrameSync Capability
//---------------------------------------------------------------------------

/** 
 * @ingroup generator
 * @defgroup framesync Frame-Sync Capability
 * The Frame Sync capability (@ref XN_CAPABILITY_FRAME_SYNC) allows two sensors producing frame data to synchronize
 * their frames so that they arrive at the same time. This allows smaller latency between two maps of the same scene
 * (for example depth and image).
 * @{
 */

/**
 * @brief Checks if this generator can frame sync to another node.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hOther		[in]	The node to be checked.
 *
 * @returns TRUE if frame sync to node is supported, FALSE otherwise.
 */
XN_C_API XnBool XN_C_DECL xnCanFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);

/**
 * @brief Activates frame sync with the other node.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hOther		[in]	The node to sync to.
 */
XN_C_API XnStatus XN_C_DECL xnFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);

/**
 * @brief Stops frame sync with the other node.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hOther		[in]	The node to sync to.
 */
XN_C_API XnStatus XN_C_DECL xnStopFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther);

/**
 * @brief Checks if current view point is as if coming from the other node view point.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hOther		[in]	The node to be checked.
 */
XN_C_API XnBool XN_C_DECL xnIsFrameSyncedWith(XnNodeHandle hInstance, XnNodeHandle hOther);

/**
 * @brief Registers a callback function to view point changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when frame sync changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromFrameSyncChange().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToFrameSyncChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToFrameSyncChange().
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToFrameSyncChange().
 */
XN_C_API void XN_C_DECL xnUnregisterFromFrameSyncChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// Map Generators
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup mapgen Map Generator
 * A Map Generator node is a @ref generator that has output data in the form of a pixel map. It supports all @ref generator functions,
 * and adds additional functions.
 * @{
 */

/** 
 * @brief Gets the number of supported modes. This is useful for allocating an array that will be passed to @ref xnGetSupportedMapOutputModes().
 *
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns	0 if this production node is not a map generator.
 */
XN_C_API XnUInt32 XN_C_DECL xnGetSupportedMapOutputModesCount(XnNodeHandle hInstance);

/** 
 * @brief Gets a list of all supported modes. The size of the array that should be passed can be obtained by calling @ref xnGetSupportedMapOutputModesCount().
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	aModes		[in/out]	An array to be filled with supported modes. 
 * @param	pnCount		[in/out]	In: number of elements allocated in the array. Out: number of elements
 *									actually written to the array.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a map generator.
 */
XN_C_API XnStatus XN_C_DECL xnGetSupportedMapOutputModes(XnNodeHandle hInstance, XnMapOutputMode* aModes, XnUInt32* pnCount);

/** 
 * @brief Sets the output mode. 
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	pOutputMode	[in]	The output mode to be set.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a map generator.
 */
XN_C_API XnStatus XN_C_DECL xnSetMapOutputMode(XnNodeHandle hInstance, const XnMapOutputMode* pOutputMode);

/** 
 * @brief Gets the current output mode. 
 * 
 * @param	hInstance	[in]	A handle to the instance.
 * @param	pOutputMode	[out]	Current output mode.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a map generator.
 */
XN_C_API XnStatus XN_C_DECL xnGetMapOutputMode(XnNodeHandle hInstance, XnMapOutputMode* pOutputMode);

/**
 * @brief Registers a callback function to mode changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when mode changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromMapOutputModeChange.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a map generator.
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToMapOutputModeChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToMapOutputModeChange.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToMapOutputModeChange.
 */
XN_C_API void XN_C_DECL xnUnregisterFromMapOutputModeChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
 * @brief Gets the number of bytes per pixel for this map generator.
 *
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns	(XnUInt32)-1 if this production node is not a map generator.
 */
XN_C_API XnUInt32 XN_C_DECL xnGetBytesPerPixel(XnNodeHandle hInstance);

/** @} */

//---------------------------------------------------------------------------
// Cropping Capability
//---------------------------------------------------------------------------


/**
 * @ingroup mapgen
 * @defgroup cropping Cropping Capability
 * The Cropping capability (@ref XN_CAPABILITY_CROPPING) allows a @ref mapgen to output a selected area
 * of the frame instead of the entire frame. When cropping is turned on, the data buffer looks just like
 * resolution is smaller, meaning data is packed. For example if the MapGenerator is working in VGA resolution
 * (640x480) and the application chose a cropping of 300x200, then after first 300 pixels the next pixel row
 * begins. Pixels outside the cropping area are not returned in the buffer (and not just being blacked out).
 * This is very useful for performance boost.
 * @{
 */

/** 
 * @brief Sets the cropping.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	pCropping	[in]	The cropping configuration to be set.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the Cropping capability.
 */
XN_C_API XnStatus XN_C_DECL xnSetCropping(XnNodeHandle hInstance, const XnCropping* pCropping);

/** 
 * @brief Gets current cropping configuration.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	pCropping	[out]	Current cropping configuration.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the Cropping capability.
 */
XN_C_API XnStatus XN_C_DECL xnGetCropping(XnNodeHandle hInstance, XnCropping* pCropping);

/**
 * @brief Registers a callback function to cropping changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when cropping changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromCroppingChange().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToCroppingChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToCroppingChange().
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from xnRegisterToCroppingChange().
 */
XN_C_API void XN_C_DECL xnUnregisterFromCroppingChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// Anti Flicker Capability
//---------------------------------------------------------------------------

/**
 * @ingroup mapgen
 * @defgroup anti_flicker Anti Flicker Capability
 * The Anti Flicker capability (@ref XN_CAPABILITY_ANTI_FLICKER) allows a @ref mapgen to time its frames
 * in such a way that no flickering will take place due to electric light frequencies.
 * @{
 */

/** 
 * @brief Sets the power line frequency: 50 Hz, 60 Hz, or 0 to turn off anti-flicker.
 *
 * @param	hGenerator	[in]	A handle to the instance.
 * @param	nFrequency	[in]	The frequency to be used.
 */
XN_C_API XnStatus XN_C_DECL xnSetPowerLineFrequency(XnNodeHandle hGenerator, XnPowerLineFrequency nFrequency);

/** 
 * @brief Gets the power line frequency.
 *
 * @param	hGenerator	[in]	A handle to the instance.
 * @returns (XnUInt32)-1 if node does not support this capability
 */
XN_C_API XnPowerLineFrequency XN_C_DECL xnGetPowerLineFrequency(XnNodeHandle hGenerator);

/**
 * @brief Registers a callback function to power line frequency changes.
 *
 * @param	hGenerator	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when power line frequency changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromPowerLineFrequencyChange().
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToPowerLineFrequencyChange
	(XnNodeHandle hGenerator, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToPowerLineFrequencyChange().
 *
 * @param	hGenerator	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToPowerLineFrequencyChange().
 */
XN_C_API void XN_C_DECL xnUnregisterFromPowerLineFrequencyChange
	(XnNodeHandle hGenerator, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// Depth Generators
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup depthgen Depth Generator
 * A Depth Generator node is a @ref mapgen that outputs depth maps. It supports all @ref mapgen functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates a depth generator.
 *
 * @param	pContext			[in]	The context in which to create the depth generator
 * @param	phDepthGenerator	[out]	A handle to the created depth generator
 * @param	pQuery				[in]	Optional. Can be used to select which depth generator to create. If not specified, this function may create any depth generator that is available.
 * @param	pErrors				[in]	Optional. If provided, will be filled with information about depth generators that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateDepthGenerator(
	XnContext* pContext,
	XnNodeHandle* phDepthGenerator,
	XnNodeQuery* pQuery, 
	XnEnumerationErrors* pErrors);

/** 
 * @brief Gets the maximum depth the device can produce. 
 *
 * @param	hInstance	[in]	A handle to the instance.
 *
 * @returns	-1 if this production node is not a depth generator.
 */
XN_C_API XnDepthPixel XN_C_DECL xnGetDeviceMaxDepth(XnNodeHandle hInstance);

/** 
 * @brief Gets the Field-Of-View of the depth generator, in radians.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	pFOV		[in]	A struct to be filled with field of view.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a depth generator.
 */
XN_C_API XnStatus XN_C_DECL xnGetDepthFieldOfView(XnNodeHandle hInstance, XnFieldOfView* pFOV);

/**
 * @brief Registers a callback function to field of view changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when field of view changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromDepthFieldOfViewChange.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToDepthFieldOfViewChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToDepthFieldOfViewChange.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToDepthFieldOfViewChange.
 */
XN_C_API void XN_C_DECL xnUnregisterFromDepthFieldOfViewChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
 * @brief Converts a list of points from projective coordinates to real world coordinates.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	nCount		[in]		The number of points to translate.
 * @param	aProjective	[in]		An array of projective coordinates points.
 * @param	aRealWorld	[in/out]	An array to be filled with real world coordinates points.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a depth generator.
 */
XN_C_API XnStatus XN_C_DECL xnConvertProjectiveToRealWorld(
	XnNodeHandle hInstance, XnUInt32 nCount, const XnPoint3D* aProjective, XnPoint3D* aRealWorld);

/**
 * @brief Converts a list of points from projective coordinates to real world coordinates.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	nCount		[in]		The number of points to translate.
 * @param	aRealWorld	[in]		An array of real world coordinates points.
 * @param	aProjective	[in/out]	An array to be filled with projective coordinates points.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not a depth generator.
 */
XN_C_API XnStatus XN_C_DECL xnConvertRealWorldToProjective(
	XnNodeHandle hInstance, XnUInt32 nCount, const XnPoint3D* aRealWorld, XnPoint3D* aProjective);

/** 
 * @brief Gets the current depth-map. This map is updated after a call to @ref xnWaitAndUpdateData(). 
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	NULL if this production node is not a depth generator.
 */
XN_C_API XnDepthPixel* XN_C_DECL xnGetDepthMap(XnNodeHandle hInstance);

/**
 * @brief Gets the current depth-map meta data.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	pMetaData	[in]		The struct to be filled.
 */
XN_C_API void XN_C_DECL xnGetDepthMetaData(XnNodeHandle hInstance, XnDepthMetaData* pMetaData);

/** @} */

//---------------------------------------------------------------------------
// User Position Capability
//---------------------------------------------------------------------------

/** 
 * @ingroup depthgen
 * @defgroup userpos User Position Capability
 * The User Position capability (@ref XN_CAPABILITY_USER_POSITION) allows a @ref depthgen to change its
 * output, so that it would be optimized in specific locations in the scene.
 * @{
 */

/**
 * @brief Gets the number of user positions supported by this generator.
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	0 if this production node does not support the User Position capability.
 */
XN_C_API XnUInt32 XN_C_DECL xnGetSupportedUserPositionsCount(XnNodeHandle hInstance);

/** 
 * @brief Sets the current user position. 
 * 
 * @param	hInstance	[in]		A handle to the instance.
 * @param	nIndex		[in]		The user position to set.
 * @param	pPosition	[in]		The user position in the frame.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
 */
XN_C_API XnStatus XN_C_DECL xnSetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, const XnBoundingBox3D* pPosition);

/** 
 * @brief Gets the current user position. 
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	nIndex		[in]	The user position to get.
 * @param	pPosition	[out]	The user position.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
 */
XN_C_API XnStatus XN_C_DECL xnGetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, XnBoundingBox3D* pPosition);

/**
 * @brief Registers a callback function to user position changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when user position changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromUserPositionChange.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToUserPositionChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToUserPositionChange.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToUserPositionChange.
 */
XN_C_API void XN_C_DECL xnUnregisterFromUserPositionChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// Image Generators
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup imagegen Image Generator
 * An Image Generator node is a @ref mapgen that outputs image maps. It supports all @ref mapgen functions,
 * and adds additional functions.
 * Image maps may arrive in different pixel formats.
 * @{
 */

/**
 * @brief Creates an image generator.
 *
 * @param	pContext			[in]	The context in which to create the image generator.
 * @param	phImageGenerator	[out]	A handle to the created image generator.
 * @param	pQuery				[in]	Optional. Can be used to select which image generator to create. If not specified, this function may create any image generator that is available.
 * @param	pErrors				[in]	Optional. If provided, will be filled with information about image generators that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateImageGenerator(
	XnContext* pContext,
	XnNodeHandle* phImageGenerator,
	XnNodeQuery* pQuery, 
	XnEnumerationErrors* pErrors
	);

/** 
 * @brief Gets the current RGB24 image-map. 
 * This map is updated after a call to @ref xnWaitAndUpdateData(). It is assumed that the node is currently in RGB24 pixel format.
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	NULL if this production node is not an image generator.
 */
XN_C_API XnRGB24Pixel* XN_C_DECL xnGetRGB24ImageMap(XnNodeHandle hInstance);

/** 
 * @brief Gets the current YUV422 image-map. 
 * This map is updated after a call to @ref xnWaitAndUpdateData(). It is assumed that the node is currently in YUV422 pixel format.
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	NULL if this production node is not an image generator.
 */
XN_C_API XnYUV422DoublePixel* XN_C_DECL xnGetYUV422ImageMap(XnNodeHandle hInstance);

/** 
 * @brief Gets the current Grayscale8 image-map. 
 * This map is updated after a call to @ref xnWaitAndUpdateData(). It is assumed that the node is currently in Grayscale8 pixel format.
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	NULL if this production node is not an image generator.
 */
XN_C_API XnGrayscale8Pixel* XN_C_DECL xnGetGrayscale8ImageMap(XnNodeHandle hInstance);

/** 
 * @brief Gets the current Grayscale16 image-map. 
 * This map is updated after a call to @ref xnWaitAndUpdateData(). It is assumed that the node is currently in Grayscale16 pixel format.
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	NULL if this production node is not an image generator.
 */
XN_C_API XnGrayscale16Pixel* XN_C_DECL xnGetGrayscale16ImageMap(XnNodeHandle hInstance);

/** 
 * @brief Gets the current image-map as a byte buffer. 
 *
 * This map is updated after a call to @ref xnWaitAndUpdateData(). 
 * It is highly advised not to use this function. Instead, if you know the format of the image, use
 * @ref xnGetRGB24ImageMap(), @ref xnGetYUV422ImageMap(), @ref xnGetGrayscale8ImageMap() or 
 * @ref xnGetGrayscale16ImageMap().
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	NULL if this production node is not an image generator.
 */
XN_C_API XnUInt8* XN_C_DECL xnGetImageMap(XnNodeHandle hInstance);

/**
 * @brief Checks if a specific pixel format is supported.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	Format		[in]		The format to check for.
 */
XN_C_API XnBool XN_C_DECL xnIsPixelFormatSupported(XnNodeHandle hInstance, XnPixelFormat Format);

/**
 * @brief Sets the pixel format of the image map.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	Format		[in]		The format to set.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node is not an image generator.
 */
XN_C_API XnStatus XN_C_DECL xnSetPixelFormat(XnNodeHandle hInstance, XnPixelFormat Format);

/**
 * @brief Gets current pixel format.
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	-1 if this production node is not an image generator.
 */
XN_C_API XnPixelFormat XN_C_DECL xnGetPixelFormat(XnNodeHandle hInstance);

/**
 * @brief Registers a callback function to pixel format changes.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	handler		[in]	A pointer to a function that will be called when pixel format changes.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Optional. Will be filled with a handle to be passed to @ref xnUnregisterFromPixelFormatChange.
 *
 * @returns	XN_STATUS_INVALID_OPERATION if this production node does not support the User Position capability.
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToPixelFormatChange(XnNodeHandle hInstance, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToPixelFormatChange.
 *
 * @param	hInstance	[in]	A handle to the instance.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToPixelFormatChange.
 */
XN_C_API void XN_C_DECL xnUnregisterFromPixelFormatChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
 * @brief Gets the current image-map meta data.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	pMetaData	[in]		The struct to be filled.
 */
XN_C_API void XN_C_DECL xnGetImageMetaData(XnNodeHandle hInstance, XnImageMetaData* pMetaData);

/** @} */

//---------------------------------------------------------------------------
// IR Generators
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup irgen IR Generator
 * An IR Generator node is a @ref mapgen that outputs infra-red maps. It supports all @ref mapgen functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates an IR generator.
 *
 * @param	pContext			[in]	The context in which to create the IR generator.
 * @param	phIRGenerator		[out]	A handle to the created IR generator.
 * @param	pQuery				[in]	Optional. Can be used to select which IR generator to create. If not specified, this function may create any IR generator that is available.
 * @param	pErrors				[in]	Optional. If provided, will be filled with information about IR generators that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateIRGenerator(
	XnContext* pContext,
	XnNodeHandle* phIRGenerator,
	XnNodeQuery* pQuery, 
	XnEnumerationErrors* pErrors
	);

/** 
 * @brief Gets the current IR-map. This map is updated after a call to @ref xnWaitAndUpdateData(). 
 *
 * @param	hInstance	[in]		A handle to the instance.
 *
 * @returns	NULL if this production node is not an IR generator.
 */
XN_C_API XnIRPixel* XN_C_DECL xnGetIRMap(XnNodeHandle hInstance);

/**
 * @brief Gets the current IR-map meta data.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	pMetaData	[in]		The struct to be filled.
 */
XN_C_API void XN_C_DECL xnGetIRMetaData(XnNodeHandle hInstance, XnIRMetaData* pMetaData);

/** @} */

//---------------------------------------------------------------------------
// Gesture Generators
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup gestures Gesture Generator
 * A Gestures Generator node is a @ref generator that recognizes certain gestures. It supports all @ref generator functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates a Gesture Generator.
 *
 * @param	pContext				[in]	The context in which to create the gesture generator.
 * @param	phGestureGenerator		[out]	A handle to the created gesture generator.
 * @param	pQuery					[in]	Optional. Can be used to select which Gesture node to create. If not specified, this function may create any gesture node that is available.
 * @param	pErrors					[in]	Optional. If provided, will be filled with information about gesture nodes that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateGestureGenerator(
	XnContext* pContext,
	XnNodeHandle* phGestureGenerator,
	XnNodeQuery* pQuery, 
	XnEnumerationErrors* pErrors
	);

/**
 * @brief Turn on gesture. The generator will now look for this gesture
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	strGesture	[in]		The name of the gesture to look for
 * @param	pArea		[in]		The area in which to look for the gesture (in Real-World coordinates)
 */
XN_C_API XnStatus XN_C_DECL xnAddGesture(XnNodeHandle hInstance, const XnChar* strGesture, XnBoundingBox3D* pArea);
/**
 * @brief Turn off gesture.  The generator will no longer look for this gesture
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	strGesture	[in]		The name of the gesture to not look for anymore
 */
XN_C_API XnStatus XN_C_DECL xnRemoveGesture(XnNodeHandle hInstance, const XnChar* strGesture);
/**
 * @brief Get the names of the gestures that are currently active
 * 
 * @param	hInstance		[in]		A handle to the instance
 * @param	pstrGestures	[out]		Preallocated memory, for the gesture names
 * @param	nGestures		[in,out]	The size of the preallocated memory. Changed to number of gestures
 */
XN_C_API XnStatus XN_C_DECL xnGetActiveGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt16* nGestures);
/**
 * @brief Get the names of the gestures that are currently active
 * 
 * @param	hInstance		[in]		A handle to the instance
 * @param	pstrGestures	[out]		Preallocated memory, for the gesture names
 * @param	nNameLength		[in]		Memory size for each gesture name
 * @param	nGestures		[in,out]	The size of the preallocated memory. Changed to number of gestures
 */
XN_C_API XnStatus XN_C_DECL xnGetAllActiveGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);
/**
 * @brief Get the names of all gestures available
 * 
 * @param	hInstance		[in]		A handle to the instance
 * @param	pstrGestures	[out]		Preallocated memory, for the gesture names
 * @param	nGestures		[in,out]	The size of the preallocated memory. Changed to number of gestures
 */
XN_C_API XnStatus XN_C_DECL xnEnumerateGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt16* nGestures);
/**
 * @brief Get the names of all gestures available
 * 
 * @param	hInstance		[in]		A handle to the instance
 * @param	pstrGestures	[out]		Preallocated memory, for the gesture names
 * @param	nNameLength		[in]		Memory size for each gesture name
 * @param	nGestures		[in,out]	The size of the preallocated memory. Changed to number of gestures
 */
XN_C_API XnStatus XN_C_DECL xnEnumerateAllGestures(XnNodeHandle hInstance, XnChar** pstrGestures, XnUInt32 nNameLength, XnUInt16* nGestures);

/**
 * @brief Get the number of all gestures available
 * 
 * @param	hInstance		[in]		A handle to the instance
 * @return the number of gestures available
 */
XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfAvailableGestures(XnNodeHandle hInstance);


/**
 * @brief Check if a specific gesture is available in this generator
 * 
 * @param	hInstance	[in]		A handle to the instance
 * @param	strGesture	[in]		Name of the gesture to check
 */
XN_C_API XnBool XN_C_DECL xnIsGestureAvailable(XnNodeHandle hInstance, const XnChar* strGesture);
/**
 * @brief Check if the specific gesture supports 'in progress' callbacks
 * 
 * @param	hInstance	[in]		A handle to the instance
 * @param	strGesture	[in]		Name of the gesture to check
 */
XN_C_API XnBool XN_C_DECL xnIsGestureProgressSupported(XnNodeHandle hInstance, const XnChar* strGesture);
/**
 * @brief Register to all gesture callbacks.
 * 
 * @param	hInstance		[in]	A handle to the instance
 * @param	RecognizedCB	[in]	A callback to be called when a gesture is recognized
 * @param	ProgressCB		[in]	A callback to be called when a gesture is on its way to be recognized
 * @param	pCookie			[in]	User's cookie, to be delivered to the callbacks
 * @param	phCallback		[out]	The handle to these callbacks, to allow unregistration
 */
XN_C_API XnStatus XN_C_DECL xnRegisterGestureCallbacks(XnNodeHandle hInstance, XnGestureRecognized RecognizedCB, XnGestureProgress ProgressCB, void* pCookie, XnCallbackHandle* phCallback);
/**
 * @brief Unregister from gesture callbacks
 * 
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
XN_C_API void XN_C_DECL xnUnregisterGestureCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/**
 * @brief Register to when gestures are added or removed
 * 
 * @param	hInstance	[in]		A handle to the instance
 * @param	handler		[in]		The callback to be called when gesture configuration changes.
 * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
 * @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToGestureChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
/**
 * @brief Unregister from when gestures are added or removed
 * 
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
XN_C_API void XN_C_DECL xnUnregisterFromGestureChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
 * @brief Register to when a gesture is in progress
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	handler		[in]		The callback to be called when the gesture is in progress
 * @param	pCookie		[in]		User's cookie, to be delivered to the callback
 * @param	phCallback	[out]		The handle to the callback, to allow unregistration
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnGestureIntermediateStageCompleted handler, void* pCookie, XnCallbackHandle* phCallback);
/**
 * @brief Unregister from when a gesture is in progress
 * 
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
XN_C_API void XN_C_DECL xnUnregisterFromGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/**
 * @brief Register to when a gesture is ready for its next stage (specific to the gesture)
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	handler		[in]		The callback to be called when the gesture is ready for its next stage
 * @param	pCookie		[in]		User's cookie, to be delivered to the callback
 * @param	phCallback	[out]		The handle to this callback, to allow unregistration
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnGestureReadyForNextIntermediateStage handler, void* pCookie, XnCallbackHandle* phCallback);
/**
 * @brief Unregister from when a gesture is ready for its next stage
 * 
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
XN_C_API void XN_C_DECL xnUnregisterFromGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/** @} */

//---------------------------------------------------------------------------
// Scene Analysis
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup scene Scene Analyzer
 * A Scene Analyzer node is a @ref mapgen that performs scene analysis. It supports all @ref mapgen functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates an scene analyzer.
 *
 * @param	pContext			[in]	The context in which to create the scene analyzer.
 * @param	phSceneAnalyzer		[out]	A handle to the created scene analyzer.
 * @param	pQuery				[in]	Optional. Can be used to select which scene analyzer to create. If not specified, this function may create any scene analyzer that is available.
 * @param	pErrors				[in]	Optional. If provided, will be filled with information about scene analyzers that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateSceneAnalyzer(
	XnContext* pContext,
	XnNodeHandle* phSceneAnalyzer,
	XnNodeQuery* pQuery, 
	XnEnumerationErrors* pErrors
	);

/**
 * @brief Gets the label map, describing the current segmentation of the scene.
 * 
 * @param	hInstance	[in]		A handle to the instance
 */
XN_C_API const XnLabel* XN_C_DECL xnGetLabelMap(XnNodeHandle hInstance);
/**
 * @brief Gets a description of the floor, if it was found.
 * 
 * @param	hInstance	[in]		A handle to the instance
 * @param	pPlane		[out]		A description of the floor
 */
XN_C_API XnStatus XN_C_DECL xnGetFloor(XnNodeHandle hInstance, XnPlane3D* pPlane);

/**
 * @brief Gets the current scene meta data.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	pMetaData	[in]		The struct to be filled.
 */
XN_C_API void XN_C_DECL xnGetSceneMetaData(XnNodeHandle hInstance, XnSceneMetaData* pMetaData);

/** @} */

//---------------------------------------------------------------------------
// User Generator
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup user User Generator
 * A User Generator node is a @ref generator that identifies a user in the scene. It supports all @ref generator functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates a user generator.
 *
 * @param	pContext			[in]	The context in which to create the user generator.
 * @param	phUserGenerator		[out]	A handle to the created user generator.
 * @param	pQuery				[in]	Optional. Can be used to select which user generator to create. If not specified, this function may create any user generator that is available.
 * @param	pErrors				[in]	Optional. If provided, will be filled with information about user generators that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateUserGenerator(
	XnContext* pContext,
	XnNodeHandle* phUserGenerator,
	XnNodeQuery* pQuery, 
	XnEnumerationErrors* pErrors
	);

/**
 * @brief Get current number of users
 *
 * @param	hInstance	[in]		A handle to the instance
 */
XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfUsers(XnNodeHandle hInstance);
/**
 * @brief Get the current users
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	pUsers		[out]		Preallocated memory for the users
 * @param	pnUsers		[in,out]	The size of the preallocated memory. Changes to the number of users
 */
XN_C_API XnStatus XN_C_DECL xnGetUsers(XnNodeHandle hInstance, XnUserID* pUsers, XnUInt16* pnUsers);
/**
 * @brief Get the center of mass of a user
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		The user for which to get the center of mass
 * @param	pCoM		[out]		The center of mass
 */
XN_C_API XnStatus XN_C_DECL xnGetUserCoM(XnNodeHandle hInstance, XnUserID user, XnPoint3D* pCoM);
/**
 * @brief Get the pixels that belong to a user.
 *
 * The output is in a XnSceneMetaData object, holding a map of the pixels of the scene,
 * with the user's label as the value in the places corresponding with the user's pixels.
 * Pixels outside the user will not contain the user's ID.
 * ID 0 means a request for the pixels of all users. In this case, the background will get the label 0.
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		The user for which to get the pixels
 * @param	pScene		[out]		XnSceneMetaData object, that holds the pixels of the user
 */
XN_C_API XnStatus XN_C_DECL xnGetUserPixels(XnNodeHandle hInstance, XnUserID user, XnSceneMetaData* pScene);
/**
 * @brief Register to user callbacks
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	NewUserCB	[in]		Callback to be called when a new user is identified
 * @param	LostUserCB	[in]		Callback to be called when an existing user is no longer identified
 * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
 * @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
 */
XN_C_API XnStatus XN_C_DECL xnRegisterUserCallbacks(XnNodeHandle hInstance, XnUserHandler NewUserCB, XnUserHandler LostUserCB, void* pCookie, XnCallbackHandle* phCallback);
/**
 * @brief Unregister from user callbacks
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
XN_C_API void XN_C_DECL xnUnregisterUserCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
 * @brief Register to when the user exits the scene (but not lost yet)
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	handler		[in]		Callback to be called when a user leaves the scene
 * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
 * @param	phCallback	[out]		The handle to this callback, to allow unregistration
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToUserExit(XnNodeHandle hInstance, XnUserHandler handler, void* pCookie, XnCallbackHandle* phCallback);
/**
 * @brief Unregister from when a user exits the scene
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
XN_C_API void XN_C_DECL xnUnregisterFromUserExit(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/**
 * @brief Register to when a user re-enters the scene after exiting
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	handler		[in]		Callback to be called when a user leaves the scene
 * @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
 * @param	phCallback	[out]		The handle to this callback, to allow unregistration
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToUserReEnter(XnNodeHandle hInstance, XnUserHandler handler, void* pCookie, XnCallbackHandle* phCallback);
/**
 * @brief Unregister from when a user re-enters the scene
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	hCallback	[in]		The handle received from registration
 */
XN_C_API void XN_C_DECL xnUnregisterFromUserReEnter(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/** @} */

//---------------------------------------------------------------------------
// Skeleton Capability
//---------------------------------------------------------------------------

/** 
 * @ingroup user
 * @defgroup skeleton Skeleton Capability
 * The Skeleton capability (@ref XN_CAPABILITY_SKELETON) allows a @ref user to also output the skeleton
 * data of the user, meaning, where every joint is located.
 * @{
 */

/**
 * @brief Check if generator supports a specific joint.
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	eJoint		[in]		The joint to check
 */
XN_C_API XnBool XN_C_DECL xnIsJointAvailable(XnNodeHandle hInstance, XnSkeletonJoint eJoint);
/**
* @brief Check if generator supports a specific profile.
*
* @param	hInstance	[in]		A handle to the instance
* @param	eProfile	[in]		The profile to check
*/
XN_C_API XnBool XN_C_DECL xnIsProfileAvailable(XnNodeHandle hInstance, XnSkeletonProfile eProfile);
/**
* @brief Set the profile. this will set some joints to be active, and others to be inactive.
*
* @param	hInstance	[in]		A handle to the instance
* @param	eProfile	[in]		The profile to set
*/
XN_C_API XnStatus XN_C_DECL xnSetSkeletonProfile(XnNodeHandle hInstance, XnSkeletonProfile eProfile);
/**
* @brief Change the state of a specific joint, to be active or inactive
*
* @param	hInstance	[in]		A handle to the instance
* @param	eJoint		[in]		The joint
* @param	bState		[in]		The new state
*/
XN_C_API XnStatus XN_C_DECL xnSetJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint, XnBool bState);
/**
* @brief Check if joint is currently active
*
* @param	hInstance	[in]		A handle to the instance
* @param	eJoint		[in]		The joint to check
*/
XN_C_API XnBool XN_C_DECL xnIsJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint);
/**
* @brief Register to joint configuration changes - when joints are activated and deactivated
*
* @param	hInstance	[in]		A handle to the instance
* @param	handler		[in]		The callback to be called when a joint is activated or deactivated
* @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
* @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
*/
XN_C_API XnStatus XN_C_DECL xnRegisterToJointConfigurationChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from joint configuration changes
*
* @param	hInstance	[in]		A handle to the instance
* @param	hCallback	[in]		The handle received from registration
*/
XN_C_API void XN_C_DECL xnUnregisterFromJointConfigurationChange(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/**
* @brief Get all active joints
*
* @param	hInstance	[in]		A handle to the instance
* @param	pJoints		[out]		Preallocated memory for the joints
* @param	pnJoints	[in,out]	The size of the preallocated memory. Changed to the number of the active joints.
*/
XN_C_API XnStatus XN_C_DECL xnEnumerateActiveJoints(XnNodeHandle hInstance, XnSkeletonJoint* pJoints, XnUInt16* pnJoints);
/**
* @brief Get a specific joint's full information
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		The ID of the user to which the skeleton belongs
* @param	eJoint		[in]		The interesting joint
* @param	pJoint		[out]		The joint's full information
*/
XN_C_API XnStatus XN_C_DECL xnGetSkeletonJoint(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation* pJoint);
/**
* @brief Get a specific joint's position
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		The ID of the user to which the skeleton belongs
* @param	eJoint		[in]		The interesting joint
* @param	pJoint		[out]		The joint's current position
*/
XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointPosition(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition* pJoint);
/**
* @brief Get a specific joint's orientation
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		The ID of the user to which the skeleton belongs
* @param	eJoint		[in]		The interesting joint
* @param	pJoint		[out]		The joint's current orientation
*/
XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointOrientation(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation* pJoint);
/**
 * @brief Check if skeleton is being tracked
 *
 * @param	hInstance	[in]		A handle to the instance
 * @param	user		[in]		Id of the user to check
 */
XN_C_API XnBool XN_C_DECL xnIsSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Check if skeleton is being calibrated
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of the user to check
*/
XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrated(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Check if skeleton is being calibrated
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of the user to check
*/
XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrating(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Request calibration when possible
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of the user to check
* @param	bForce		[in]		Disregard previous calibration
*/
XN_C_API XnStatus XN_C_DECL xnRequestSkeletonCalibration(XnNodeHandle hInstance, XnUserID user, XnBool bForce);
/**
* @brief stop calibration
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of the user to check
*/
XN_C_API XnStatus XN_C_DECL xnAbortSkeletonCalibration(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Save the calibration data to file
*
* @param	hInstance	[in]	A handle to the instance
* @param	user		[in]	the user for which the calibration is saved
* @param	strFileName	[in]	The file to which to save the calibration data
*/
XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationDataToFile(XnNodeHandle hInstance, XnUserID user, const XnChar* strFileName);
/**
* @brief Load previously saved calibration data from file
*
* @param	hInstance	[in]	A handle to the instance
* @param	user		[in]	the user to be assigned the calibration data
* @param	strFileName	[in]	The file from which to load the calibration data.
*/
XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationDataFromFile(XnNodeHandle hInstance, XnUserID user, const XnChar* strFileName);
/**
 * @brief Save the calibration data
 *
 * @param	hInstance	[in]	A handle to the instance
 * @param	user		[in]	the user for which the calibration is saved
 * @param	nSlot		[in]	The slot to use for saving the calibration data
 */
XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot);
/**
* @brief Load previously saved calibration data.
*
* @param	hInstance	[in]	A handle to the instance
* @param	user		[in]	the user to be assigned the calibration data
* @param	nSlot		[in]	The slot to use for saving the calibration data.
*/
XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot);
/**
* @brief Clear the requested slot from any saved calibration data.
*
* @param	hInstance	[in]	A handle to the instance
* @param	nSlot		[in]	The slot to clear
*/
XN_C_API XnStatus XN_C_DECL xnClearSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot);
/**
* @brief Check if a specific slot already holds calibration data
*
* @param	hInstance	[in]	A handle to the instance
* @param	nSlot		[in]	The slot to check
*/
XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot);
/**
* @brief Start tracking a skeleton
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of the user to check
*/
XN_C_API XnStatus XN_C_DECL xnStartSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Stop tracking a skeleton
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of the user to check
*/
XN_C_API XnStatus XN_C_DECL xnStopSkeletonTracking(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Reset the skeleton - discard calibration
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of the user to check
*/
XN_C_API XnStatus XN_C_DECL xnResetSkeleton(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Check if a specific pose is required for calibration
*
* @param	hInstance	[in]		A handle to the instance
*/
XN_C_API XnBool XN_C_DECL xnNeedPoseForSkeletonCalibration(XnNodeHandle hInstance);
/**
* @brief Get the pose that is required for calibration
*
* @param	hInstance	[in]		A handle to the instance
* @param	strPose		[in]		Name of the required pose
*/
XN_C_API XnStatus XN_C_DECL xnGetSkeletonCalibrationPose(XnNodeHandle hInstance, XnChar* strPose);
/**
* @brief Set the skeleton's smoothing factor
*
* @param	hInstance	[in]		A handle to the instance
* @param	fFactor		[in]		The smoothing factor
*/
XN_C_API XnStatus XN_C_DECL xnSetSkeletonSmoothing(XnNodeHandle hInstance, XnFloat fFactor);
/**
* @brief Register to calibration callbacks.
*
* @param	hInstance			[in]		A handle to the instance
* @param	CalibrationStartCB	[in]		Callback to be called when calibration is starting
* @param	CalibrationEndCB	[in]		Callback to be called when calibration is complete
* @param	pCookie				[in]		User's cookie, to be delivered to the callbacks
* @param	phCallback			[out]		The handle to these callbacks, to allow unregistration
*/
XN_C_API XnStatus XN_API_DEPRECATED("Please use RegisterToCalibrationStart/Complete") XN_C_DECL xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, XnCalibrationStart CalibrationStartCB, XnCalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from calibration callbacks
*
* @param	hInstance	[in]		A handle to the instance
* @param	hCallback	[in]		The handle received from registration
*/
XN_C_API void XN_API_DEPRECATED("Please use UnregisterFromCalibrationStart/Complete") XN_C_DECL xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/**
* @brief Register to calibration start callback
*
* @param	hInstance	[in]	A handle to the instance
* @param	handler		[in]	Callback to be called when calibration starts
* @param	pCookie		[in]	User's cookie, to be delivered to the callback
* @param	phCallback	[out]	the handle to this callback, to allow unregistration
*/
XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationStart(XnNodeHandle hInstance, XnCalibrationStart handler, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from calibration start callback
*
* @param	[in]	hInstance	A handle to the instance
* @param	[in]	hCallback	The handle received from registration
*/
XN_C_API void XN_C_DECL xnUnregisterFromCalibrationStart(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
* @brief Register to calibration status while calibration is in progress
*
* @param	hInstance			[in]		A handle to the instance
* @param	handler				[in]		Callback to be called when calibration is in progress
* @param	pCookie				[in]		User's cookie, to be delivered to the callbacks
* @param	phCallback			[out]		The handle to this callback, to allow unregistration
*/
XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationInProgress(XnNodeHandle hInstance, XnCalibrationInProgress handler, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from calibration status while in progress
*
* @param	hInstance	[in]		A handle to the instance
* @param	hCallback	[in]		The handle received from registration
*/
XN_C_API void XN_C_DECL xnUnregisterFromCalibrationInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/**
* @brief Register to when calibration is complete, with status
*
* @param	hInstance			[in]		A handle to the instance
* @param	handler				[in]		Callback to be called when calibration is complete
* @param	pCookie				[in]		User's cookie, to be delivered to the callbacks
* @param	phCallback			[out]		The handle to this callback, to allow unregistration
*/
XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationComplete(XnNodeHandle hInstance, XnCalibrationComplete handler, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from calibration complete with status
*
* @param	hInstance	[in]		A handle to the instance
* @param	hCallback	[in]		The handle received from registration
*/
XN_C_API void XN_C_DECL xnUnregisterFromCalibrationComplete(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/** @} */

//---------------------------------------------------------------------------
// Pose Detection Capability
//---------------------------------------------------------------------------

/** 
 * @ingroup user
 * @defgroup pose Pose Detection Capability
 * The Pose capability (@ref XN_CAPABILITY_POSE_DETECTION) allows a @ref user to recognize when the user
 * is in a specific pose.
 * @{
 */

/**
* @brief Get the number of the supported poses
*
* @param	hInstance	[in]		A handle to the instance
*/
XN_C_API XnUInt32 XN_C_DECL xnGetNumberOfPoses(XnNodeHandle hInstance);
/**
* @brief Get the names of the supported poses
*
* @param	hInstance	[in]		A handle to the instance
* @param	pstrPoses	[out]		Pre-allocated memory for the names of the supported poses
* @param	pnPoses		[in,out]	In input - size of the preallocated memory, in output - the number of pose names
*/
XN_C_API XnStatus XN_C_DECL xnGetAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPoses, XnUInt32* pnPoses);
/**
* @brief Get the names of the supported poses
*
* @param	hInstance	[in]		A handle to the instance
* @param	pstrPoses	[out]		Pre-allocated memory for the names of the supported poses
* @param	nNameLength	[in]		Memory size for each pose name
* @param	pnPoses		[in,out]	In input - size of the preallocated memory, in output - the number of pose names
*/
XN_C_API XnStatus XN_C_DECL xnGetAllAvailablePoses(XnNodeHandle hInstance, XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32* pnPoses);

/**
* @brief Tests if a pose is supported
*
* @param	hInstance	[in]		A handle to the instance
* @param	strPose 	[in]		The pose string to test
* @return   True if the pose is supported and False otherwise.
*/
XN_C_API XnBool XN_C_DECL xnIsPoseSupported(XnNodeHandle hInstance, const XnChar* strPose);

/** 
* @brief Gets the current pose status
*
* @param	hInstance	[in]	A handle to the instance
* @param    userID      [in]    The user whose pose status we are interested in.
* @param    poseName    [in]    The pose we want to get a status on.
* @param    poseTime    [out]   The time stamp in which the user entered into the pose (0 if not in pose). 
* @param    eStatus     [out]   The status of the user's pose, i.e. the progress error for getting into 
*                               pose (XnPoseDetectionStatus, the same as received from the in progress
*                               callback. See @ref xnRegisterToPoseDetectionInProgress).
* @param    eState      [out]   The state of the user pose (i.e. in pose, out of pose).
* @return   The success status. The data is invalid if failed.
*/
XN_C_API XnStatus xnGetPoseStatus(XnNodeHandle hInstance, XnUserID userID, const XnChar* poseName, XnUInt64* poseTime, XnPoseDetectionStatus* eStatus, XnPoseDetectionState* eState);
/**
* @brief Start detection of a specific pose for a specific user
*
* @param	hInstance	[in]		A handle to the instance
* @param	strPose		[in]		Name of requested pose
* @param	user		[in]		Id of user
*/
XN_C_API XnStatus XN_C_DECL xnStartPoseDetection(XnNodeHandle hInstance,const  XnChar* strPose, XnUserID user);
/**
* @brief Stop detection of poses for a specific user
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of user
*/
XN_C_API XnStatus XN_C_DECL xnStopPoseDetection(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Stop detection of a specific pose for a specific user
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		Id of user
* @param	strPose		[in]		Name of the pose
*/
XN_C_API XnStatus XN_C_DECL xnStopSinglePoseDetection(XnNodeHandle hInstance, XnUserID user, const XnChar* strPose);
/**
* @brief Register to callbacks for pose events
*
* @param	hInstance	[in]		A handle to the instance
* @param	PoseDetectionStartCB	[in]	Function to be called when the pose is detected
* @param	PoseDetectionEndCB		[in]	Function to be called when the user is out of pose
* @param	pCookie					[in]	User's cookie, to be delivered to the callbacks
* @param	phCallback				[out]	The handle to these callbacks, to allow unregistration
*/
XN_C_API XnStatus XN_API_DEPRECATED("Please use PoseDetected and/or OutOfPose callbacks") XN_C_DECL xnRegisterToPoseCallbacks(XnNodeHandle hInstance, XnPoseDetectionCallback PoseDetectionStartCB, XnPoseDetectionCallback PoseDetectionEndCB, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from pose events
*
* @param	hInstance	[in]		A handle to the instance
* @param	hCallback	[in]		The handle received from registration
*/
XN_C_API void XN_API_DEPRECATED("Please use PoseDetected and/or OutOfPose callbacks") XN_C_DECL xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
* @brief Register to callback when a user is in pose
*
* @param	hInstance	[in]	A handle to the instance
* @param	handler		[in]	Callback to be called when the pose is detected
* @param	pCookie		[in]	User's cookie, to be delivered to the callback
* @param	phCallback	[out]	the handle to this callback, to allow unregistration
*/
XN_C_API XnStatus xnRegisterToPoseDetected(XnNodeHandle hInstance, XnPoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from pose detected callback
*
* @param	[in]	hInstance	A handle to the instance
* @param	[in]	hCallback	The handle received from registration
*/
XN_C_API void xnUnregisterFromPoseDetected(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
* @brief Register to callback when a use is no longer in pose
*
* @param	hInstance	[in]	A handle to the instance
* @param	handler		[in]	Callback to be called when user isn't in pose anymore
* @param	pCookie		[in]	User's cookie, to be delivered to the callback
* @param	phCallback	[out]	the handle to this callback, to allow unregistration
*/
XN_C_API XnStatus xnRegisterToOutOfPose(XnNodeHandle hInstance, XnPoseDetectionCallback handler, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from out of pose callback
*
* @param	[in]	hInstance	A handle to the instance
* @param	[in]	hCallback	The handle received from registration
*/
XN_C_API void xnUnregisterFromOutOfPose(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
* @brief Register to callback for status when pose is detected
*
* @param	hInstance				[in]	A handle to the instance
* @param	handler					[in]	Function to be called when pose detection is in progress
* @param	pCookie					[in]	User's cookie, to be delivered to the callbacks
* @param	phCallback				[out]	The handle to these callbacks, to allow unregistration
*/
XN_C_API XnStatus XN_C_DECL xnRegisterToPoseDetectionInProgress(XnNodeHandle hInstance, XnPoseDetectionInProgress handler, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from pose status callback
*
* @param	hInstance	[in]		A handle to the instance
* @param	hCallback	[in]		The handle received from registration
*/
XN_C_API void XN_C_DECL xnUnregisterFromPoseDetectionInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/** @} */

//---------------------------------------------------------------------------
// Hands Generator
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup hands Hands Generator
 * A Hands Generator node is a @ref generator that tracks hand points. It supports all @ref generator functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates an hands generator.
 *
 * @param	pContext				[in]	The context in which to create the hands generator.
 * @param	phHandsGenerator		[out]	A handle to the created hands generator.
 * @param	pQuery					[in]	Optional. Can be used to select which hands generator to create. If not specified, this function may create any hands generator that is available.
 * @param	pErrors					[in]	Optional. If provided, will be filled with information about hands generators that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateHandsGenerator(
	XnContext* pContext,
	XnNodeHandle* phHandsGenerator,
	XnNodeQuery* pQuery, 
	XnEnumerationErrors* pErrors
	);

/**
* @brief Register to hands callbacks
*
* @param	hInstance	[in]		A handle to the instance
* @param	CreateCB	[in]		Callback to be called when a new hand is created
* @param	UpdateCB	[in]		Callback to be called when an existing hand has a new position
* @param	DestroyCB	[in]		Callback to be called when an existing hand has vanished
* @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
* @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
*/
XN_C_API XnStatus XN_C_DECL xnRegisterHandCallbacks(XnNodeHandle hInstance, XnHandCreate CreateCB, XnHandUpdate UpdateCB, XnHandDestroy DestroyCB, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from hands callbacks
*
* @param	hInstance	[in]		A handle to the instance
* @param	hCallback	[in]		The handle received from registration
*/
XN_C_API void XN_C_DECL xnUnregisterHandCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/**
* @brief Stop tracking a specific hand
*
* @param	hInstance	[in]		A handle to the instance
* @param	user		[in]		The hand to stop tracking
*/
XN_C_API XnStatus XN_C_DECL xnStopTracking(XnNodeHandle hInstance, XnUserID user);
/**
* @brief Stop tracking all hands
*
* @param	hInstance	[in]		A handle to the instance
*/
XN_C_API XnStatus XN_C_DECL xnStopTrackingAll(XnNodeHandle hInstance);
/**
* @brief Start tracking at a specific position
*
* @param	hInstance	[in]		A handle to the instance
* @param	pPosition	[in]		The position at which there is a new hand
*/
XN_C_API XnStatus XN_C_DECL xnStartTracking(XnNodeHandle hInstance, const XnPoint3D* pPosition);
/**
* @brief Change smoothing factor
*
* @param	hInstance	[in]		A handle to the instance
* @param	fFactor		[in]		Smoothing factor, in the range 0..1. 0 Means no smoothing, 1 means infinite smoothing. Inside the range is generator dependent.
*/
XN_C_API XnStatus XN_C_DECL xnSetTrackingSmoothing(XnNodeHandle hInstance, XnFloat fFactor);
/** @} */

//---------------------------------------------------------------------------
// Hand Touching FOV Edge Capability
//---------------------------------------------------------------------------

/** 
* @ingroup user
* @defgroup touchingEdge Hand Touching FOV Edge Capability
* The Touching FOV Edge capability (@ref XN_CAPABILITY_HAND_TOUCHING_FOV_EDGE) allows callbacks when a hand (from hands generator) is touching the edge of the FOV
* @{
*/

/**
* @brief Register to when a hand is approaching the edge of the FOV
*
* @param	hInstance	[in]		A handle to the instance
* @param	handler		[in]		Callback to be called when a hand is approaching the FOV
* @param	pCookie		[in]		User's cookie, to be delivered to the callbacks
* @param	phCallback	[out]		The handle to these callbacks, to allow unregistration
*/
XN_C_API XnStatus XN_C_DECL xnRegisterToHandTouchingFOVEdge(XnNodeHandle hInstance, XnHandTouchingFOVEdge handler, void* pCookie, XnCallbackHandle* phCallback);
/**
* @brief Unregister from hand approaching the edge of the FOV
*
* @param	hInstance	[in]		A handle to the instance
* @param	hCallback	[in]		The handle received from registration
*/
XN_C_API void XN_C_DECL xnUnregisterFromHandTouchingFOVEdge(XnNodeHandle hInstance, XnCallbackHandle hCallback);
/** @} */

//---------------------------------------------------------------------------
// Audio Generator
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup audio Audio Generator
 * An Audio Generator node is a @ref generator that outputs audio data. It supports all @ref generator functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates an audio generator.
 *
 * @param	pContext				[in]	The context in which to create the audio generator.
 * @param	phAudioGenerator		[out]	A handle to the created audio generator.
 * @param	pQuery					[in]	Optional. Can be used to select which audio generator to create. If not specified, this function may create any audio generator that is available.
 * @param	pErrors					[in]	Optional. If provided, will be filled with information about audio generators that could not be created.
 */
XN_C_API XnStatus XN_C_DECL xnCreateAudioGenerator(
	XnContext* pContext,
	XnNodeHandle* phAudioGenerator,
	XnNodeQuery* pQuery, 
	XnEnumerationErrors* pErrors
	);

XN_C_API XnUChar* XN_C_DECL xnGetAudioBuffer(XnNodeHandle hInstance);
XN_C_API XnUInt32 XN_C_DECL xnGetSupportedWaveOutputModesCount(XnNodeHandle hInstance);
XN_C_API XnStatus XN_C_DECL xnGetSupportedWaveOutputModes(XnNodeHandle hInstance, XnWaveOutputMode* aSupportedModes, XnUInt32* pnCount);
XN_C_API XnStatus XN_C_DECL xnSetWaveOutputMode(XnNodeHandle hInstance, const XnWaveOutputMode* OutputMode);
XN_C_API XnStatus XN_C_DECL xnGetWaveOutputMode(XnNodeHandle hInstance, XnWaveOutputMode* OutputMode);
XN_C_API XnStatus XN_C_DECL xnRegisterToWaveOutputModeChanges(XnNodeHandle hInstance, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
XN_C_API void XN_C_DECL xnUnregisterFromWaveOutputModeChanges(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
 * @brief Gets the current audio meta data.
 *
 * @param	hInstance	[in]		A handle to the instance.
 * @param	pMetaData	[in]		The struct to be filled.
 */
XN_C_API void XN_C_DECL xnGetAudioMetaData(XnNodeHandle hInstance, XnAudioMetaData* pMetaData);

/** @} */

//---------------------------------------------------------------------------
// Mocks
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup mocks Mock Nodes
 * @{
 */

XN_C_API XnStatus XN_C_DECL xnMockDepthSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel* pData);
XN_C_API XnStatus XN_C_DECL xnMockImageSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pData);
XN_C_API XnStatus XN_C_DECL xnMockIRSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnIRPixel* pData);
XN_C_API XnStatus XN_C_DECL xnMockAudioSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pData);
XN_C_API XnStatus XN_C_DECL xnMockRawSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void* pData);

/** @} */

//---------------------------------------------------------------------------
// Codecs
//---------------------------------------------------------------------------

/**
 * @ingroup prd_node
 * @defgroup codec Codec
 * A Codec node is a @ref node that allows compression and decompression of data. It supports all @ref node functions,
 * and adds additional functions.
 * @{
 */

XN_C_API XnStatus XN_C_DECL xnCreateCodec(XnContext* pContext, XnCodecID codecID, XnNodeHandle hInitializerNode, XnNodeHandle* phCodec);
XN_C_API XnCodecID XN_C_DECL xnGetCodecID(XnNodeHandle hCodec);
XN_C_API XnStatus XN_C_DECL xnEncodeData(XnNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, 
							   void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten);
XN_C_API XnStatus XN_C_DECL xnDecodeData(XnNodeHandle hCodec, const void* pSrc, XnUInt32 nSrcSize, 
							   void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten);

/** @} */

//---------------------------------------------------------------------------
// Recorder
//---------------------------------------------------------------------------
/** 
 * @ingroup prd_node
 * @defgroup recorder Recorder
 * A Recorder node is a @ref node that allows recording of data. It supports all @ref node functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates a recorder.
 *
 * @param	pContext		[in]	The context in which to create the recorder.
 * @param	strFormatName	[in]	Optional. The name of the format the recorded file will be in. If NULL, file will be in ONI format.
 * @param	phRecorder		[out]	A pointer to the created recorder handle.
 */
XN_C_API XnStatus XN_C_DECL xnCreateRecorder(XnContext* pContext, const XnChar* strFormatName, XnNodeHandle* phRecorder);

/**
 * @brief Tells the recorder where to record.
 *
 * @param	hRecorder	[in]	A handle to the recorder
 * @param	destType	[in]	The type of medium to record to. Currently only XN_RECORD_MEDIUM_FILE is supported.
 * @param	strDest		[in]	Recording destination. If destType is XN_RECORD_MEDIUM_FILE, this specifies a file name.
 */
XN_C_API XnStatus XN_C_DECL xnSetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium destType, const XnChar* strDest);

/**
 * @brief Returns the recoder's destination
 *
 * @param	hRecorder	[in]	A handle to the recorder
 * @param	pDestType	[out]	The type of medium the recorder is set to record.
 * @param	strDest		[out]	Recording destination. If destType is XN_RECORD_MEDIUM_FILE, this specifies a file name.
 * @param	nBufSize	[in]	The size of the strDest buffer.
 */
XN_C_API XnStatus XN_C_DECL xnGetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium* pDestType, XnChar* strDest, XnUInt32 nBufSize);

/**
 * @brief Adds a node to recording and start recording it. This function must be called on each node that is to be 
 * recorded with this recorder.
 *
 * @param	hRecorder	[in]	A handle to the recorder.
 * @param	hNode		[in]	The node to add to the recording.
 * @param	compression	[in]	The type of compression that will be used to encode the node's data 
 *								(See @ref XnCodecIDs.h). If XN_CODEC_NULL is specified, a default compression 
 *								will be chosen according to the node type.
 */
XN_C_API XnStatus XN_C_DECL xnAddNodeToRecording(XnNodeHandle hRecorder, XnNodeHandle hNode, XnCodecID compression);

/**
 * @brief Removes node from recording and stop recording it. This function can be called on a node that was added to 
 * recording with @ref xnAddNodeToRecording.
 *
 * @param	hRecorder	[in]	A handle to the recorder.
 * @param	hNode		[in]	The node to remove from recording.
 */
XN_C_API XnStatus XN_C_DECL xnRemoveNodeFromRecording(XnNodeHandle hRecorder, XnNodeHandle hNode);

/**
 * @brief Records one frame of data from each node that was added to the recorder with @ref xnAddNodeToRecording.
 *
 * @param	hRecorder	[in]	A handle to the recorder.
 */
XN_C_API XnStatus XN_C_DECL xnRecord(XnNodeHandle hRecorder);

/**
 * @brief Gets a string representation of the recording format.
 *
 * @param	hRecorder	[in]	A handle to the recorder.
 */
XN_C_API const XnChar* XN_C_DECL xnGetRecorderFormat(XnNodeHandle hRecorder);

/** @} */

//---------------------------------------------------------------------------
// Player
//---------------------------------------------------------------------------

/** 
 * @ingroup prd_node
 * @defgroup player Player
 * A Player node is a @ref node that allows playing of a recording. It supports all @ref node functions,
 * and adds additional functions.
 * @{
 */

/**
 * @brief Creates a player.
 *
 * @param	pContext		[in]	The context in which to create the player.
 * @param	strFormatName	[in]	The name of the recording format that the created player should play.
 * @param	phPlayer		[out]	Pointer to the created player handle.
 */
XN_C_API XnStatus XN_C_DECL xnCreatePlayer(XnContext* pContext, const XnChar* strFormatName, XnNodeHandle* phPlayer);

/**
 * @brief Determines whether the player will automatically rewind to the beginning of the recording when reaching the end.
 *
 * @param	hPlayer	[in]	A handle to the player.
 * @param	bRepeat	[in]	Determines whether the player will repeat or not.
 * 
 * @remark If bRepeat is set to TRUE, the player will automatically rewind when reaching the end.
 * @remark If bRepeat is set to FALSE, the player will stop playing when reaching the end, and will raise the event that was registered with @ref xnRegisterToEndOfFileReached(). In this state, @ref xnIsPlayerAtEOF() returns TRUE.
 */
XN_C_API XnStatus XN_C_DECL xnSetPlayerRepeat(XnNodeHandle hPlayer, XnBool bRepeat);

/**
 * @brief Sets the source for the player, i.e. where the played events will come from. 
 
 * The only supported source type at this point is a file.
 *
 * @param	hPlayer		[in]	A handle to the player.
 * @param	sourceType	[in]	The type of source to set. Currently only XN_RECORD_MEDIUM_FILE is supported.
 * @param	strSource	[in]	The source from which to play. If sourceType is XN_RECORD_MEDIUM_FILE, strSource specifies a file name.
 *
 * @sa xnGetPlayerSource()
 */
XN_C_API XnStatus XN_C_DECL xnSetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium sourceType, const XnChar* strSource);

/**
 * @brief Gets the player's source, i.e where the played events come from.
 *
 * @param	hPlayer		[in]	A handle to the player.
 * @param	pSourceType	[out]	The player's source type.
 * @param	strSource	[in]	The player's source.
 * @param	nBufSize	[in]	The size of the buffer specified by strSource.
 *
 * @sa xnSetPlayerSource()
 */
XN_C_API XnStatus XN_C_DECL xnGetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium* pSourceType, XnChar* strSource, XnUInt32 nBufSize);

/**
 * @brief Reads the next data element from the player. 
 *
 * Can cause data updates and/or property updates of the played nodes.
 *
 * @param	hPlayer	[in]	A handle to the player.
 */
XN_C_API XnStatus XN_C_DECL xnPlayerReadNext(XnNodeHandle hPlayer);

/**
 * @brief Seeks the player to a specific timestamp, so that playing will continue from that point onwards.
 * @note For the built-in ONI player, this function is not currently supported and always returns XN_STATUS_NOT_IMPLEMENTED.
 *
 * @param	hPlayer		[in]	A handle to the player.
 * @param	nTimeOffset	[in]	The offset, in microseconds, to move, relative to the specified origin. See the remark below.
 * @param	origin		[in]	The origin to seek from. See the remark below.
 *
 * @remark The meaning of the nTimeOffset parameter changes according to the origin parameter:
 *
 *	<table>
 *		<tr><td><b>origin</b></td><td><b>Meaning of the nTimeOffset parameter</b></td>
 *		<tr><td>XN_PLAYER_SEEK_SET</td><td>nTimeOffset specifies the total time passed since the beginning of the recording. Note that nTimeOffset will be case to XnUInt64 in this case.</td>
 *		<tr><td>XN_PLAYER_SEEK_CUR</td><td>nTimeOffset specifies a period of time to move, relative to the current player position. A positive value means move forward, and a negative value means move backwards.</td>
 *		<tr><td>XN_PLAYER_SEEK_END</td><td>nTimeOffset specifies a period of time to move, relative to the end of the recording. This must be a negative value.</td></tr>
 *	</table>
 */
XN_C_API XnStatus XN_C_DECL xnSeekPlayerToTimeStamp(XnNodeHandle hPlayer, XnInt64 nTimeOffset, XnPlayerSeekOrigin origin);

/**
 * @brief Seeks the player to a specific frame of a specific played node, so that playing will continue from that frame onwards.
 *
 * @param	hPlayer			[in]	A handle to the player.
 * @param	strNodeName		[in]	The name of the node whose frame is to be sought.
 * @param	nFrameOffset	[in]	The number of frames to move, relative to the specified origin. See the remark below.
 * @param	origin			[in]	The origin to seek from. See the remark below.
 *
 * @remark The meaning of the nTimeOffset parameter changes according to the origin parameter:
 *
 *	<table>
 *		<tr><td><b>origin</b></td><td><b>Meaning of the nFrameOffset parameter</b></td>
 *		<tr><td>XN_PLAYER_SEEK_SET</td><td>nFrameOffset specifies the total number of frames since the beginning of the node's recording. Note that nFrameOffset will be case to XnUInt64 in this case.</td>
 *		<tr><td>XN_PLAYER_SEEK_CUR</td><td>nFrameOffset specifies the number of frames to move, relative to the current frame of the specifies node. A positive value means move forward, and a negative value means move backwards.</td>
 *		<tr><td>XN_PLAYER_SEEK_END</td><td>nFrameOffset specifies the number of frames to move, relative to the end of the node's recording. This must be a negative value.</td></tr>
 *	</table>
 *
 * @note You can get different results using this function for different values of strNodeName, because the frame numbers of different nodes are not necessarily in sync.
 */
XN_C_API XnStatus XN_C_DECL xnSeekPlayerToFrame(XnNodeHandle hPlayer, const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin);

/**
 * @brief Reports the current timestamp of a player, i.e. the amount of time passed since the beginning of the recording.
 *
 * @param	hPlayer		[in]	A handle to the player.
 * @param	pnTimestamp	[out]	A pointer to the retrieved timestamp in microseconds.
 */
XN_C_API XnStatus XN_C_DECL xnTellPlayerTimestamp(XnNodeHandle hPlayer, XnUInt64* pnTimestamp);

/**
 * @brief Reports the current frame number of a specific node played by a player.
 *
 * @param	hPlayer		[in]	A handle to the player.
 * @param	strNodeName	[in]	The name of the node for which to report the frame number.
 * @param	pnFrame		[out]	A pointer to the reported frame number.
 *
 * @remark Different nodes that belong to the player can have different frame numbers, because the nodes are not necessarily in sync.
 */
XN_C_API XnStatus XN_C_DECL xnTellPlayerFrame(XnNodeHandle hPlayer, const XnChar* strNodeName, XnUInt32* pnFrame);

/**
 * @brief Retrieves the number of frames of a specific node played by a player.
 *
 * @param	hPlayer		[in]	A handle to the player.
 * @param	strNodeName	[in]	The name of the node for which to retrieve the number of frames.
 * @param	pnFrames	[out]	A pointer to the retrieved number of frames.
 */
XN_C_API XnStatus XN_C_DECL xnGetPlayerNumFrames(XnNodeHandle hPlayer, const XnChar* strNodeName, XnUInt32* pnFrames);

/**
 * @brief Gets the name of the format supported by a player.
 *
 * @param	hPlayer	[in]	A handle to the player.
 * @returns	The name of the format supported by the player, or NULL if hPlayer is NULL.
 */
XN_C_API const XnChar* XN_C_DECL xnGetPlayerSupportedFormat(XnNodeHandle hPlayer);

/**
 * @brief Retrieves a list of the nodes played by a player.
 *
 * @param	hPlayer	[in]	A handle to the player.
 * @param	ppList	[out]	A pointer to the retrieved list of nodes.
 *
 * @remark This function fills the pointer that is pointed to by ppList with a newly allocated node info list
 * of the played nodes. This list must later be freed by the caller with @ref xnNodeInfoListFree().
 */
XN_C_API XnStatus XN_C_DECL xnEnumeratePlayerNodes(XnNodeHandle hPlayer, XnNodeInfoList** ppList);

/**
 * @brief Checks whether the player is at the end-of-file marker.
 * @note In the built-in ONI player, this function will never return TRUE for a player that is in repeat mode, although the event registered with @ref xnRegisterToEndOfFileReached() will be fired.
 *
 * @param	hPlayer	[in]	A handle to the player.
 *
 * @sa xnSetPlayerRepeat()
 */
XN_C_API XnBool XN_C_DECL xnIsPlayerAtEOF(XnNodeHandle hPlayer);

/**
 * @brief Registers a callback function to be called when end-of-file is reached.
 *
 * @param	hPlayer		[in]	A handle to the player.
 * @param	handler		[in]	A pointer to a function that will be called.
 * @param	pCookie		[in]	A user cookie that will be passed to the callback function.
 * @param	phCallback	[out]	Will be filled with a handle to be passed to @ref xnUnregisterFromEndOfFileReached().
 *
 * @sa xnSetPlayerRepeat()
 */
XN_C_API XnStatus XN_C_DECL xnRegisterToEndOfFileReached
	(XnNodeHandle hPlayer, XnStateChangedHandler handler,
	void* pCookie, XnCallbackHandle* phCallback);

/**
 * @brief Unregisters a callback function which was registered using @ref xnRegisterToEndOfFileReached().
 *
 * @param	hInstance	[in]	A handle to the player.
 * @param	hCallback	[in]	The handle to the callback returned from @ref xnRegisterToEndOfFileReached().
 */
XN_C_API void XN_C_DECL xnUnregisterFromEndOfFileReached
	(XnNodeHandle hInstance, XnCallbackHandle hCallback);

/**
 * @brief Sets the playback speed, as a ratio of the time passed in the recording.
 * A value of 1.0 means the player will try to output frames in the rate they were recorded (according to
 * their timestamps).
 * A value bigger than 1.0 means fast-forward, and a value between 0.0 and 1.0 means slow-motion.
 * The special value of XN_PLAYBACK_SPEED_FASTEST (0.0) means there will be no delay, and that frames will
 * be returned as soon as asked for.
 *
 * @param	hInstance	[in]	A handle to the player.
 * @param	dSpeed		[in]	The speed ratio (see function description).
 */
XN_C_API XnStatus XN_C_DECL xnSetPlaybackSpeed(XnNodeHandle hInstance, XnDouble dSpeed);

/**
 * @brief Gets the playback speed. see @ref xnSetPlaybackSpeed() for more details.
 *
 * @param	hInstance	[in]	A handle to the player.
 * @returns speed ratio, or -1.0 if this node is not a player.
 */
XN_C_API XnDouble XN_C_DECL xnGetPlaybackSpeed(XnNodeHandle hInstance);

/** @} */

//---------------------------------------------------------------------------
// ScriptNode
//---------------------------------------------------------------------------

/**
 * @ingroup prd_node
 * @defgroup script_node Script Node
 * A Script node is a @ref node that allows running scripts, and acts as a lifetime manager for nodes created
 * by that script.
 * @{
 */

XN_C_API XnStatus XN_C_DECL xnCreateScriptNode(XnContext* pContext, const XnChar* strFormat, XnNodeHandle* phScript);
XN_C_API const XnChar* XN_C_DECL xnScriptNodeGetSupportedFormat(XnNodeHandle hScript);
XN_C_API XnStatus XN_C_DECL xnLoadScriptFromFile(XnNodeHandle hScript, const XnChar* strFileName);
XN_C_API XnStatus XN_C_DECL xnLoadScriptFromString(XnNodeHandle hScript, const XnChar* strScript);
XN_C_API XnStatus XN_C_DECL xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors* pErrors);

/** @} */

#endif // __XN_PRD_NODE_H__