OpenNI 1.3.2
XnCppWrapper.h
Go to the documentation of this file.
1 /****************************************************************************
2 * *
3 * OpenNI 1.1 Alpha *
4 * Copyright (C) 2011 PrimeSense Ltd. *
5 * *
6 * This file is part of OpenNI. *
7 * *
8 * OpenNI is free software: you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published *
10 * by the Free Software Foundation, either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * OpenNI is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
20 * *
21 ****************************************************************************/
22 #ifndef __XN_CPP_WRAPPER_H__
23 #define __XN_CPP_WRAPPER_H__
24 
25 //---------------------------------------------------------------------------
26 // Includes
27 //---------------------------------------------------------------------------
28 #include <XnOpenNI.h>
29 #include <XnCodecIDs.h>
30 
31 //---------------------------------------------------------------------------
32 // Types
33 //---------------------------------------------------------------------------
34 namespace xn
35 {
36  //---------------------------------------------------------------------------
37  // Forward Declarations
38  //---------------------------------------------------------------------------
39  class ProductionNode;
40  class EnumerationErrors;
41  class NodeInfo;
42  class NodeInfoList;
43  class Context;
44  class Query;
45  class Generator;
46 
52  //---------------------------------------------------------------------------
53  // Types
54  //---------------------------------------------------------------------------
55 
62  typedef void (XN_CALLBACK_TYPE* StateChangedHandler)(ProductionNode& node, void* pCookie);
63 
64  //---------------------------------------------------------------------------
65  // Internal stuff
66  //---------------------------------------------------------------------------
67  typedef XnStatus (*_XnRegisterStateChangeFuncPtr)(XnNodeHandle hNode, XnStateChangedHandler handler, void* pCookie, XnCallbackHandle* phCallback);
68  typedef void (*_XnUnregisterStateChangeFuncPtr)(XnNodeHandle hNode, XnCallbackHandle hCallback);
69 
70  static XnStatus _RegisterToStateChange(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback);
71  static void _UnregisterFromStateChange(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback);
72 
73  //---------------------------------------------------------------------------
74  // Some Utilities
75  //---------------------------------------------------------------------------
76  class Version
77  {
78  public:
79  Version(const XnVersion& version) : m_version(version) {}
80  Version(XnUInt8 nMajor, XnUInt8 nMinor, XnUInt16 nMaintenance, XnUInt32 nBuild)
81  {
82  m_version.nMajor = nMajor;
83  m_version.nMinor = nMinor;
84  m_version.nMaintenance = nMaintenance;
85  m_version.nBuild = nBuild;
86  }
87 
88  bool operator==(const Version& other) const
89  {
90  return (xnVersionCompare(&m_version, &other.m_version) == 0);
91  }
92  bool operator!=(const Version& other) const
93  {
94  return (xnVersionCompare(&m_version, &other.m_version) != 0);
95  }
96  bool operator<(const Version& other) const
97  {
98  return (xnVersionCompare(&m_version, &other.m_version) < 0);
99  }
100  bool operator<=(const Version& other) const
101  {
102  return (xnVersionCompare(&m_version, &other.m_version) <= 0);
103  }
104  bool operator>(const Version& other) const
105  {
106  return (xnVersionCompare(&m_version, &other.m_version) > 0);
107  }
108  bool operator>=(const Version& other) const
109  {
110  return (xnVersionCompare(&m_version, &other.m_version) >= 0);
111  }
112  private:
113  XnVersion m_version;
114  };
115 
116  //---------------------------------------------------------------------------
117  // Meta Data
118  //---------------------------------------------------------------------------
119 
125  {
126  public:
132  inline OutputMetaData(const XnUInt8** ppData) : m_pAllocatedData(NULL), m_ppData(ppData), m_nAllocatedSize(0)
133  {
134  xnOSMemSet(&m_output, 0, sizeof(XnOutputMetaData));
135  }
136 
140  virtual ~OutputMetaData() { Free(); }
141 
143  inline XnUInt64 Timestamp() const { return m_output.nTimestamp; }
145  inline XnUInt64& Timestamp() { return m_output.nTimestamp; }
146 
148  inline XnUInt32 FrameID() const { return m_output.nFrameID; }
150  inline XnUInt32& FrameID() { return m_output.nFrameID; }
151 
153  inline XnUInt32 DataSize() const { return m_output.nDataSize; }
155  inline XnUInt32& DataSize() { return m_output.nDataSize; }
156 
158  inline XnBool IsDataNew() const { return m_output.bIsNew; }
160  inline XnBool& IsDataNew() { return m_output.bIsNew; }
161 
163  inline const XnOutputMetaData* GetUnderlying() const { return &m_output; }
165  inline XnOutputMetaData* GetUnderlying() { return &m_output; }
166 
168  inline const XnUInt8* Data() const { return *m_ppData; }
170  inline const XnUInt8*& Data() { return *m_ppData; }
172  inline XnUInt8* WritableData()
173  {
175  return m_pAllocatedData;
176  }
177 
184  XnStatus AllocateData(XnUInt32 nBytes)
185  {
186  if (nBytes > m_nAllocatedSize)
187  {
188  // reallocate
189  XnUInt8* pData = (XnUInt8*)xnOSMallocAligned(nBytes, XN_DEFAULT_MEM_ALIGN);
190  XN_VALIDATE_ALLOC_PTR(pData);
191 
192  // allocation succeeded, replace
193  Free();
194  m_pAllocatedData = pData;
195  m_nAllocatedSize = nBytes;
196  }
197 
198  DataSize() = nBytes;
199  *m_ppData = m_pAllocatedData;
200 
201  return XN_STATUS_OK;
202  }
203 
207  void Free()
208  {
209  if (m_nAllocatedSize != 0)
210  {
212  m_pAllocatedData = NULL;
213  m_nAllocatedSize = 0;
214  }
215  }
216 
222  {
223  XnStatus nRetVal = XN_STATUS_OK;
224 
225  // check data isn't already writable
226  if (Data() != m_pAllocatedData || DataSize() > m_nAllocatedSize)
227  {
228  const XnUInt8* pOrigData = *m_ppData;
229 
230  nRetVal = AllocateData(DataSize());
231  XN_IS_STATUS_OK(nRetVal);
232 
233  if (pOrigData != NULL)
234  {
235  xnOSMemCopy(m_pAllocatedData, pOrigData, DataSize());
236  }
237  else
238  {
240  }
241  }
242 
243  return (XN_STATUS_OK);
244  }
245 
246  protected:
248 
249  private:
250  XnOutputMetaData m_output;
251 
252  const XnUInt8** m_ppData;
253  XnUInt32 m_nAllocatedSize;
254  };
255 
261  {
262  public:
269  inline MapMetaData(XnPixelFormat format, const XnUInt8** ppData) : OutputMetaData(ppData)
270  {
271  xnOSMemSet(&m_map, 0, sizeof(XnMapMetaData));
273  m_map.PixelFormat = format;
274  }
275 
277  inline XnUInt32 XRes() const { return m_map.Res.X; }
279  inline XnUInt32& XRes() { return m_map.Res.X; }
280 
282  inline XnUInt32 YRes() const { return m_map.Res.Y; }
284  inline XnUInt32& YRes() { return m_map.Res.Y; }
285 
287  inline XnUInt32 XOffset() const { return m_map.Offset.X; }
289  inline XnUInt32& XOffset() { return m_map.Offset.X; }
290 
292  inline XnUInt32 YOffset() const { return m_map.Offset.Y; }
294  inline XnUInt32& YOffset() { return m_map.Offset.Y; }
295 
297  inline XnUInt32 FullXRes() const { return m_map.FullRes.X; }
299  inline XnUInt32& FullXRes() { return m_map.FullRes.X; }
300 
302  inline XnUInt32 FullYRes() const { return m_map.FullRes.Y; }
304  inline XnUInt32& FullYRes() { return m_map.FullRes.Y; }
305 
307  inline XnUInt32 FPS() const { return m_map.nFPS; }
309  inline XnUInt32& FPS() { return m_map.nFPS; }
310 
312  inline XnPixelFormat PixelFormat() const { return m_map.PixelFormat; }
313 
315  inline const XnMapMetaData* GetUnderlying() const { return &m_map; }
317  inline XnMapMetaData* GetUnderlying() { return &m_map; }
318 
320  inline XnUInt32 BytesPerPixel() const
321  {
322  switch (PixelFormat())
323  {
325  return sizeof(XnRGB24Pixel);
327  return sizeof(XnYUV422DoublePixel)/2;
329  return sizeof(XnGrayscale8Pixel);
331  return sizeof(XnGrayscale16Pixel);
333  return 2;
334  default:
335  XN_ASSERT(FALSE);
336  return 0;
337  }
338  }
339 
346  XnStatus AllocateData(XnUInt32 nXRes, XnUInt32 nYRes)
347  {
348  XnStatus nRetVal = XN_STATUS_OK;
349 
350  XnUInt32 nSize = nXRes * nYRes * BytesPerPixel();
351  nRetVal = OutputMetaData::AllocateData(nSize);
352  XN_IS_STATUS_OK(nRetVal);
353 
354  FullXRes() = XRes() = nXRes;
355  FullYRes() = YRes() = nYRes;
356  XOffset() = YOffset() = 0;
357 
358  return (XN_STATUS_OK);
359  }
360 
369  XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnUInt8* pExternalBuffer)
370  {
371  XnStatus nRetVal = XN_STATUS_OK;
372 
373  if (pExternalBuffer == NULL)
374  {
375  nRetVal = AllocateData(nXRes, nYRes);
376  XN_IS_STATUS_OK(nRetVal);
377  }
378  else
379  {
380  FullXRes() = XRes() = nXRes;
381  FullYRes() = YRes() = nYRes;
382  XOffset() = YOffset() = 0;
383  Data() = pExternalBuffer;
384  DataSize() = nXRes * nYRes * BytesPerPixel();
385  }
386 
387  return (XN_STATUS_OK);
388  }
389 
390  protected:
392 
393  private:
394  // block copy ctor and assignment operator
395  MapMetaData& operator=(const MapMetaData&);
396  inline MapMetaData(const MapMetaData& other);
397 
398  // Members
399  XnMapMetaData m_map;
400  };
401 
402 /* Declares a map data accessor class */
403 #define _XN_DECLARE_MAP_DATA_CLASS(_name, _pixelType) \
404  class _name \
405  { \
406  public: \
407  inline _name(_pixelType*& pData, XnUInt32& nXRes, XnUInt32 &nYRes) : \
408  m_pData(pData), m_nXRes(nXRes), m_nYRes(nYRes) {} \
409  \
410  inline XnUInt32 XRes() const { return m_nXRes; } \
411  inline XnUInt32 YRes() const { return m_nYRes; } \
412  \
413  inline const _pixelType& operator[](XnUInt32 nIndex) const \
414  { \
415  XN_ASSERT(nIndex < (m_nXRes * m_nYRes)); \
416  return m_pData[nIndex]; \
417  } \
418  inline _pixelType& operator[](XnUInt32 nIndex) \
419  { \
420  XN_ASSERT(nIndex < (m_nXRes *m_nYRes)); \
421  return m_pData[nIndex]; \
422  } \
423  \
424  inline const _pixelType& operator()(XnUInt32 x, XnUInt32 y) const \
425  { \
426  XN_ASSERT(x < m_nXRes && y < m_nYRes); \
427  return m_pData[y*m_nXRes + x]; \
428  } \
429  inline _pixelType& operator()(XnUInt32 x, XnUInt32 y) \
430  { \
431  XN_ASSERT(x < m_nXRes && y < m_nYRes); \
432  return m_pData[y*m_nXRes + x]; \
433  } \
434  \
435  private: \
436  /* block copy ctor and assignment operator */ \
437  _name(const _name& other); \
438  _name& operator=(const _name&); \
439  \
440  _pixelType*& m_pData; \
441  XnUInt32& m_nXRes; \
442  XnUInt32& m_nYRes; \
443  };
444 
445  _XN_DECLARE_MAP_DATA_CLASS(DepthMap, XnDepthPixel);
446  _XN_DECLARE_MAP_DATA_CLASS(ImageMap, XnUInt8);
447  _XN_DECLARE_MAP_DATA_CLASS(RGB24Map, XnRGB24Pixel);
448  _XN_DECLARE_MAP_DATA_CLASS(Grayscale16Map, XnGrayscale16Pixel);
449  _XN_DECLARE_MAP_DATA_CLASS(Grayscale8Map, XnGrayscale8Pixel);
450  _XN_DECLARE_MAP_DATA_CLASS(IRMap, XnIRPixel);
451  _XN_DECLARE_MAP_DATA_CLASS(LabelMap, XnLabel);
452 
457  class DepthMetaData : public MapMetaData
458  {
459  public:
463  inline DepthMetaData() :
464  MapMetaData(XN_PIXEL_FORMAT_GRAYSCALE_16_BIT, (const XnUInt8**)&m_depth.pData),
465  m_depthMap(const_cast<XnDepthPixel*&>(m_depth.pData), MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
466  m_writableDepthMap((XnDepthPixel*&)m_pAllocatedData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y)
467  {
468  xnOSMemSet(&m_depth, 0, sizeof(XnDepthMetaData));
469  m_depth.pMap = MapMetaData::GetUnderlying();
470  }
471 
477  inline void InitFrom(const DepthMetaData& other)
478  {
479  xnCopyDepthMetaData(&m_depth, &other.m_depth);
480  }
481 
491  inline XnStatus InitFrom(const DepthMetaData& other, XnUInt32 nXRes, XnUInt32 nYRes, const XnDepthPixel* pExternalBuffer)
492  {
493  InitFrom(other);
494  return ReAdjust(nXRes, nYRes, pExternalBuffer);
495  }
496 
503  {
504  // copy props
505  InitFrom(other);
506  // and make a copy of the data (this will allocate and copy data)
507  return MakeDataWritable();
508  }
509 
511  XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnDepthPixel* pExternalBuffer = NULL)
512  {
513  return MapMetaData::ReAdjust(nXRes, nYRes, (const XnUInt8*)pExternalBuffer);
514  }
515 
517  inline XnDepthPixel ZRes() const { return m_depth.nZRes; }
519  inline XnDepthPixel& ZRes() { return m_depth.nZRes; }
520 
522  inline const XnDepthPixel* Data() const { return (const XnDepthPixel*)MapMetaData::Data(); }
524  inline const XnDepthPixel*& Data() { return (const XnDepthPixel*&)MapMetaData::Data(); }
527 
529  inline const xn::DepthMap& DepthMap() const { return m_depthMap; }
531  inline xn::DepthMap& WritableDepthMap()
532  {
534  return m_writableDepthMap;
535  }
536 
542  inline const XnDepthPixel& operator[](XnUInt32 nIndex) const
543  {
544  XN_ASSERT(nIndex < (XRes()*YRes()));
545  return Data()[nIndex];
546  }
547 
554  inline const XnDepthPixel& operator()(XnUInt32 x, XnUInt32 y) const
555  {
556  XN_ASSERT(x < XRes() && y < YRes());
557  return Data()[y*XRes() + x];
558  }
559 
561  inline const XnDepthMetaData* GetUnderlying() const { return &m_depth; }
563  inline XnDepthMetaData* GetUnderlying() { return &m_depth; }
564 
565  private:
566  // block copy ctor and assignment operator (because we can't return errors in those)
567  DepthMetaData(const DepthMetaData& other);
568  DepthMetaData& operator=(const DepthMetaData&);
569 
570  XnDepthMetaData m_depth;
571  const xn::DepthMap m_depthMap;
572  xn::DepthMap m_writableDepthMap;
573  };
574 
579  class ImageMetaData : public MapMetaData
580  {
581  public:
583  inline ImageMetaData() :
584  MapMetaData(XN_PIXEL_FORMAT_RGB24, &m_image.pData),
585  m_imageMap(const_cast<XnUInt8*&>(m_image.pData), MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
586  m_writableImageMap((XnUInt8*&)m_pAllocatedData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
587  m_rgb24Map((XnRGB24Pixel*&)m_image.pData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
588  m_writableRgb24Map((XnRGB24Pixel*&)m_pAllocatedData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
589  m_gray16Map((XnGrayscale16Pixel*&)m_image.pData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
590  m_writableGray16Map((XnGrayscale16Pixel*&)m_pAllocatedData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
591  m_gray8Map((XnGrayscale8Pixel*&)m_image.pData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
592  m_writableGray8Map((XnGrayscale8Pixel*&)m_pAllocatedData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y)
593  {
594  xnOSMemSet(&m_image, 0, sizeof(XnImageMetaData));
595  m_image.pMap = MapMetaData::GetUnderlying();
596  }
597 
603  inline void InitFrom(const ImageMetaData& other)
604  {
605  xnCopyImageMetaData(&m_image, &other.m_image);
606  }
607 
618  inline XnStatus InitFrom(const ImageMetaData& other, XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format, const XnUInt8* pExternalBuffer)
619  {
620  InitFrom(other);
621  XnStatus nRetVal = ReAdjust(nXRes, nYRes, format, pExternalBuffer);
622  XN_IS_STATUS_OK(nRetVal);
623  PixelFormat() = format;
624  return XN_STATUS_OK;
625  }
626 
634  inline XnStatus AllocateData(XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format)
635  {
636  XnPixelFormat origFormat = PixelFormat();
637  PixelFormat() = format;
638  XnStatus nRetVal = MapMetaData::AllocateData(nXRes, nYRes);
639  if (nRetVal != XN_STATUS_OK)
640  {
641  PixelFormat() = origFormat;
642  return (nRetVal);
643  }
644 
645  return XN_STATUS_OK;
646  }
647 
649  inline XnStatus CopyFrom(const ImageMetaData& other)
650  {
651  // copy props
652  xnCopyImageMetaData(&m_image, &other.m_image);
653  // and make a copy of the data (this will allocate and copy data)
654  return MakeDataWritable();
655  }
656 
666  XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format, const XnUInt8* pExternalBuffer = NULL)
667  {
668  XnPixelFormat origFormat = PixelFormat();
669  PixelFormat() = format;
670  XnStatus nRetVal = MapMetaData::ReAdjust(nXRes, nYRes, pExternalBuffer);
671  if (nRetVal != XN_STATUS_OK)
672  {
673  PixelFormat() = origFormat;
674  return (nRetVal);
675  }
676 
677  return XN_STATUS_OK;
678  }
679 
684 
686  inline XnUInt8* WritableData() { return MapMetaData::WritableData(); }
687 
689  inline const XnRGB24Pixel* RGB24Data() const { return (const XnRGB24Pixel*)MapMetaData::Data(); }
691  inline const XnRGB24Pixel*& RGB24Data() { return (const XnRGB24Pixel*&)MapMetaData::Data(); }
694 
696  inline const XnYUV422DoublePixel* YUV422Data() const { return (const XnYUV422DoublePixel*)MapMetaData::Data(); }
698  inline const XnYUV422DoublePixel*& YUV422Data() { return (const XnYUV422DoublePixel*&)MapMetaData::Data(); }
701 
703  inline const XnGrayscale8Pixel* Grayscale8Data() const { return (const XnGrayscale8Pixel*)MapMetaData::Data(); }
705  inline const XnGrayscale8Pixel*& Grayscale8Data() { return (const XnGrayscale8Pixel*&)MapMetaData::Data(); }
708 
710  inline const XnGrayscale16Pixel* Grayscale16Data() const { return (const XnGrayscale16Pixel*)MapMetaData::Data(); }
715 
717  inline const xn::ImageMap& ImageMap() const { return m_imageMap; }
719  inline xn::ImageMap& WritableImageMap() { MakeDataWritable(); return m_writableImageMap; }
720 
722  inline const xn::RGB24Map& RGB24Map() const { return m_rgb24Map; }
724  inline xn::RGB24Map& WritableRGB24Map() { MakeDataWritable(); return m_writableRgb24Map; }
725 
727  inline const xn::Grayscale8Map& Grayscale8Map() const { return m_gray8Map; }
729  inline xn::Grayscale8Map& WritableGrayscale8Map() { MakeDataWritable(); return m_writableGray8Map; }
730 
732  inline const xn::Grayscale16Map& Grayscale16Map() const { return m_gray16Map; }
734  inline xn::Grayscale16Map& WritableGrayscale16Map() { MakeDataWritable(); return m_writableGray16Map; }
735 
737  inline const XnImageMetaData* GetUnderlying() const { return &m_image; }
739  inline XnImageMetaData* GetUnderlying() { return &m_image; }
740 
741  private:
742  // block copy ctor and assignment operator
743  ImageMetaData(const ImageMetaData& other);
744  ImageMetaData& operator=(const ImageMetaData&);
745 
746  XnImageMetaData m_image;
747  const xn::ImageMap m_imageMap;
748  xn::ImageMap m_writableImageMap;
749  const xn::RGB24Map m_rgb24Map;
750  xn::RGB24Map m_writableRgb24Map;
751  const xn::Grayscale16Map m_gray16Map;
752  xn::Grayscale16Map m_writableGray16Map;
753  const xn::Grayscale8Map m_gray8Map;
754  xn::Grayscale8Map m_writableGray8Map;
755  };
756 
761  class IRMetaData : public MapMetaData
762  {
763  public:
765  inline IRMetaData() :
766  MapMetaData(XN_PIXEL_FORMAT_GRAYSCALE_16_BIT, (const XnUInt8**)&m_ir.pData),
767  m_irMap(const_cast<XnIRPixel*&>(m_ir.pData), MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
768  m_writableIRMap((XnIRPixel*&)m_pAllocatedData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y)
769  {
770  xnOSMemSet(&m_ir, 0, sizeof(XnIRMetaData));
772  }
773 
779  inline void InitFrom(const IRMetaData& other)
780  {
781  xnCopyIRMetaData(&m_ir, &other.m_ir);
782  }
783 
785  inline XnStatus InitFrom(const IRMetaData& other, XnUInt32 nXRes, XnUInt32 nYRes, const XnIRPixel* pExternalBuffer)
786  {
787  InitFrom(other);
788  return ReAdjust(nXRes, nYRes, pExternalBuffer);
789  }
790 
793  {
794  // copy props
795  xnCopyIRMetaData(&m_ir, &other.m_ir);
796  // and make a copy of the data (this will allocate and copy data)
797  return MakeDataWritable();
798  }
799 
801  XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnIRPixel* pExternalBuffer = NULL)
802  {
803  return MapMetaData::ReAdjust(nXRes, nYRes, (const XnUInt8*)pExternalBuffer);
804  }
805 
807  inline const XnIRPixel* Data() const { return (const XnIRPixel*)MapMetaData::Data(); }
809  inline const XnIRPixel*& Data() { return (const XnIRPixel*&)MapMetaData::Data(); }
812 
814  inline const xn::IRMap& IRMap() const { return m_irMap; }
816  inline xn::IRMap& WritableIRMap() { MakeDataWritable(); return m_writableIRMap; }
817 
819  inline const XnIRMetaData* GetUnderlying() const { return &m_ir; }
821  inline XnIRMetaData* GetUnderlying() { return &m_ir; }
822 
823  private:
824  // block copy ctor and assignment operator
825  IRMetaData(const IRMetaData& other);
826  IRMetaData& operator=(const IRMetaData&);
827 
828  XnIRMetaData m_ir;
829  const xn::IRMap m_irMap;
830  xn::IRMap m_writableIRMap;
831  };
832 
838  {
839  public:
841  inline AudioMetaData() : OutputMetaData(&m_audio.pData)
842  {
843  xnOSMemSet(&m_audio, 0, sizeof(XnAudioMetaData));
845  }
846 
852  inline void InitFrom(const AudioMetaData& other)
853  {
854  xnCopyAudioMetaData(&m_audio, &other.m_audio);
855  }
856 
858  inline XnUInt8 NumberOfChannels() const { return m_audio.Wave.nChannels; }
860  inline XnUInt8& NumberOfChannels() { return m_audio.Wave.nChannels; }
861 
863  inline XnUInt32 SampleRate() const { return m_audio.Wave.nSampleRate; }
865  inline XnUInt32& SampleRate() { return m_audio.Wave.nSampleRate; }
866 
868  inline XnUInt16 BitsPerSample() const { return m_audio.Wave.nBitsPerSample; }
870  inline XnUInt16& BitsPerSample() { return m_audio.Wave.nBitsPerSample; }
871 
873  inline const XnAudioMetaData* GetUnderlying() const { return &m_audio; }
875  inline XnAudioMetaData* GetUnderlying() { return &m_audio; }
876 
877  private:
878  // block copy ctor and assignment operator
879  AudioMetaData(const AudioMetaData& other);
880  AudioMetaData& operator=(const AudioMetaData&);
881 
882  XnAudioMetaData m_audio;
883  XnBool m_bAllocated;
884  };
885 
890  class SceneMetaData : public MapMetaData
891  {
892  public:
894  inline SceneMetaData() :
895  MapMetaData(XN_PIXEL_FORMAT_GRAYSCALE_16_BIT, (const XnUInt8**)&m_scene.pData),
896  m_labelMap(const_cast<XnLabel*&>(m_scene.pData), MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
897  m_writableLabelMap((XnLabel*&)m_pAllocatedData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y)
898  {
899  xnOSMemSet(&m_scene, 0, sizeof(XnSceneMetaData));
900  m_scene.pMap = MapMetaData::GetUnderlying();
901  }
902 
908  inline void InitFrom(const SceneMetaData& other)
909  {
910  xnCopySceneMetaData(&m_scene, &other.m_scene);
911  }
912 
914  inline XnStatus InitFrom(const SceneMetaData& other, XnUInt32 nXRes, XnUInt32 nYRes, const XnLabel* pExternalBuffer)
915  {
916  InitFrom(other);
917  return ReAdjust(nXRes, nYRes, pExternalBuffer);
918  }
919 
922  {
923  // copy props
924  xnCopySceneMetaData(&m_scene, &other.m_scene);
925  // and make a copy of the data (this will allocate and copy data)
926  return MakeDataWritable();
927  }
928 
930  XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnLabel* pExternalBuffer = NULL)
931  {
932  return MapMetaData::ReAdjust(nXRes, nYRes, (const XnUInt8*)pExternalBuffer);
933  }
934 
936  inline const XnLabel* Data() const { return (const XnLabel*)MapMetaData::Data(); }
938  inline const XnLabel*& Data() { return (const XnLabel*&)MapMetaData::Data(); }
941 
943  inline const xn::LabelMap& LabelMap() const { return m_labelMap; }
945  inline xn::LabelMap& WritableLabelMap() { MakeDataWritable(); return m_writableLabelMap; }
946 
952  inline const XnLabel& operator[](XnUInt32 nIndex) const
953  {
954  XN_ASSERT(nIndex < (XRes()*YRes()));
955  return Data()[nIndex];
956  }
957 
964  inline const XnLabel& operator()(XnUInt32 x, XnUInt32 y) const
965  {
966  XN_ASSERT(x < XRes() && y < YRes());
967  return (*this)[y*XRes() + x];
968  }
969 
971  inline const XnSceneMetaData* GetUnderlying() const { return &m_scene; }
973  inline XnSceneMetaData* GetUnderlying() { return &m_scene; }
974 
975  private:
976  // block copy ctor and assignment operator
977  SceneMetaData(const SceneMetaData& other);
978  SceneMetaData& operator=(const SceneMetaData&);
979 
980  XnSceneMetaData m_scene;
981  const xn::LabelMap m_labelMap;
982  xn::LabelMap m_writableLabelMap;
983  };
984 
985  //---------------------------------------------------------------------------
986  // NodeWrapper
987  //---------------------------------------------------------------------------
988 
994  {
995  public:
996  friend class Context;
997 
1003  inline NodeWrapper(XnNodeHandle hNode) : m_hNode(NULL), m_hShuttingDownCallback(NULL)
1004  {
1005  NodeWrapper::SetHandle(hNode);
1006  }
1007 
1008  inline NodeWrapper(const NodeWrapper& other) : m_hNode(NULL), m_hShuttingDownCallback(NULL)
1009  {
1011  }
1012 
1013  inline NodeWrapper& operator=(const NodeWrapper& other)
1014  {
1016  return *this;
1017  }
1018 
1019  inline ~NodeWrapper()
1020  {
1021  NodeWrapper::SetHandle(NULL);
1022  }
1023 
1024  inline operator XnNodeHandle() const { return GetHandle(); }
1025 
1027  inline XnNodeHandle GetHandle() const { return m_hNode; }
1028 
1034  inline XnBool operator==(const NodeWrapper& other)
1035  {
1036  return (GetHandle() == other.GetHandle());
1037  }
1038 
1044  inline XnBool operator!=(const NodeWrapper& other)
1045  {
1046  return (GetHandle() != other.GetHandle());
1047  }
1048 
1050  inline XnBool IsValid() const { return (GetHandle() != NULL); }
1051 
1055  const XnChar* GetName() const {return xnGetNodeName(GetHandle()); }
1056 
1061 
1065  inline void Release()
1066  {
1067  NodeWrapper::SetHandle(NULL);
1068  }
1069 
1070  inline XnStatus XN_API_DEPRECATED("Please use AddRef() instead.") Ref() { return AddRef(); }
1071  inline void XN_API_DEPRECATED("Please use Release() instead.") Unref() { Release(); }
1072 
1074  inline void SetHandle(XnNodeHandle hNode)
1075  {
1076  if (m_hNode == hNode)
1077  {
1078  // Optimization: do nothing
1079  return;
1080  }
1081 
1082  // check currently held node. If we're holding a node, release it
1083  if (m_hNode != NULL)
1084  {
1085  XnContext* pContext = xnGetRefContextFromNodeHandle(m_hNode);
1086  xnContextUnregisterFromShutdown(pContext, m_hShuttingDownCallback);
1087  xnContextRelease(pContext);
1088  xnProductionNodeRelease(m_hNode);
1089  }
1090 
1091  // check new node handle, if it points to a node, add ref to it
1092  if (hNode != NULL)
1093  {
1094  XnStatus nRetVal = xnProductionNodeAddRef(hNode);
1095  XN_ASSERT(nRetVal == XN_STATUS_OK);
1096 
1097  XnContext* pContext = xnGetRefContextFromNodeHandle(hNode);
1098 
1099  nRetVal = xnContextRegisterForShutdown(pContext, ContextShuttingDownCallback, this, &m_hShuttingDownCallback);
1100  XN_ASSERT(nRetVal == XN_STATUS_OK);
1101 
1102  xnContextRelease(pContext);
1103  }
1104 
1105  m_hNode = hNode;
1106  }
1107 
1108  inline void TakeOwnership(XnNodeHandle hNode)
1109  {
1110  SetHandle(hNode);
1111 
1112  if (hNode != NULL)
1113  {
1114  xnProductionNodeRelease(hNode);
1115  }
1116  }
1117 
1118  private:
1119  XnNodeHandle m_hNode;
1120  XnCallbackHandle m_hShuttingDownCallback;
1121 
1122  static void XN_CALLBACK_TYPE ContextShuttingDownCallback(XnContext* /*pContext*/, void* pCookie)
1123  {
1124  NodeWrapper* pThis = (NodeWrapper*)pCookie;
1125  pThis->m_hNode = NULL;
1126  }
1127  };
1128 
1129  //---------------------------------------------------------------------------
1130  // Node Info
1131  //---------------------------------------------------------------------------
1132 
1137  class NodeInfo
1138  {
1139  public:
1145  NodeInfo(XnNodeInfo* pInfo) : m_pNeededNodes(NULL), m_bOwnerOfNode(FALSE)
1146  {
1147  SetUnderlyingObject(pInfo);
1148  }
1149 
1156  NodeInfo(const NodeInfo& other) : m_pNeededNodes(NULL), m_bOwnerOfNode(FALSE)
1157  {
1158  SetUnderlyingObject(other.m_pInfo);
1159  }
1160 
1163  {
1164  SetUnderlyingObject(NULL);
1165  }
1166 
1172  inline NodeInfo& operator=(const NodeInfo& other)
1173  {
1174  SetUnderlyingObject(other.m_pInfo);
1175  return *this;
1176  }
1177 
1179  inline operator XnNodeInfo*()
1180  {
1181  return m_pInfo;
1182  }
1183 
1187  inline XnStatus SetInstanceName(const XnChar* strName)
1188  {
1189  return xnNodeInfoSetInstanceName(m_pInfo, strName);
1190  }
1191 
1196  {
1197  return *xnNodeInfoGetDescription(m_pInfo);
1198  }
1199 
1203  inline const XnChar* GetInstanceName() const
1204  {
1205  return xnNodeInfoGetInstanceName(m_pInfo);
1206  }
1207  inline const XnChar* GetCreationInfo() const
1211  {
1212  return xnNodeInfoGetCreationInfo(m_pInfo);
1213  }
1214 
1218  inline NodeInfoList& GetNeededNodes() const;
1219 
1227  inline XnStatus GetInstance(ProductionNode& node) const;
1228 
1232  inline const void* GetAdditionalData() const
1233  {
1234  return xnNodeInfoGetAdditionalData(m_pInfo);
1235  }
1236 
1237  private:
1238  inline void SetUnderlyingObject(XnNodeInfo* pInfo);
1239 
1240  XnNodeInfo* m_pInfo;
1241  mutable NodeInfoList* m_pNeededNodes;
1242  XnBool m_bOwnerOfNode; // backwards compatibility
1243  friend class Context;
1244  };
1245 
1246  //---------------------------------------------------------------------------
1247  // Query
1248  //---------------------------------------------------------------------------
1249 
1255  class Query
1256  {
1257  public:
1259  inline Query() : m_bAllocated(TRUE)
1260  {
1261  xnNodeQueryAllocate(&m_pQuery);
1262  }
1263 
1264  inline Query(XnNodeQuery* pNodeQuery) : m_pQuery(pNodeQuery), m_bAllocated(FALSE)
1265  {
1266  }
1267 
1270  {
1271  if (m_bAllocated)
1272  {
1273  xnNodeQueryFree(m_pQuery);
1274  }
1275  }
1276 
1278  inline const XnNodeQuery* GetUnderlyingObject() const { return m_pQuery; }
1279  inline XnNodeQuery* GetUnderlyingObject() { return m_pQuery; }
1280 
1284  inline XnStatus SetVendor(const XnChar* strVendor)
1285  {
1286  return xnNodeQuerySetVendor(m_pQuery, strVendor);
1287  }
1288 
1292  inline XnStatus SetName(const XnChar* strName)
1293  {
1294  return xnNodeQuerySetName(m_pQuery, strName);
1295  }
1296 
1300  inline XnStatus SetMinVersion(const XnVersion& minVersion)
1301  {
1302  return xnNodeQuerySetMinVersion(m_pQuery, &minVersion);
1303  }
1304 
1308  inline XnStatus SetMaxVersion(const XnVersion& maxVersion)
1309  {
1310  return xnNodeQuerySetMaxVersion(m_pQuery, &maxVersion);
1311  }
1312 
1316  inline XnStatus AddSupportedCapability(const XnChar* strNeededCapability)
1317  {
1318  return xnNodeQueryAddSupportedCapability(m_pQuery, strNeededCapability);
1319  }
1320 
1325  {
1326  return xnNodeQueryAddSupportedMapOutputMode(m_pQuery, &MapOutputMode);
1327  }
1328 
1332  inline XnStatus SetSupportedMinUserPositions(const XnUInt32 nCount)
1333  {
1334  return xnNodeQuerySetSupportedMinUserPositions(m_pQuery, nCount);
1335  }
1336 
1340  inline XnStatus SetExistingNodeOnly(XnBool bExistingNode)
1341  {
1342  return xnNodeQuerySetExistingNodeOnly(m_pQuery, bExistingNode);
1343  }
1344 
1348  inline XnStatus AddNeededNode(const XnChar* strInstanceName)
1349  {
1350  return xnNodeQueryAddNeededNode(m_pQuery, strInstanceName);
1351  }
1352 
1356  inline XnStatus SetCreationInfo(const XnChar* strCreationInfo)
1357  {
1358  return xnNodeQuerySetCreationInfo(m_pQuery, strCreationInfo);
1359  }
1360 
1361  private:
1362  XnNodeQuery* m_pQuery;
1363  XnBool m_bAllocated;
1364  };
1365 
1366  //---------------------------------------------------------------------------
1367  // Node Info List
1368  //---------------------------------------------------------------------------
1369 
1375  {
1376  public:
1378  class Iterator
1379  {
1380  public:
1381  friend class NodeInfoList;
1382 
1388  XnBool operator==(const Iterator& other) const
1389  {
1390  return m_it.pCurrent == other.m_it.pCurrent;
1391  }
1392 
1398  XnBool operator!=(const Iterator& other) const
1399  {
1400  return m_it.pCurrent != other.m_it.pCurrent;
1401  }
1402 
1408  {
1409  UpdateInternalObject(xnNodeInfoListGetNext(m_it));
1410  return *this;
1411  }
1412 
1417  inline Iterator operator++(int)
1418  {
1419  XnNodeInfoListIterator curr = m_it;
1420  UpdateInternalObject(xnNodeInfoListGetNext(m_it));
1421  return Iterator(curr);
1422  }
1423 
1428  {
1429  UpdateInternalObject(xnNodeInfoListGetPrevious(m_it));
1430  return *this;
1431  }
1432 
1436  inline Iterator operator--(int)
1437  {
1438  XnNodeInfoListIterator curr = m_it;
1439  UpdateInternalObject(xnNodeInfoListGetPrevious(m_it));
1440  return Iterator(curr);
1441  }
1442 
1445  {
1446  return m_Info;
1447  }
1448 
1449  private:
1450  inline Iterator(XnNodeInfoListIterator it) : m_Info(NULL)
1451  {
1452  UpdateInternalObject(it);
1453  }
1454 
1455  inline void UpdateInternalObject(XnNodeInfoListIterator it)
1456  {
1457  m_it = it;
1459  {
1460  XnNodeInfo* pInfo = xnNodeInfoListGetCurrent(it);
1461  m_Info = NodeInfo(pInfo);
1462  }
1463  else
1464  {
1465  m_Info = NodeInfo(NULL);
1466  }
1467  }
1468 
1469  NodeInfo m_Info;
1471  };
1472 
1476  inline NodeInfoList()
1477  {
1478  xnNodeInfoListAllocate(&m_pList);
1479  m_bAllocated = TRUE;
1480  }
1481 
1488  inline NodeInfoList(XnNodeInfoList* pList) : m_pList(pList), m_bAllocated(FALSE) {}
1489 
1491  inline ~NodeInfoList()
1492  {
1493  FreeImpl();
1494  }
1495 
1497  inline XnNodeInfoList* GetUnderlyingObject() const { return m_pList; }
1498 
1506  {
1507  FreeImpl();
1508  m_pList = pList;
1509  m_bAllocated = TRUE;
1510  }
1511 
1515  inline XnStatus Add(XnProductionNodeDescription& description, const XnChar* strCreationInfo, NodeInfoList* pNeededNodes)
1516  {
1517  XnNodeInfoList* pList = (pNeededNodes == NULL) ? NULL : pNeededNodes->GetUnderlyingObject();
1518  return xnNodeInfoListAdd(m_pList, &description, strCreationInfo, pList);
1519  }
1520 
1524  inline XnStatus AddEx(XnProductionNodeDescription& description, const XnChar* strCreationInfo, NodeInfoList* pNeededNodes, const void* pAdditionalData, XnFreeHandler pFreeHandler)
1525  {
1526  XnNodeInfoList* pList = (pNeededNodes == NULL) ? NULL : pNeededNodes->GetUnderlyingObject();
1527  return xnNodeInfoListAddEx(m_pList, &description, strCreationInfo, pList, pAdditionalData, pFreeHandler);
1528  }
1529 
1533  inline XnStatus AddNode(NodeInfo& info)
1534  {
1535  return xnNodeInfoListAddNode(m_pList, info);
1536  }
1537 
1542  {
1543  return xnNodeInfoListAddNodeFromList(m_pList, it.m_it);
1544  }
1545 
1547  inline Iterator Begin() const
1548  {
1549  return Iterator(xnNodeInfoListGetFirst(m_pList));
1550  }
1551 
1553  inline Iterator End() const
1554  {
1555  XnNodeInfoListIterator it = { NULL };
1556  return Iterator(it);
1557  }
1558 
1560  inline Iterator RBegin() const
1561  {
1562  return Iterator(xnNodeInfoListGetLast(m_pList));
1563  }
1564 
1566  inline Iterator REnd() const
1567  {
1568  XnNodeInfoListIterator it = { NULL };
1569  return Iterator(it);
1570  }
1571 
1576  {
1577  return xnNodeInfoListRemove(m_pList, it.m_it);
1578  }
1579 
1583  inline XnStatus Clear()
1584  {
1585  return xnNodeInfoListClear(m_pList);
1586  }
1587 
1592  {
1593  return xnNodeInfoListAppend(m_pList, other.GetUnderlyingObject());
1594  }
1595 
1599  inline XnBool IsEmpty()
1600  {
1601  return xnNodeInfoListIsEmpty(m_pList);
1602  }
1603 
1607  inline XnStatus FilterList(Context& context, Query& query);
1608 
1609  private:
1610  inline void FreeImpl()
1611  {
1612  if (m_bAllocated)
1613  {
1614  xnNodeInfoListFree(m_pList);
1615  m_bAllocated = FALSE;
1616  m_pList = NULL;
1617  }
1618  }
1619 
1620  XnNodeInfoList* m_pList;
1621  XnBool m_bAllocated;
1622  };
1623 
1624  //---------------------------------------------------------------------------
1625  // Production Nodes Functionality
1626  //---------------------------------------------------------------------------
1627 
1632  class Capability : public NodeWrapper
1633  {
1634  public:
1641  Capability(const NodeWrapper& node) : NodeWrapper(node) {}
1642  };
1643 
1649  {
1650  public:
1658 
1662  inline XnStatus GetErrorState() const
1663  {
1664  return xnGetNodeErrorState(GetHandle());
1665  }
1666 
1671  {
1672  return _RegisterToStateChange(xnRegisterToNodeErrorStateChange, GetHandle(), handler, pCookie, hCallback);
1673  }
1674 
1679  {
1680  _UnregisterFromStateChange(xnUnregisterFromNodeErrorStateChange, GetHandle(), hCallback);
1681  }
1682  };
1683 
1689  {
1690  public:
1697  GeneralIntCapability(XnNodeHandle hNode, const XnChar* strCap) : Capability(hNode), m_strCap(strCap) {}
1699 
1703  inline void GetRange(XnInt32& nMin, XnInt32& nMax, XnInt32& nStep, XnInt32& nDefault, XnBool& bIsAutoSupported) const
1704  {
1705  xnGetGeneralIntRange(GetHandle(), m_strCap, &nMin, &nMax, &nStep, &nDefault, &bIsAutoSupported);
1706  }
1707 
1711  inline XnInt32 Get()
1712  {
1713  XnInt32 nValue;
1714  xnGetGeneralIntValue(GetHandle(), m_strCap, &nValue);
1715  return nValue;
1716  }
1717 
1721  inline XnStatus Set(XnInt32 nValue)
1722  {
1723  return xnSetGeneralIntValue(GetHandle(), m_strCap, nValue);
1724  }
1725 
1729  XnStatus RegisterToValueChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback);
1730 
1735 
1736  private:
1737  const XnChar* m_strCap;
1738  };
1739 
1745  {
1746  public:
1752  inline ProductionNode(XnNodeHandle hNode = NULL) : NodeWrapper(hNode) {}
1753  inline ProductionNode(const NodeWrapper& other) : NodeWrapper(other) {}
1754 
1758  inline NodeInfo GetInfo() const { return NodeInfo(xnGetNodeInfo(GetHandle())); }
1759 
1764  {
1765  return xnAddNeededNode(GetHandle(), needed.GetHandle());
1766  }
1767 
1772  {
1773  return xnRemoveNeededNode(GetHandle(), needed.GetHandle());
1774  }
1775 
1779  inline void GetContext(Context& context) const;
1780 
1784  inline XnBool IsCapabilitySupported(const XnChar* strCapabilityName) const
1785  {
1786  return xnIsCapabilitySupported(GetHandle(), strCapabilityName);
1787  }
1788 
1792  inline XnStatus SetIntProperty(const XnChar* strName, XnUInt64 nValue)
1793  {
1794  return xnSetIntProperty(GetHandle(), strName, nValue);
1795  }
1796 
1800  inline XnStatus SetRealProperty(const XnChar* strName, XnDouble dValue)
1801  {
1802  return xnSetRealProperty(GetHandle(), strName, dValue);
1803  }
1804 
1808  inline XnStatus SetStringProperty(const XnChar* strName, const XnChar* strValue)
1809  {
1810  return xnSetStringProperty(GetHandle(), strName, strValue);
1811  }
1812 
1816  inline XnStatus SetGeneralProperty(const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer)
1817  {
1818  return xnSetGeneralProperty(GetHandle(), strName, nBufferSize, pBuffer);
1819  }
1820 
1824  inline XnStatus GetIntProperty(const XnChar* strName, XnUInt64& nValue) const
1825  {
1826  return xnGetIntProperty(GetHandle(), strName, &nValue);
1827  }
1828 
1832  inline XnStatus GetRealProperty(const XnChar* strName, XnDouble &dValue) const
1833  {
1834  return xnGetRealProperty(GetHandle(), strName, &dValue);
1835  }
1836 
1840  inline XnStatus GetStringProperty(const XnChar* strName, XnChar* csValue, XnUInt32 nBufSize) const
1841  {
1842  return xnGetStringProperty(GetHandle(), strName, csValue, nBufSize);
1843  }
1844 
1848  inline XnStatus GetGeneralProperty(const XnChar* strName, XnUInt32 nBufferSize, void* pBuffer) const
1849  {
1850  return xnGetGeneralProperty(GetHandle(), strName, nBufferSize, pBuffer);
1851  }
1852 
1857  {
1858  return xnLockNodeForChanges(GetHandle(), phLock);
1859  }
1860 
1864  inline void UnlockForChanges(XnLockHandle hLock)
1865  {
1867  }
1868 
1873  {
1874  return xnLockedNodeStartChanges(GetHandle(), hLock);
1875  }
1876 
1881  {
1883  }
1884 
1891  {
1892  return ErrorStateCapability(GetHandle());
1893  }
1894 
1901  {
1902  return ErrorStateCapability(GetHandle());
1903  }
1904 
1912  inline GeneralIntCapability GetGeneralIntCap(const XnChar* strCapability)
1913  {
1914  return GeneralIntCapability(GetHandle(), strCapability);
1915  }
1916  };
1917 
1923  {
1924  public:
1932 
1936  inline XnStatus GetDeviceName(XnChar* strBuffer, XnUInt32 nBufferSize)
1937  {
1938  return xnGetDeviceName(GetHandle(), strBuffer, &nBufferSize);
1939  }
1940 
1944  inline XnStatus GetVendorSpecificData(XnChar* strBuffer, XnUInt32 nBufferSize)
1945  {
1946  return xnGetVendorSpecificData(GetHandle(), strBuffer, &nBufferSize);
1947  }
1948 
1952  inline XnStatus GetSerialNumber(XnChar* strBuffer, XnUInt32 nBufferSize)
1953  {
1954  return xnGetSerialNumber(GetHandle(), strBuffer, &nBufferSize);
1955  }
1956  };
1957 
1962  class Device : public ProductionNode
1963  {
1964  public:
1970  inline Device(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
1971  inline Device(const NodeWrapper& other) : ProductionNode(other) {}
1972 
1976  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
1977 
1984  {
1986  }
1987  };
1988 
1994  {
1995  public:
2001  inline MirrorCapability(XnNodeHandle hNode) : Capability(hNode) {}
2002  MirrorCapability(const NodeWrapper& node) : Capability(node) {}
2003 
2007  inline XnStatus SetMirror(XnBool bMirror)
2008  {
2009  return xnSetMirror(GetHandle(), bMirror);
2010  }
2011 
2015  inline XnBool IsMirrored() const
2016  {
2017  return xnIsMirrored(GetHandle());
2018  }
2019 
2023  inline XnStatus RegisterToMirrorChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
2024  {
2025  return _RegisterToStateChange(xnRegisterToMirrorChange, GetHandle(), handler, pCookie, hCallback);
2026  }
2027 
2032  {
2033  _UnregisterFromStateChange(xnUnregisterFromMirrorChange, GetHandle(), hCallback);
2034  }
2035  };
2036 
2042  {
2043  public:
2051 
2055  inline XnBool IsViewPointSupported(ProductionNode& otherNode) const
2056  {
2057  return xnIsViewPointSupported(GetHandle(), otherNode.GetHandle());
2058  }
2059 
2064  {
2065  return xnSetViewPoint(GetHandle(), otherNode.GetHandle());
2066  }
2067 
2072  {
2073  return xnResetViewPoint(GetHandle());
2074  }
2075 
2079  inline XnBool IsViewPointAs(ProductionNode& otherNode) const
2080  {
2081  return xnIsViewPointAs(GetHandle(), otherNode.GetHandle());
2082  }
2083 
2087  inline XnStatus RegisterToViewPointChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
2088  {
2089  return _RegisterToStateChange(xnRegisterToViewPointChange, GetHandle(), handler, pCookie, hCallback);
2090  }
2091 
2096  {
2097  _UnregisterFromStateChange(xnUnregisterFromViewPointChange, GetHandle(), hCallback);
2098  }
2099  };
2100 
2106  {
2107  public:
2113  inline FrameSyncCapability(XnNodeHandle hNode) : Capability(hNode) {}
2115 
2119  inline XnBool CanFrameSyncWith(Generator& other) const;
2120 
2124  inline XnStatus FrameSyncWith(Generator& other);
2125 
2129  inline XnStatus StopFrameSyncWith(Generator& other);
2130 
2134  inline XnBool IsFrameSyncedWith(Generator& other) const;
2135 
2139  inline XnStatus RegisterToFrameSyncChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
2140  {
2141  return _RegisterToStateChange(xnRegisterToFrameSyncChange, GetHandle(), handler, pCookie, hCallback);
2142  }
2143 
2148  {
2149  _UnregisterFromStateChange(xnUnregisterFromFrameSyncChange, GetHandle(), hCallback);
2150  }
2151  };
2152 
2157  class Generator : public ProductionNode
2158  {
2159  public:
2165  inline Generator(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
2166  inline Generator(const NodeWrapper& other) : ProductionNode(other) {}
2167 
2172  {
2173  return xnStartGenerating(GetHandle());
2174  }
2175 
2179  inline XnBool IsGenerating() const
2180  {
2181  return xnIsGenerating(GetHandle());
2182  }
2183 
2188  {
2189  return xnStopGenerating(GetHandle());
2190  }
2191 
2196  {
2197  return _RegisterToStateChange(xnRegisterToGenerationRunningChange, GetHandle(), handler, pCookie, hCallback);
2198  }
2199 
2204  {
2205  _UnregisterFromStateChange(xnUnregisterFromGenerationRunningChange, GetHandle(), hCallback);
2206  }
2207 
2212  {
2213  return _RegisterToStateChange(xnRegisterToNewDataAvailable, GetHandle(), handler, pCookie, hCallback);
2214  }
2215 
2220  {
2221  _UnregisterFromStateChange(xnUnregisterFromNewDataAvailable, GetHandle(), hCallback);
2222  }
2223 
2227  inline XnBool IsNewDataAvailable(XnUInt64* pnTimestamp = NULL) const
2228  {
2229  return xnIsNewDataAvailable(GetHandle(), pnTimestamp);
2230  }
2231 
2236  {
2237  return xnWaitAndUpdateData(GetHandle());
2238  }
2239 
2243  inline XnBool IsDataNew() const
2244  {
2245  return xnIsDataNew(GetHandle());
2246  }
2247 
2251  inline const void* GetData()
2252  {
2253  return xnGetData(GetHandle());
2254  }
2255 
2259  inline XnUInt32 GetDataSize() const
2260  {
2261  return xnGetDataSize(GetHandle());
2262  }
2263 
2267  inline XnUInt64 GetTimestamp() const
2268  {
2269  return xnGetTimestamp(GetHandle());
2270  }
2271 
2275  inline XnUInt32 GetFrameID() const
2276  {
2277  return xnGetFrameID(GetHandle());
2278  }
2279 
2285  inline const MirrorCapability GetMirrorCap() const
2286  {
2287  return MirrorCapability(GetHandle());
2288  }
2289 
2296  {
2297  return MirrorCapability(GetHandle());
2298  }
2299 
2306  {
2308  }
2309 
2316  {
2318  }
2319 
2326  {
2327  return FrameSyncCapability(GetHandle());
2328  }
2329 
2336  {
2337  return FrameSyncCapability(GetHandle());
2338  }
2339  };
2340 
2345  class Recorder : public ProductionNode
2346  {
2347  public:
2353  inline Recorder(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
2354  inline Recorder(const NodeWrapper& other) : ProductionNode(other) {}
2355 
2359  inline XnStatus Create(Context& context, const XnChar* strFormatName = NULL);
2360 
2364  inline XnStatus SetDestination(XnRecordMedium destType, const XnChar* strDest)
2365  {
2366  return xnSetRecorderDestination(GetHandle(), destType, strDest);
2367  }
2368 
2369  inline XnStatus GetDestination(XnRecordMedium& destType, XnChar* strDest, XnUInt32 nBufSize)
2370  {
2371  return xnGetRecorderDestination(GetHandle(), &destType, strDest, nBufSize);
2372  }
2373 
2378  {
2379  return xnAddNodeToRecording(GetHandle(), Node.GetHandle(), compression);
2380  }
2381 
2386  {
2387  return xnRemoveNodeFromRecording(GetHandle(), Node.GetHandle());
2388  }
2389 
2393  inline XnStatus Record()
2394  {
2395  return xnRecord(GetHandle());
2396  }
2397  };
2398 
2403  class Player : public ProductionNode
2404  {
2405  public:
2411  inline Player(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
2412  inline Player(const NodeWrapper& other) : ProductionNode(other) {}
2413 
2417  inline XnStatus Create(Context& context, const XnChar* strFormatName);
2418 
2422  inline XnStatus SetRepeat(XnBool bRepeat)
2423  {
2424  return xnSetPlayerRepeat(GetHandle(), bRepeat);
2425  }
2426 
2430  inline XnStatus SetSource(XnRecordMedium sourceType, const XnChar* strSource)
2431  {
2432  return xnSetPlayerSource(GetHandle(), sourceType, strSource);
2433  }
2434 
2438  inline XnStatus GetSource(XnRecordMedium &sourceType, XnChar* strSource, XnUInt32 nBufSize) const
2439  {
2440  return xnGetPlayerSource(GetHandle(), &sourceType, strSource, nBufSize);
2441  }
2442 
2447  {
2448  return xnPlayerReadNext(GetHandle());
2449  }
2450 
2454  inline XnStatus SeekToTimeStamp(XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
2455  {
2456  return xnSeekPlayerToTimeStamp(GetHandle(), nTimeOffset, origin);
2457  }
2458 
2462  inline XnStatus SeekToFrame(const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin)
2463  {
2464  return xnSeekPlayerToFrame(GetHandle(), strNodeName, nFrameOffset, origin);
2465  }
2466 
2470  inline XnStatus TellTimestamp(XnUInt64& nTimestamp) const
2471  {
2472  return xnTellPlayerTimestamp(GetHandle(), &nTimestamp);
2473  }
2474 
2478  inline XnStatus TellFrame(const XnChar* strNodeName, XnUInt32& nFrame) const
2479  {
2480  return xnTellPlayerFrame(GetHandle(), strNodeName, &nFrame);
2481  }
2482 
2486  inline XnStatus GetNumFrames(const XnChar* strNodeName, XnUInt32& nFrames) const
2487  {
2488  return xnGetPlayerNumFrames(GetHandle(), strNodeName, &nFrames);
2489  }
2490 
2494  inline const XnChar* GetSupportedFormat() const
2495  {
2497  }
2498 
2503  {
2504  XnNodeInfoList* pList;
2505  XnStatus nRetVal = xnEnumeratePlayerNodes(GetHandle(), &pList);
2506  XN_IS_STATUS_OK(nRetVal);
2507 
2508  list.ReplaceUnderlyingObject(pList);
2509 
2510  return (XN_STATUS_OK);
2511  }
2512 
2516  inline XnBool IsEOF() const
2517  {
2518  return xnIsPlayerAtEOF(GetHandle());
2519  }
2520 
2525  {
2526  return _RegisterToStateChange(xnRegisterToEndOfFileReached, GetHandle(), handler, pCookie, hCallback);
2527  }
2528 
2533  {
2534  _UnregisterFromStateChange(xnUnregisterFromEndOfFileReached, GetHandle(), hCallback);
2535  }
2536 
2540  inline XnStatus SetPlaybackSpeed(XnDouble dSpeed)
2541  {
2542  return xnSetPlaybackSpeed(GetHandle(), dSpeed);
2543  }
2544 
2548  inline XnDouble GetPlaybackSpeed() const
2549  {
2550  return xnGetPlaybackSpeed(GetHandle());
2551  }
2552  };
2553 
2559  {
2560  public:
2566  inline CroppingCapability(XnNodeHandle hNode) : Capability(hNode) {}
2568 
2572  inline XnStatus SetCropping(const XnCropping& Cropping)
2573  {
2574  return xnSetCropping(GetHandle(), &Cropping);
2575  }
2576 
2580  inline XnStatus GetCropping(XnCropping& Cropping) const
2581  {
2582  return xnGetCropping(GetHandle(), &Cropping);
2583  }
2584 
2588  inline XnStatus RegisterToCroppingChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
2589  {
2590  return _RegisterToStateChange(xnRegisterToCroppingChange, GetHandle(), handler, pCookie, hCallback);
2591  }
2592 
2597  {
2598  _UnregisterFromStateChange(xnUnregisterFromCroppingChange, GetHandle(), hCallback);
2599  }
2600  };
2601 
2607  {
2608  public:
2616 
2621  {
2622  return xnSetPowerLineFrequency(GetHandle(), nFrequency);
2623  }
2624 
2629  {
2631  }
2632 
2637  {
2638  return _RegisterToStateChange(xnRegisterToPowerLineFrequencyChange, GetHandle(), handler, pCookie, hCallback);
2639  }
2640 
2645  {
2646  _UnregisterFromStateChange(xnUnregisterFromPowerLineFrequencyChange, GetHandle(), hCallback);
2647  }
2648  };
2649 
2654  class MapGenerator : public Generator
2655  {
2656  public:
2662  inline MapGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
2663  inline MapGenerator(const NodeWrapper& other) : Generator(other) {}
2664 
2668  inline XnUInt32 GetSupportedMapOutputModesCount() const
2669  {
2671  }
2672 
2676  inline XnStatus GetSupportedMapOutputModes(XnMapOutputMode* aModes, XnUInt32& nCount) const
2677  {
2678  return xnGetSupportedMapOutputModes(GetHandle(), aModes, &nCount);
2679  }
2680 
2684  inline XnStatus SetMapOutputMode(const XnMapOutputMode& OutputMode)
2685  {
2686  return xnSetMapOutputMode(GetHandle(), &OutputMode);
2687  }
2688 
2692  inline XnStatus GetMapOutputMode(XnMapOutputMode &OutputMode) const
2693  {
2694  return xnGetMapOutputMode(GetHandle(), &OutputMode);
2695  }
2696 
2700  inline XnUInt32 GetBytesPerPixel() const
2701  {
2702  return xnGetBytesPerPixel(GetHandle());
2703  }
2704 
2709  {
2710  return _RegisterToStateChange(xnRegisterToMapOutputModeChange, GetHandle(), handler, pCookie, hCallback);
2711  }
2712 
2717  {
2718  _UnregisterFromStateChange(xnUnregisterFromMapOutputModeChange, GetHandle(), hCallback);
2719  }
2720 
2726  inline const CroppingCapability GetCroppingCap() const
2727  {
2728  return CroppingCapability(GetHandle());
2729  }
2730 
2737  {
2738  return CroppingCapability(GetHandle());
2739  }
2740 
2747  {
2749  }
2750 
2757  {
2759  }
2760 
2767  {
2769  }
2770 
2777  {
2779  }
2780 
2787  {
2789  }
2790 
2797  {
2799  }
2800 
2807  {
2809  }
2810 
2817  {
2819  }
2820 
2827  {
2829  }
2830 
2837  {
2839  }
2840 
2847  {
2849  }
2850 
2857  {
2859  }
2860 
2867  {
2869  }
2870 
2877  {
2879  }
2880 
2887  {
2889  }
2890 
2897  {
2899  }
2900 
2907  {
2909  }
2910 
2917  {
2918  return AntiFlickerCapability(GetHandle());
2919  }
2920  };
2921 
2927  {
2928  public:
2934  inline UserPositionCapability(XnNodeHandle hNode = NULL) : Capability(hNode) {}
2936 
2940  inline XnUInt32 GetSupportedUserPositionsCount() const
2941  {
2943  }
2944 
2948  inline XnStatus SetUserPosition(XnUInt32 nIndex, const XnBoundingBox3D& Position)
2949  {
2950  return xnSetUserPosition(GetHandle(), nIndex, &Position);
2951  }
2952 
2956  inline XnStatus GetUserPosition(XnUInt32 nIndex, XnBoundingBox3D& Position) const
2957  {
2958  return xnGetUserPosition(GetHandle(), nIndex, &Position);
2959  }
2960 
2965  {
2966  return _RegisterToStateChange(xnRegisterToUserPositionChange, GetHandle(), handler, pCookie, hCallback);
2967  }
2968 
2973  {
2974  _UnregisterFromStateChange(xnUnregisterFromUserPositionChange, GetHandle(), hCallback);
2975  }
2976  };
2977 
2983  {
2984  public:
2990  inline DepthGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
2991  inline DepthGenerator(const NodeWrapper& other) : MapGenerator(other) {}
2992 
2996  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
2997 
3001  inline void GetMetaData(DepthMetaData& metaData) const
3002  {
3004  }
3005 
3009  inline const XnDepthPixel* GetDepthMap() const
3010  {
3011  return xnGetDepthMap(GetHandle());
3012  }
3013 
3018  {
3019  return xnGetDeviceMaxDepth(GetHandle());
3020  }
3021 
3026  {
3027  return xnGetDepthFieldOfView(GetHandle(), &FOV);
3028  }
3029 
3034  {
3035  return _RegisterToStateChange(xnRegisterToDepthFieldOfViewChange, GetHandle(), handler, pCookie, hCallback);
3036  }
3037 
3042  {
3043  _UnregisterFromStateChange(xnUnregisterFromDepthFieldOfViewChange, GetHandle(), hCallback);
3044  }
3045 
3049  inline XnStatus ConvertProjectiveToRealWorld(XnUInt32 nCount, const XnPoint3D aProjective[], XnPoint3D aRealWorld[]) const
3050  {
3051  return xnConvertProjectiveToRealWorld(GetHandle(), nCount, aProjective, aRealWorld);
3052  }
3053 
3057  inline XnStatus ConvertRealWorldToProjective(XnUInt32 nCount, const XnPoint3D aRealWorld[], XnPoint3D aProjective[]) const
3058  {
3059  return xnConvertRealWorldToProjective(GetHandle(), nCount, aRealWorld, aProjective);
3060  }
3061 
3068  {
3070  }
3071 
3078  {
3080  }
3081  };
3082 
3088  {
3089  public:
3095  inline MockDepthGenerator(XnNodeHandle hNode = NULL) : DepthGenerator(hNode) {}
3096  inline MockDepthGenerator(const NodeWrapper& other) : DepthGenerator(other) {}
3097 
3104  XnStatus Create(Context& context, const XnChar* strName = NULL);
3105 
3112  XnStatus CreateBasedOn(DepthGenerator& other, const XnChar* strName = NULL);
3113 
3117  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel* pDepthMap)
3118  {
3119  return xnMockDepthSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pDepthMap);
3120  }
3121 
3129  inline XnStatus SetData(const DepthMetaData& depthMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
3130  {
3131  return SetData(nFrameID, nTimestamp, depthMD.DataSize(), depthMD.Data());
3132  }
3133 
3139  inline XnStatus SetData(const DepthMetaData& depthMD)
3140  {
3141  return SetData(depthMD, depthMD.FrameID(), depthMD.Timestamp());
3142  }
3143  };
3144 
3150  {
3151  public:
3157  inline ImageGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
3158  inline ImageGenerator(const NodeWrapper& other) : MapGenerator(other) {}
3159 
3163  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3164 
3168  inline void GetMetaData(ImageMetaData& metaData) const
3169  {
3171  }
3172 
3176  inline const XnRGB24Pixel* GetRGB24ImageMap() const
3177  {
3178  return xnGetRGB24ImageMap(GetHandle());
3179  }
3180 
3185  {
3186  return xnGetYUV422ImageMap(GetHandle());
3187  }
3188 
3193  {
3195  }
3196 
3201  {
3203  }
3204 
3208  inline const XnUInt8* GetImageMap() const
3209  {
3210  return xnGetImageMap(GetHandle());
3211  }
3212 
3216  inline XnBool IsPixelFormatSupported(XnPixelFormat Format) const
3217  {
3218  return xnIsPixelFormatSupported(GetHandle(), Format);
3219  }
3220 
3225  {
3226  return xnSetPixelFormat(GetHandle(), Format);
3227  }
3228 
3233  {
3234  return xnGetPixelFormat(GetHandle());
3235  }
3236 
3241  {
3242  return _RegisterToStateChange(xnRegisterToPixelFormatChange, GetHandle(), handler, pCookie, hCallback);
3243  }
3244 
3249  {
3250  _UnregisterFromStateChange(xnUnregisterFromPixelFormatChange, GetHandle(), hCallback);
3251  }
3252  };
3253 
3259  {
3260  public:
3266  inline MockImageGenerator(XnNodeHandle hNode = NULL) : ImageGenerator(hNode) {}
3267  inline MockImageGenerator(const NodeWrapper& other) : ImageGenerator(other) {}
3268 
3275  XnStatus Create(Context& context, const XnChar* strName = NULL);
3276 
3283  XnStatus CreateBasedOn(ImageGenerator& other, const XnChar* strName = NULL);
3284 
3288  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pImageMap)
3289  {
3290  return xnMockImageSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pImageMap);
3291  }
3292 
3300  inline XnStatus SetData(const ImageMetaData& imageMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
3301  {
3302  return SetData(nFrameID, nTimestamp, imageMD.DataSize(), imageMD.Data());
3303  }
3304 
3310  inline XnStatus SetData(const ImageMetaData& imageMD)
3311  {
3312  return SetData(imageMD, imageMD.FrameID(), imageMD.Timestamp());
3313  }
3314  };
3315 
3320  class IRGenerator : public MapGenerator
3321  {
3322  public:
3328  inline IRGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
3329  inline IRGenerator(const NodeWrapper& other) : MapGenerator(other) {}
3330 
3334  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3335 
3339  inline void GetMetaData(IRMetaData& metaData) const
3340  {
3341  xnGetIRMetaData(GetHandle(), metaData.GetUnderlying());
3342  }
3343 
3347  inline const XnIRPixel* GetIRMap() const
3348  {
3349  return xnGetIRMap(GetHandle());
3350  }
3351  };
3352 
3358  {
3359  public:
3365  inline MockIRGenerator(XnNodeHandle hNode = NULL) : IRGenerator(hNode) {}
3366  inline MockIRGenerator(const NodeWrapper& other) : IRGenerator(other) {}
3367 
3374  XnStatus Create(Context& context, const XnChar* strName = NULL);
3381  XnStatus CreateBasedOn(IRGenerator& other, const XnChar* strName = NULL);
3382 
3386  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnIRPixel* pIRMap)
3387  {
3388  return xnMockIRSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pIRMap);
3389  }
3390 
3398  inline XnStatus SetData(const IRMetaData& irMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
3399  {
3400  return SetData(nFrameID, nTimestamp, irMD.DataSize(), irMD.Data());
3401  }
3402 
3408  inline XnStatus SetData(const IRMetaData& irMD)
3409  {
3410  return SetData(irMD, irMD.FrameID(), irMD.Timestamp());
3411  }
3412  };
3413 
3419  {
3420  public:
3426  inline GestureGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
3427  inline GestureGenerator(const NodeWrapper& other) : Generator(other) {}
3428 
3432  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3433 
3437  inline XnStatus AddGesture(const XnChar* strGesture, XnBoundingBox3D* pArea)
3438  {
3439  return xnAddGesture(GetHandle(), strGesture, pArea);
3440  }
3441 
3445  inline XnStatus RemoveGesture(const XnChar* strGesture)
3446  {
3447  return xnRemoveGesture(GetHandle(), strGesture);
3448  }
3449 
3453  inline XnStatus GetActiveGestures(XnChar*& astrGestures, XnUInt16& nGestures) const
3454  {
3455  return xnGetActiveGestures(GetHandle(), &astrGestures, &nGestures);
3456  }
3457 
3461  inline XnStatus GetAllActiveGestures(XnChar** astrGestures, XnUInt32 nNameLength, XnUInt16& nGestures) const
3462  {
3463  return xnGetAllActiveGestures(GetHandle(), astrGestures, nNameLength, &nGestures);
3464  }
3465 
3469  inline XnStatus EnumerateGestures(XnChar*& astrGestures, XnUInt16& nGestures) const
3470  {
3471  return xnEnumerateGestures(GetHandle(), &astrGestures, &nGestures);
3472  }
3476  inline XnStatus EnumerateAllGestures(XnChar** astrGestures, XnUInt32 nNameLength, XnUInt16& nGestures) const
3477  {
3478  return xnEnumerateAllGestures(GetHandle(), astrGestures, nNameLength, &nGestures);
3479  }
3480 
3484  inline XnBool IsGestureAvailable(const XnChar* strGesture) const
3485  {
3486  return xnIsGestureAvailable(GetHandle(), strGesture);
3487  }
3488 
3492  inline XnBool IsGestureProgressSupported(const XnChar* strGesture) const
3493  {
3494  return xnIsGestureProgressSupported(GetHandle(), strGesture);
3495  }
3496 
3506  typedef void (XN_CALLBACK_TYPE* GestureRecognized)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pIDPosition, const XnPoint3D* pEndPosition, void* pCookie);
3516  typedef void (XN_CALLBACK_TYPE* GestureProgress)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pPosition, XnFloat fProgress, void* pCookie);
3517 
3521  XnStatus RegisterGestureCallbacks(GestureRecognized RecognizedCB, GestureProgress ProgressCB, void* pCookie, XnCallbackHandle& hCallback)
3522  {
3523  XnStatus nRetVal = XN_STATUS_OK;
3524 
3525  GestureCookie* pGestureCookie;
3526  XN_VALIDATE_ALLOC(pGestureCookie, GestureCookie);
3527  pGestureCookie->recognizedHandler = RecognizedCB;
3528  pGestureCookie->progressHandler = ProgressCB;
3529  pGestureCookie->pUserCookie = pCookie;
3530 
3531  nRetVal = xnRegisterGestureCallbacks(GetHandle(), GestureRecognizedCallback, GestureProgressCallback, pGestureCookie, &pGestureCookie->hCallback);
3532  if (nRetVal != XN_STATUS_OK)
3533  {
3534  xnOSFree(pGestureCookie);
3535  return (nRetVal);
3536  }
3537 
3538  hCallback = pGestureCookie;
3539 
3540  return (XN_STATUS_OK);
3541  }
3542 
3547  {
3548  GestureCookie* pGestureCookie = (GestureCookie*)hCallback;
3549  xnUnregisterGestureCallbacks(GetHandle(), pGestureCookie->hCallback);
3550  xnOSFree(pGestureCookie);
3551  }
3552 
3556  inline XnStatus RegisterToGestureChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
3557  {
3558  return _RegisterToStateChange(xnRegisterToGestureChange, GetHandle(), handler, pCookie, hCallback);
3559  }
3560 
3565  {
3566  _UnregisterFromStateChange(xnUnregisterFromGestureChange, GetHandle(), hCallback);
3567  }
3568 
3577  typedef void (XN_CALLBACK_TYPE* GestureIntermediateStageCompleted)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
3582  {
3583  XnStatus nRetVal = XN_STATUS_OK;
3584 
3585  GestureIntermediateStageCompletedCookie* pGestureCookie;
3586  XN_VALIDATE_ALLOC(pGestureCookie, GestureIntermediateStageCompletedCookie);
3587  pGestureCookie->handler = handler;
3588  pGestureCookie->pUserCookie = pCookie;
3589 
3590  nRetVal = xnRegisterToGestureIntermediateStageCompleted(GetHandle(), GestureIntermediateStageCompletedCallback, pGestureCookie, &pGestureCookie->hCallback);
3591  if (nRetVal != XN_STATUS_OK)
3592  {
3593  xnOSFree(pGestureCookie);
3594  return (nRetVal);
3595  }
3596 
3597  hCallback = pGestureCookie;
3598 
3599  return (XN_STATUS_OK);
3600  }
3605  {
3606  GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)hCallback;
3607  xnUnregisterFromGestureIntermediateStageCompleted(GetHandle(), pGestureCookie->hCallback);
3608  xnOSFree(pGestureCookie);
3609  }
3610 
3619  typedef void (XN_CALLBACK_TYPE* GestureReadyForNextIntermediateStage)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
3624  {
3625  XnStatus nRetVal = XN_STATUS_OK;
3626 
3627  GestureReadyForNextIntermediateStageCookie* pGestureCookie;
3628  XN_VALIDATE_ALLOC(pGestureCookie, GestureReadyForNextIntermediateStageCookie);
3629  pGestureCookie->handler = handler;
3630  pGestureCookie->pUserCookie = pCookie;
3631 
3632  nRetVal = xnRegisterToGestureReadyForNextIntermediateStage(GetHandle(), GestureReadyForNextIntermediateStageCallback, pGestureCookie, &pGestureCookie->hCallback);
3633  if (nRetVal != XN_STATUS_OK)
3634  {
3635  xnOSFree(pGestureCookie);
3636  return (nRetVal);
3637  }
3638 
3639  hCallback = pGestureCookie;
3640 
3641  return (XN_STATUS_OK);
3642  }
3643 
3648  {
3649  GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)hCallback;
3651  xnOSFree(pGestureCookie);
3652  }
3653 
3654  private:
3655  typedef struct GestureCookie
3656  {
3657  GestureRecognized recognizedHandler;
3658  GestureProgress progressHandler;
3659  void* pUserCookie;
3660  XnCallbackHandle hCallback;
3661  } GestureCookie;
3662 
3663  static void XN_CALLBACK_TYPE GestureRecognizedCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pIDPosition, const XnPoint3D* pEndPosition, void* pCookie)
3664  {
3665  GestureCookie* pGestureCookie = (GestureCookie*)pCookie;
3666  GestureGenerator gen(hNode);
3667  if (pGestureCookie->recognizedHandler != NULL)
3668  {
3669  pGestureCookie->recognizedHandler(gen, strGesture, pIDPosition, pEndPosition, pGestureCookie->pUserCookie);
3670  }
3671  }
3672 
3673  static void XN_CALLBACK_TYPE GestureProgressCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, XnFloat fProgress, void* pCookie)
3674  {
3675  GestureCookie* pGestureCookie = (GestureCookie*)pCookie;
3676  GestureGenerator gen(hNode);
3677  if (pGestureCookie->progressHandler != NULL)
3678  {
3679  pGestureCookie->progressHandler(gen, strGesture, pPosition, fProgress, pGestureCookie->pUserCookie);
3680  }
3681  }
3682 
3683  typedef struct GestureIntermediateStageCompletedCookie
3684  {
3686  void* pUserCookie;
3687  XnCallbackHandle hCallback;
3688  } GestureIntermediateStageCompletedCookie;
3689 
3690  static void XN_CALLBACK_TYPE GestureIntermediateStageCompletedCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie)
3691  {
3692  GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)pCookie;
3693  GestureGenerator gen(hNode);
3694  if (pGestureCookie->handler != NULL)
3695  {
3696  pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
3697  }
3698  }
3699 
3700  typedef struct GestureReadyForNextIntermediateStageCookie
3701  {
3703  void* pUserCookie;
3704  XnCallbackHandle hCallback;
3705  } GestureReadyForNextIntermediateStageCookie;
3706 
3707  static void XN_CALLBACK_TYPE GestureReadyForNextIntermediateStageCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie)
3708  {
3709  GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)pCookie;
3710  GestureGenerator gen(hNode);
3711  if (pGestureCookie->handler != NULL)
3712  {
3713  pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
3714  }
3715  }
3716  };
3717 
3723  {
3724  public:
3730  inline SceneAnalyzer(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
3731  inline SceneAnalyzer(const NodeWrapper& other) : MapGenerator(other) {}
3732 
3736  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3737 
3741  inline void GetMetaData(SceneMetaData& metaData) const
3742  {
3744  }
3745 
3749  inline const XnLabel* GetLabelMap() const
3750  {
3751  return xnGetLabelMap(GetHandle());
3752  }
3753 
3757  inline XnStatus GetFloor(XnPlane3D& Plane) const
3758  {
3759  return xnGetFloor(GetHandle(), &Plane);
3760  }
3761  };
3762 
3768  {
3769  public:
3777 
3788  typedef void (XN_CALLBACK_TYPE* HandTouchingFOVEdge)(HandTouchingFOVEdgeCapability& touchingfov, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie);
3793  {
3794  XnStatus nRetVal = XN_STATUS_OK;
3795 
3796  HandTouchingFOVEdgeCookie* pHandCookie;
3797  XN_VALIDATE_ALLOC(pHandCookie, HandTouchingFOVEdgeCookie);
3798  pHandCookie->handler = handler;
3799  pHandCookie->pUserCookie = pCookie;
3800 
3801  nRetVal = xnRegisterToHandTouchingFOVEdge(GetHandle(), HandTouchingFOVEdgeCB, pHandCookie, &pHandCookie->hCallback);
3802  if (nRetVal != XN_STATUS_OK)
3803  {
3804  xnOSFree(pHandCookie);
3805  return (nRetVal);
3806  }
3807 
3808  hCallback = pHandCookie;
3809 
3810  return (XN_STATUS_OK);
3811  }
3812 
3817  {
3818  HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)hCallback;
3819  xnUnregisterFromHandTouchingFOVEdge(GetHandle(), pHandCookie->hCallback);
3820  xnOSFree(pHandCookie);
3821  }
3822  private:
3823  typedef struct HandTouchingFOVEdgeCookie
3824  {
3825  HandTouchingFOVEdge handler;
3826  void* pUserCookie;
3827  XnCallbackHandle hCallback;
3828  } HandTouchingFOVEdgeCookie;
3829 
3830  static void XN_CALLBACK_TYPE HandTouchingFOVEdgeCB(XnNodeHandle hNode, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie)
3831  {
3832  HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)pCookie;
3833  HandTouchingFOVEdgeCapability cap(hNode);
3834  if (pHandCookie->handler != NULL)
3835  {
3836  pHandCookie->handler(cap, user, pPosition, fTime, eDir, pHandCookie->pUserCookie);
3837  }
3838  }
3839 
3840  };
3845  class HandsGenerator : public Generator
3846  {
3847  public:
3853  inline HandsGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
3854  inline HandsGenerator(const NodeWrapper& other) : Generator(other) {}
3855 
3859  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3860 
3870  typedef void (XN_CALLBACK_TYPE* HandCreate)(HandsGenerator& generator, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie);
3880  typedef void (XN_CALLBACK_TYPE* HandUpdate)(HandsGenerator& generator, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie);
3889  typedef void (XN_CALLBACK_TYPE* HandDestroy)(HandsGenerator& generator, XnUserID user, XnFloat fTime, void* pCookie);
3890 
3894  inline XnStatus RegisterHandCallbacks(HandCreate CreateCB, HandUpdate UpdateCB, HandDestroy DestroyCB, void* pCookie, XnCallbackHandle& hCallback)
3895  {
3896  XnStatus nRetVal = XN_STATUS_OK;
3897 
3898  HandCookie* pHandCookie;
3899  XN_VALIDATE_ALLOC(pHandCookie, HandCookie);
3900  pHandCookie->createHandler = CreateCB;
3901  pHandCookie->updateHandler = UpdateCB;
3902  pHandCookie->destroyHandler = DestroyCB;
3903  pHandCookie->pUserCookie = pCookie;
3904 
3905  nRetVal = xnRegisterHandCallbacks(GetHandle(), HandCreateCB, HandUpdateCB, HandDestroyCB, pHandCookie, &pHandCookie->hCallback);
3906  if (nRetVal != XN_STATUS_OK)
3907  {
3908  xnOSFree(pHandCookie);
3909  return (nRetVal);
3910  }
3911 
3912  hCallback = pHandCookie;
3913 
3914  return (XN_STATUS_OK);
3915  }
3916 
3921  {
3922  HandCookie* pHandCookie = (HandCookie*)hCallback;
3923  xnUnregisterHandCallbacks(GetHandle(), pHandCookie->hCallback);
3924  xnOSFree(pHandCookie);
3925  }
3926 
3931  {
3932  return xnStopTracking(GetHandle(), user);
3933  }
3934 
3939  {
3940  return xnStopTrackingAll(GetHandle());
3941  }
3942 
3946  inline XnStatus StartTracking(const XnPoint3D& ptPosition)
3947  {
3948  return xnStartTracking(GetHandle(), &ptPosition);
3949  }
3950 
3954  inline XnStatus SetSmoothing(XnFloat fSmoothingFactor)
3955  {
3956  return xnSetTrackingSmoothing(GetHandle(), fSmoothingFactor);
3957  }
3958 
3965  {
3967  }
3968 
3975  {
3977  }
3978 
3979  private:
3980  typedef struct HandCookie
3981  {
3982  HandCreate createHandler;
3983  HandUpdate updateHandler;
3984  HandDestroy destroyHandler;
3985  void* pUserCookie;
3986  XnCallbackHandle hCallback;
3987  } HandCookie;
3988 
3989  static void XN_CALLBACK_TYPE HandCreateCB(XnNodeHandle hNode, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie)
3990  {
3991  HandCookie* pHandCookie = (HandCookie*)pCookie;
3992  HandsGenerator gen(hNode);
3993  if (pHandCookie->createHandler != NULL)
3994  {
3995  pHandCookie->createHandler(gen, user, pPosition, fTime, pHandCookie->pUserCookie);
3996  }
3997  }
3998  static void XN_CALLBACK_TYPE HandUpdateCB(XnNodeHandle hNode, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie)
3999  {
4000  HandCookie* pHandCookie = (HandCookie*)pCookie;
4001  HandsGenerator gen(hNode);
4002  if (pHandCookie->updateHandler != NULL)
4003  {
4004  pHandCookie->updateHandler(gen, user, pPosition, fTime, pHandCookie->pUserCookie);
4005  }
4006  }
4007  static void XN_CALLBACK_TYPE HandDestroyCB(XnNodeHandle hNode, XnUserID user, XnFloat fTime, void* pCookie)
4008  {
4009  HandCookie* pHandCookie = (HandCookie*)pCookie;
4010  HandsGenerator gen(hNode);
4011  if (pHandCookie->destroyHandler != NULL)
4012  {
4013  pHandCookie->destroyHandler(gen, user, fTime, pHandCookie->pUserCookie);
4014  }
4015  }
4016  };
4017 
4023  {
4024  public:
4030  inline SkeletonCapability(XnNodeHandle hNode) : Capability(hNode) {}
4032 
4036  inline XnBool IsJointAvailable(XnSkeletonJoint eJoint) const
4037  {
4038  return xnIsJointAvailable(GetHandle(), eJoint);
4039  }
4040 
4044  inline XnBool IsProfileAvailable(XnSkeletonProfile eProfile) const
4045  {
4046  return xnIsProfileAvailable(GetHandle(), eProfile);
4047  }
4048 
4053  {
4054  return xnSetSkeletonProfile(GetHandle(), eProfile);
4055  }
4056 
4060  inline XnStatus SetJointActive(XnSkeletonJoint eJoint, XnBool bState)
4061  {
4062  return xnSetJointActive(GetHandle(), eJoint, bState);
4063  }
4064 
4068  XN_API_DEPRECATED("Use the version with one argument")
4069  inline XnBool IsJointActive(XnSkeletonJoint eJoint, XnBool /*bState*/) const
4070  {
4071  return xnIsJointActive(GetHandle(), eJoint);
4072  }
4073 
4077  inline XnBool IsJointActive(XnSkeletonJoint eJoint) const
4078  {
4079  return xnIsJointActive(GetHandle(), eJoint);
4080  }
4081 
4086  {
4087  return _RegisterToStateChange(xnRegisterToJointConfigurationChange, GetHandle(), handler, pCookie, hCallback);
4088  }
4089 
4094  {
4095  _UnregisterFromStateChange(xnUnregisterFromJointConfigurationChange, GetHandle(), hCallback);
4096  }
4097 
4101  inline XnStatus EnumerateActiveJoints(XnSkeletonJoint* pJoints, XnUInt16& nJoints) const
4102  {
4103  return xnEnumerateActiveJoints(GetHandle(), pJoints, &nJoints);
4104  }
4105 
4110  {
4111  return xnGetSkeletonJoint(GetHandle(), user, eJoint, &Joint);
4112  }
4113 
4118  {
4119  return xnGetSkeletonJointPosition(GetHandle(), user, eJoint, &Joint);
4120  }
4121 
4126  {
4127  return xnGetSkeletonJointOrientation(GetHandle(), user, eJoint, &Joint);
4128  }
4129 
4133  inline XnBool IsTracking(XnUserID user) const
4134  {
4135  return xnIsSkeletonTracking(GetHandle(), user);
4136  }
4137 
4141  inline XnBool IsCalibrated(XnUserID user) const
4142  {
4143 
4144  return xnIsSkeletonCalibrated(GetHandle(), user);
4145  }
4146 
4150  inline XnBool IsCalibrating(XnUserID user) const
4151  {
4152  return xnIsSkeletonCalibrating(GetHandle(), user);
4153  }
4154 
4158  inline XnStatus RequestCalibration(XnUserID user, XnBool bForce)
4159  {
4160  return xnRequestSkeletonCalibration(GetHandle(), user, bForce);
4161  }
4162 
4167  {
4168  return xnAbortSkeletonCalibration(GetHandle(), user);
4169  }
4170 
4174  inline XnStatus SaveCalibrationDataToFile(XnUserID user, const XnChar* strFileName)
4175  {
4176  return xnSaveSkeletonCalibrationDataToFile(GetHandle(), user, strFileName);
4177  }
4178 
4182  inline XnStatus LoadCalibrationDataFromFile(XnUserID user, const XnChar* strFileName)
4183  {
4184  return xnLoadSkeletonCalibrationDataFromFile(GetHandle(), user, strFileName);
4185  }
4186 
4190  inline XnStatus SaveCalibrationData(XnUserID user, XnUInt32 nSlot)
4191  {
4192  return xnSaveSkeletonCalibrationData(GetHandle(), user, nSlot);
4193  }
4194 
4198  inline XnStatus LoadCalibrationData(XnUserID user, XnUInt32 nSlot)
4199  {
4200  return xnLoadSkeletonCalibrationData(GetHandle(), user, nSlot);
4201  }
4202 
4206  inline XnStatus ClearCalibrationData(XnUInt32 nSlot)
4207  {
4208  return xnClearSkeletonCalibrationData(GetHandle(), nSlot);
4209  }
4210 
4214  inline XnBool IsCalibrationData(XnUInt32 nSlot) const
4215  {
4216  return xnIsSkeletonCalibrationData(GetHandle(), nSlot);
4217  }
4218 
4223  {
4224  return xnStartSkeletonTracking(GetHandle(), user);
4225  }
4226 
4231  {
4232  return xnStopSkeletonTracking(GetHandle(), user);
4233  }
4234 
4238  inline XnStatus Reset(XnUserID user)
4239  {
4240  return xnResetSkeleton(GetHandle(), user);
4241  }
4242 
4246  inline XnBool NeedPoseForCalibration() const
4247  {
4249  }
4250 
4254  inline XnStatus GetCalibrationPose(XnChar* strPose) const
4255  {
4256  return xnGetSkeletonCalibrationPose(GetHandle(), strPose);
4257  }
4258 
4262  inline XnStatus SetSmoothing(XnFloat fSmoothingFactor)
4263  {
4264  return xnSetSkeletonSmoothing(GetHandle(), fSmoothingFactor);
4265  }
4266 
4274  typedef void (XN_CALLBACK_TYPE* CalibrationStart)(SkeletonCapability& skeleton, XnUserID user, void* pCookie);
4283  typedef void (XN_CALLBACK_TYPE* CalibrationEnd)(SkeletonCapability& skeleton, XnUserID user, XnBool bSuccess, void* pCookie);
4284 
4288  inline XnStatus XN_API_DEPRECATED("Please use RegisterToCalibrationStart/Complete") RegisterCalibrationCallbacks(CalibrationStart CalibrationStartCB, CalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle& hCallback)
4289  {
4290  XnStatus nRetVal = XN_STATUS_OK;
4291 
4292  SkeletonCookie* pSkeletonCookie;
4293  XN_VALIDATE_ALLOC(pSkeletonCookie, SkeletonCookie);
4294  pSkeletonCookie->startHandler = CalibrationStartCB;
4295  pSkeletonCookie->endHandler = CalibrationEndCB;
4296  pSkeletonCookie->pUserCookie = pCookie;
4297 
4298 #pragma warning (push)
4299 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
4300  nRetVal = xnRegisterCalibrationCallbacks(GetHandle(), CalibrationStartBundleCallback, CalibrationEndBundleCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
4301 #pragma warning (pop)
4302  if (nRetVal != XN_STATUS_OK)
4303  {
4304  xnOSFree(pSkeletonCookie);
4305  return (nRetVal);
4306  }
4307 
4308  hCallback = pSkeletonCookie;
4309 
4310  return (XN_STATUS_OK);
4311  }
4312 
4316  inline void XN_API_DEPRECATED("Please use UnregisterFromCalibrationStart/Complete") UnregisterCalibrationCallbacks(XnCallbackHandle hCallback)
4317  {
4318  SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)hCallback;
4319 #pragma warning (push)
4320 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
4321  xnUnregisterCalibrationCallbacks(GetHandle(), pSkeletonCookie->hCallback);
4322 #pragma warning (pop)
4323  xnOSFree(pSkeletonCookie);
4324  }
4325 
4329  inline XnStatus RegisterToCalibrationStart(CalibrationStart handler, void* pCookie, XnCallbackHandle& hCallback)
4330  {
4331  XnStatus nRetVal = XN_STATUS_OK;
4332  CalibrationStartCookie* pCalibrationCookie;
4333  XN_VALIDATE_ALLOC(pCalibrationCookie, CalibrationStartCookie);
4334  pCalibrationCookie->handler = handler;
4335  pCalibrationCookie->pUserCookie = pCookie;
4336  nRetVal = xnRegisterToCalibrationStart(GetHandle(), CalibrationStartCallback, pCalibrationCookie, &pCalibrationCookie->hCallback);
4337  if (nRetVal != XN_STATUS_OK)
4338  {
4339  xnOSFree(pCalibrationCookie);
4340  return nRetVal;
4341  }
4342  hCallback = pCalibrationCookie;
4343  return XN_STATUS_OK;
4344  }
4349  {
4350  CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)hCallback;
4351  xnUnregisterFromCalibrationStart(GetHandle(), pCalibrationCookie->hCallback);
4352  xnOSFree(pCalibrationCookie);
4353  return XN_STATUS_OK;
4354  }
4355 
4364  typedef void (XN_CALLBACK_TYPE* CalibrationInProgress)(SkeletonCapability& skeleton, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
4365 
4370  {
4371  XnStatus nRetVal = XN_STATUS_OK;
4372 
4373  CalibrationInProgressCookie* pSkeletonCookie;
4374  XN_VALIDATE_ALLOC(pSkeletonCookie, CalibrationInProgressCookie);
4375  pSkeletonCookie->handler = handler;
4376  pSkeletonCookie->pUserCookie = pCookie;
4377 
4378  nRetVal = xnRegisterToCalibrationInProgress(GetHandle(), CalibrationInProgressCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
4379  if (nRetVal != XN_STATUS_OK)
4380  {
4381  xnOSFree(pSkeletonCookie);
4382  return (nRetVal);
4383  }
4384 
4385  hCallback = pSkeletonCookie;
4386 
4387  return (XN_STATUS_OK);
4388  }
4389 
4394  {
4395  CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)hCallback;
4396  xnUnregisterFromCalibrationInProgress(GetHandle(), pSkeletonCookie->hCallback);
4397  xnOSFree(pSkeletonCookie);
4398  }
4399 
4408  typedef void (XN_CALLBACK_TYPE* CalibrationComplete)(SkeletonCapability& skeleton, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
4413  {
4414  XnStatus nRetVal = XN_STATUS_OK;
4415 
4416  CalibrationCompleteCookie* pSkeletonCookie;
4417  XN_VALIDATE_ALLOC(pSkeletonCookie, CalibrationCompleteCookie);
4418  pSkeletonCookie->handler = handler;
4419  pSkeletonCookie->pUserCookie = pCookie;
4420 
4421  nRetVal = xnRegisterToCalibrationComplete(GetHandle(), CalibrationCompleteCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
4422  if (nRetVal != XN_STATUS_OK)
4423  {
4424  xnOSFree(pSkeletonCookie);
4425  return (nRetVal);
4426  }
4427 
4428  hCallback = pSkeletonCookie;
4429 
4430  return (XN_STATUS_OK);
4431  }
4432 
4437  {
4438  CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)hCallback;
4439  xnUnregisterFromCalibrationComplete(GetHandle(), pSkeletonCookie->hCallback);
4440  xnOSFree(pSkeletonCookie);
4441  }
4442  private:
4443  typedef struct SkeletonCookie
4444  {
4445  CalibrationStart startHandler;
4446  CalibrationEnd endHandler;
4447  void* pUserCookie;
4448  XnCallbackHandle hCallback;
4449  } SkeletonCookie;
4450 
4451  static void XN_CALLBACK_TYPE CalibrationStartBundleCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
4452  {
4453  SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
4454  SkeletonCapability cap(hNode);
4455  if (pSkeletonCookie->startHandler != NULL)
4456  {
4457  pSkeletonCookie->startHandler(cap, user, pSkeletonCookie->pUserCookie);
4458  }
4459  }
4460 
4461  static void XN_CALLBACK_TYPE CalibrationEndBundleCallback(XnNodeHandle hNode, XnUserID user, XnBool bSuccess, void* pCookie)
4462  {
4463  SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
4464  SkeletonCapability cap(hNode);
4465  if (pSkeletonCookie->endHandler != NULL)
4466  {
4467  pSkeletonCookie->endHandler(cap, user, bSuccess, pSkeletonCookie->pUserCookie);
4468  }
4469  }
4470  typedef struct CalibrationStartCookie
4471  {
4472  CalibrationStart handler;
4473  void* pUserCookie;
4474  XnCallbackHandle hCallback;
4475  } CalibrationStartCookie;
4476 
4477  static void XN_CALLBACK_TYPE CalibrationStartCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
4478  {
4479  CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)pCookie;
4480  SkeletonCapability cap(hNode);
4481  if (pCalibrationCookie->handler != NULL)
4482  {
4483  pCalibrationCookie->handler(cap, user, pCalibrationCookie->pUserCookie);
4484  }
4485  }
4486  typedef struct CalibrationInProgressCookie
4487  {
4488  CalibrationInProgress handler;
4489  void* pUserCookie;
4490  XnCallbackHandle hCallback;
4491  } CalibrationInProgressCookie;
4492 
4493  static void XN_CALLBACK_TYPE CalibrationInProgressCallback(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie)
4494  {
4495  CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)pCookie;
4496  SkeletonCapability cap(hNode);
4497  if (pSkeletonCookie->handler != NULL)
4498  {
4499  pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
4500  }
4501  }
4502 
4503  typedef struct CalibrationCompleteCookie
4504  {
4505  CalibrationComplete handler;
4506  void* pUserCookie;
4507  XnCallbackHandle hCallback;
4508  } CalibrationCompleteCookie;
4509 
4510  static void XN_CALLBACK_TYPE CalibrationCompleteCallback(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie)
4511  {
4512  CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)pCookie;
4513  SkeletonCapability cap(hNode);
4514  if (pSkeletonCookie->handler != NULL)
4515  {
4516  pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
4517  }
4518  }
4519  };
4520 
4526  {
4527  public:
4535 
4544  typedef void (XN_CALLBACK_TYPE* PoseDetection)(PoseDetectionCapability& pose, const XnChar* strPose, XnUserID user, void* pCookie);
4545 
4549  inline XnUInt32 GetNumberOfPoses() const
4550  {
4551  return xnGetNumberOfPoses(GetHandle());
4552  }
4553 
4557  inline XnStatus GetAvailablePoses(XnChar** pstrPoses, XnUInt32& nPoses) const
4558  {
4559  return xnGetAvailablePoses(GetHandle(), pstrPoses, &nPoses);
4560  }
4564  inline XnStatus GetAllAvailablePoses(XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32& nPoses) const
4565  {
4566  return xnGetAllAvailablePoses(GetHandle(), pstrPoses, nNameLength, &nPoses);
4567  }
4568 
4572  inline XnStatus StartPoseDetection(const XnChar* strPose, XnUserID user)
4573  {
4574  return xnStartPoseDetection(GetHandle(), strPose, user);
4575  }
4576 
4581  {
4582  return xnStopPoseDetection(GetHandle(), user);
4583  }
4584 
4588  inline XnStatus XN_API_DEPRECATED("Please use RegisterToPoseDetected/RegisterToOutOfPose instead") RegisterToPoseCallbacks(PoseDetection PoseStartCB, PoseDetection PoseEndCB, void* pCookie, XnCallbackHandle& hCallback)
4589  {
4590  XnStatus nRetVal = XN_STATUS_OK;
4591 
4592  PoseCookie* pPoseCookie;
4593  XN_VALIDATE_ALLOC(pPoseCookie, PoseCookie);
4594  pPoseCookie->startHandler = PoseStartCB;
4595  pPoseCookie->endHandler = PoseEndCB;
4596  pPoseCookie->pPoseCookie = pCookie;
4597 
4598 #pragma warning (push)
4599 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
4600  nRetVal = xnRegisterToPoseCallbacks(GetHandle(), PoseDetectionStartBundleCallback, PoseDetectionStartEndBundleCallback, pPoseCookie, &pPoseCookie->hCallback);
4601 #pragma warning (pop)
4602  if (nRetVal != XN_STATUS_OK)
4603  {
4604  xnOSFree(pPoseCookie);
4605  return (nRetVal);
4606  }
4607 
4608  hCallback = pPoseCookie;
4609 
4610  return (XN_STATUS_OK);
4611  }
4612 
4616  inline void XN_API_DEPRECATED("Please use UnregisterFromPoseDetected/UnregisterFromOutOfPose instead") UnregisterFromPoseCallbacks(XnCallbackHandle hCallback)
4617  {
4618  PoseCookie* pPoseCookie = (PoseCookie*)hCallback;
4619 #pragma warning (push)
4620 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
4621  xnUnregisterFromPoseCallbacks(GetHandle(), pPoseCookie->hCallback);
4622 #pragma warning (pop)
4623  xnOSFree(pPoseCookie);
4624  }
4625 
4629  inline XnStatus RegisterToPoseDetected(PoseDetection handler, void* pCookie, XnCallbackHandle& hCallback)
4630  {
4631  XnStatus nRetVal = XN_STATUS_OK;
4632  PoseDetectionCookie* pPoseCookie;
4633  XN_VALIDATE_ALLOC(pPoseCookie, PoseDetectionCookie);
4634  pPoseCookie->handler = handler;
4635  pPoseCookie->pPoseCookie = pCookie;
4636 
4637  nRetVal = xnRegisterToPoseDetected(GetHandle(), PoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
4638  if (nRetVal != XN_STATUS_OK)
4639  {
4640  xnOSFree(pPoseCookie);
4641  return nRetVal;
4642  }
4643  hCallback = pPoseCookie;
4644  return XN_STATUS_OK;
4645  }
4649  inline XnStatus RegisterToOutOfPose(PoseDetection handler, void* pCookie, XnCallbackHandle& hCallback)
4650  {
4651  XnStatus nRetVal = XN_STATUS_OK;
4652  PoseDetectionCookie* pPoseCookie;
4653  XN_VALIDATE_ALLOC(pPoseCookie, PoseDetectionCookie);
4654  pPoseCookie->handler = handler;
4655  pPoseCookie->pPoseCookie = pCookie;
4656 
4657  nRetVal = xnRegisterToOutOfPose(GetHandle(), PoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
4658  if (nRetVal != XN_STATUS_OK)
4659  {
4660  xnOSFree(pPoseCookie);
4661  return nRetVal;
4662  }
4663  hCallback = pPoseCookie;
4664  return XN_STATUS_OK;
4665  }
4670  {
4671  PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
4672  xnUnregisterFromPoseDetected(GetHandle(), pPoseCookie->hCallback);
4673  xnOSFree(pPoseCookie);
4674  }
4679  {
4680  PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
4681  xnUnregisterFromOutOfPose(GetHandle(), pPoseCookie->hCallback);
4682  xnOSFree(pPoseCookie);
4683  }
4684 
4694  typedef void (XN_CALLBACK_TYPE* PoseInProgress)(PoseDetectionCapability& pose, const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseError, void* pCookie);
4698  inline XnStatus RegisterToPoseInProgress(PoseInProgress handler, void* pCookie, XnCallbackHandle& hCallback)
4699  {
4700  XnStatus nRetVal = XN_STATUS_OK;
4701 
4702  PoseInProgressCookie* pPoseCookie;
4703  XN_VALIDATE_ALLOC(pPoseCookie, PoseInProgressCookie);
4704  pPoseCookie->handler = handler;
4705  pPoseCookie->pPoseCookie = pCookie;
4706 
4707  nRetVal = xnRegisterToPoseDetectionInProgress(GetHandle(), PoseDetectionInProgressCallback, pPoseCookie, &pPoseCookie->hCallback);
4708  if (nRetVal != XN_STATUS_OK)
4709  {
4710  xnOSFree(pPoseCookie);
4711  return (nRetVal);
4712  }
4713 
4714  hCallback = pPoseCookie;
4715 
4716  return (XN_STATUS_OK);
4717  }
4718 
4723  {
4724  PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)hCallback;
4725  xnUnregisterFromPoseDetectionInProgress(GetHandle(), pPoseCookie->hCallback);
4726  xnOSFree(pPoseCookie);
4727  }
4728 
4729  private:
4730  typedef struct PoseCookie
4731  {
4732  PoseDetection startHandler;
4733  PoseDetection endHandler;
4734  void* pPoseCookie;
4735  XnCallbackHandle hCallback;
4736  } PoseCookie;
4737 
4738  static void XN_CALLBACK_TYPE PoseDetectionStartBundleCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
4739  {
4740  PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
4741  PoseDetectionCapability cap(hNode);
4742  if (pPoseCookie->startHandler != NULL)
4743  {
4744  pPoseCookie->startHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
4745  }
4746  }
4747 
4748  static void XN_CALLBACK_TYPE PoseDetectionStartEndBundleCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
4749  {
4750  PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
4751  PoseDetectionCapability cap(hNode);
4752  if (pPoseCookie->endHandler != NULL)
4753  {
4754  pPoseCookie->endHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
4755  }
4756  }
4757  typedef struct PoseDetectionCookie
4758  {
4759  PoseDetection handler;
4760  void* pPoseCookie;
4761  XnCallbackHandle hCallback;
4762  } PoseDetectionCookie;
4763  static void XN_CALLBACK_TYPE PoseDetectionCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
4764  {
4765  PoseDetectionCookie* pPoseDetectionCookie = (PoseDetectionCookie*)pCookie;
4766  PoseDetectionCapability cap(hNode);
4767  if (pPoseDetectionCookie->handler != NULL)
4768  {
4769  pPoseDetectionCookie->handler(cap, strPose, user, pPoseDetectionCookie->pPoseCookie);
4770  }
4771  }
4772 
4773  typedef struct PoseInProgressCookie
4774  {
4775  PoseInProgress handler;
4776  void* pPoseCookie;
4777  XnCallbackHandle hCallback;
4778  } PoseInProgressCookie;
4779 
4780  static void XN_CALLBACK_TYPE PoseDetectionInProgressCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseErrors, void* pCookie)
4781  {
4782  PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)pCookie;
4783  PoseDetectionCapability cap(hNode);
4784  if (pPoseCookie->handler != NULL)
4785  {
4786  pPoseCookie->handler(cap, strPose, user, poseErrors, pPoseCookie->pPoseCookie);
4787  }
4788  }
4789  };
4790 
4795  class UserGenerator : public Generator
4796  {
4797  public:
4803  inline UserGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
4804  inline UserGenerator(const NodeWrapper& other) : Generator(other) {}
4805 
4809  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
4810 
4811  typedef void (XN_CALLBACK_TYPE* UserHandler)(UserGenerator& generator, XnUserID user, void* pCookie);
4812 
4816  inline XnUInt16 GetNumberOfUsers() const
4817  {
4818  return xnGetNumberOfUsers(GetHandle());
4819  }
4820 
4824  inline XnStatus GetUsers(XnUserID aUsers[], XnUInt16& nUsers) const
4825  {
4826  return xnGetUsers(GetHandle(), aUsers, &nUsers);
4827  }
4828 
4832  inline XnStatus GetCoM(XnUserID user, XnPoint3D& com) const
4833  {
4834  return xnGetUserCoM(GetHandle(), user, &com);
4835  }
4836 
4841  {
4842  return xnGetUserPixels(GetHandle(), user, smd.GetUnderlying());
4843  }
4844 
4848  inline XnStatus RegisterUserCallbacks(UserHandler NewUserCB, UserHandler LostUserCB, void* pCookie, XnCallbackHandle& hCallback)
4849  {
4850  XnStatus nRetVal = XN_STATUS_OK;
4851 
4852  UserCookie* pUserCookie;
4853  XN_VALIDATE_ALLOC(pUserCookie, UserCookie);
4854  pUserCookie->newHandler = NewUserCB;
4855  pUserCookie->lostHandler = LostUserCB;
4856  pUserCookie->pUserCookie = pCookie;
4857 
4858  nRetVal = xnRegisterUserCallbacks(GetHandle(), NewUserCallback, LostUserCallback, pUserCookie, &pUserCookie->hCallback);
4859  if (nRetVal != XN_STATUS_OK)
4860  {
4861  xnOSFree(pUserCookie);
4862  return (nRetVal);
4863  }
4864 
4865  hCallback = pUserCookie;
4866 
4867  return (XN_STATUS_OK);
4868  }
4869 
4874  {
4875  UserCookie* pUserCookie = (UserCookie*)hCallback;
4876  xnUnregisterUserCallbacks(GetHandle(), pUserCookie->hCallback);
4877  xnOSFree(pUserCookie);
4878  }
4879 
4885  inline const SkeletonCapability GetSkeletonCap() const
4886  {
4887  return SkeletonCapability(GetHandle());
4888  }
4889 
4896  {
4897  return SkeletonCapability(GetHandle());
4898  }
4899 
4906  {
4908  }
4909 
4916  {
4918  }
4919 
4923  inline XnStatus RegisterToUserExit(UserHandler handler, void* pCookie, XnCallbackHandle& hCallback)
4924  {
4925  XnStatus nRetVal = XN_STATUS_OK;
4926 
4927  UserSingleCookie* pUserCookie;
4928  XN_VALIDATE_ALLOC(pUserCookie, UserSingleCookie);
4929  pUserCookie->handler = handler;
4930  pUserCookie->pUserCookie = pCookie;
4931 
4932  nRetVal = xnRegisterToUserExit(GetHandle(), UserSingleCallback, pUserCookie, &pUserCookie->hCallback);
4933  if (nRetVal != XN_STATUS_OK)
4934  {
4935  xnOSFree(pUserCookie);
4936  return (nRetVal);
4937  }
4938 
4939  hCallback = pUserCookie;
4940 
4941  return (XN_STATUS_OK);
4942  }
4943 
4948  {
4949  UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
4950  xnUnregisterFromUserExit(GetHandle(), pUserCookie->hCallback);
4951  xnOSFree(pUserCookie);
4952  }
4953 
4957  inline XnStatus RegisterToUserReEnter(UserHandler handler, void* pCookie, XnCallbackHandle& hCallback)
4958  {
4959  XnStatus nRetVal = XN_STATUS_OK;
4960 
4961  UserSingleCookie* pUserCookie;
4962  XN_VALIDATE_ALLOC(pUserCookie, UserSingleCookie);
4963  pUserCookie->handler = handler;
4964  pUserCookie->pUserCookie = pCookie;
4965 
4966  nRetVal = xnRegisterToUserReEnter(GetHandle(), UserSingleCallback, pUserCookie, &pUserCookie->hCallback);
4967  if (nRetVal != XN_STATUS_OK)
4968  {
4969  xnOSFree(pUserCookie);
4970  return (nRetVal);
4971  }
4972 
4973  hCallback = pUserCookie;
4974 
4975  return (XN_STATUS_OK);
4976  }
4977 
4982  {
4983  UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
4984  xnUnregisterFromUserReEnter(GetHandle(), pUserCookie->hCallback);
4985  xnOSFree(pUserCookie);
4986  }
4987 
4988  private:
4989  typedef struct UserCookie
4990  {
4991  UserHandler newHandler;
4992  UserHandler lostHandler;
4993  void* pUserCookie;
4994  XnCallbackHandle hCallback;
4995  } UserCookie;
4996 
4997  static void XN_CALLBACK_TYPE NewUserCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
4998  {
4999  UserCookie* pUserCookie = (UserCookie*)pCookie;
5000  UserGenerator gen(hNode);
5001  if (pUserCookie->newHandler != NULL)
5002  {
5003  pUserCookie->newHandler(gen, user, pUserCookie->pUserCookie);
5004  }
5005  }
5006 
5007  static void XN_CALLBACK_TYPE LostUserCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
5008  {
5009  UserCookie* pUserCookie = (UserCookie*)pCookie;
5010  UserGenerator gen(hNode);
5011  if (pUserCookie->lostHandler != NULL)
5012  {
5013  pUserCookie->lostHandler(gen, user, pUserCookie->pUserCookie);
5014  }
5015  }
5016 
5017  typedef struct UserSingleCookie
5018  {
5019  UserHandler handler;
5020  void* pUserCookie;
5021  XnCallbackHandle hCallback;
5022  } UserSingleCookie;
5023 
5024  static void XN_CALLBACK_TYPE UserSingleCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
5025  {
5026  UserSingleCookie* pUserCookie = (UserSingleCookie*)pCookie;
5027  UserGenerator gen(hNode);
5028  if (pUserCookie->handler != NULL)
5029  {
5030  pUserCookie->handler(gen, user, pUserCookie->pUserCookie);
5031  }
5032  }
5033  };
5034 
5039  class AudioGenerator : public Generator
5040  {
5041  public:
5047  inline AudioGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
5048  inline AudioGenerator(const NodeWrapper& other) : Generator(other) {}
5049 
5053  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
5054 
5058  inline void GetMetaData(AudioMetaData& metaData) const
5059  {
5061  }
5062 
5066  inline const XnUChar* GetAudioBuffer() const
5067  {
5068  return xnGetAudioBuffer(GetHandle());
5069  }
5070 
5074  inline XnUInt32 GetSupportedWaveOutputModesCount() const
5075  {
5077  }
5078 
5082  inline XnStatus GetSupportedWaveOutputModes(XnWaveOutputMode* aSupportedModes, XnUInt32& nCount) const
5083  {
5084  return xnGetSupportedWaveOutputModes(GetHandle(), aSupportedModes, &nCount);
5085  }
5086 
5090  inline XnStatus SetWaveOutputMode(const XnWaveOutputMode& OutputMode)
5091  {
5092  return xnSetWaveOutputMode(GetHandle(), &OutputMode);
5093  }
5094 
5098  inline XnStatus GetWaveOutputMode(XnWaveOutputMode& OutputMode) const
5099  {
5100  return xnGetWaveOutputMode(GetHandle(), &OutputMode);
5101  }
5102 
5107  {
5108  return _RegisterToStateChange(xnRegisterToWaveOutputModeChanges, GetHandle(), handler, pCookie, hCallback);
5109  }
5110 
5115  {
5116  _UnregisterFromStateChange(xnUnregisterFromWaveOutputModeChanges, GetHandle(), hCallback);
5117  }
5118  };
5119 
5125  {
5126  public:
5132  inline MockAudioGenerator(XnNodeHandle hNode = NULL) : AudioGenerator(hNode) {}
5133  inline MockAudioGenerator(const NodeWrapper& other) : AudioGenerator(other) {}
5134 
5141  XnStatus Create(Context& context, const XnChar* strName = NULL);
5142 
5149  XnStatus CreateBasedOn(AudioGenerator& other, const XnChar* strName = NULL);
5150 
5154  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pAudioBuffer)
5155  {
5156  return xnMockAudioSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pAudioBuffer);
5157  }
5158 
5166  inline XnStatus SetData(const AudioMetaData& audioMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
5167  {
5168  return SetData(nFrameID, nTimestamp, audioMD.DataSize(), audioMD.Data());
5169  }
5170 
5176  inline XnStatus SetData(const AudioMetaData& audioMD)
5177  {
5178  return SetData(audioMD, audioMD.FrameID(), audioMD.Timestamp());
5179  }
5180  };
5181 
5183  {
5184  public:
5185  MockRawGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
5186  MockRawGenerator(const NodeWrapper& other) : Generator(other) {}
5187 
5188  inline XnStatus Create(Context& context, const XnChar* strName = NULL);
5189 
5190  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void* pData)
5191  {
5192  return xnMockRawSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pData);
5193  }
5194 
5195  };
5196 
5201  class Codec : public ProductionNode
5202  {
5203  public:
5209  inline Codec(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
5210  inline Codec(const NodeWrapper& other) : ProductionNode(other) {}
5211 
5215  inline XnStatus Create(Context& context, XnCodecID codecID, ProductionNode& initializerNode);
5216 
5220  inline XnCodecID GetCodecID() const
5221  {
5222  return xnGetCodecID(GetHandle());
5223  }
5224 
5228  inline XnStatus EncodeData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const
5229  {
5230  return xnEncodeData(GetHandle(), pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
5231  }
5232 
5236  inline XnStatus DecodeData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const
5237  {
5238  return xnDecodeData(GetHandle(), pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
5239  }
5240  };
5241 
5247  {
5248  public:
5254  inline ScriptNode(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
5255  inline ScriptNode(const NodeWrapper& other) : ProductionNode(other) {}
5256 
5257  inline const XnChar* GetSupportedFormat()
5258  {
5260  }
5261 
5262  inline XnStatus LoadScriptFromFile(const XnChar* strFileName)
5263  {
5264  return xnLoadScriptFromFile(GetHandle(), strFileName);
5265  }
5266 
5267  inline XnStatus LoadScriptFromString(const XnChar* strScript)
5268  {
5269  return xnLoadScriptFromString(GetHandle(), strScript);
5270  }
5271 
5272  inline XnStatus Run(EnumerationErrors* pErrors);
5273  };
5274 
5275  //---------------------------------------------------------------------------
5276  // EnumerationErrors
5277  //---------------------------------------------------------------------------
5283  {
5284  public:
5286  inline EnumerationErrors() : m_pErrors(NULL), m_bAllocated(TRUE) { xnEnumerationErrorsAllocate(&m_pErrors); }
5287 
5294  inline EnumerationErrors(XnEnumerationErrors* pErrors, XnBool bOwn = FALSE) : m_pErrors(pErrors), m_bAllocated(bOwn) {}
5295 
5298 
5300  class Iterator
5301  {
5302  public:
5303  friend class EnumerationErrors;
5304 
5310  XnBool operator==(const Iterator& other) const
5311  {
5312  return m_it == other.m_it;
5313  }
5314 
5320  XnBool operator!=(const Iterator& other) const
5321  {
5322  return m_it != other.m_it;
5323  }
5324 
5330  {
5331  m_it = xnEnumerationErrorsGetNext(m_it);
5332  return *this;
5333  }
5334 
5339  inline Iterator operator++(int)
5340  {
5341  return Iterator(xnEnumerationErrorsGetNext(m_it));
5342  }
5343 
5348 
5349  private:
5350  inline Iterator(XnEnumerationErrorsIterator it) : m_it(it) {}
5351 
5353  };
5354 
5356  inline Iterator Begin() const { return Iterator(xnEnumerationErrorsGetFirst(m_pErrors)); }
5358  inline Iterator End() const { return Iterator(NULL); }
5359 
5363  inline XnStatus ToString(XnChar* csBuffer, XnUInt32 nSize)
5364  {
5365  return xnEnumerationErrorsToString(m_pErrors, csBuffer, nSize);
5366  }
5367 
5371  inline void Free()
5372  {
5373  if (m_bAllocated)
5374  {
5375  xnEnumerationErrorsFree(m_pErrors);
5376  m_pErrors = NULL;
5377  m_bAllocated = FALSE;
5378  }
5379  }
5380 
5382  inline XnEnumerationErrors* GetUnderlying() { return m_pErrors; }
5383 
5384  private:
5385  XnEnumerationErrors* m_pErrors;
5386  XnBool m_bAllocated;
5387  };
5388 
5389  //---------------------------------------------------------------------------
5390  // Context
5391  //---------------------------------------------------------------------------
5392 
5397  class Context
5398  {
5399  public:
5401  inline Context() : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL) {}
5402 
5408  inline Context(XnContext* pContext) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
5409  {
5410  SetHandle(pContext);
5411  }
5412 
5419  inline Context(const Context& other) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
5420  {
5421  SetHandle(other.m_pContext);
5422  }
5423 
5426  {
5427  SetHandle(NULL);
5428  }
5429 
5430  inline Context& operator=(const Context& other)
5431  {
5432  SetHandle(other.m_pContext);
5433  return *this;
5434  }
5435 
5437  inline XnContext* GetUnderlyingObject() const { return m_pContext; }
5438 
5442  inline XnStatus Init()
5443  {
5444  XnContext* pContext = NULL;
5445  XnStatus nRetVal = xnInit(&pContext);
5446  XN_IS_STATUS_OK(nRetVal);
5447 
5448  TakeOwnership(pContext);
5449  m_bAllocated = TRUE;
5450 
5451  return (XN_STATUS_OK);
5452  }
5453 
5457  inline XnStatus XN_API_DEPRECATED("Use other overload!") RunXmlScript(const XnChar* strScript, EnumerationErrors* pErrors = NULL)
5458  {
5459  m_bUsingDeprecatedAPI = TRUE;
5460  #pragma warning (push)
5461  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5462  return xnContextRunXmlScript(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5463  #pragma warning (pop)
5464  }
5465 
5469  inline XnStatus RunXmlScript(const XnChar* strScript, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
5470  {
5471  XnStatus nRetVal = XN_STATUS_OK;
5472 
5473  XnNodeHandle hScriptNode;
5474  nRetVal = xnContextRunXmlScriptEx(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
5475  XN_IS_STATUS_OK(nRetVal);
5476 
5477  scriptNode.TakeOwnership(hScriptNode);
5478 
5479  return (XN_STATUS_OK);
5480  }
5481 
5485  inline XnStatus XN_API_DEPRECATED("Use other overload!") RunXmlScriptFromFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
5486  {
5487  m_bUsingDeprecatedAPI = TRUE;
5488  #pragma warning (push)
5489  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5490  return xnContextRunXmlScriptFromFile(m_pContext, strFileName, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5491  #pragma warning (pop)
5492  }
5493 
5497  inline XnStatus RunXmlScriptFromFile(const XnChar* strFileName, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
5498  {
5499  XnStatus nRetVal = XN_STATUS_OK;
5500 
5501  XnNodeHandle hScriptNode;
5502  nRetVal = xnContextRunXmlScriptFromFileEx(m_pContext, strFileName, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
5503  XN_IS_STATUS_OK(nRetVal);
5504 
5505  scriptNode.TakeOwnership(hScriptNode);
5506 
5507  return (XN_STATUS_OK);
5508  }
5509 
5513  inline XnStatus XN_API_DEPRECATED("Use other overload!") InitFromXmlFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
5514  {
5515  XnContext* pContext = NULL;
5516  m_bUsingDeprecatedAPI = TRUE;
5517 
5518  #pragma warning (push)
5519  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5520  XnStatus nRetVal = xnInitFromXmlFile(strFileName, &pContext, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5521  #pragma warning (pop)
5522  XN_IS_STATUS_OK(nRetVal);
5523 
5524  TakeOwnership(pContext);
5525  m_bAllocated = TRUE;
5526 
5527  return (XN_STATUS_OK);
5528  }
5529 
5533  inline XnStatus InitFromXmlFile(const XnChar* strFileName, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
5534  {
5535  XnContext* pContext = NULL;
5536 
5537  XnNodeHandle hScriptNode;
5538  XnStatus nRetVal = xnInitFromXmlFileEx(strFileName, &pContext, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
5539  XN_IS_STATUS_OK(nRetVal);
5540 
5541  scriptNode.TakeOwnership(hScriptNode);
5542  TakeOwnership(pContext);
5543  m_bAllocated = TRUE;
5544 
5545  return (XN_STATUS_OK);
5546  }
5547 
5551  inline XnStatus XN_API_DEPRECATED("Use other overload!") OpenFileRecording(const XnChar* strFileName)
5552  {
5553  m_bUsingDeprecatedAPI = TRUE;
5554  #pragma warning (push)
5555  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5556  return xnContextOpenFileRecording(m_pContext, strFileName);
5557  #pragma warning (pop)
5558  }
5559 
5563  inline XnStatus OpenFileRecording(const XnChar* strFileName, ProductionNode& playerNode)
5564  {
5565  XnStatus nRetVal = XN_STATUS_OK;
5566 
5567  XnNodeHandle hPlayer;
5568  nRetVal = xnContextOpenFileRecordingEx(m_pContext, strFileName, &hPlayer);
5569  XN_IS_STATUS_OK(nRetVal);
5570 
5571  playerNode.TakeOwnership(hPlayer);
5572 
5573  return (XN_STATUS_OK);
5574  }
5575 
5579  inline XnStatus CreateMockNode(XnProductionNodeType type, const XnChar* strName, ProductionNode& mockNode)
5580  {
5581  XnStatus nRetVal = XN_STATUS_OK;
5582 
5583  XnNodeHandle hMockNode;
5584  nRetVal = xnCreateMockNode(m_pContext, type, strName, &hMockNode);
5585  XN_IS_STATUS_OK(nRetVal);
5586 
5587  mockNode.TakeOwnership(hMockNode);
5588 
5589  return (XN_STATUS_OK);
5590  }
5591 
5595  inline XnStatus CreateMockNodeBasedOn(ProductionNode& originalNode, const XnChar* strName, ProductionNode& mockNode)
5596  {
5597  XnStatus nRetVal = XN_STATUS_OK;
5598 
5599  XnNodeHandle hMockNode;
5600  nRetVal = xnCreateMockNodeBasedOn(m_pContext, originalNode, strName, &hMockNode);
5601  XN_IS_STATUS_OK(nRetVal);
5602 
5603  mockNode.TakeOwnership(hMockNode);
5604 
5605  return (XN_STATUS_OK);
5606  }
5607 
5611  inline XnStatus CreateCodec(XnCodecID codecID, ProductionNode& initializerNode, Codec& codec)
5612  {
5613  XnStatus nRetVal = XN_STATUS_OK;
5614 
5615  XnNodeHandle hCodec;
5616  nRetVal = xnCreateCodec(m_pContext, codecID, initializerNode.GetHandle(), &hCodec);
5617  XN_IS_STATUS_OK(nRetVal);
5618 
5619  codec.TakeOwnership(hCodec);
5620 
5621  return (XN_STATUS_OK);
5622  }
5623 
5627  inline XnStatus AddRef()
5628  {
5629  return xnContextAddRef(m_pContext);
5630  }
5631 
5635  inline void Release()
5636  {
5637  SetHandle(NULL);
5638  }
5639 
5643  inline void XN_API_DEPRECATED("You may use Release() instead, or count on dtor") Shutdown()
5644  {
5645  if (m_pContext != NULL)
5646  {
5647  #pragma warning (push)
5648  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5649  xnShutdown(m_pContext);
5650  #pragma warning (pop)
5651  m_pContext = NULL;
5652  }
5653  }
5654 
5658  inline XnStatus AddLicense(const XnLicense& License)
5659  {
5660  return xnAddLicense(m_pContext, &License);
5661  }
5662 
5666  inline XnStatus EnumerateLicenses(XnLicense*& aLicenses, XnUInt32& nCount) const
5667  {
5668  return xnEnumerateLicenses(m_pContext, &aLicenses, &nCount);
5669  }
5670 
5674  inline static void FreeLicensesList(XnLicense aLicenses[])
5675  {
5676  xnFreeLicensesList(aLicenses);
5677  }
5678 
5682  XnStatus EnumerateProductionTrees(XnProductionNodeType Type, const Query* pQuery, NodeInfoList& TreesList, EnumerationErrors* pErrors = NULL) const
5683  {
5684  XnStatus nRetVal = XN_STATUS_OK;
5685 
5686  const XnNodeQuery* pInternalQuery = (pQuery != NULL) ? pQuery->GetUnderlyingObject() : NULL;
5687 
5688  XnNodeInfoList* pList = NULL;
5689  nRetVal = xnEnumerateProductionTrees(m_pContext, Type, pInternalQuery, &pList, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5690  XN_IS_STATUS_OK(nRetVal);
5691 
5692  TreesList.ReplaceUnderlyingObject(pList);
5693 
5694  return (XN_STATUS_OK);
5695  }
5696 
5701  {
5702  XnStatus nRetVal = XN_STATUS_OK;
5703 
5704  XnNodeQuery* pInternalQuery = (pQuery != NULL) ? pQuery->GetUnderlyingObject() : NULL;
5705 
5706  XnNodeHandle hNode;
5707  nRetVal = xnCreateAnyProductionTree(m_pContext, type, pInternalQuery, &hNode, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5708  XN_IS_STATUS_OK(nRetVal);
5709 
5710  node.TakeOwnership(hNode);
5711 
5712  return (XN_STATUS_OK);
5713  }
5714 
5718  XnStatus XN_API_DEPRECATED("Please use other overload") CreateProductionTree(NodeInfo& Tree)
5719  {
5720  XnStatus nRetVal = XN_STATUS_OK;
5721 
5722  XnNodeHandle hNode;
5723  nRetVal = xnCreateProductionTree(m_pContext, Tree, &hNode);
5724  XN_IS_STATUS_OK(nRetVal);
5725 
5726  Tree.m_bOwnerOfNode = TRUE;
5727 
5728  return (XN_STATUS_OK);
5729  }
5730 
5735  {
5736  XnStatus nRetVal = XN_STATUS_OK;
5737 
5738  XnNodeHandle hNode;
5739  nRetVal = xnCreateProductionTree(m_pContext, Tree, &hNode);
5740  XN_IS_STATUS_OK(nRetVal);
5741 
5742  node.TakeOwnership(hNode);
5743 
5744  return (XN_STATUS_OK);
5745  }
5746 
5751  {
5752  XnNodeInfoList* pList;
5753  XnStatus nRetVal = xnEnumerateExistingNodes(m_pContext, &pList);
5754  XN_IS_STATUS_OK(nRetVal);
5755 
5756  list.ReplaceUnderlyingObject(pList);
5757 
5758  return (XN_STATUS_OK);
5759  }
5760 
5765  {
5766  XnNodeInfoList* pList;
5767  XnStatus nRetVal = xnEnumerateExistingNodesByType(m_pContext, type, &pList);
5768  XN_IS_STATUS_OK(nRetVal);
5769 
5770  list.ReplaceUnderlyingObject(pList);
5771 
5772  return (XN_STATUS_OK);
5773  }
5774 
5779  {
5780  XnStatus nRetVal = XN_STATUS_OK;
5781 
5782  XnNodeHandle hNode;
5783  nRetVal = xnFindExistingRefNodeByType(m_pContext, type, &hNode);
5784  XN_IS_STATUS_OK(nRetVal);
5785 
5786  node.TakeOwnership(hNode);
5787 
5788  return (XN_STATUS_OK);
5789  }
5790 
5794  XnStatus GetProductionNodeByName(const XnChar* strInstanceName, ProductionNode& node) const
5795  {
5796  XnStatus nRetVal = XN_STATUS_OK;
5797 
5798  XnNodeHandle hNode;
5799  nRetVal = xnGetRefNodeHandleByName(m_pContext, strInstanceName, &hNode);
5800  XN_IS_STATUS_OK(nRetVal);
5801 
5802  node.TakeOwnership(hNode);
5803 
5804  return (XN_STATUS_OK);
5805  }
5806 
5810  XnStatus GetProductionNodeInfoByName(const XnChar* strInstanceName, NodeInfo& nodeInfo) const
5811  {
5812  XnStatus nRetVal = XN_STATUS_OK;
5813 
5814  XnNodeHandle hNode;
5815  nRetVal = xnGetRefNodeHandleByName(m_pContext, strInstanceName, &hNode);
5816  XN_IS_STATUS_OK(nRetVal);
5817 
5818  xnProductionNodeRelease(hNode);
5819 
5820  nodeInfo = NodeInfo(xnGetNodeInfo(hNode));
5821 
5822  return (XN_STATUS_OK);
5823  }
5824 
5829  {
5830  return xnStartGeneratingAll(m_pContext);
5831  }
5832 
5837  {
5838  return xnStopGeneratingAll(m_pContext);
5839  }
5840 
5844  inline XnStatus SetGlobalMirror(XnBool bMirror)
5845  {
5846  return xnSetGlobalMirror(m_pContext, bMirror);
5847  }
5848 
5852  inline XnBool GetGlobalMirror()
5853  {
5854  return xnGetGlobalMirror(m_pContext);
5855  }
5856 
5861  {
5862  return xnGetGlobalErrorState(m_pContext);
5863  }
5864 
5869  {
5870  return xnRegisterToGlobalErrorStateChange(m_pContext, handler, pCookie, &hCallback);
5871  }
5872 
5878  {
5879  xnUnregisterFromGlobalErrorStateChange(m_pContext, hCallback);
5880  }
5881 
5886  {
5887  return xnWaitAndUpdateAll(m_pContext);
5888  }
5889 
5894  {
5895  return xnWaitAnyUpdateAll(m_pContext);
5896  }
5897 
5902  {
5903  return xnWaitOneUpdateAll(m_pContext, node.GetHandle());
5904  }
5905 
5910  {
5911  return xnWaitNoneUpdateAll(m_pContext);
5912  }
5913 
5917  inline XnStatus AutoEnumerateOverSingleInput(NodeInfoList& List, XnProductionNodeDescription& description, const XnChar* strCreationInfo, XnProductionNodeType InputType, EnumerationErrors* pErrors, Query* pQuery = NULL) const
5918  {
5919  return xnAutoEnumerateOverSingleInput(m_pContext, List.GetUnderlyingObject(), &description, strCreationInfo, InputType, pErrors == NULL ? NULL : pErrors->GetUnderlying(), pQuery == NULL ? NULL : pQuery->GetUnderlyingObject());
5920  }
5921 
5923  inline void SetHandle(XnContext* pContext)
5924  {
5925  if (m_pContext == pContext)
5926  {
5927  return;
5928  }
5929 
5930  if (m_pContext != NULL)
5931  {
5932  if (m_bUsingDeprecatedAPI && m_bAllocated)
5933  {
5934  // Backwards compatibility: call shutdown instead of release, to make old programs get the
5935  // exact same behavior they used to have.
5936  xnForceShutdown(m_pContext);
5937  }
5938  else
5939  {
5940  xnContextUnregisterFromShutdown(m_pContext, m_hShuttingDownCallback);
5941  xnContextRelease(m_pContext);
5942  }
5943  }
5944 
5945  if (pContext != NULL)
5946  {
5947  XnStatus nRetVal = xnContextAddRef(pContext);
5948  XN_ASSERT(nRetVal == XN_STATUS_OK);
5949 
5950  nRetVal = xnContextRegisterForShutdown(pContext, ContextShuttingDownCallback, this, &m_hShuttingDownCallback);
5951  XN_ASSERT(nRetVal == XN_STATUS_OK);
5952  }
5953 
5954  m_pContext = pContext;
5955  }
5956 
5957  inline void TakeOwnership(XnContext* pContext)
5958  {
5959  SetHandle(pContext);
5960 
5961  if (pContext != NULL)
5962  {
5963  xnContextRelease(pContext);
5964  }
5965  }
5966 
5967  private:
5968  static void XN_CALLBACK_TYPE ContextShuttingDownCallback(XnContext* /*pContext*/, void* pCookie)
5969  {
5970  Context* pThis = (Context*)pCookie;
5971  pThis->m_pContext = NULL;
5972  }
5973 
5974  XnContext* m_pContext;
5975  XnBool m_bUsingDeprecatedAPI;
5976  XnBool m_bAllocated;
5977  XnCallbackHandle m_hShuttingDownCallback;
5978  };
5979 
5985  {
5986  public:
5992  inline Resolution(XnResolution res) : m_Res(res)
5993  {
5994  m_nXRes = xnResolutionGetXRes(res);
5995  m_nYRes = xnResolutionGetYRes(res);
5996  m_strName = xnResolutionGetName(res);
5997  }
5998 
6005  inline Resolution(XnUInt32 xRes, XnUInt32 yRes) : m_nXRes(xRes), m_nYRes(yRes)
6006  {
6007  m_Res = xnResolutionGetFromXYRes(xRes, yRes);
6008  m_strName = xnResolutionGetName(m_Res);
6009  }
6010 
6016  inline Resolution(const XnChar* strName)
6017  {
6018  m_Res = xnResolutionGetFromName(strName);
6019  m_nXRes = xnResolutionGetXRes(m_Res);
6020  m_nYRes = xnResolutionGetYRes(m_Res);
6021  m_strName = xnResolutionGetName(m_Res);
6022  }
6023 
6025  inline XnResolution GetResolution() const { return m_Res; }
6027  inline XnUInt32 GetXResolution() const { return m_nXRes; }
6029  inline XnUInt32 GetYResolution() const { return m_nYRes; }
6031  inline const XnChar* GetName() const { return m_strName; }
6032 
6033  private:
6034  XnResolution m_Res;
6035  XnUInt32 m_nXRes;
6036  XnUInt32 m_nYRes;
6037  const XnChar* m_strName;
6038  };
6039 
6040  //---------------------------------------------------------------------------
6041  // Functions Implementation
6042  //---------------------------------------------------------------------------
6044  {
6045  return xnNodeQueryFilterList(context.GetUnderlyingObject(), query.GetUnderlyingObject(), m_pList);
6046  }
6047 
6048  inline void ProductionNode::GetContext(Context& context) const
6049  {
6051  }
6052 
6054  {
6055  if (m_pNeededNodes == NULL)
6056  {
6057  XnNodeInfoList* pList = xnNodeInfoGetNeededNodes(m_pInfo);
6058  m_pNeededNodes = XN_NEW(NodeInfoList, pList);
6059  }
6060 
6061  return *m_pNeededNodes;
6062  }
6063 
6064  inline void NodeInfo::SetUnderlyingObject(XnNodeInfo* pInfo)
6065  {
6066  if (m_pNeededNodes != NULL)
6067  {
6068  XN_DELETE(m_pNeededNodes);
6069  }
6070 
6071  m_bOwnerOfNode = FALSE;
6072  m_pInfo = pInfo;
6073  m_pNeededNodes = NULL;
6074  }
6075 
6077  {
6078  return xnCanFrameSyncWith(GetHandle(), other.GetHandle());
6079  }
6080 
6082  {
6083  return xnFrameSyncWith(GetHandle(), other.GetHandle());
6084  }
6085 
6087  {
6088  return xnStopFrameSyncWith(GetHandle(), other.GetHandle());
6089  }
6090 
6092  {
6093  return xnIsFrameSyncedWith(GetHandle(), other.GetHandle());
6094  }
6095 
6097  {
6098  if (m_pInfo == NULL)
6099  {
6100  return XN_STATUS_INVALID_OPERATION;
6101  }
6102 
6103  XnNodeHandle hNode = xnNodeInfoGetRefHandle(m_pInfo);
6104  node.TakeOwnership(hNode);
6105 
6106  if (m_bOwnerOfNode)
6107  {
6108  xnProductionNodeRelease(hNode);
6109  }
6110 
6111  return (XN_STATUS_OK);
6112  }
6113 
6114  //---------------------------------------------------------------------------
6115  // Node creation functions
6116  //---------------------------------------------------------------------------
6117 
6118  inline XnStatus Device::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6119  {
6120  XnNodeHandle hNode;
6121  XnStatus nRetVal = xnCreateDevice(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6122  XN_IS_STATUS_OK(nRetVal);
6123  TakeOwnership(hNode);
6124  return (XN_STATUS_OK);
6125  }
6126 
6127  inline XnStatus Recorder::Create(Context& context, const XnChar* strFormatName /*= NULL*/)
6128  {
6129  XnNodeHandle hNode;
6130  XnStatus nRetVal = xnCreateRecorder(context.GetUnderlyingObject(), strFormatName, &hNode);
6131  XN_IS_STATUS_OK(nRetVal);
6132  TakeOwnership(hNode);
6133  return (XN_STATUS_OK);
6134  }
6135 
6136  inline XnStatus Player::Create(Context& context, const XnChar* strFormatName)
6137  {
6138  XnNodeHandle hNode;
6139  XnStatus nRetVal = xnCreatePlayer(context.GetUnderlyingObject(), strFormatName, &hNode);
6140  XN_IS_STATUS_OK(nRetVal);
6141  TakeOwnership(hNode);
6142  return (XN_STATUS_OK);
6143  }
6144 
6145  inline XnStatus DepthGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6146  {
6147  XnNodeHandle hNode;
6148  XnStatus nRetVal = xnCreateDepthGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6149  XN_IS_STATUS_OK(nRetVal);
6150  TakeOwnership(hNode);
6151  return (XN_STATUS_OK);
6152  }
6153 
6154  inline XnStatus MockDepthGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
6155  {
6156  XnNodeHandle hNode;
6157  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_DEPTH, strName, &hNode);
6158  XN_IS_STATUS_OK(nRetVal);
6159  TakeOwnership(hNode);
6160  return (XN_STATUS_OK);
6161  }
6162 
6163  inline XnStatus MockDepthGenerator::CreateBasedOn(DepthGenerator& other, const XnChar* strName /* = NULL */)
6164  {
6165  Context context;
6166  other.GetContext(context);
6167  XnNodeHandle hNode;
6168  XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
6169  XN_IS_STATUS_OK(nRetVal);
6170  TakeOwnership(hNode);
6171  return (XN_STATUS_OK);
6172  }
6173 
6174  inline XnStatus ImageGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6175  {
6176  XnNodeHandle hNode;
6177  XnStatus nRetVal = xnCreateImageGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6178  XN_IS_STATUS_OK(nRetVal);
6179  TakeOwnership(hNode);
6180  return (XN_STATUS_OK);
6181  }
6182 
6183  inline XnStatus MockImageGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
6184  {
6185  XnNodeHandle hNode;
6186  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_IMAGE, strName, &hNode);
6187  XN_IS_STATUS_OK(nRetVal);
6188  TakeOwnership(hNode);
6189  return (XN_STATUS_OK);
6190  }
6191 
6192  inline XnStatus MockImageGenerator::CreateBasedOn(ImageGenerator& other, const XnChar* strName /* = NULL */)
6193  {
6194  Context context;
6195  other.GetContext(context);
6196  XnNodeHandle hNode;
6197  XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
6198  XN_IS_STATUS_OK(nRetVal);
6199  TakeOwnership(hNode);
6200  return (XN_STATUS_OK);
6201  }
6202 
6203  inline XnStatus IRGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6204  {
6205  XnNodeHandle hNode;
6206  XnStatus nRetVal = xnCreateIRGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6207  XN_IS_STATUS_OK(nRetVal);
6208  TakeOwnership(hNode);
6209  return (XN_STATUS_OK);
6210  }
6211 
6212  inline XnStatus MockIRGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
6213  {
6214  XnNodeHandle hNode;
6215  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_IR, strName, &hNode);
6216  XN_IS_STATUS_OK(nRetVal);
6217  TakeOwnership(hNode);
6218  return (XN_STATUS_OK);
6219  }
6220 
6221  inline XnStatus MockIRGenerator::CreateBasedOn(IRGenerator& other, const XnChar* strName /* = NULL */)
6222  {
6223  Context context;
6224  other.GetContext(context);
6225  XnNodeHandle hNode;
6226  XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
6227  XN_IS_STATUS_OK(nRetVal);
6228  TakeOwnership(hNode);
6229  return (XN_STATUS_OK);
6230  }
6231 
6232  inline XnStatus GestureGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6233  {
6234  XnNodeHandle hNode;
6235  XnStatus nRetVal = xnCreateGestureGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6236  XN_IS_STATUS_OK(nRetVal);
6237  TakeOwnership(hNode);
6238  return (XN_STATUS_OK);
6239  }
6240 
6241  inline XnStatus SceneAnalyzer::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6242  {
6243  //You're creating a scene!
6244  XnNodeHandle hNode;
6245  XnStatus nRetVal = xnCreateSceneAnalyzer(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6246  XN_IS_STATUS_OK(nRetVal);
6247  TakeOwnership(hNode);
6248  return (XN_STATUS_OK);
6249  }
6250 
6251  inline XnStatus HandsGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6252  {
6253  XnNodeHandle hNode;
6254  XnStatus nRetVal = xnCreateHandsGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6255  XN_IS_STATUS_OK(nRetVal);
6256  TakeOwnership(hNode);
6257  return (XN_STATUS_OK);
6258  }
6259 
6260  inline XnStatus UserGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6261  {
6262  XnNodeHandle hNode;
6263  XnStatus nRetVal = xnCreateUserGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6264  XN_IS_STATUS_OK(nRetVal);
6265  TakeOwnership(hNode);
6266  return (XN_STATUS_OK);
6267  }
6268 
6269  inline XnStatus AudioGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6270  {
6271  XnNodeHandle hNode;
6272  XnStatus nRetVal = xnCreateAudioGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6273  XN_IS_STATUS_OK(nRetVal);
6274  TakeOwnership(hNode);
6275  return (XN_STATUS_OK);
6276  }
6277 
6278  inline XnStatus MockAudioGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
6279  {
6280  XnNodeHandle hNode;
6281  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_AUDIO, strName, &hNode);
6282  XN_IS_STATUS_OK(nRetVal);
6283  TakeOwnership(hNode);
6284  return (XN_STATUS_OK);
6285  }
6286 
6287  inline XnStatus MockAudioGenerator::CreateBasedOn(AudioGenerator& other, const XnChar* strName /* = NULL */)
6288  {
6289  Context context;
6290  other.GetContext(context);
6291  XnNodeHandle hNode;
6292  XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
6293  XN_IS_STATUS_OK(nRetVal);
6294  TakeOwnership(hNode);
6295  return (XN_STATUS_OK);
6296  }
6297 
6298  inline XnStatus MockRawGenerator::Create(Context& context, const XnChar* strName /*= NULL*/)
6299  {
6300  XnNodeHandle hNode;
6301  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_GENERATOR, strName, &hNode);
6302  XN_IS_STATUS_OK(nRetVal);
6303  TakeOwnership(hNode);
6304  return (XN_STATUS_OK);
6305  }
6306 
6307  inline XnStatus Codec::Create(Context& context, XnCodecID codecID, ProductionNode& initializerNode)
6308  {
6309  XnNodeHandle hNode;
6310  XnStatus nRetVal = xnCreateCodec(context.GetUnderlyingObject(), codecID, initializerNode.GetHandle(), &hNode);
6311  XN_IS_STATUS_OK(nRetVal);
6312  TakeOwnership(hNode);
6313  return (XN_STATUS_OK);
6314  }
6315 
6317  {
6318  return xnScriptNodeRun(GetHandle(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6319  }
6320 
6321  //---------------------------------------------------------------------------
6322  // Global Helper Functions
6323  //---------------------------------------------------------------------------
6324 
6329  {
6330  xnGetVersion(&Version);
6331  }
6332 
6333  //---------------------------------------------------------------------------
6334  // Internal Helper Classes and Functions
6335  //---------------------------------------------------------------------------
6336 
6338  {
6339  public:
6340  StateChangedCallbackTranslator(StateChangedHandler handler, void* pCookie) : m_UserHandler(handler), m_pUserCookie(pCookie), m_hCallback(NULL) {}
6341 
6342  XnStatus Register(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
6343  {
6344  return xnFunc(hNode, StateChangedCallback, this, &m_hCallback);
6345  }
6346 
6347  void Unregister(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
6348  {
6349  xnFunc(hNode, m_hCallback);
6350  }
6351 
6352  static XnStatus RegisterToUnderlying(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
6353  {
6354  XnStatus nRetVal = XN_STATUS_OK;
6355 
6357  XN_VALIDATE_NEW(pTrans, StateChangedCallbackTranslator, handler, pCookie);
6358 
6359  nRetVal = pTrans->Register(xnFunc, hNode);
6360  if (nRetVal != XN_STATUS_OK)
6361  {
6362  XN_DELETE(pTrans);
6363  return (nRetVal);
6364  }
6365 
6366  hCallback = pTrans;
6367 
6368  return (XN_STATUS_OK);
6369  }
6370 
6371  static XnStatus UnregisterFromUnderlying(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback)
6372  {
6374  pTrans->Unregister(xnFunc, hNode);
6375  XN_DELETE(pTrans);
6376  return XN_STATUS_OK;
6377  }
6378 
6379  private:
6380  friend class GeneralIntCapability;
6381 
6382  typedef struct StateChangeCookie
6383  {
6384  StateChangedHandler userHandler;
6385  void* pUserCookie;
6386  XnCallbackHandle hCallback;
6387  } StateChangeCookie;
6388 
6389  static void XN_CALLBACK_TYPE StateChangedCallback(XnNodeHandle hNode, void* pCookie)
6390  {
6392  ProductionNode node(hNode);
6393  pTrans->m_UserHandler(node, pTrans->m_pUserCookie);
6394  }
6395 
6396  StateChangedHandler m_UserHandler;
6397  void* m_pUserCookie;
6398  XnCallbackHandle m_hCallback;
6399  };
6400 
6401  static XnStatus _RegisterToStateChange(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
6402  {
6403  return StateChangedCallbackTranslator::RegisterToUnderlying(xnFunc, hNode, handler, pCookie, hCallback);
6404  }
6405 
6406  static void _UnregisterFromStateChange(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback)
6407  {
6409  }
6410 
6412  {
6413  XnStatus nRetVal = XN_STATUS_OK;
6414 
6416  XN_VALIDATE_NEW(pTrans, StateChangedCallbackTranslator, handler, pCookie);
6417 
6418  nRetVal = xnRegisterToGeneralIntValueChange(GetHandle(), m_strCap, pTrans->StateChangedCallback, pTrans, &pTrans->m_hCallback);
6419  if (nRetVal != XN_STATUS_OK)
6420  {
6421  XN_DELETE(pTrans);
6422  return (nRetVal);
6423  }
6424 
6425  hCallback = pTrans;
6426 
6427  return (XN_STATUS_OK);
6428  }
6429 
6431  {
6433  xnUnregisterFromGeneralIntValueChange(GetHandle(), m_strCap, pTrans->m_hCallback);
6434  XN_DELETE(pTrans);
6435  }
6436 
6438 };
6439 
6440 #endif // __XN_CPP_WRAPPER_H__
XnUInt32 & FullXRes()
Definition: XnCppWrapper.h:299
Definition: XnTypes.h:482
const PoseDetectionCapability GetPoseDetectionCap() const
Definition: XnCppWrapper.h:4905
XN_C_API XnNodeHandle XN_C_DECL xnNodeInfoGetRefHandle(XnNodeInfo *pNodeInfo)
XN_C_API XnStatus XN_C_DECL xnContextRunXmlScriptEx(XnContext *pContext, const XnChar *xmlScript, XnEnumerationErrors *pErrors, XnNodeHandle *phScriptNode)
Runs an XML script in the given context.
XN_C_API void XN_C_DECL xnNodeInfoListFree(XnNodeInfoList *pList)
Represents an iterator over a NodeInfoList list.
Definition: XnCppWrapper.h:1378
XN_C_API XnStatus XN_C_DECL xnRegisterCalibrationCallbacks(XnNodeHandle hInstance, XnCalibrationStart CalibrationStartCB, XnCalibrationEnd CalibrationEndCB, void *pCookie, XnCallbackHandle *phCallback)
Register to calibration callbacks.
XN_C_API XnStatus XN_C_DECL xnGetVersion(XnVersion *pVersion)
XN_C_API XnStatus XN_C_DECL xnSetGeneralIntValue(XnNodeHandle hNode, const XnChar *strCap, XnInt32 nValue)
Sets the current value of this capability.
XnStatus ConvertProjectiveToRealWorld(XnUInt32 nCount, const XnPoint3D aProjective[], XnPoint3D aRealWorld[]) const
Converts a list of points from projective coordinates to real world coordinates. For full details and...
Definition: XnCppWrapper.h:3049
SkeletonCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:4031
XN_C_API const void *XN_C_DECL xnNodeInfoGetAdditionalData(XnNodeInfo *pNodeInfo)
XnStatus SetData(const IRMetaData &irMD)
Definition: XnCppWrapper.h:3408
Definition: XnCppWrapper.h:2606
XnUInt32 GetSupportedWaveOutputModesCount() const
For full details and usage, see xnGetSupportedWaveOutputModesCount
Definition: XnCppWrapper.h:5074
XnNodeHandle GetHandle() const
Gets the underlying C handle.
Definition: XnCppWrapper.h:1027
XN_C_API XnUInt32 XN_C_DECL xnGetNumberOfPoses(XnNodeHandle hInstance)
Get the number of the supported poses.
AlternativeViewPointCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:2049
XN_C_API XnUInt32 XN_C_DECL xnGetFrameID(XnNodeHandle hInstance)
Gets the frame ID of current data.
XnBool IsValid() const
TRUE if the object points to an actual node, FALSE otherwise.
Definition: XnCppWrapper.h:1050
XnStatus SetData(const ImageMetaData &imageMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
Definition: XnCppWrapper.h:3300
XnStatus RegisterToFrameSyncChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to view point changes. For full details and usage, see xnRegisterToFram...
Definition: XnCppWrapper.h:2139
void Unregister(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
Definition: XnCppWrapper.h:6347
XN_C_API void XN_C_DECL xnUnregisterFromCalibrationStart(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from calibration start callback.
XN_C_API XnBool XN_C_DECL xnCanFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther)
Checks if this generator can frame sync to another node.
XnStatus SetWaveOutputMode(const XnWaveOutputMode &OutputMode)
For full details and usage, see xnSetWaveOutputMode
Definition: XnCppWrapper.h:5090
XN_C_API XnStatus XN_C_DECL xnGetAllActiveGestures(XnNodeHandle hInstance, XnChar **pstrGestures, XnUInt32 nNameLength, XnUInt16 *nGestures)
Get the names of the gestures that are currently active.
XN_C_API XnStatus XN_C_DECL xnRegisterToUserReEnter(XnNodeHandle hInstance, XnUserHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Register to when a user re-enters the scene after exiting.
XN_C_API XnStatus XN_C_DECL xnLoadScriptFromFile(XnNodeHandle hScript, const XnChar *strFileName)
const XnImageMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:737
XnBool NeedPoseForCalibration() const
Check if a specific pose is required for calibration. For full details and usage, see xnNeedPoseForSk...
Definition: XnCppWrapper.h:4246
#define XN_CAPABILITY_BACKLIGHT_COMPENSATION
Definition: XnTypes.h:310
XnStatus RequestCalibration(XnUserID user, XnBool bForce)
Request calibration when possible. For full details and usage, see xnRequestSkeletonCalibration ...
Definition: XnCppWrapper.h:4158
Query()
Ctor.
Definition: XnCppWrapper.h:1259
Definition: XnCppWrapper.h:260
XN_C_API XnStatus XN_C_DECL xnNodeQuerySetCreationInfo(XnNodeQuery *pQuery, const XnChar *strCreationInfo)
void GetVersion(XnVersion &Version)
For full details and usage, see xnGetVersion
Definition: XnCppWrapper.h:6328
XN_C_API XnStatus XN_C_DECL xnLockedNodeStartChanges(XnNodeHandle hInstance, XnLockHandle hLock)
Start changes request on a locked node, without releasing that lock.
SceneAnalyzer(const NodeWrapper &other)
Definition: XnCppWrapper.h:3731
XN_C_API XnBool XN_C_DECL xnIsJointAvailable(XnNodeHandle hInstance, XnSkeletonJoint eJoint)
Check if generator supports a specific joint.
XN_C_API XnStatus XN_C_DECL xnRecord(XnNodeHandle hRecorder)
Records one frame of data from each node that was added to the recorder with xnAddNodeToRecording.
XnUInt32 XnUserID
Definition: XnTypes.h:525
XnUInt8 * m_pAllocatedData
Definition: XnCppWrapper.h:247
MockRawGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:5185
XN_C_API XnStatus XN_C_DECL xnWaitAnyUpdateAll(XnContext *pContext)
Updates all generators nodes in the context, once any of them have new data.
Definition: XnTypes.h:112
XnStatus GetGlobalErrorState()
Gets the global error state of the context. If one of the nodes in the context is in error state...
Definition: XnCppWrapper.h:5860
XnStatus SetSource(XnRecordMedium sourceType, const XnChar *strSource)
Sets the source for the player, i.e. where the played events will come from. For full details and usa...
Definition: XnCppWrapper.h:2430
XN_C_API XnStatus XN_C_DECL xnCreateMockNode(XnContext *pContext, XnProductionNodeType type, const XnChar *strName, XnNodeHandle *phNode)
Creates a production node which is only a mock. This node does not represent an actual node...
SceneAnalyzer(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3730
XnStatus ClearCalibrationData(XnUInt32 nSlot)
Clear the requested slot from any saved calibration data. For full details and usage, see xnClearSkeletonCalibrationData
Definition: XnCppWrapper.h:4206
XnUInt32 & FPS()
Definition: XnCppWrapper.h:309
GeneralIntCapability GetHueCap()
Definition: XnCppWrapper.h:2766
XnStatus SetSmoothing(XnFloat fSmoothingFactor)
Change smoothing factor. For full details and usage, see xnSetTrackingSmoothing
Definition: XnCppWrapper.h:3954
XnMapMetaData * pMap
Definition: XnTypes.h:1105
const XnDepthPixel * Data() const
Definition: XnCppWrapper.h:522
XN_C_API XnInt32 XN_C_DECL xnVersionCompare(const XnVersion *pVersion1, const XnVersion *pVersion2)
XnStatus RunXmlScriptFromFile(const XnChar *strFileName, EnumerationErrors *pErrors=NULL)
Runs an XML script in the given context. NOTE: when using this function, the context will be the owne...
Definition: XnCppWrapper.h:5485
void UnregisterHandCallbacks(XnCallbackHandle hCallback)
Unregister from hands callbacks. For full details and usage, see xnUnregisterHandCallbacks ...
Definition: XnCppWrapper.h:3920
XN_C_API XnUInt32 XN_C_DECL xnGetSupportedMapOutputModesCount(XnNodeHandle hInstance)
Gets the number of supported modes. This is useful for allocating an array that will be passed to xnG...
XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetPrevious(XnNodeInfoListIterator it)
Definition: XnCppWrapper.h:5282
xn::DepthMap & WritableDepthMap()
Gets a light object wrapping the writable depth-map.
Definition: XnCppWrapper.h:531
XnStatus SetData(const ImageMetaData &imageMD)
Definition: XnCppWrapper.h:3310
CroppingCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2567
XnStatus SetData(const AudioMetaData &audioMD)
Definition: XnCppWrapper.h:5176
Definition: XnCppWrapper.h:2654
void(* HandDestroy)(HandsGenerator &generator, XnUserID user, XnFloat fTime, void *pCookie)
Definition: XnCppWrapper.h:3889
XN_C_API XnStatus XN_C_DECL xnGetSkeletonJoint(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation *pJoint)
Get a specific joint's full information.
XnStatus SetMaxVersion(const XnVersion &maxVersion)
For full details and usage, see xnNodeQuerySetMaxVersion
Definition: XnCppWrapper.h:1308
XnStatus GetCropping(XnCropping &Cropping) const
Gets current cropping configuration. For full details and usage, see xnGetCropping ...
Definition: XnCppWrapper.h:2580
XnStatus CreateMockNode(XnProductionNodeType type, const XnChar *strName, ProductionNode &mockNode)
Creates a production node which is only a mock. This node does not represent an actual node...
Definition: XnCppWrapper.h:5579
#define XN_IS_STATUS_OK(x)
Definition: XnMacros.h:60
XnStatus AddGesture(const XnChar *strGesture, XnBoundingBox3D *pArea)
Turn on gesture. The generator will now look for this gesture. For full details and usage...
Definition: XnCppWrapper.h:3437
XnUInt32XYPair Offset
Definition: XnTypes.h:1045
#define FALSE
Definition: XnPlatform.h:90
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates a user generator. For full details and usage, see xnCreateUserGenerator
Definition: XnCppWrapper.h:6260
NodeWrapper(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1003
XN_C_API XnStatus XN_C_DECL xnStopPoseDetection(XnNodeHandle hInstance, XnUserID user)
Stop detection of poses for a specific user.
XnStatus GetSkeletonJointOrientation(XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation &Joint) const
Get a specific joint's orientation. For full details and usage, see xnGetSkeletonJointOrientation ...
Definition: XnCppWrapper.h:4125
XnStatus LockForChanges(XnLockHandle *phLock)
Locks a node, not allowing any changes (any "set" function). For full details and usage...
Definition: XnCppWrapper.h:1856
XN_C_API XnStatus XN_C_DECL xnRegisterToMirrorChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to mirror changes.
AudioMetaData()
Ctor.
Definition: XnCppWrapper.h:841
XN_C_API XnStatus XN_C_DECL xnSetPowerLineFrequency(XnNodeHandle hGenerator, XnPowerLineFrequency nFrequency)
Sets the power line frequency: 50 Hz, 60 Hz, or 0 to turn off anti-flicker.
xn::RGB24Map & WritableRGB24Map()
Gets a light object wrapping the writable image-map.
Definition: XnCppWrapper.h:724
#define XN_CAPABILITY_GAMMA
Definition: XnTypes.h:308
GeneralIntCapability GetFocusCap()
Definition: XnCppWrapper.h:2896
const XnYUV422DoublePixel *& YUV422Data()
Definition: XnCppWrapper.h:698
XnStatus FrameSyncWith(Generator &other)
Activates frame sync with the other node. For full details and usage, see xnFrameSyncWith ...
Definition: XnCppWrapper.h:6081
XN_C_API XnBool XN_C_DECL xnIsGestureAvailable(XnNodeHandle hInstance, const XnChar *strGesture)
Check if a specific gesture is available in this generator.
XnOutputMetaData * GetUnderlying()
Definition: XnCppWrapper.h:165
XN_C_API XnStatus XN_C_DECL xnGetNodeErrorState(XnNodeHandle hInstance)
Gets current error state of this node.
XnUInt32 YRes() const
Definition: XnCppWrapper.h:282
XnStatus Error()
Gets the failure error code of the failing node this iterator points to.
Definition: XnCppWrapper.h:5347
XN_C_API XnStatus XN_C_DECL xnEnumerateProductionTrees(XnContext *pContext, XnProductionNodeType Type, const XnNodeQuery *pQuery, XnNodeInfoList **ppTreesList, XnEnumerationErrors *pErrors)
Enumerates all available production trees for a specific node type. The trees populated in the list s...
GeneralIntCapability GetSaturationCap()
Definition: XnCppWrapper.h:2776
XnBool IsDataNew() const
Checks whether current data is new. Meaning, did the data change on the last call to xnWaitAndUpdateA...
Definition: XnCppWrapper.h:2243
void UnregisterFromErrorStateChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToNodeErrorStateChange(). For full details and usage, see xnUnregisterFromNodeErrorStateChange
Definition: XnCppWrapper.h:1678
struct XnEnumerationErrors XnEnumerationErrors
Definition: XnTypes.h:214
#define XN_VALIDATE_ALLOC_PTR(x)
Definition: XnOS.h:132
XnStatus GetCalibrationPose(XnChar *strPose) const
Get the pose that is required for calibration. For full details and usage, see xnGetSkeletonCalibrati...
Definition: XnCppWrapper.h:4254
XN_C_API void XN_C_DECL xnUnregisterFromPoseCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from pose events.
XnStatus RegisterToOutOfPose(PoseDetection handler, void *pCookie, XnCallbackHandle &hCallback)
Register to callback when a use is no longer in pose. For full details and usage, see xnRegisterToOut...
Definition: XnCppWrapper.h:4649
XnStatus StopTracking(XnUserID user)
Stop tracking a skeleton. For full details and usage, see xnStopSkeletonTracking
Definition: XnCppWrapper.h:4230
const AlternativeViewPointCapability GetAlternativeViewPointCap() const
Definition: XnCppWrapper.h:2305
Resolution(XnResolution res)
Definition: XnCppWrapper.h:5992
XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationInProgress(XnNodeHandle hInstance, XnCalibrationInProgress handler, void *pCookie, XnCallbackHandle *phCallback)
Register to calibration status while calibration is in progress.
const XnGrayscale8Pixel * GetGrayscale8ImageMap() const
Gets the current Grayscale8 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in Grayscale8 pixel format. For full details and usage, see xnGetGrayscale8ImageMap
Definition: XnCppWrapper.h:3192
const XnUInt8 *& Data()
Definition: XnCppWrapper.h:170
XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrating(XnNodeHandle hInstance, XnUserID user)
Check if skeleton is being calibrated.
xn::Grayscale16Map & WritableGrayscale16Map()
Gets a light object wrapping the writable image-map.
Definition: XnCppWrapper.h:734
XN_C_API XnNodeInfo *XN_C_DECL xnGetNodeInfo(XnNodeHandle hNode)
Gets information about a specific node, like its description, and dependent nodes.
Definition: XnTypes.h:261
XN_C_API XnStatus XN_C_DECL xnCopyImageMetaData(XnImageMetaData *pDestination, const XnImageMetaData *pSource)
Shallow-Copies an Image Meta Data object. Note that the data buffer is not copied, and that both object will point to the same buffer.
XN_C_API XnUInt64 XN_C_DECL xnGetTimestamp(XnNodeHandle hInstance)
Gets the timestamp of current data, in microseconds.
const XnChar * GetSupportedFormat()
Definition: XnCppWrapper.h:5257
GeneralIntCapability GetBrightnessCap()
Definition: XnCppWrapper.h:2746
#define XN_CAPABILITY_SHARPNESS
Definition: XnTypes.h:307
XnUInt32 GetYResolution() const
Gets the Y resolution.
Definition: XnCppWrapper.h:6029
XN_C_API XnStatus XN_C_DECL xnCreateDepthGenerator(XnContext *pContext, XnNodeHandle *phDepthGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates a depth generator.
XN_C_API XnStatus XN_C_DECL xnCopySceneMetaData(XnSceneMetaData *pDestination, const XnSceneMetaData *pSource)
Shallow-Copies a Scene Meta Data object. Note that the data buffer is not copied, and that both objec...
XN_C_API XnStatus XN_C_DECL xnRegisterGestureCallbacks(XnNodeHandle hInstance, XnGestureRecognized RecognizedCB, XnGestureProgress ProgressCB, void *pCookie, XnCallbackHandle *phCallback)
Register to all gesture callbacks.
Definition: XnCppWrapper.h:4525
XnBool GetGlobalMirror()
Gets the global mirror flag. For full details and usage, see xnGetGlobalMirror
Definition: XnCppWrapper.h:5852
const XnNodeQuery * GetUnderlyingObject() const
Gets the underlying C object.
Definition: XnCppWrapper.h:1278
void Release()
Releases a context object, decreasing its ref count by 1. If reference count has reached 0...
Definition: XnCppWrapper.h:5635
XN_C_API XnUInt32 XN_C_DECL xnGetSupportedWaveOutputModesCount(XnNodeHandle hInstance)
XnUInt32 XnLockHandle
Definition: XnTypes.h:87
XN_C_API const void *XN_C_DECL xnGetData(XnNodeHandle hInstance)
Gets the current data.
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6183
XnUInt32 FullXRes() const
Definition: XnCppWrapper.h:297
XnStatus AddSupportedMapOutputMode(const XnMapOutputMode &MapOutputMode)
For full details and usage, see xnNodeQueryAddSupportedMapOutputMode
Definition: XnCppWrapper.h:1324
XN_C_API void XN_C_DECL xnUnregisterFromNewDataAvailable(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToNewDataAvailable().
XnStatus EnumerateExistingNodes(NodeInfoList &list, XnProductionNodeType type) const
Gets a list of all existing node in the context. Each node that was returned increases its ref count...
Definition: XnCppWrapper.h:5764
XnStatus StopTrackingAll()
Stop tracking all hands. For full details and usage, see xnStopTrackingAll
Definition: XnCppWrapper.h:3938
void(* PoseInProgress)(PoseDetectionCapability &pose, const XnChar *strPose, XnUserID user, XnPoseDetectionStatus poseError, void *pCookie)
Definition: XnCppWrapper.h:4694
const xn::DepthMap & DepthMap() const
Gets a light object wrapping the depth-map.
Definition: XnCppWrapper.h:529
XnIRMetaData * GetUnderlying()
Definition: XnCppWrapper.h:821
#define XN_CAPABILITY_SATURATION
Definition: XnTypes.h:306
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsToString(const XnEnumerationErrors *pErrors, XnChar *csBuffer, XnUInt32 nSize)
Definition: XnTypes.h:115
XN_C_API XnStatus XN_C_DECL xnGetAllAvailablePoses(XnNodeHandle hInstance, XnChar **pstrPoses, XnUInt32 nNameLength, XnUInt32 *pnPoses)
Get the names of the supported poses.
XnBool IsMirrored() const
Gets current mirroring configuration. For full details and usage, see xnIsMirrored ...
Definition: XnCppWrapper.h:2015
XN_C_API XnStatus XN_C_DECL xnRegisterToCroppingChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to cropping changes.
XnStatus EnumerateActiveJoints(XnSkeletonJoint *pJoints, XnUInt16 &nJoints) const
Get all active joints. For full details and usage, see xnEnumerateActiveJoints
Definition: XnCppWrapper.h:4101
Definition: XnTypes.h:492
XnOutputMetaData * pOutput
Definition: XnTypes.h:1039
XnStatus LoadScriptFromFile(const XnChar *strFileName)
Definition: XnCppWrapper.h:5262
bool operator==(const Version &other) const
Definition: XnCppWrapper.h:88
XN_C_API void XN_C_DECL xnUnregisterFromMapOutputModeChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToMapOutputModeChange.
const xn::Grayscale16Map & Grayscale16Map() const
Gets a light object wrapping the image-map.
Definition: XnCppWrapper.h:732
XnUInt32 & FullYRes()
Definition: XnCppWrapper.h:304
XnBool operator!=(const Iterator &other) const
Definition: XnCppWrapper.h:1398
XN_C_API XnStatus XN_C_DECL xnMockIRSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnIRPixel *pData)
GeneralIntCapability GetGeneralIntCap(const XnChar *strCapability)
Definition: XnCppWrapper.h:1912
XnStatus SeekToFrame(const XnChar *strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin)
Seeks the player to a specific frame of a specific played node, so that playing will continue from th...
Definition: XnCppWrapper.h:2462
AntiFlickerCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2615
XnBool IsJointActive(XnSkeletonJoint eJoint, XnBool) const
Check if joint is currently active. For full details and usage, see xnIsJointActive ...
Definition: XnCppWrapper.h:4069
XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot)
Save the calibration data.
GeneralIntCapability GetTiltCap()
Definition: XnCppWrapper.h:2846
Definition: XnTypes.h:162
XnBool IsFrameSyncedWith(Generator &other) const
Checks if current view point is as if coming from the other node view point. For full details and usa...
Definition: XnCppWrapper.h:6091
Definition: XnCppWrapper.h:761
XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnUInt8 *pExternalBuffer)
Definition: XnCppWrapper.h:369
XnUInt32 XRes() const
Definition: XnCppWrapper.h:277
void UnregisterFromOutOfPose(XnCallbackHandle hCallback)
Unregister from out of pose callback. For full details and usage, see xnUnregisterFromOutOfPose ...
Definition: XnCppWrapper.h:4678
XnStatus ReadNext()
Reads the next data element from the player. For full details and usage, see xnPlayerReadNext ...
Definition: XnCppWrapper.h:2446
XnUInt8 * WritableData()
Definition: XnCppWrapper.h:172
XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format, const XnUInt8 *pExternalBuffer=NULL)
Definition: XnCppWrapper.h:666
MockImageGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3266
XnStatus ResetViewPoint()
Sets the view point of this generator to its normal one. For full details and usage, see xnResetViewPoint
Definition: XnCppWrapper.h:2071
void Shutdown()
Shuts down an OpenNI context, destroying all its nodes. Do not call any function of this context or a...
Definition: XnCppWrapper.h:5643
XnStatus CopyFrom(const DepthMetaData &other)
Definition: XnCppWrapper.h:502
XnStatus EncodeData(const void *pSrc, XnUInt32 nSrcSize, void *pDst, XnUInt32 nDstSize, XnUInt *pnBytesWritten) const
For full details and usage, see xnEncodeData
Definition: XnCppWrapper.h:5228
XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnIRPixel *pExternalBuffer=NULL)
Definition: XnCppWrapper.h:801
XnBool IsViewPointSupported(ProductionNode &otherNode) const
Checks if this generator can change its output to look like it was taken from a different location...
Definition: XnCppWrapper.h:2055
ErrorStateCapability GetErrorStateCap()
Definition: XnCppWrapper.h:1900
XN_C_API void XN_C_DECL xnNodeQueryFree(XnNodeQuery *pQuery)
HandTouchingFOVEdgeCapability GetHandTouchingFOVEdgeCap()
Definition: XnCppWrapper.h:3974
const XnLabel & operator()(XnUInt32 x, XnUInt32 y) const
Definition: XnCppWrapper.h:964
XN_C_API XnStatus XN_C_DECL xnRegisterToMapOutputModeChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to mode changes.
const FrameSyncCapability GetFrameSyncCap() const
Definition: XnCppWrapper.h:2325
PoseDetectionCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:4534
Definition: XnCppWrapper.h:1993
XnStatus GetVendorSpecificData(XnChar *strBuffer, XnUInt32 nBufferSize)
For full details and usage, see xnGetVendorSpecificData
Definition: XnCppWrapper.h:1944
XN_C_API XnStatus XN_C_DECL xnRegisterToUserPositionChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to user position changes.
void Free()
For full details and usage, see xnEnumerationErrorsFree
Definition: XnCppWrapper.h:5371
Definition: XnCppWrapper.h:1648
XN_C_API XnStatus XN_C_DECL xnGetDepthFieldOfView(XnNodeHandle hInstance, XnFieldOfView *pFOV)
Gets the Field-Of-View of the depth generator, in radians.
void GetMetaData(SceneMetaData &metaData) const
Gets the current scene meta data. For full details and usage, see xnGetSceneMetaData ...
Definition: XnCppWrapper.h:3741
XnStatus RemoveGesture(const XnChar *strGesture)
Turn off gesture. The generator will no longer look for this gesture. For full details and usage...
Definition: XnCppWrapper.h:3445
XnStatus GetMapOutputMode(XnMapOutputMode &OutputMode) const
Gets the current output mode. For full details and usage, see xnGetMapOutputMode
Definition: XnCppWrapper.h:2692
XN_C_API XnStatus XN_C_DECL xnCreateSceneAnalyzer(XnContext *pContext, XnNodeHandle *phSceneAnalyzer, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates an scene analyzer.
XnStatus StopTracking(XnUserID user)
Stop tracking a specific hand. For full details and usage, see xnStopTracking
Definition: XnCppWrapper.h:3930
Iterator & operator++()
Definition: XnCppWrapper.h:1407
ImageGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3158
XnPlayerSeekOrigin
Definition: XnTypes.h:510
XN_C_API XnStatus XN_C_DECL xnRegisterToNewDataAvailable(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to be called when new data is available.
void Unref()
Definition: XnCppWrapper.h:1071
XnStatus Append(NodeInfoList &other)
For full details and usage, see xnNodeInfoListAppend
Definition: XnCppWrapper.h:1591
XnStatus Record()
Records one frame of data from each node that was added to the recorder with xnAddNodeToRecording. For full details and usage, see xnRecord
Definition: XnCppWrapper.h:2393
XN_C_API void XN_C_DECL xnUnregisterFromWaveOutputModeChanges(XnNodeHandle hInstance, XnCallbackHandle hCallback)
XN_C_API XnStatus XN_C_DECL xnSetPlaybackSpeed(XnNodeHandle hInstance, XnDouble dSpeed)
Sets the playback speed, as a ratio of the time passed in the recording. A value of 1...
const xn::ImageMap & ImageMap() const
Gets a light object wrapping the image-map.
Definition: XnCppWrapper.h:717
XnUInt32 & YOffset()
Definition: XnCppWrapper.h:294
XN_C_API XnStatus XN_C_DECL xnCreateCodec(XnContext *pContext, XnCodecID codecID, XnNodeHandle hInitializerNode, XnNodeHandle *phCodec)
XN_C_API XnStatus XN_C_DECL xnGetPlayerNumFrames(XnNodeHandle hPlayer, const XnChar *strNodeName, XnUInt32 *pnFrames)
Retrieves the number of frames of a specific node played by a player.
#define XN_STATUS_OK
Definition: XnStatus.h:37
void UnregisterFromGestureChange(XnCallbackHandle hCallback)
Unregister from when gestures are added or removed. For full details and usage, see xnUnregisterFromG...
Definition: XnCppWrapper.h:3564
XN_C_API void XN_C_DECL xnUnregisterFromViewPointChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToViewPointChange().
CroppingCapability GetCroppingCap()
Definition: XnCppWrapper.h:2736
const xn::IRMap & IRMap() const
Gets a light object wrapping the IR map.
Definition: XnCppWrapper.h:814
XN_C_API XnStatus XN_C_DECL xnRegisterToGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnGestureReadyForNextIntermediateStage handler, void *pCookie, XnCallbackHandle *phCallback)
Register to when a gesture is ready for its next stage (specific to the gesture)
XN_C_API XnStatus XN_C_DECL xnNodeQuerySetExistingNodeOnly(XnNodeQuery *pQuery, XnBool bExistingNode)
XN_C_API XnStatus XN_C_DECL xnCreateProductionTree(XnContext *pContext, XnNodeInfo *pTree, XnNodeHandle *phNode)
Creates a production node. If the tree specifies additional needed nodes, and those nodes do not exis...
XnStatus AddSupportedCapability(const XnChar *strNeededCapability)
For full details and usage, see xnNodeQueryAddSupportedCapability
Definition: XnCppWrapper.h:1316
const XnUInt8 * GetImageMap() const
Gets the current image-map as a byte buffer. For full details, see xnGetImageMap().
Definition: XnCppWrapper.h:3208
XN_C_API XnStatus XN_C_DECL xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors *pErrors)
void(* HandUpdate)(HandsGenerator &generator, XnUserID user, const XnPoint3D *pPosition, XnFloat fTime, void *pCookie)
Definition: XnCppWrapper.h:3880
Device(const NodeWrapper &other)
Definition: XnCppWrapper.h:1971
XnUInt32 nDataSize
Definition: XnTypes.h:1028
Iterator RBegin() const
Gets an iterator to the last item in the list.
Definition: XnCppWrapper.h:1560
void UnregisterFromFieldOfViewChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToDepthFieldOfViewChange. For full details and usage, see xnUnregisterFromDepthFieldOfViewChange
Definition: XnCppWrapper.h:3041
XN_C_API void XN_C_DECL xnProductionNodeRelease(XnNodeHandle hNode)
Unreference a production node, decreasing its reference count by 1. If the reference count reaches ze...
void UnregisterUserCallbacks(XnCallbackHandle hCallback)
Unregister from user callbacks. For full details and usage, see xnUnregisterUserCallbacks ...
Definition: XnCppWrapper.h:4873
XN_C_API XnBool XN_C_DECL xnIsGenerating(XnNodeHandle hInstance)
Checks if this node is currently generating.
~EnumerationErrors()
Dtor.
Definition: XnCppWrapper.h:5297
Definition: XnTypes.h:151
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsAllocate(XnEnumerationErrors **ppErrors)
XN_C_API XnStatus XN_C_DECL xnGetMapOutputMode(XnNodeHandle hInstance, XnMapOutputMode *pOutputMode)
Gets the current output mode.
MockIRGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3365
XnStatus AutoEnumerateOverSingleInput(NodeInfoList &List, XnProductionNodeDescription &description, const XnChar *strCreationInfo, XnProductionNodeType InputType, EnumerationErrors *pErrors, Query *pQuery=NULL) const
For full details and usage, see xnAutoEnumerateOverSingleInput
Definition: XnCppWrapper.h:5917
void UnregisterFromJointConfigurationChange(XnCallbackHandle hCallback)
Unregister from joint configuration changes. For full details and usage, see xnUnregisterFromJointCon...
Definition: XnCppWrapper.h:4093
void(* StateChangedHandler)(ProductionNode &node, void *pCookie)
Definition: XnCppWrapper.h:62
XN_C_API XnStatus XN_C_DECL xnMockDepthSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel *pData)
XnUInt32 & DataSize()
Definition: XnCppWrapper.h:155
XN_C_API void XN_C_DECL xnUnregisterFromUserReEnter(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from when a user re-enters the scene.
XnOutputMetaData * pOutput
Definition: XnTypes.h:1093
Definition: XnCppWrapper.h:6337
Definition: XnCppWrapper.h:457
GeneralIntCapability GetExposureCap()
Definition: XnCppWrapper.h:2876
void SetHandle(XnNodeHandle hNode)
Replaces the object being pointed.
Definition: XnCppWrapper.h:1074
XnWaveOutputMode Wave
Definition: XnTypes.h:1096
XnUInt8 XnGrayscale8Pixel
Definition: XnTypes.h:278
XnBool IsViewPointAs(ProductionNode &otherNode) const
Checks if current view point is as if coming from the other node view point. For full details and usa...
Definition: XnCppWrapper.h:2079
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6154
XnRecordMedium
Definition: XnTypes.h:799
XnStatus StopGeneratingAll()
Stop all generators from generating data. For full details and usage, see xnStopGeneratingAll ...
Definition: XnCppWrapper.h:5836
XnStatus RegisterToMirrorChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to mirror changes. For full details and usage, see xnRegisterToMirrorCh...
Definition: XnCppWrapper.h:2023
Definition: XnTypes.h:1090
const CroppingCapability GetCroppingCap() const
Definition: XnCppWrapper.h:2726
Codec(const NodeWrapper &other)
Definition: XnCppWrapper.h:5210
const XnMapMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:315
XnStatus UnregisterFromCalibrationStart(XnCallbackHandle hCallback)
Unregister from calibration start callback. For full details and usage, see xnUnregisterFromCalibrati...
Definition: XnCppWrapper.h:4348
XnUInt32 XOffset() const
Definition: XnCppWrapper.h:287
Definition: XnCppWrapper.h:5201
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsGetCurrentError(XnEnumerationErrorsIterator it)
XnStatus RegisterCalibrationCallbacks(CalibrationStart CalibrationStartCB, CalibrationEnd CalibrationEndCB, void *pCookie, XnCallbackHandle &hCallback)
Register to calibration callbacks. For full details and usage, see xnRegisterCalibrationCallbacks ...
Definition: XnCppWrapper.h:4288
GeneralIntCapability GetContrastCap()
Definition: XnCppWrapper.h:2756
XnStatus Reset(XnUserID user)
Reset the skeleton - discard calibration. For full details and usage, see xnResetSkeleton ...
Definition: XnCppWrapper.h:4238
XnEnumerationErrors * GetUnderlying()
Gets the underlying C object.
Definition: XnCppWrapper.h:5382
const XnLabel & operator[](XnUInt32 nIndex) const
Definition: XnCppWrapper.h:952
XN_C_API XnStatus XN_C_DECL xnStopTrackingAll(XnNodeHandle hInstance)
Stop tracking all hands.
#define XN_CAPABILITY_EXPOSURE
Definition: XnTypes.h:316
MirrorCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:2001
XnPoseDetectionStatus
Definition: XnTypes.h:642
XN_C_API XnStatus XN_C_DECL xnContextOpenFileRecording(XnContext *pContext, const XnChar *strFileName)
Opens a recording file, adding all nodes in it to the context. NOTE: when using this function...
XN_C_API XnStatus XN_C_DECL xnRegisterToPoseCallbacks(XnNodeHandle hInstance, XnPoseDetectionCallback PoseDetectionStartCB, XnPoseDetectionCallback PoseDetectionEndCB, void *pCookie, XnCallbackHandle *phCallback)
Register to callbacks for pose events.
XN_C_API XnPowerLineFrequency XN_C_DECL xnGetPowerLineFrequency(XnNodeHandle hGenerator)
Gets the power line frequency.
DeviceIdentificationCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:1931
XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfUsers(XnNodeHandle hInstance)
Get current number of users.
#define XN_CAPABILITY_COLOR_TEMPERATURE
Definition: XnTypes.h:309
XnUInt16 GetNumberOfUsers() const
Get current number of users. For full details and usage, see xnGetNumberOfUsers
Definition: XnCppWrapper.h:4816
XN_C_API XnStatus XN_C_DECL xnInitFromXmlFileEx(const XnChar *strFileName, XnContext **ppContext, XnEnumerationErrors *pErrors, XnNodeHandle *phScriptNode)
Initializes OpenNI context, and then configures it using the given file.
XnUInt16 XnGrayscale16Pixel
Definition: XnTypes.h:281
XnMapMetaData * GetUnderlying()
Definition: XnCppWrapper.h:317
XnUInt32 GetDataSize() const
Gets the size of current data, in bytes. For full details and usage, see xnGetDataSize ...
Definition: XnCppWrapper.h:2259
Iterator REnd() const
Gets an iterator marking the start of the list. This iterator does not point to a valid item...
Definition: XnCppWrapper.h:1566
xn::Grayscale8Map & WritableGrayscale8Map()
Gets a light object wrapping the writable image-map.
Definition: XnCppWrapper.h:729
Iterator Begin() const
Gets an iterator to the first item in the list.
Definition: XnCppWrapper.h:5356
Definition: XnTypes.h:192
XN_C_API void XN_C_DECL xnUnregisterFromGenerationRunningChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToGenerationRunningChange().
XN_C_API XnStatus XN_C_DECL xnGetSkeletonCalibrationPose(XnNodeHandle hInstance, XnChar *strPose)
Get the pose that is required for calibration.
XN_C_API void XN_C_DECL xnGetDepthMetaData(XnNodeHandle hInstance, XnDepthMetaData *pMetaData)
Gets the current depth-map meta data.
XnBool bIsNew
Definition: XnTypes.h:1031
XnUInt32 GetXResolution() const
Gets the X resolution.
Definition: XnCppWrapper.h:6027
XN_C_API void XN_C_DECL xnUnregisterFromCroppingChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToCroppingChange().
XN_C_API XnStatus XN_C_DECL xnStopSkeletonTracking(XnNodeHandle hInstance, XnUserID user)
Stop tracking a skeleton.
XnStatus EnumerateGestures(XnChar *&astrGestures, XnUInt16 &nGestures) const
Get the names of all gestures available. For full details and usage, see xnEnumerateGestures ...
Definition: XnCppWrapper.h:3469
XnStatus AllocateData(XnUInt32 nBytes)
Allocated a writable buffer. If a previous buffer was allocated it will be freed (or reused if possib...
Definition: XnCppWrapper.h:184
XnStatus Ref()
Definition: XnCppWrapper.h:1070
XN_C_API XnDepthPixel *XN_C_DECL xnGetDepthMap(XnNodeHandle hInstance)
Gets the current depth-map. This map is updated after a call to xnWaitAndUpdateData().
XnUInt32 nSampleRate
Definition: XnTypes.h:436
XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationStart(XnNodeHandle hInstance, XnCalibrationStart handler, void *pCookie, XnCallbackHandle *phCallback)
Register to calibration start callback.
const XnChar * GetCreationInfo() const
For full details and usage, see xnNodeInfoGetCreationInfo
Definition: XnCppWrapper.h:1210
AntiFlickerCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:2614
XnStatus Set(XnInt32 nValue)
Sets the current value of this capability. For full details and usage, see xnSetGeneralIntValue ...
Definition: XnCppWrapper.h:1721
XnStatus RegisterToUserExit(UserHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Register to when the user exits the scene (but not lost yet) For full details and usage...
Definition: XnCppWrapper.h:4923
~Context()
Dtor.
Definition: XnCppWrapper.h:5425
XnUInt16 & BitsPerSample()
Gets the number of bits per channel in a sample.
Definition: XnCppWrapper.h:870
const XnGrayscale8Pixel *& Grayscale8Data()
Definition: XnCppWrapper.h:705
XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8 *pImageMap)
For full details and usage, see xnMockImageSetData
Definition: XnCppWrapper.h:3288
XN_C_API XnStatus XN_C_DECL xnWaitOneUpdateAll(XnContext *pContext, XnNodeHandle hNode)
Updates all generators nodes in the context, waiting for a specific one to have new data...
XnStatus RegisterToHandTouchingFOVEdge(HandTouchingFOVEdge handler, void *pCookie, XnCallbackHandle &hCallback)
Register to when a hand is approaching the edge of the FOV. For full details and usage, see xnRegisterToHandTouchingFOVEdge
Definition: XnCppWrapper.h:3792
XnStatus AbortCalibration(XnUserID user)
stop calibration For full details and usage, see xnAbortSkeletonCalibration
Definition: XnCppWrapper.h:4166
XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void *pData)
Definition: XnCppWrapper.h:5190
XnUInt32 FPS() const
Definition: XnCppWrapper.h:307
void GetContext(Context &context) const
For full details and usage, see xnGetContextFromNodeHandle
Definition: XnCppWrapper.h:6048
XnUInt64 & Timestamp()
Definition: XnCppWrapper.h:145
XnStatus GetInstance(ProductionNode &node) const
Definition: XnCppWrapper.h:6096
XnDepthPixel * WritableData()
Definition: XnCppWrapper.h:526
const XnUInt8 * Data() const
Definition: XnCppWrapper.h:168
AlternativeViewPointCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2050
XnStatus SetData(const DepthMetaData &depthMD)
Definition: XnCppWrapper.h:3139
~NodeInfo()
Dtor.
Definition: XnCppWrapper.h:1162
XN_C_API XnStatus XN_C_DECL xnAddNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode)
Adds another node to the list of needed nodes for this node.
XN_C_API XnStatus XN_C_DECL xnSetGlobalMirror(XnContext *pContext, XnBool bMirror)
Sets the global mirror flag. This will set all current existing nodes' mirror state, and also affect future created nodes. The default mirror flag is FALSE.
XnStatus RegisterToWaveOutputModeChanges(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
For full details and usage, see xnRegisterToWaveOutputModeChanges
Definition: XnCppWrapper.h:5106
XN_C_API XnStatus XN_C_DECL xnFindExistingRefNodeByType(XnContext *pContext, XnProductionNodeType type, XnNodeHandle *phNode)
Returns the first found existing node of the specified type.
XN_C_API XnStatus XN_C_DECL xnLockedNodeEndChanges(XnNodeHandle hInstance, XnLockHandle hLock)
Ends changes request on a locked node.
XnStatus RemoveNodeFromRecording(ProductionNode &Node)
Removes node from recording and stop recording it. This function can be called on a node that was add...
Definition: XnCppWrapper.h:2385
const SkeletonCapability GetSkeletonCap() const
Definition: XnCppWrapper.h:4885
XN_C_API XnStatus XN_C_DECL xnTellPlayerFrame(XnNodeHandle hPlayer, const XnChar *strNodeName, XnUInt32 *pnFrame)
Reports the current frame number of a specific node played by a player.
XnUInt32 X
Definition: XnTypes.h:1014
XN_C_API XnStatus XN_C_DECL xnGetAvailablePoses(XnNodeHandle hInstance, XnChar **pstrPoses, XnUInt32 *pnPoses)
Get the names of the supported poses.
XN_C_API XnStatus XN_C_DECL xnAddGesture(XnNodeHandle hInstance, const XnChar *strGesture, XnBoundingBox3D *pArea)
Turn on gesture. The generator will now look for this gesture.
Definition: XnCppWrapper.h:3767
XnPowerLineFrequency
Definition: XnTypes.h:517
XnStatus InitFrom(const SceneMetaData &other, XnUInt32 nXRes, XnUInt32 nYRes, const XnLabel *pExternalBuffer)
Definition: XnCppWrapper.h:914
XnUInt32 & YRes()
Definition: XnCppWrapper.h:284
void(* XnStateChangedHandler)(XnNodeHandle hNode, void *pCookie)
Definition: XnTypes.h:227
XnStatus ToString(XnChar *csBuffer, XnUInt32 nSize)
For full details and usage, see xnEnumerationErrorsToString
Definition: XnCppWrapper.h:5363
XnStatus SetPowerLineFrequency(XnPowerLineFrequency nFrequency)
Sets the power line frequency: 50 Hz, 60 Hz, or 0 to turn off anti-flicker. For full details and usag...
Definition: XnCppWrapper.h:2620
GeneralIntCapability GetWhiteBalanceCap()
Definition: XnCppWrapper.h:2806
XN_C_API XnBool XN_C_DECL xnIsViewPointAs(XnNodeHandle hInstance, XnNodeHandle hOther)
Checks if current view point is as if coming from the other node view point.
XN_C_API XnYUV422DoublePixel *XN_C_DECL xnGetYUV422ImageMap(XnNodeHandle hInstance)
Gets the current YUV422 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in YUV422 pixel format.
XnBool & IsDataNew()
Definition: XnCppWrapper.h:160
SkeletonCapability GetSkeletonCap()
Definition: XnCppWrapper.h:4895
#define XN_CAPABILITY_FOCUS
Definition: XnTypes.h:318
XN_C_API XnStatus XN_C_DECL xnStopGeneratingAll(XnContext *pContext)
Stop all generators from generating data.
XN_C_API XnBool XN_C_DECL xnIsMirrored(XnNodeHandle hInstance)
Gets current mirroring configuration.
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates an hands generator. For full details and usage, see xnCreateHandsGenerator ...
Definition: XnCppWrapper.h:6251
XN_C_API XnStatus XN_C_DECL xnGetUserCoM(XnNodeHandle hInstance, XnUserID user, XnPoint3D *pCoM)
Get the center of mass of a user.
XN_C_API XnStatus XN_C_DECL xnAddLicense(XnContext *pContext, const XnLicense *pLicense)
XN_C_API XnUInt32 XN_C_DECL xnGetSupportedUserPositionsCount(XnNodeHandle hInstance)
Gets the number of user positions supported by this generator.
XnStatus StartPoseDetection(const XnChar *strPose, XnUserID user)
Start detection of a specific pose for a specific user. For full details and usage, see xnStartPoseDetection
Definition: XnCppWrapper.h:4572
XnStatus RegisterToCroppingChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to cropping changes. For full details and usage, see xnRegisterToCroppi...
Definition: XnCppWrapper.h:2588
const void * GetAdditionalData() const
For full details and usage, see xnNodeInfoGetAdditionalData
Definition: XnCppWrapper.h:1232
Definition: XnTypes.h:568
MockIRGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3366
const XnOutputMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:163
XnBool operator==(const NodeWrapper &other)
Definition: XnCppWrapper.h:1034
XN_C_API XnStatus xnContextRunXmlScriptFromFile(XnContext *pContext, const XnChar *strFileName, XnEnumerationErrors *pErrors)
Runs an XML script in the given context. NOTE: when using this function, the context will be the owne...
XnStatus StartGeneratingAll()
Make sure all generators are generating data. For full details and usage, see xnStartGeneratingAll ...
Definition: XnCppWrapper.h:5828
HandsGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3853
AudioGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:5048
XnStatus SetMirror(XnBool bMirror)
Sets current mirror configuration. For full details and usage, see xnSetMirror
Definition: XnCppWrapper.h:2007
XN_C_API XnRGB24Pixel *XN_C_DECL xnGetRGB24ImageMap(XnNodeHandle hInstance)
Gets the current RGB24 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in RGB24 pixel format.
XN_C_API void XN_C_DECL xnUnregisterHandCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from hands callbacks.
XN_C_API XnStatus XN_C_DECL xnSetPlayerRepeat(XnNodeHandle hPlayer, XnBool bRepeat)
Determines whether the player will automatically rewind to the beginning of the recording when reachi...
void SetHandle(XnContext *pContext)
Replaces the underlying C object pointed to by this object.
Definition: XnCppWrapper.h:5923
Definition: XnTypes.h:465
XnStatus SetSupportedMinUserPositions(const XnUInt32 nCount)
For full details and usage, see xnNodeQuerySetSupportedMinUserPositions
Definition: XnCppWrapper.h:1332
MockAudioGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:5132
void(* HandCreate)(HandsGenerator &generator, XnUserID user, const XnPoint3D *pPosition, XnFloat fTime, void *pCookie)
Definition: XnCppWrapper.h:3870
XnStatus Create(Context &context, XnCodecID codecID, ProductionNode &initializerNode)
For full details and usage, see xnCreateCodec
Definition: XnCppWrapper.h:6307
XN_C_API XnStatus XN_C_DECL xnConvertProjectiveToRealWorld(XnNodeHandle hInstance, XnUInt32 nCount, const XnPoint3D *aProjective, XnPoint3D *aRealWorld)
Converts a list of points from projective coordinates to real world coordinates.
const xn::Grayscale8Map & Grayscale8Map() const
Gets a light object wrapping the image-map.
Definition: XnCppWrapper.h:727
const void * GetData()
Gets the current data. For full details and usage, see xnGetData
Definition: XnCppWrapper.h:2251
XN_C_API XnStatus XN_C_DECL xnRegisterToGlobalErrorStateChange(XnContext *pContext, XnErrorStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to global error state changes.
XnStatus GetNumFrames(const XnChar *strNodeName, XnUInt32 &nFrames) const
Retrieves the number of frames of a specific node played by a player. For full details and usage...
Definition: XnCppWrapper.h:2486
XN_C_API XnStatus XN_C_DECL xnSetCropping(XnNodeHandle hInstance, const XnCropping *pCropping)
Sets the cropping.
XN_C_API void XN_C_DECL xnContextUnregisterFromShutdown(XnContext *pContext, XnCallbackHandle hCallback)
Unregisters from context shutting down event. This function is used for backwards compatibility and s...
XN_C_API XnStatus XN_C_DECL xnRegisterToWaveOutputModeChanges(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
const XnLabel * Data() const
Definition: XnCppWrapper.h:936
XN_C_API XnStatus XN_C_DECL xnRegisterToNodeErrorStateChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to error state changes.
XnStatus GetDeviceName(XnChar *strBuffer, XnUInt32 nBufferSize)
For full details and usage, see xnGetDeviceName
Definition: XnCppWrapper.h:1936
XN_C_API const XnProductionNodeDescription *XN_C_DECL xnEnumerationErrorsGetCurrentDescription(XnEnumerationErrorsIterator it)
XnBool IsCalibrated(XnUserID user) const
Check if skeleton is being calibrated. For full details and usage, see xnIsSkeletonCalibrated ...
Definition: XnCppWrapper.h:4141
XN_C_API const XnChar *XN_C_DECL xnGetPlayerSupportedFormat(XnNodeHandle hPlayer)
Gets the name of the format supported by a player.
XnNodeQuery * GetUnderlyingObject()
Definition: XnCppWrapper.h:1279
XN_C_API XnStatus XN_C_DECL xnSetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, const XnBoundingBox3D *pPosition)
Sets the current user position.
XN_C_API void XN_C_DECL xnGetIRMetaData(XnNodeHandle hInstance, XnIRMetaData *pMetaData)
Gets the current IR-map meta data.
XnUInt32 & XOffset()
Definition: XnCppWrapper.h:289
XnUInt32 XnStatus
Definition: XnStatus.h:34
XN_C_API XnBool XN_C_DECL xnIsNewDataAvailable(XnNodeHandle hInstance, XnUInt64 *pnTimestamp)
Checks whether this node has new data (and so a call to xnWaitAndUpdateData() will not block)...
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates a depth generator. For full details and usage, see xnCreateDepthGenerator ...
Definition: XnCppWrapper.h:6145
XnUInt64 Timestamp() const
Definition: XnCppWrapper.h:143
XN_C_API XnStatus XN_C_DECL xnRegisterToJointConfigurationChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Register to joint configuration changes - when joints are activated and deactivated.
Definition: XnCppWrapper.h:4795
void UnregisterFromValueChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToGeneralIntValueChange(). For full details and usage, see xnUnregisterFromGeneralIntValueChange
Definition: XnCppWrapper.h:6430
void UnregisterFromUserExit(XnCallbackHandle hCallback)
Unregister from when a user exits the scene. For full details and usage, see xnUnregisterFromUserExit...
Definition: XnCppWrapper.h:4947
XN_C_API XnBool XN_C_DECL xnNodeInfoListIsEmpty(XnNodeInfoList *pList)
XnStatus StartTracking(const XnPoint3D &ptPosition)
Start tracking at a specific position. For full details and usage, see xnStartTracking ...
Definition: XnCppWrapper.h:3946
xn::ImageMap & WritableImageMap()
Gets a light object wrapping the writable image-map.
Definition: XnCppWrapper.h:719
XnPixelFormat & PixelFormatImpl()
Definition: XnCppWrapper.h:391
XN_C_API XnStatus XN_C_DECL xnRemoveNodeFromRecording(XnNodeHandle hRecorder, XnNodeHandle hNode)
Removes node from recording and stop recording it. This function can be called on a node that was add...
XN_C_API XnBool XN_C_DECL xnNodeInfoListIteratorIsValid(XnNodeInfoListIterator it)
void(* GestureIntermediateStageCompleted)(GestureGenerator &generator, const XnChar *strGesture, const XnPoint3D *pPosition, void *pCookie)
Definition: XnCppWrapper.h:3577
XN_C_API XnStatus XN_C_DECL xnAbortSkeletonCalibration(XnNodeHandle hInstance, XnUserID user)
stop calibration
XnStatus RegisterToValueChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to values changes. For full details and usage, see xnRegisterToGeneralI...
Definition: XnCppWrapper.h:6411
XnUInt32XYPair Res
Definition: XnTypes.h:1042
const xn::RGB24Map & RGB24Map() const
Gets a light object wrapping the image-map.
Definition: XnCppWrapper.h:722
PoseDetectionCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:4533
XnStatus GetProductionNodeInfoByName(const XnChar *strInstanceName, NodeInfo &nodeInfo) const
For full details and usage, see xnGetNodeHandleByName
Definition: XnCppWrapper.h:5810
XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationDataFromFile(XnNodeHandle hInstance, XnUserID user, const XnChar *strFileName)
Load previously saved calibration data from file.
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAppend(XnNodeInfoList *pList, XnNodeInfoList *pOther)
Definition: XnTypes.h:495
FrameSyncCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2114
void InitFrom(const AudioMetaData &other)
Definition: XnCppWrapper.h:852
XN_C_API void XN_C_DECL xnOSFreeAligned(const void *pMemBlock)
const XnDepthPixel * GetDepthMap() const
Gets the current depth-map. This map is updated after a call to xnWaitAndUpdateData(). For full details and usage, see xnGetDepthMap
Definition: XnCppWrapper.h:3009
Definition: XnCppWrapper.h:579
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6298
UserPositionCapability GetUserPositionCap()
Definition: XnCppWrapper.h:3077
XnStatus Create(Context &context, const XnChar *strFormatName)
Creates a player. For full details and usage, see xnCreatePlayer
Definition: XnCppWrapper.h:6136
XnMapMetaData * pMap
Definition: XnTypes.h:1074
XnStatus RegisterToPowerLineFrequencyChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to power line frequency changes. For full details and usage...
Definition: XnCppWrapper.h:2636
void(* UserHandler)(UserGenerator &generator, XnUserID user, void *pCookie)
Definition: XnCppWrapper.h:4811
StateChangedCallbackTranslator(StateChangedHandler handler, void *pCookie)
Definition: XnCppWrapper.h:6340
MirrorCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2002
XnUInt32 GetSupportedMapOutputModesCount() const
Gets the number of supported modes. This is useful for allocating an array that will be passed to xnG...
Definition: XnCppWrapper.h:2668
XnStatus GetGeneralProperty(const XnChar *strName, XnUInt32 nBufferSize, void *pBuffer) const
Gets a buffer property. For full details and usage, see xnGetGeneralProperty
Definition: XnCppWrapper.h:1848
XnUInt32XYPair FullRes
Definition: XnTypes.h:1048
XN_C_API void XN_C_DECL xnEnumerationErrorsFree(const XnEnumerationErrors *pErrors)
const XnIRPixel * GetIRMap() const
Gets the current IR-map. This map is updated after a call to xnWaitAndUpdateData(). For full details and usage, see xnGetIRMap
Definition: XnCppWrapper.h:3347
XnStatus RegisterToPixelFormatChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to pixel format changes. For full details and usage, see xnRegisterToPixelFormatChange
Definition: XnCppWrapper.h:3240
#define XN_CAPABILITY_LOW_LIGHT_COMPENSATION
Definition: XnTypes.h:319
XnStatus LockedNodeStartChanges(XnLockHandle hLock)
Start changes request on a locked node, without releasing that lock. For full details and usage...
Definition: XnCppWrapper.h:1872
~NodeWrapper()
Definition: XnCppWrapper.h:1019
NodeInfo operator*()
Gets the NodeInfo object pointed by the iterator.
Definition: XnCppWrapper.h:1444
XN_C_API XnStatus XN_C_DECL xnNodeQueryFilterList(XnContext *pContext, const XnNodeQuery *pQuery, XnNodeInfoList *pList)
const XnChar * GetInstanceName() const
For full details and usage, see xnNodeInfoGetInstanceName()
Definition: XnCppWrapper.h:1203
XN_C_API void XN_C_DECL xnUnregisterFromGestureChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from when gestures are added or removed.
XN_C_API XnStatus XN_C_DECL xnRegisterToDepthFieldOfViewChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to field of view changes.
Definition: XnTypes.h:579
UserGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:4803
XN_C_API XnStatus XN_C_DECL xnGetIntProperty(XnNodeHandle hInstance, const XnChar *strName, XnUInt64 *pnValue)
Gets an integer property.
Iterator operator--(int)
Definition: XnCppWrapper.h:1436
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates an image generator. For full details and usage, see xnCreateImageGenerator ...
Definition: XnCppWrapper.h:6174
XnStatus SetIntProperty(const XnChar *strName, XnUInt64 nValue)
Sets an integer property. For full details and usage, see xnSetIntProperty
Definition: XnCppWrapper.h:1792
const XnChar * GetName() const
Gets the instance name of a node by its handle. For full details and usage, see xnGetNodeName() ...
Definition: XnCppWrapper.h:1055
XN_C_API XnStatus XN_C_DECL xnGetSupportedMapOutputModes(XnNodeHandle hInstance, XnMapOutputMode *aModes, XnUInt32 *pnCount)
Gets a list of all supported modes. The size of the array that should be passed can be obtained by ca...
XN_C_API XnStatus XN_C_DECL xnRegisterToPoseDetectionInProgress(XnNodeHandle hInstance, XnPoseDetectionInProgress handler, void *pCookie, XnCallbackHandle *phCallback)
Register to callback for status when pose is detected.
XnUInt32 & FrameID()
Definition: XnCppWrapper.h:150
XN_C_API XnBool XN_C_DECL xnIsFrameSyncedWith(XnNodeHandle hInstance, XnNodeHandle hOther)
Checks if current view point is as if coming from the other node view point.
XnStatus GetUserPosition(XnUInt32 nIndex, XnBoundingBox3D &Position) const
Gets the current user position. For full details and usage, see xnGetUserPosition ...
Definition: XnCppWrapper.h:2956
XnStatus LoadCalibrationData(XnUserID user, XnUInt32 nSlot)
Load previously saved calibration data. For full details and usage, see xnLoadSkeletonCalibrationData...
Definition: XnCppWrapper.h:4198
XN_C_API XnStatus XN_C_DECL xnStopGenerating(XnNodeHandle hInstance)
Stops generation of the output.
XN_C_API XnStatus XN_C_DECL xnNodeInfoSetInstanceName(XnNodeInfo *pNodeInfo, const XnChar *strInstanceName)
Definition: XnCppWrapper.h:3722
XN_C_API XnPixelFormat XN_C_DECL xnGetPixelFormat(XnNodeHandle hInstance)
Gets current pixel format.
XnStatus GetUsers(XnUserID aUsers[], XnUInt16 &nUsers) const
Get the current users. For full details and usage, see xnGetUsers
Definition: XnCppWrapper.h:4824
Definition: XnTypes.h:1058
XnUInt16 XnDepthPixel
Definition: XnTypes.h:255
XnStatus GetUserPixels(XnUserID user, SceneMetaData &smd) const
Get the pixels that belong to a user. For full details and usage, see xnGetUserPixels ...
Definition: XnCppWrapper.h:4840
XnStatus Register(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
Definition: XnCppWrapper.h:6342
XN_C_API void XN_C_DECL xnUnregisterGestureCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from gesture callbacks.
XN_C_API XnStatus XN_C_DECL xnContextAddRef(XnContext *pContext)
Adds a reference to the context object.
Definition: XnCppWrapper.h:3845
#define XN_VALIDATE_ALLOC(x, y)
Definition: XnOS.h:135
XnInt32 Get()
Gets the current value of this capability. For full details and usage, see xnGetGeneralIntValue ...
Definition: XnCppWrapper.h:1711
XnStatus CreateCodec(XnCodecID codecID, ProductionNode &initializerNode, Codec &codec)
For full details and usage, see xnCreateCodec
Definition: XnCppWrapper.h:5611
XnUInt32 GetFrameID() const
Gets the frame ID of current data. For full details and usage, see xnGetFrameID
Definition: XnCppWrapper.h:2275
XN_C_API XnStatus XN_C_DECL xnGetSerialNumber(XnNodeHandle hInstance, XnChar *strBuffer, XnUInt32 *pnBufferSize)
XnBool IsNewDataAvailable(XnUInt64 *pnTimestamp=NULL) const
Checks whether this node has new data (and so a call to xnWaitAndUpdateData() will not block)...
Definition: XnCppWrapper.h:2227
XnStatus GetDestination(XnRecordMedium &destType, XnChar *strDest, XnUInt32 nBufSize)
Definition: XnCppWrapper.h:2369
XnStatus GetSkeletonJointPosition(XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition &Joint) const
Get a specific joint's position. For full details and usage, see xnGetSkeletonJointPosition ...
Definition: XnCppWrapper.h:4117
XN_C_API XnBool XN_C_DECL xnIsPixelFormatSupported(XnNodeHandle hInstance, XnPixelFormat Format)
Checks if a specific pixel format is supported.
Definition: XnCppWrapper.h:3087
XN_C_API XnStatus XN_C_DECL xnAutoEnumerateOverSingleInput(XnContext *pContext, XnNodeInfoList *pList, XnProductionNodeDescription *pDescription, const XnChar *strCreationInfo, XnProductionNodeType InputType, XnEnumerationErrors *pErrors, XnNodeQuery *pQuery)
EnumerationErrors(XnEnumerationErrors *pErrors, XnBool bOwn=FALSE)
Definition: XnCppWrapper.h:5294
XN_C_API void XN_C_DECL xnUnregisterFromDepthFieldOfViewChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToDepthFieldOfViewChange.
XN_C_API XnCodecID XN_C_DECL xnGetCodecID(XnNodeHandle hCodec)
XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8 *pAudioBuffer)
For full details and usage, see xnMockAudioSetData
Definition: XnCppWrapper.h:5154
XN_C_API XnStatus XN_C_DECL xnUnlockNodeForChanges(XnNodeHandle hInstance, XnLockHandle hLock)
Unlocks a previously locked node.
XnStatus CreateBasedOn(DepthGenerator &other, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6163
XN_C_API XnStatus XN_C_DECL xnSetMirror(XnNodeHandle hInstance, XnBool bMirror)
Sets current mirror configuration.
XnInt32 XnProductionNodeType
Definition: XnTypes.h:92
XnStatus SetPixelFormat(XnPixelFormat Format)
Sets the pixel format of the image map. For full details and usage, see xnSetPixelFormat ...
Definition: XnCppWrapper.h:3224
XnStatus GetSource(XnRecordMedium &sourceType, XnChar *strSource, XnUInt32 nBufSize) const
Gets the player's source, i.e where the played events come from. For full details and usage...
Definition: XnCppWrapper.h:2438
XnStatus ConvertRealWorldToProjective(XnUInt32 nCount, const XnPoint3D aRealWorld[], XnPoint3D aProjective[]) const
Converts a list of points from projective coordinates to real world coordinates. For full details and...
Definition: XnCppWrapper.h:3057
AntiFlickerCapability GetAntiFlickerCap()
Definition: XnCppWrapper.h:2916
XnStatus CreateProductionTree(NodeInfo &Tree, ProductionNode &node)
Creates a production node. If the tree specifies additional needed nodes, and those nodes do not exis...
Definition: XnCppWrapper.h:5734
XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointOrientation(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation *pJoint)
Get a specific joint's orientation.
XN_C_API XnStatus XN_C_DECL xnSetMapOutputMode(XnNodeHandle hInstance, const XnMapOutputMode *pOutputMode)
Sets the output mode.
XN_C_API void XN_C_DECL xnUnregisterFromUserExit(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from when a user exits the scene.
XN_C_API XnStatus XN_C_DECL xnRegisterToEndOfFileReached(XnNodeHandle hPlayer, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to be called when end-of-file is reached.
XN_C_API XnStatus XN_C_DECL xnClearSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot)
Clear the requested slot from any saved calibration data.
XN_C_API XnBool XN_C_DECL xnIsCapabilitySupported(XnNodeHandle hInstance, const XnChar *strCapabilityName)
Checks if a production node supports specific capability.
XN_C_API void XN_C_DECL xnGetAudioMetaData(XnNodeHandle hInstance, XnAudioMetaData *pMetaData)
Gets the current audio meta data.
MockAudioGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:5133
XN_C_API XnStatus XN_C_DECL xnRegisterToPowerLineFrequencyChange(XnNodeHandle hGenerator, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to power line frequency changes.
XnBool IsCapabilitySupported(const XnChar *strCapabilityName) const
Checks if a production node supports specific capability. For full details and usage, see xnIsCapabilitySupported
Definition: XnCppWrapper.h:1784
MockImageGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3267
XN_C_API XnIRPixel *XN_C_DECL xnGetIRMap(XnNodeHandle hInstance)
Gets the current IR-map. This map is updated after a call to xnWaitAndUpdateData().
Recorder(const NodeWrapper &other)
Definition: XnCppWrapper.h:2354
XnStatus WaitAndUpdateData()
Updates the data to the latest available one. If needed, the call will block until new data is availa...
Definition: XnCppWrapper.h:2235
GeneralIntCapability(XnNodeHandle hNode, const XnChar *strCap)
Definition: XnCppWrapper.h:1697
Definition: XnTypes.h:444
struct XnInternalNodeData * XnNodeHandle
Definition: XnTypes.h:82
XnStatus RegisterToGestureChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Register to when gestures are added or removed. For full details and usage, see xnRegisterToGestureCh...
Definition: XnCppWrapper.h:3556
XnLabel * WritableData()
Definition: XnCppWrapper.h:940
void UnregisterFromEndOfFileReached(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToEndOfFileReached(). For full details and usage, see xnUnregisterFromEndOfFileReached
Definition: XnCppWrapper.h:2532
XN_C_API XnStatus XN_C_DECL xnMockRawSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void *pData)
XnPixelFormat PixelFormat
Definition: XnTypes.h:1051
void UnregisterFromHandTouchingFOVEdge(XnCallbackHandle hCallback)
Unregister from hand approaching the edge of the FOV. For full details and usage, see xnUnregisterFro...
Definition: XnCppWrapper.h:3816
XnUInt32 GetBytesPerPixel() const
Gets the number of bytes per pixel for this map generator. For full details and usage, see xnGetBytesPerPixel
Definition: XnCppWrapper.h:2700
XN_C_API XnUInt8 *XN_C_DECL xnGetImageMap(XnNodeHandle hInstance)
Gets the current image-map as a byte buffer.
XnUInt16 BitsPerSample() const
Gets the number of bits per channel in a sample.
Definition: XnCppWrapper.h:868
Definition: XnCppWrapper.h:5124
void UnregisterFromCalibrationInProgress(XnCallbackHandle hCallback)
Unregister from calibration status while in progress. For full details and usage, see xnUnregisterFro...
Definition: XnCppWrapper.h:4393
Definition: XnCppWrapper.h:1632
Capability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1640
XN_C_API XnBool XN_C_DECL xnIsProfileAvailable(XnNodeHandle hInstance, XnSkeletonProfile eProfile)
Check if generator supports a specific profile.
XnStatus RegisterToErrorStateChange(XnErrorStateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to global error state changes. For full details and usage...
Definition: XnCppWrapper.h:5868
XN_C_API XnStatus XN_C_DECL xnEnumerateActiveJoints(XnNodeHandle hInstance, XnSkeletonJoint *pJoints, XnUInt16 *pnJoints)
Get all active joints.
XN_C_API XnStatus XN_C_DECL xnCreateImageGenerator(XnContext *pContext, XnNodeHandle *phImageGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates an image generator.
IRGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3328
NodeInfo & operator=(const NodeInfo &other)
Definition: XnCppWrapper.h:1172
XnNodeInfoList * GetUnderlyingObject() const
Gets the underlying C object.
Definition: XnCppWrapper.h:1497
XnUInt8 nChannels
Definition: XnTypes.h:438
Definition: XnTypes.h:1071
#define XN_VALIDATE_NEW(ptr, type)
Definition: XnOS.h:203
MockDepthGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3096
XnUInt8 nMinor
Definition: XnTypes.h:154
XN_C_API XnBool XN_C_DECL xnIsPlayerAtEOF(XnNodeHandle hPlayer)
Checks whether the player is at the end-of-file marker.
XnStatus AddNodeToRecording(ProductionNode &Node, XnCodecID compression=XN_CODEC_NULL)
Adds a node to recording and start recording it. This function must be called on each node that is to...
Definition: XnCppWrapper.h:2377
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates a device node. For full details and usage, see xnCreateDevice
Definition: XnCppWrapper.h:6118
XnStatus RegisterToFieldOfViewChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to field of view changes. For full details and usage, see xnRegisterToDepthFieldOfViewChange
Definition: XnCppWrapper.h:3033
XnUInt32 & SampleRate()
Gets the rate in which audio is sampled.
Definition: XnCppWrapper.h:865
OutputMetaData(const XnUInt8 **ppData)
Definition: XnCppWrapper.h:132
XnStatus RunXmlScript(const XnChar *strScript, EnumerationErrors *pErrors=NULL)
Runs an XML script in the given context. NOTE: when using this function, the context will be the owne...
Definition: XnCppWrapper.h:5457
Definition: XnCppWrapper.h:5246
XnBool operator==(const Iterator &other) const
Definition: XnCppWrapper.h:1388
XN_C_API void XN_C_DECL xnOSMemCopy(void *pDest, const void *pSource, XnSizeT nCount)
MockRawGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:5186
XnStatus CreateMockNodeBasedOn(ProductionNode &originalNode, const XnChar *strName, ProductionNode &mockNode)
Creates a production node which is only a mock, base on the type and properties of another node...
Definition: XnCppWrapper.h:5595
struct XnYUV422DoublePixel XnYUV422DoublePixel
XN_C_API XnStatus XN_C_DECL xnConvertRealWorldToProjective(XnNodeHandle hInstance, XnUInt32 nCount, const XnPoint3D *aRealWorld, XnPoint3D *aProjective)
Converts a list of points from projective coordinates to real world coordinates.
XnUInt8 * WritableData()
Definition: XnCppWrapper.h:686
XnUInt32 GetSupportedUserPositionsCount() const
Gets the number of user positions supported by this generator. For full details and usage...
Definition: XnCppWrapper.h:2940
bool operator>(const Version &other) const
Definition: XnCppWrapper.h:104
XN_C_API XnStatus XN_C_DECL xnGetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium *pSourceType, XnChar *strSource, XnUInt32 nBufSize)
Gets the player's source, i.e where the played events come from.
XnStatus SeekToTimeStamp(XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
Seeks the player to a specific timestamp, so that playing will continue from that point onwards...
Definition: XnCppWrapper.h:2454
XN_C_API void XN_C_DECL xnUnregisterFromUserPositionChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToUserPositionChange.
#define TRUE
Definition: XnPlatform.h:86
XnContext * GetUnderlyingObject() const
Gets the underlying C object.
Definition: XnCppWrapper.h:5437
XN_C_API XnStatus XN_C_DECL xnNodeInfoListRemove(XnNodeInfoList *pList, XnNodeInfoListIterator it)
XN_C_API XnEnumerationErrorsIterator XN_C_DECL xnEnumerationErrorsGetNext(XnEnumerationErrorsIterator it)
Iterator End() const
Gets an iterator representing the end of the list. This iterator does not point to an actual item...
Definition: XnCppWrapper.h:5358
XnStatus RegisterToCalibrationComplete(CalibrationComplete handler, void *pCookie, XnCallbackHandle &hCallback)
Register to when calibration is complete, with status. For full details and usage, see xnRegisterToCalibrationComplete
Definition: XnCppWrapper.h:4412
XN_C_API XnNodeInfo *XN_C_DECL xnNodeInfoListGetCurrent(XnNodeInfoListIterator it)
XN_C_API XnStatus XN_C_DECL xnNodeQuerySetSupportedMinUserPositions(XnNodeQuery *pQuery, const XnUInt32 nCount)
struct XnNodeInfoList XnNodeInfoList
Definition: XnTypes.h:187
XnBool IsGenerating() const
Checks if this node is currently generating. For full details and usage, see xnIsGenerating ...
Definition: XnCppWrapper.h:2179
#define XN_CAPABILITY_HUE
Definition: XnTypes.h:305
XN_C_API XnStatus XN_C_DECL xnCreateDevice(XnContext *pContext, XnNodeHandle *phDevice, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates a device node.
XnStatus RegisterToCalibrationStart(CalibrationStart handler, void *pCookie, XnCallbackHandle &hCallback)
Register to calibration start callback. For full details and usage, see xnRegisterToCalibrationStart ...
Definition: XnCppWrapper.h:4329
const XnIRPixel *& Data()
Definition: XnCppWrapper.h:809
XN_C_API void XN_C_DECL xnGetSceneMetaData(XnNodeHandle hInstance, XnSceneMetaData *pMetaData)
Gets the current scene meta data.
XN_C_API XnStatus XN_C_DECL xnContextRunXmlScript(XnContext *pContext, const XnChar *xmlScript, XnEnumerationErrors *pErrors)
Runs an XML script in the given context. NOTE: when using this function, the context will be the owne...
XnUInt32 nFPS
Definition: XnTypes.h:1054
XN_C_API const XnChar *XN_C_DECL xnResolutionGetName(XnResolution resolution)
XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetLast(XnNodeInfoList *pList)
XnCodecID GetCodecID() const
For full details and usage, see xnGetCodecID
Definition: XnCppWrapper.h:5220
XnStatus RegisterToPoseDetected(PoseDetection handler, void *pCookie, XnCallbackHandle &hCallback)
Register to callback when a user is in pose. For full details and usage, see xnRegisterToPoseDetected...
Definition: XnCppWrapper.h:4629
XN_C_API XnStatus XN_C_DECL xnGetActiveGestures(XnNodeHandle hInstance, XnChar **pstrGestures, XnUInt16 *nGestures)
Get the names of the gestures that are currently active.
GeneralIntCapability GetPanCap()
Definition: XnCppWrapper.h:2836
XnStatus SetDestination(XnRecordMedium destType, const XnChar *strDest)
Tells the recorder where to record. For full details and usage, see xnSetRecorderDestination ...
Definition: XnCppWrapper.h:2364
XN_C_API XnStatus XN_C_DECL xnRegisterToPixelFormatChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to pixel format changes.
XnSceneMetaData * GetUnderlying()
Definition: XnCppWrapper.h:973
const XnIRPixel * Data() const
Definition: XnCppWrapper.h:807
XnStatus EnumerateLicenses(XnLicense *&aLicenses, XnUInt32 &nCount) const
For full details and usage, see xnEnumerateLicenses
Definition: XnCppWrapper.h:5666
ImageGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3157
~NodeInfoList()
Dtor.
Definition: XnCppWrapper.h:1491
XN_C_API XnStatus XN_C_DECL xnCopyAudioMetaData(XnAudioMetaData *pDestination, const XnAudioMetaData *pSource)
Shallow-Copies an Audio Meta Data object. Note that the data buffer is not copied, and that both object will point to the same buffer.
xn::LabelMap & WritableLabelMap()
Gets a light object wrapping the writable label map.
Definition: XnCppWrapper.h:945
XnStatus GetSupportedWaveOutputModes(XnWaveOutputMode *aSupportedModes, XnUInt32 &nCount) const
For full details and usage, see xnGetSupportedWaveOutputModes
Definition: XnCppWrapper.h:5082
void UnregisterFromViewPointChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToViewPointChange(). For full details and usage, see xnUnregisterFromViewPointChange
Definition: XnCppWrapper.h:2095
XnGrayscale16Pixel * WritableGrayscale16Data()
Definition: XnCppWrapper.h:714
void InitFrom(const IRMetaData &other)
Definition: XnCppWrapper.h:779
XnStatus RegisterToCalibrationInProgress(CalibrationInProgress handler, void *pCookie, XnCallbackHandle &hCallback)
Register to calibration status while calibration is in progress. For full details and usage...
Definition: XnCppWrapper.h:4369
XN_C_API void XN_C_DECL xnUnregisterFromEndOfFileReached(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToEndOfFileReached().
XnStatus Clear()
For full details and usage, see xnNodeInfoListClear
Definition: XnCppWrapper.h:1583
XnPowerLineFrequency GetPowerLineFrequency()
Gets the power line frequency. For full details and usage, see xnGetPowerLineFrequency ...
Definition: XnCppWrapper.h:2628
XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnDepthPixel *pExternalBuffer=NULL)
Definition: XnCppWrapper.h:511
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAdd(XnNodeInfoList *pList, const XnProductionNodeDescription *pDescription, const XnChar *strCreationInfo, XnNodeInfoList *pNeededNodes)
Definition: XnTypes.h:1102
HandTouchingFOVEdgeCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:3776
XN_C_API void XN_C_DECL xnOSFree(const void *pMemBlock)
void UnregisterFromUserPositionChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToUserPositionChange. For full details and usage, see xnUnregisterFromUserPositionChange
Definition: XnCppWrapper.h:2972
XN_C_API XnResolution XN_C_DECL xnResolutionGetFromXYRes(XnUInt32 xRes, XnUInt32 yRes)
XnStatus RegisterUserCallbacks(UserHandler NewUserCB, UserHandler LostUserCB, void *pCookie, XnCallbackHandle &hCallback)
Register to user callbacks. For full details and usage, see xnRegisterUserCallbacks ...
Definition: XnCppWrapper.h:4848
Player(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2411
Definition: XnCppWrapper.h:1137
XN_C_API XnStatus XN_C_DECL xnGetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium *pDestType, XnChar *strDest, XnUInt32 nBufSize)
Returns the recoder's destination.
XN_C_API XnStatus XN_C_DECL xnSeekPlayerToFrame(XnNodeHandle hPlayer, const XnChar *strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin)
Seeks the player to a specific frame of a specific played node, so that playing will continue from th...
Definition: XnTypes.h:411
XN_C_API XnStatus XN_C_DECL xnNodeQueryAllocate(XnNodeQuery **ppQuery)
DepthGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:2991
XnStatus GetCoM(XnUserID user, XnPoint3D &com) const
Get the center of mass of a user. For full details and usage, see xnGetUserCoM
Definition: XnCppWrapper.h:4832
GeneralIntCapability GetZoomCap()
Definition: XnCppWrapper.h:2866
XN_C_API XnEnumerationErrorsIterator XN_C_DECL xnEnumerationErrorsGetFirst(const XnEnumerationErrors *pErrors)
XN_C_API XnStatus XN_C_DECL xnSetViewPoint(XnNodeHandle hInstance, XnNodeHandle hOther)
Sets the view point of this generator to look like as if placed at another generator location...
XN_C_API XnStatus XN_C_DECL xnCreateRecorder(XnContext *pContext, const XnChar *strFormatName, XnNodeHandle *phRecorder)
Creates a recorder.
const XnDepthMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:561
XnUInt16 XnLabel
Definition: XnTypes.h:287
XnBool IsGestureAvailable(const XnChar *strGesture) const
Check if a specific gesture is available in this generator. For full details and usage, see xnIsGestureAvailable
Definition: XnCppWrapper.h:3484
void UnregisterFromNewDataAvailable(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToNewDataAvailable(). For full details and usage, see xnUnregisterFromNewDataAvailable
Definition: XnCppWrapper.h:2219
XN_C_API XnStatus XN_C_DECL xnStartPoseDetection(XnNodeHandle hInstance, const XnChar *strPose, XnUserID user)
Start detection of a specific pose for a specific user.
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddEx(XnNodeInfoList *pList, const XnProductionNodeDescription *pDescription, const XnChar *strCreationInfo, XnNodeInfoList *pNeededNodes, const void *pAdditionalData, XnFreeHandler pFreeHandler)
XnStatus LoadCalibrationDataFromFile(XnUserID user, const XnChar *strFileName)
Load previously saved calibration data from file. For full details and usage, see xnLoadSkeletonCalib...
Definition: XnCppWrapper.h:4182
XnStatus SetRealProperty(const XnChar *strName, XnDouble dValue)
Sets a real property. For full details and usage, see xnSetRealProperty
Definition: XnCppWrapper.h:1800
XnIRPixel * WritableData()
Definition: XnCppWrapper.h:811
XnBool IsEOF() const
Checks whether the player is at the end-of-file marker. For full details and usage, see xnIsPlayerAtEOF
Definition: XnCppWrapper.h:2516
XnStatus RemoveNeededNode(ProductionNode &needed)
Removes a needed node from the list of needed nodes. For full details and usage, see xnRemoveNeededNo...
Definition: XnCppWrapper.h:1771
XnStatus Add(XnProductionNodeDescription &description, const XnChar *strCreationInfo, NodeInfoList *pNeededNodes)
For full details and usage, see xnNodeInfoListAdd
Definition: XnCppWrapper.h:1515
Recorder(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2353
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates a Gesture Generator. For full details and usage, see xnCreateGestureGenerator ...
Definition: XnCppWrapper.h:6232
XnGrayscale16Pixel XnIRPixel
Definition: XnTypes.h:284
CroppingCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:2566
XnStatus RegisterToViewPointChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to view point changes. For full details and usage, see xnRegisterToView...
Definition: XnCppWrapper.h:2087
XN_C_API void XN_C_DECL xnUnregisterFromGlobalErrorStateChange(XnContext *pContext, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToGlobalErrorStateChange().
XnStatus FilterList(Context &context, Query &query)
For full details and usage, see xnNodeQueryFilterList
Definition: XnCppWrapper.h:6043
XnStatus AddRef()
References a production node, increasing its reference count by 1. For full details and usage...
Definition: XnCppWrapper.h:1060
Definition: XnCppWrapper.h:5039
XN_C_API XnStatus XN_C_DECL xnSetRealProperty(XnNodeHandle hInstance, const XnChar *strName, XnDouble dValue)
Sets a real property.
Definition: XnTypes.h:269
bool operator<=(const Version &other) const
Definition: XnCppWrapper.h:100
XnStatus AddEx(XnProductionNodeDescription &description, const XnChar *strCreationInfo, NodeInfoList *pNeededNodes, const void *pAdditionalData, XnFreeHandler pFreeHandler)
For full details and usage, see xnNodeInfoListAddEx
Definition: XnCppWrapper.h:1524
XN_C_API XnStatus XN_C_DECL xnCopyIRMetaData(XnIRMetaData *pDestination, const XnIRMetaData *pSource)
Shallow-Copies an IR Meta Data object. Note that the data buffer is not copied, and that both object ...
XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointPosition(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition *pJoint)
Get a specific joint's position.
void(* CalibrationStart)(SkeletonCapability &skeleton, XnUserID user, void *pCookie)
Definition: XnCppWrapper.h:4274
XnGrayscale8Pixel * WritableGrayscale8Data()
Definition: XnCppWrapper.h:707
XnStatus InitFromXmlFile(const XnChar *strFileName, ScriptNode &scriptNode, EnumerationErrors *pErrors=NULL)
Initializes OpenNI context, and then configures it using the given file. NOTE: when using this functi...
Definition: XnCppWrapper.h:5533
GeneralIntCapability GetGammaCap()
Definition: XnCppWrapper.h:2796
XN_C_API XnStatus XN_C_DECL xnRegisterToGenerationRunningChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to be called when generation starts or stops.
Iterator & operator++()
Definition: XnCppWrapper.h:5329
XN_C_API XnStatus XN_C_DECL xnEncodeData(XnNodeHandle hCodec, const void *pSrc, XnUInt32 nSrcSize, void *pDst, XnUInt32 nDstSize, XnUInt *pnBytesWritten)
XnStatus GetAvailablePoses(XnChar **pstrPoses, XnUInt32 &nPoses) const
Get the names of the supported poses. For full details and usage, see xnGetAvailablePoses ...
Definition: XnCppWrapper.h:4557
XnStatus SetUserPosition(XnUInt32 nIndex, const XnBoundingBox3D &Position)
Sets the current user position. For full details and usage, see xnSetUserPosition ...
Definition: XnCppWrapper.h:2948
XN_C_API XnStatus XN_C_DECL xnSetPixelFormat(XnNodeHandle hInstance, XnPixelFormat Format)
Sets the pixel format of the image map.
void TakeOwnership(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1108
XN_C_API XnStatus XN_C_DECL xnEnumerateAllGestures(XnNodeHandle hInstance, XnChar **pstrGestures, XnUInt32 nNameLength, XnUInt16 *nGestures)
Get the names of all gestures available.
XnStatus SetViewPoint(ProductionNode &otherNode)
Sets the view point of this generator to look like as if placed at another generator location...
Definition: XnCppWrapper.h:2063
XnPixelFormat PixelFormat() const
Definition: XnCppWrapper.h:312
XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnIRPixel *pIRMap)
For full details and usage, see xnMockIRSetData
Definition: XnCppWrapper.h:3386
Definition: XnTypes.h:109
XN_C_API XnStatus XN_C_DECL xnStopTracking(XnNodeHandle hInstance, XnUserID user)
Stop tracking a specific hand.
XN_C_API XnStatus XN_C_DECL xnSetSkeletonProfile(XnNodeHandle hInstance, XnSkeletonProfile eProfile)
Set the profile. this will set some joints to be active, and others to be inactive.
XnStatus CopyFrom(const ImageMetaData &other)
Definition: XnCppWrapper.h:649
ScriptNode(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:5254
XnPixelFormat GetPixelFormat() const
Gets current pixel format. For full details and usage, see xnGetPixelFormat
Definition: XnCppWrapper.h:3232
XN_C_API XnGrayscale8Pixel *XN_C_DECL xnGetGrayscale8ImageMap(XnNodeHandle hInstance)
Gets the current Grayscale8 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in Grayscale8 pixel format.
XnMapMetaData * pMap
Definition: XnTypes.h:1084
XN_C_API XnStatus XN_C_DECL xnCreateGestureGenerator(XnContext *pContext, XnNodeHandle *phGestureGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates a Gesture Generator.
XnStatus InitFromXmlFile(const XnChar *strFileName, EnumerationErrors *pErrors=NULL)
Initializes OpenNI context, and then configures it using the given file. NOTE: when using this functi...
Definition: XnCppWrapper.h:5513
HandsGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3854
PoseDetectionCapability GetPoseDetectionCap()
Definition: XnCppWrapper.h:4915
void(* PoseDetection)(PoseDetectionCapability &pose, const XnChar *strPose, XnUserID user, void *pCookie)
Definition: XnCppWrapper.h:4544
#define XN_CAPABILITY_GAIN
Definition: XnTypes.h:311
XnNodeInfoListNode * pCurrent
Definition: XnTypes.h:194
XN_C_API XnStatus XN_C_DECL xnRegisterToGestureChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Register to when gestures are added or removed.
XN_C_API XnStatus XN_C_DECL xnRegisterToHandTouchingFOVEdge(XnNodeHandle hInstance, XnHandTouchingFOVEdge handler, void *pCookie, XnCallbackHandle *phCallback)
Register to when a hand is approaching the edge of the FOV.
XN_C_API void XN_C_DECL xnUnregisterFromPoseDetectionInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from pose status callback.
XN_C_API XnStatus XN_C_DECL xnInit(XnContext **ppContext)
Initializes the OpenNI library.
XnUInt32 nFrameID
Definition: XnTypes.h:1025
const XnRGB24Pixel * GetRGB24ImageMap() const
Gets the current RGB24 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in RGB24 pixel format. For full details and usage, see xnGetRGB24ImageMap
Definition: XnCppWrapper.h:3176
XN_C_API XnStatus XN_C_DECL xnCreateAudioGenerator(XnContext *pContext, XnNodeHandle *phAudioGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates an audio generator.
Definition: XnCppWrapper.h:1255
XnUInt64 GetTimestamp() const
Gets the timestamp of current data, in microseconds. For full details and usage, see xnGetTimestamp ...
Definition: XnCppWrapper.h:2267
void Free()
Definition: XnCppWrapper.h:207
void UnregisterFromPixelFormatChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToPixelFormatChange. For full details and usage, see xnUnregisterFromPixelFormatChange
Definition: XnCppWrapper.h:3248
Definition: XnCppWrapper.h:3320
Definition: XnCppWrapper.h:5397
bool operator!=(const Version &other) const
Definition: XnCppWrapper.h:92
Definition: XnTypes.h:496
XnRGB24Pixel * WritableRGB24Data()
Definition: XnCppWrapper.h:693
void * XnCallbackHandle
Definition: XnTypes.h:247
bool operator>=(const Version &other) const
Definition: XnCppWrapper.h:108
Generator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2165
XnStatus RunXmlScriptFromFile(const XnChar *strFileName, ScriptNode &scriptNode, EnumerationErrors *pErrors=NULL)
Runs an XML script in the given context. NOTE: when using this function, the context will be the owne...
Definition: XnCppWrapper.h:5497
XnCalibrationStatus
Definition: XnTypes.h:652
XN_C_API void XN_C_DECL xnShutdown(XnContext *pContext)
Shuts down an OpenNI context, destroying all its nodes. Do not call any function of this context or a...
const XnSceneMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:971
Definition: XnTypes.h:456
~Query()
Dtor.
Definition: XnCppWrapper.h:1269
XnStatus SaveCalibrationDataToFile(XnUserID user, const XnChar *strFileName)
Save the calibration data to file. For full details and usage, see xnSaveSkeletonCalibrationDataToFil...
Definition: XnCppWrapper.h:4174
XnStatus SetData(const DepthMetaData &depthMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
Definition: XnCppWrapper.h:3129
Iterator End() const
Gets an iterator marking the end of the list. This iterator does not point to a valid item...
Definition: XnCppWrapper.h:1553
XnStatus StartGenerating()
Starts generation of the output. This will also cause all dependencies to start generating. For full details and usage, see xnStartGenerating
Definition: XnCppWrapper.h:2171
XN_C_API XnBool XN_C_DECL xnIsDataNew(XnNodeHandle hInstance)
Checks whether current data is new. Meaning, did the data change on the last call to xnWaitAndUpdateA...
NodeInfo(XnNodeInfo *pInfo)
Definition: XnCppWrapper.h:1145
Context & operator=(const Context &other)
Definition: XnCppWrapper.h:5430
XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrated(XnNodeHandle hInstance, XnUserID user)
Check if skeleton is being calibrated.
XN_C_API const XnProductionNodeDescription *XN_C_DECL xnNodeInfoGetDescription(XnNodeInfo *pNodeInfo)
XnStatus OpenFileRecording(const XnChar *strFileName)
Opens a recording file, adding all nodes in it to the context. NOTE: when using this function...
Definition: XnCppWrapper.h:5551
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates an scene analyzer. For full details and usage, see xnCreateSceneAnalyzer
Definition: XnCppWrapper.h:6241
XN_C_API XnStatus XN_C_DECL xnWaitAndUpdateData(XnNodeHandle hInstance)
Updates the data to the latest available one. If needed, the call will block until new data is availa...
XnStatus Init()
Initializes the OpenNI library. For full details and usage, see xnInit
Definition: XnCppWrapper.h:5442
XN_C_API XnStatus XN_C_DECL xnAddNodeToRecording(XnNodeHandle hRecorder, XnNodeHandle hNode, XnCodecID compression)
Adds a node to recording and start recording it. This function must be called on each node that is to...
XN_C_API void XN_C_DECL xnGetImageMetaData(XnNodeHandle hInstance, XnImageMetaData *pMetaData)
Gets the current image-map meta data.
Query(XnNodeQuery *pNodeQuery)
Definition: XnCppWrapper.h:1264
const XnRGB24Pixel *& RGB24Data()
Definition: XnCppWrapper.h:691
const XnYUV422DoublePixel * YUV422Data() const
Definition: XnCppWrapper.h:696
XnBool IsGestureProgressSupported(const XnChar *strGesture) const
Check if the specific gesture supports 'in progress' callbacks. For full details and usage...
Definition: XnCppWrapper.h:3492
DeviceIdentificationCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1930
XnDepthMetaData * GetUnderlying()
Definition: XnCppWrapper.h:563
XN_C_API XnStatus XN_C_DECL xnEnumeratePlayerNodes(XnNodeHandle hPlayer, XnNodeInfoList **ppList)
Retrieves a list of the nodes played by a player.
struct XnNodeQuery XnNodeQuery
Definition: XnTypes.h:197
XnUInt32 YOffset() const
Definition: XnCppWrapper.h:292
void(* GestureProgress)(GestureGenerator &generator, const XnChar *strGesture, const XnPoint3D *pPosition, XnFloat fProgress, void *pCookie)
Definition: XnCppWrapper.h:3516
#define XN_CAPABILITY_ROLL
Definition: XnTypes.h:314
NodeInfoList & GetNeededNodes() const
For full details and usage, see xnNodeInfoGetNeededNodes
Definition: XnCppWrapper.h:6053
XnStatus SetName(const XnChar *strName)
For full details and usage, see xnNodeQuerySetName()
Definition: XnCppWrapper.h:1292
const XnIRMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:819
XnStatus RunXmlScript(const XnChar *strScript, ScriptNode &scriptNode, EnumerationErrors *pErrors=NULL)
Runs an XML script in the given context. NOTE: when using this function, the context will be the owne...
Definition: XnCppWrapper.h:5469
Definition: XnCppWrapper.h:2041
static XnStatus UnregisterFromUnderlying(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback)
Definition: XnCppWrapper.h:6371
XnStatus GetAllActiveGestures(XnChar **astrGestures, XnUInt32 nNameLength, XnUInt16 &nGestures) const
Get the names of the gestures that are currently active. For full details and usage, see xnGetActiveGestures
Definition: XnCppWrapper.h:3461
XN_C_API XnStatus XN_C_DECL xnSeekPlayerToTimeStamp(XnNodeHandle hPlayer, XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
Seeks the player to a specific timestamp, so that playing will continue from that point onwards...
XnUInt32 XnCodecID
Definition: XnTypes.h:806
const XnLabel *& Data()
Definition: XnCppWrapper.h:938
XnDouble GetPlaybackSpeed() const
Gets the playback speed. see xnSetPlaybackSpeed() for more details. For full details and usage...
Definition: XnCppWrapper.h:2548
XnBool IsPixelFormatSupported(XnPixelFormat Format) const
Checks if a specific pixel format is supported. For full details and usage, see xnIsPixelFormatSuppor...
Definition: XnCppWrapper.h:3216
void UnregisterFromMapOutputModeChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToMapOutputModeChange. For full details and usage, see xnUnregisterFromMapOutputModeChange
Definition: XnCppWrapper.h:2716
struct XnNodeInfo XnNodeInfo
Definition: XnTypes.h:177
const XnGrayscale8Pixel * Grayscale8Data() const
Definition: XnCppWrapper.h:703
XN_C_API XnStatus XN_C_DECL xnRemoveNeededNode(XnNodeHandle hInstance, XnNodeHandle hNeededNode)
Removes a needed node from the list of needed nodes.
XN_C_API void XN_C_DECL xnUnregisterFromFrameSyncChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToFrameSyncChange().
XN_C_API XnStatus XN_C_DECL xnCreatePlayer(XnContext *pContext, const XnChar *strFormatName, XnNodeHandle *phPlayer)
Creates a player.
XnStatus SetCreationInfo(const XnChar *strCreationInfo)
For full details and usage, see xnNodeQuerySetCreationInfo
Definition: XnCppWrapper.h:1356
void UnregisterFromGestureReadyForNextIntermediateStageCallbacks(XnCallbackHandle hCallback)
Unregister from when a gesture is ready for its next stage. For full details and usage, see xnUnregisterFromGestureReadyForNextIntermediateStage
Definition: XnCppWrapper.h:3647
Definition: XnTypes.h:493
NodeWrapper & operator=(const NodeWrapper &other)
Definition: XnCppWrapper.h:1013
void(* CalibrationComplete)(SkeletonCapability &skeleton, XnUserID user, XnCalibrationStatus calibrationError, void *pCookie)
Definition: XnCppWrapper.h:4408
const ErrorStateCapability GetErrorStateCap() const
Definition: XnCppWrapper.h:1890
XN_C_API XnStatus XN_C_DECL xnEnumerateLicenses(XnContext *pContext, XnLicense **paLicenses, XnUInt32 *pnCount)
Definition: XnCppWrapper.h:3258
const XnGrayscale16Pixel *& Grayscale16Data()
Definition: XnCppWrapper.h:712
XnStatus SetVendor(const XnChar *strVendor)
For full details and usage, see xnNodeQuerySetVendor()
Definition: XnCppWrapper.h:1284
XN_C_API XnStatus XN_C_DECL xnStartSkeletonTracking(XnNodeHandle hInstance, XnUserID user)
Start tracking a skeleton.
XnStatus GetAllAvailablePoses(XnChar **pstrPoses, XnUInt32 nNameLength, XnUInt32 &nPoses) const
Get the names of the supported poses. For full details and usage, see xnGetAvailablePoses ...
Definition: XnCppWrapper.h:4564
XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationDataToFile(XnNodeHandle hInstance, XnUserID user, const XnChar *strFileName)
Save the calibration data to file.
XN_C_API XnStatus XN_C_DECL xnStartGenerating(XnNodeHandle hInstance)
Starts generation of the output. This will also cause all dependencies to start generating.
Definition: XnTypes.h:1036
XnStatus RegisterHandCallbacks(HandCreate CreateCB, HandUpdate UpdateCB, HandDestroy DestroyCB, void *pCookie, XnCallbackHandle &hCallback)
Register to hands callbacks. For full details and usage, see xnRegisterHandCallbacks ...
Definition: XnCppWrapper.h:3894
void UnregisterFromGestureIntermediateStageCompleted(XnCallbackHandle hCallback)
Unregister from when a gesture is in progress. For full details and usage, see xnUnregisterFromGestur...
Definition: XnCppWrapper.h:3604
XN_C_API XnStatus XN_C_DECL xnInitFromXmlFile(const XnChar *strFileName, XnContext **ppContext, XnEnumerationErrors *pErrors)
Initializes OpenNI context, and then configures it using the given file. NOTE: when using this functi...
ImageMetaData()
Ctor.
Definition: XnCppWrapper.h:583
XnBool IsJointAvailable(XnSkeletonJoint eJoint) const
Check if generator supports a specific joint. For full details and usage, see xnIsJointAvailable ...
Definition: XnCppWrapper.h:4036
XnStatus SetInstanceName(const XnChar *strName)
For full details and usage, see xnNodeInfoSetInstanceName
Definition: XnCppWrapper.h:1187
XN_C_API XnStatus XN_C_DECL xnGetRealProperty(XnNodeHandle hInstance, const XnChar *strName, XnDouble *pdValue)
Gets a real property.
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddNode(XnNodeInfoList *pList, XnNodeInfo *pNode)
XN_C_API XnStatus XN_C_DECL xnGetVendorSpecificData(XnNodeHandle hInstance, XnChar *strBuffer, XnUInt32 *pnBufferSize)
XN_C_API XnStatus XN_C_DECL xnGetCropping(XnNodeHandle hInstance, XnCropping *pCropping)
Gets current cropping configuration.
XN_C_API XnStatus XN_C_DECL xnEnumerateExistingNodesByType(XnContext *pContext, XnProductionNodeType type, XnNodeInfoList **ppList)
Gets a list of all existing node in the context. Each node that was returned increases its ref count...
void UnregisterFromMirrorChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToMirrorChange(). For full details and usage, see xnUnregisterFromMirrorChange
Definition: XnCppWrapper.h:2031
XnStatus RegisterToErrorStateChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to error state changes. For full details and usage, see xnRegisterToNod...
Definition: XnCppWrapper.h:1670
XN_C_API void XN_C_DECL xnUnregisterFromMirrorChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToMirrorChange().
Definition: XnTypes.h:202
xn::IRMap & WritableIRMap()
Gets a light object wrapping the writable IR map.
Definition: XnCppWrapper.h:816
const XnProductionNodeDescription & Description()
Gets the description of the failing node this iterator points to.
Definition: XnCppWrapper.h:5345
XN_C_API XnDouble XN_C_DECL xnGetPlaybackSpeed(XnNodeHandle hInstance)
Gets the playback speed. see xnSetPlaybackSpeed() for more details.
XN_C_API XnStatus XN_C_DECL xnCreateHandsGenerator(XnContext *pContext, XnNodeHandle *phHandsGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates an hands generator.
UserGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:4804
const XnGrayscale16Pixel * Grayscale16Data() const
Definition: XnCppWrapper.h:710
XN_C_API XnStatus XN_C_DECL xnFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther)
Activates frame sync with the other node.
static void FreeLicensesList(XnLicense aLicenses[])
For full details and usage, see xnFreeLicensesList
Definition: XnCppWrapper.h:5674
XN_C_API XnStatus XN_C_DECL xnWaitNoneUpdateAll(XnContext *pContext)
Updates all generator nodes in the context, without any waiting. If a node has new data...
XnStatus GetSerialNumber(XnChar *strBuffer, XnUInt32 nBufferSize)
For full details and usage, see xnGetSerialNumber
Definition: XnCppWrapper.h:1952
XN_C_API XnStatus XN_C_DECL xnSetPlayerSource(XnNodeHandle hPlayer, XnRecordMedium sourceType, const XnChar *strSource)
Sets the source for the player, i.e. where the played events will come from.
XnStatus AddNode(NodeInfo &info)
For full details and usage, see xnNodeInfoListAddNode
Definition: XnCppWrapper.h:1533
XnStatus CopyFrom(const SceneMetaData &other)
Definition: XnCppWrapper.h:921
XN_C_API XnBool XN_C_DECL xnIsSkeletonTracking(XnNodeHandle hInstance, XnUserID user)
Check if skeleton is being tracked.
XN_C_API XnStatus xnRegisterToOutOfPose(XnNodeHandle hInstance, XnPoseDetectionCallback handler, void *pCookie, XnCallbackHandle *phCallback)
Register to callback when a use is no longer in pose.
void UnregisterFromPoseCallbacks(XnCallbackHandle hCallback)
Unregister from calibration callbacks. For full details and usage, see xnUnregisterCalibrationCallbac...
Definition: XnCppWrapper.h:4616
XN_C_API XnStatus XN_C_DECL xnGetStringProperty(XnNodeHandle hInstance, const XnChar *strName, XnChar *csValue, XnUInt32 nBufSize)
Gets a string property.
XN_C_API XnStatus XN_C_DECL xnContextRegisterForShutdown(XnContext *pContext, XnContextShuttingDownHandler pHandler, void *pCookie, XnCallbackHandle *phCallback)
Registers for context shutting down event. This function is used for backwards compatibility and shou...
XnStatus CreateProductionTree(NodeInfo &Tree)
Creates a production node. If the tree specifies additional needed nodes, and those nodes do not exis...
Definition: XnCppWrapper.h:5718
XN_C_API const XnChar *XN_C_DECL xnNodeInfoGetInstanceName(XnNodeInfo *pNodeInfo)
Definition: XnCppWrapper.h:1744
XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnLabel *pExternalBuffer=NULL)
Definition: XnCppWrapper.h:930
void GetMetaData(IRMetaData &metaData) const
Gets the current IR-map meta data. For full details and usage, see xnGetIRMetaData ...
Definition: XnCppWrapper.h:3339
#define XN_NEW(type, arg)
Definition: XnOS.h:339
XN_C_API XnUInt32 XN_C_DECL xnResolutionGetXRes(XnResolution resolution)
XN_C_API void XN_C_DECL xnUnregisterFromHandTouchingFOVEdge(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from hand approaching the edge of the FOV.
Resolution(XnUInt32 xRes, XnUInt32 yRes)
Definition: XnCppWrapper.h:6005
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddNodeFromList(XnNodeInfoList *pList, XnNodeInfoListIterator otherListIt)
const UserPositionCapability GetUserPositionCap() const
Definition: XnCppWrapper.h:3067
XN_C_API void XN_C_DECL xnUnregisterFromCalibrationComplete(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from calibration complete with status.
XN_C_API XnStatus XN_C_DECL xnPlayerReadNext(XnNodeHandle hPlayer)
Reads the next data element from the player.
NodeInfo GetInfo() const
Gets information about a specific node, like its description, and dependent nodes. For full details and usage, see xnGetNodeInfo
Definition: XnCppWrapper.h:1758
XN_C_API XnStatus XN_C_DECL xnContextOpenFileRecordingEx(XnContext *pContext, const XnChar *strFileName, XnNodeHandle *phPlayerNode)
Opens a recording file, adding all nodes in it to the context.
XN_C_API void XN_C_DECL xnOSMemSet(void *pDest, XnUInt8 nValue, XnSizeT nCount)
Definition: XnCppWrapper.h:5984
XnStatus RegisterToJointConfigurationChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Register to joint configuration changes - when joints are activated and deactivated. For full details and usage, see xnRegisterToJointConfigurationChange
Definition: XnCppWrapper.h:4085
XN_C_API void XN_C_DECL xnUnregisterFromPixelFormatChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToPixelFormatChange.
FrameSyncCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:2113
XN_C_API void xnUnregisterFromPoseDetected(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from pose detected callback.
Definition: XnCppWrapper.h:76
XnUInt32 & XRes()
Definition: XnCppWrapper.h:279
Context()
Ctor.
Definition: XnCppWrapper.h:5401
Definition: XnCppWrapper.h:3149
SceneMetaData()
Ctor.
Definition: XnCppWrapper.h:894
NodeInfoList(XnNodeInfoList *pList)
Definition: XnCppWrapper.h:1488
EnumerationErrors()
Ctor.
Definition: XnCppWrapper.h:5286
XnDepthPixel & ZRes()
Definition: XnCppWrapper.h:519
void(* HandTouchingFOVEdge)(HandTouchingFOVEdgeCapability &touchingfov, XnUserID user, const XnPoint3D *pPosition, XnFloat fTime, XnDirection eDir, void *pCookie)
Definition: XnCppWrapper.h:3788
XN_C_API XnDepthPixel XN_C_DECL xnGetDeviceMaxDepth(XnNodeHandle hInstance)
Gets the maximum depth the device can produce.
XnStatus InitFrom(const IRMetaData &other, XnUInt32 nXRes, XnUInt32 nYRes, const XnIRPixel *pExternalBuffer)
Definition: XnCppWrapper.h:785
XnUInt32 SampleRate() const
Gets the rate in which audio is sampled.
Definition: XnCppWrapper.h:863
XnStatus WaitAndUpdateAll()
Updates all generators nodes in the context, waiting for all to have new data. For full details and u...
Definition: XnCppWrapper.h:5885
XnStatus SetSmoothing(XnFloat fSmoothingFactor)
Set the skeleton's smoothing factor. For full details and usage, see xnSetSkeletonSmoothing ...
Definition: XnCppWrapper.h:4262
const XnChar * GetSupportedFormat() const
Gets the name of the format supported by a player. For full details and usage, see xnGetPlayerSupport...
Definition: XnCppWrapper.h:2494
struct XnRGB24Pixel XnRGB24Pixel
XnStatus GetFieldOfView(XnFieldOfView &FOV) const
Gets the Field-Of-View of the depth generator, in radians. For full details and usage, see xnGetDepthFieldOfView
Definition: XnCppWrapper.h:3025
const xn::LabelMap & LabelMap() const
Gets a light object wrapping the label map.
Definition: XnCppWrapper.h:943
Definition: XnTypes.h:140
IRMetaData()
Ctor.
Definition: XnCppWrapper.h:765
XnStatus SaveCalibrationData(XnUserID user, XnUInt32 nSlot)
Save the calibration data. For full details and usage, see xnSaveSkeletonCalibrationData ...
Definition: XnCppWrapper.h:4190
#define XN_DELETE(p)
Definition: XnOS.h:343
XnStatus DecodeData(const void *pSrc, XnUInt32 nSrcSize, void *pDst, XnUInt32 nDstSize, XnUInt *pnBytesWritten) const
For full details and usage, see xnDecodeData
Definition: XnCppWrapper.h:5236
XN_C_API XnNodeInfoList *XN_C_DECL xnNodeInfoGetNeededNodes(XnNodeInfo *pNodeInfo)
Definition: XnCppWrapper.h:2403
XN_C_API void XN_C_DECL xnUnregisterFromGeneralIntValueChange(XnNodeHandle hNode, const XnChar *strCap, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToGeneralIntValueChange().
XnStatus AddLicense(const XnLicense &License)
For full details and usage, see xnAddLicense
Definition: XnCppWrapper.h:5658
XN_C_API XnStatus XN_C_DECL xnWaitAndUpdateAll(XnContext *pContext)
Updates all generators nodes in the context, waiting for all to have new data.
XnUInt32 FrameID() const
Definition: XnCppWrapper.h:148
XnStatus EnumerateProductionTrees(XnProductionNodeType Type, const Query *pQuery, NodeInfoList &TreesList, EnumerationErrors *pErrors=NULL) const
Enumerates all available production trees for a specific node type. The trees populated in the list s...
Definition: XnCppWrapper.h:5682
XnStatus RegisterToGestureIntermediateStageCompleted(GestureIntermediateStageCompleted handler, void *pCookie, XnCallbackHandle &hCallback)
Register to when a gesture is in progress. For full details and usage, see xnRegisterToGestureInterme...
Definition: XnCppWrapper.h:3581
XnStatus Run(EnumerationErrors *pErrors)
Definition: XnCppWrapper.h:6316
bool operator<(const Version &other) const
Definition: XnCppWrapper.h:96
XnUInt32 nBuild
Definition: XnTypes.h:156
XN_C_API XnStatus XN_C_DECL xnNodeQueryAddNeededNode(XnNodeQuery *pQuery, const XnChar *strInstanceName)
XN_C_API void *XN_C_DECL xnOSMallocAligned(const XnSizeT nAllocSize, const XnSizeT nAlignment)
XN_C_API XnStatus XN_C_DECL xnCreateMockNodeBasedOn(XnContext *pContext, XnNodeHandle hOriginalNode, const XnChar *strName, XnNodeHandle *phMockNode)
Creates a production node which is only a mock, base on the type and properties of another node...
XnStatus EnumerateNodes(NodeInfoList &list) const
Retrieves a list of the nodes played by a player. For full details and usage, see xnEnumeratePlayerNo...
Definition: XnCppWrapper.h:2502
Device(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:1970
Definition: XnCppWrapper.h:1922
XN_C_API XnStatus XN_C_DECL xnStartGeneratingAll(XnContext *pContext)
Make sure all generators are generating data.
XN_C_API XnStatus XN_C_DECL xnStartTracking(XnNodeHandle hInstance, const XnPoint3D *pPosition)
Start tracking at a specific position.
XN_C_API XnStatus XN_C_DECL xnSetGeneralProperty(XnNodeHandle hInstance, const XnChar *strName, XnUInt32 nBufferSize, const void *pBuffer)
Sets a buffer property.
XnBool operator!=(const NodeWrapper &other)
Definition: XnCppWrapper.h:1044
Definition: XnCppWrapper.h:3418
void GetMetaData(ImageMetaData &metaData) const
Gets the current image-map meta data. For full details and usage, see xnGetImageMetaData ...
Definition: XnCppWrapper.h:3168
XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationComplete(XnNodeHandle hInstance, XnCalibrationComplete handler, void *pCookie, XnCallbackHandle *phCallback)
Register to when calibration is complete, with status.
XnUInt8 nMajor
Definition: XnTypes.h:153
XnStatus EnumerateAllGestures(XnChar **astrGestures, XnUInt32 nNameLength, XnUInt16 &nGestures) const
Get the names of all gestures available. For full details and usage, see xnEnumerateAllGestures ...
Definition: XnCppWrapper.h:3476
XnUInt16 nBitsPerSample
Definition: XnTypes.h:437
XN_C_API XnStatus XN_C_DECL xnRegisterHandCallbacks(XnNodeHandle hInstance, XnHandCreate CreateCB, XnHandUpdate UpdateCB, XnHandDestroy DestroyCB, void *pCookie, XnCallbackHandle *phCallback)
Register to hands callbacks.
XnResolution GetResolution() const
Gets the resolution.
Definition: XnCppWrapper.h:6025
XN_C_API XnStatus XN_C_DECL xnContextRunXmlScriptFromFileEx(XnContext *pContext, const XnChar *strFileName, XnEnumerationErrors *pErrors, XnNodeHandle *phScriptNode)
Runs an XML script in the given context.
XnUInt16 nMaintenance
Definition: XnTypes.h:155
XN_C_API XnBool XN_C_DECL xnIsGestureProgressSupported(XnNodeHandle hInstance, const XnChar *strGesture)
Check if the specific gesture supports 'in progress' callbacks.
XN_C_API XnStatus XN_C_DECL xnNodeQuerySetMaxVersion(XnNodeQuery *pQuery, const XnVersion *pMaxVersion)
const XnYUV422DoublePixel * GetYUV422ImageMap() const
Gets the current YUV422 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in YUV422 pixel format. For full details and usage, see xnGetYUV422ImageMap
Definition: XnCppWrapper.h:3184
XnStatus SetPlaybackSpeed(XnDouble dSpeed)
Sets the playback speed, as a ratio of the time passed in the recording. A value of 1...
Definition: XnCppWrapper.h:2540
XN_C_API XnStatus XN_C_DECL xnCreateIRGenerator(XnContext *pContext, XnNodeHandle *phIRGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates an IR generator.
XnSkeletonJoint
Definition: XnTypes.h:590
XnStatus TellTimestamp(XnUInt64 &nTimestamp) const
Reports the current timestamp of a player, i.e. the amount of time passed since the beginning of the ...
Definition: XnCppWrapper.h:2470
XnBool IsProfileAvailable(XnSkeletonProfile eProfile) const
Check if generator supports a specific profile. For full details and usage, see xnIsProfileAvailable ...
Definition: XnCppWrapper.h:4044
void Release()
Unreference a production node, decreasing its reference count by 1. If the reference count reaches ze...
Definition: XnCppWrapper.h:1065
void TakeOwnership(XnContext *pContext)
Definition: XnCppWrapper.h:5957
XN_C_API XnStatus XN_C_DECL xnNodeQueryAddSupportedCapability(XnNodeQuery *pQuery, const XnChar *strNeededCapability)
Definition: XnCppWrapper.h:2157
XnStatus Create(Context &context, const XnChar *strFormatName=NULL)
Creates a recorder. For full details and usage, see xnCreateRecorder
Definition: XnCppWrapper.h:6127
XnStatus SetRepeat(XnBool bRepeat)
Determines whether the player will automatically rewind to the beginning of the recording when reachi...
Definition: XnCppWrapper.h:2422
XN_C_API void XN_C_DECL xnUnregisterFromPowerLineFrequencyChange(XnNodeHandle hGenerator, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToPowerLineFrequencyChange().
XnStatus RegisterToUserReEnter(UserHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Register to when a user re-enters the scene after exiting. For full details and usage, see xnRegisterToUserReEnter
Definition: XnCppWrapper.h:4957
XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetNext(XnNodeInfoListIterator it)
XnStatus SetStringProperty(const XnChar *strName, const XnChar *strValue)
Sets a string property. For full details and usage, see xnSetStringProperty
Definition: XnCppWrapper.h:1808
void UnregisterFromUserReEnter(XnCallbackHandle hCallback)
Unregister from when a user re-enters the scene. For full details and usage, see xnUnregisterFromUser...
Definition: XnCppWrapper.h:4981
XnStatus SetData(const AudioMetaData &audioMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
Definition: XnCppWrapper.h:5166
GestureGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3427
XN_C_API XnStatus XN_C_DECL xnGetUserPixels(XnNodeHandle hInstance, XnUserID user, XnSceneMetaData *pScene)
Get the pixels that belong to a user.
void UnregisterFromWaveOutputModeChanges(XnCallbackHandle hCallback)
For full details and usage, see xnUnregisterFromWaveOutputModeChanges
Definition: XnCppWrapper.h:5114
XnStatus GetStringProperty(const XnChar *strName, XnChar *csValue, XnUInt32 nBufSize) const
Gets a string property. For full details and usage, see xnGetStringProperty
Definition: XnCppWrapper.h:1840
Context(const Context &other)
Definition: XnCppWrapper.h:5419
XnStatus CreateBasedOn(IRGenerator &other, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6221
MapMetaData(XnPixelFormat format, const XnUInt8 **ppData)
Definition: XnCppWrapper.h:269
XnStatus CreateBasedOn(AudioGenerator &other, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6287
Definition: XnCppWrapper.h:5182
XN_C_API XnStatus XN_C_DECL xnRegisterToViewPointChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to view point changes.
XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrationData(XnNodeHandle hInstance, XnUInt32 nSlot)
Check if a specific slot already holds calibration data.
XnImageMetaData * GetUnderlying()
Definition: XnCppWrapper.h:739
XN_C_API XnStatus XN_C_DECL xnGetUserPosition(XnNodeHandle hInstance, XnUInt32 nIndex, XnBoundingBox3D *pPosition)
Gets the current user position.
XN_C_API XnStatus XN_C_DECL xnSetStringProperty(XnNodeHandle hInstance, const XnChar *strName, const XnChar *strValue)
Sets a string property.
Definition: XnTypes.h:552
XnStatus AddNeededNode(const XnChar *strInstanceName)
For full details and usage, see xnNodeQueryAddNeededNode
Definition: XnCppWrapper.h:1348
DepthMetaData()
Definition: XnCppWrapper.h:463
XN_C_API XnStatus XN_C_DECL xnCreateAnyProductionTree(XnContext *pContext, XnProductionNodeType type, XnNodeQuery *pQuery, XnNodeHandle *phNode, XnEnumerationErrors *pErrors)
Enumerates for production trees for a specific node type, and creates the first found tree...
NodeInfoList()
Definition: XnCppWrapper.h:1476
XN_C_API XnBool XN_C_DECL xnIsJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint)
Check if joint is currently active.
FrameSyncCapability GetFrameSyncCap()
Definition: XnCppWrapper.h:2335
#define XN_CAPABILITY_IRIS
Definition: XnTypes.h:317
Definition: XnTypes.h:434
XN_C_API XnStatus XN_C_DECL xnSetWaveOutputMode(XnNodeHandle hInstance, const XnWaveOutputMode *OutputMode)
Definition: XnCppWrapper.h:2105
Definition: XnCppWrapper.h:837
Definition: XnTypes.h:1081
const XnRGB24Pixel * RGB24Data() const
Definition: XnCppWrapper.h:689
XN_C_API XnStatus XN_C_DECL xnSetSkeletonSmoothing(XnNodeHandle hInstance, XnFloat fFactor)
Set the skeleton's smoothing factor.
Iterator operator++(int)
Definition: XnCppWrapper.h:1417
const XnChar * GetName() const
Gets the name of the resolution.
Definition: XnCppWrapper.h:6031
XN_C_API XnStatus XN_C_DECL xnGetWaveOutputMode(XnNodeHandle hInstance, XnWaveOutputMode *OutputMode)
XN_C_API XnStatus XN_C_DECL xnSetIntProperty(XnNodeHandle hInstance, const XnChar *strName, XnUInt64 nValue)
Sets an integer property.
XnStatus WaitAnyUpdateAll()
Updates all generators nodes in the context, once any of them have new data. For full details and usa...
Definition: XnCppWrapper.h:5893
XnStatus RegisterToGestureReadyForNextIntermediateStage(GestureReadyForNextIntermediateStage handler, void *pCookie, XnCallbackHandle &hCallback)
Register to when a gesture is ready for its next stage (specific to the gesture) For full details and...
Definition: XnCppWrapper.h:3623
Definition: XnCppWrapper.h:4022
XN_C_API XnStatus XN_C_DECL xnNodeQuerySetMinVersion(XnNodeQuery *pQuery, const XnVersion *pMinVersion)
XnSkeletonProfile
Definition: XnTypes.h:623
GeneralIntCapability GetLowLightCompensationCap()
Definition: XnCppWrapper.h:2906
XN_C_API XnGrayscale16Pixel *XN_C_DECL xnGetGrayscale16ImageMap(XnNodeHandle hInstance)
Gets the current Grayscale16 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in Grayscale16 pixel format.
XnBool IsJointActive(XnSkeletonJoint eJoint) const
Check if joint is currently active. For full details and usage, see xnIsJointActive ...
Definition: XnCppWrapper.h:4077
XnStatus GetFloor(XnPlane3D &Plane) const
Gets a description of the floor, if it was found. For full details and usage, see xnGetFloor ...
Definition: XnCppWrapper.h:3757
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates an IR generator. For full details and usage, see xnCreateIRGenerator
Definition: XnCppWrapper.h:6203
AudioGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:5047
XN_C_API XnStatus XN_C_DECL xnRegisterUserCallbacks(XnNodeHandle hInstance, XnUserHandler NewUserCB, XnUserHandler LostUserCB, void *pCookie, XnCallbackHandle *phCallback)
Register to user callbacks.
XN_C_API XnStatus XN_C_DECL xnNodeQueryAddSupportedMapOutputMode(XnNodeQuery *pQuery, const XnMapOutputMode *pMapOutputMode)
Player(const NodeWrapper &other)
Definition: XnCppWrapper.h:2412
XN_C_API XnUChar *XN_C_DECL xnGetAudioBuffer(XnNodeHandle hInstance)
void(* XnErrorStateChangedHandler)(XnStatus errorState, void *pCookie)
Definition: XnTypes.h:235
IRGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3329
XN_C_API XnStatus XN_C_DECL xnLockNodeForChanges(XnNodeHandle hInstance, XnLockHandle *phLock)
Locks a node, not allowing any changes (any "set" function).
XnStatus RegisterToMapOutputModeChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to mode changes. For full details and usage, see xnRegisterToMapOutputM...
Definition: XnCppWrapper.h:2708
XN_C_API void XN_C_DECL xnUnregisterFromGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from when a gesture is in progress.
XnStatus AddRef()
Adds a reference to the context object. For full details and usage, see xnContextAddRef ...
Definition: XnCppWrapper.h:5627
XnStatus InitFrom(const ImageMetaData &other, XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format, const XnUInt8 *pExternalBuffer)
Definition: XnCppWrapper.h:618
XnStatus GetSkeletonJoint(XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation &Joint) const
Get a specific joint's full information. For full details and usage, see xnGetSkeletonJoint ...
Definition: XnCppWrapper.h:4109
XnStatus SetSkeletonProfile(XnSkeletonProfile eProfile)
Set the profile. this will set some joints to be active, and others to be inactive. For full details and usage, see xnSetSkeletonProfile
Definition: XnCppWrapper.h:4052
XN_C_API XnStatus XN_C_DECL xnRegisterToGestureIntermediateStageCompleted(XnNodeHandle hInstance, XnGestureIntermediateStageCompleted handler, void *pCookie, XnCallbackHandle *phCallback)
Register to when a gesture is in progress.
XnStatus MakeDataWritable()
Definition: XnCppWrapper.h:221
Codec(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:5209
XnStatus FindExistingNode(XnProductionNodeType type, ProductionNode &node) const
For full details and usage, see xnFindExistingNodeByType
Definition: XnCppWrapper.h:5778
void(* XnFreeHandler)(const void *pData)
Definition: XnTypes.h:242
XnDepthPixel nZRes
Definition: XnTypes.h:1067
XN_C_API const XnChar *XN_C_DECL xnGetNodeName(XnNodeHandle hNode)
Gets the instance name of a node by its handle.
XN_C_API XnStatus XN_C_DECL xnProductionNodeAddRef(XnNodeHandle hNode)
References a production node, increasing its reference count by 1.
Definition: XnCppWrapper.h:2345
XN_C_API XnStatus XN_C_DECL xnResetSkeleton(XnNodeHandle hInstance, XnUserID user)
Reset the skeleton - discard calibration.
void UnregisterFromCalibrationComplete(XnCallbackHandle hCallback)
Unregister from calibration complete with status. For full details and usage, see xnUnregisterFromCal...
Definition: XnCppWrapper.h:4436
XnBool operator!=(const Iterator &other) const
Definition: XnCppWrapper.h:5320
XN_C_API XnStatus XN_C_DECL xnGetFloor(XnNodeHandle hInstance, XnPlane3D *pPlane)
Gets a description of the floor, if it was found.
Definition: XnCppWrapper.h:3357
AlternativeViewPointCapability GetAlternativeViewPointCap()
Definition: XnCppWrapper.h:2315
Definition: XnCppWrapper.h:124
XN_C_API XnStatus XN_C_DECL xnCopyDepthMetaData(XnDepthMetaData *pDestination, const XnDepthMetaData *pSource)
Shallow-Copies a Depth Meta Data object. Note that the data buffer is not copied, and that both objec...
XN_C_API XnStatus XN_C_DECL xnResetViewPoint(XnNodeHandle hInstance)
Sets the view point of this generator to its normal one.
XnPixelFormat
Definition: XnTypes.h:490
#define XN_CAPABILITY_PAN
Definition: XnTypes.h:312
XN_C_API XnStatus XN_C_DECL xnMockAudioSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8 *pData)
const HandTouchingFOVEdgeCapability GetHandTouchingFOVEdgeCap() const
Definition: XnCppWrapper.h:3964
XnStatus GetErrorState() const
Gets current error state of this node. For full details and usage, see xnGetNodeErrorState ...
Definition: XnCppWrapper.h:1662
XN_C_API void XN_C_DECL xnUnregisterUserCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from user callbacks.
Iterator operator++(int)
Definition: XnCppWrapper.h:5339
XnStatus GetActiveGestures(XnChar *&astrGestures, XnUInt16 &nGestures) const
Get the names of the gestures that are currently active. For full details and usage, see xnGetActiveGestures
Definition: XnCppWrapper.h:3453
XnUInt8 NumberOfChannels() const
Gets the number of channels in every sample.
Definition: XnCppWrapper.h:858
XnStatus LoadScriptFromString(const XnChar *strScript)
Definition: XnCppWrapper.h:5267
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6212
XN_C_API void XN_C_DECL xnFreeLicensesList(XnLicense *aLicenses)
XN_C_API XnStatus XN_C_DECL xnGetGeneralIntValue(XnNodeHandle hNode, const XnChar *strCap, XnInt32 *pnValue)
Gets the current value of this capability.
XnUInt8 & NumberOfChannels()
Gets the number of channels in every sample.
Definition: XnCppWrapper.h:860
XnBool IsEmpty()
For full details and usage, see xnNodeInfoListIsEmpty
Definition: XnCppWrapper.h:1599
XnUInt32 GetNumberOfPoses() const
Get the number of the supported poses. For full details and usage, see xnGetNumberOfPoses ...
Definition: XnCppWrapper.h:4549
XN_C_API const XnChar *XN_C_DECL xnScriptNodeGetSupportedFormat(XnNodeHandle hScript)
XN_C_API const XnLabel *XN_C_DECL xnGetLabelMap(XnNodeHandle hInstance)
Gets the label map, describing the current segmentation of the scene.
void UnregisterFromFrameSyncChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToFrameSyncChange(). For full details and usage, see xnUnregisterFromFrameSyncChange
Definition: XnCppWrapper.h:2147
XnUInt64 nTimestamp
Definition: XnTypes.h:1022
HandTouchingFOVEdgeCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:3775
Iterator Begin() const
Gets an iterator to the first item in the list.
Definition: XnCppWrapper.h:1547
ErrorStateCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1656
XN_C_API void xnUnregisterFromOutOfPose(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from out of pose callback.
const XnDepthPixel *& Data()
Definition: XnCppWrapper.h:524
XnAudioMetaData * GetUnderlying()
Definition: XnCppWrapper.h:875
GeneralIntCapability GetGainCap()
Definition: XnCppWrapper.h:2826
Definition: XnTypes.h:539
XnStatus SetGeneralProperty(const XnChar *strName, XnUInt32 nBufferSize, const void *pBuffer)
Sets a buffer property. For full details and usage, see xnSetGeneralProperty
Definition: XnCppWrapper.h:1816
Context(XnContext *pContext)
Definition: XnCppWrapper.h:5408
XnBool CanFrameSyncWith(Generator &other) const
Checks if this generator can frame sync to another node. For full details and usage, see xnCanFrameSyncWith
Definition: XnCppWrapper.h:6076
void LockedNodeEndChanges(XnLockHandle hLock)
Ends changes request on a locked node. For full details and usage, see xnLockedNodeEndChanges ...
Definition: XnCppWrapper.h:1880
static XnStatus RegisterToUnderlying(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Definition: XnCppWrapper.h:6352
XnStatus RegisterToPoseCallbacks(PoseDetection PoseStartCB, PoseDetection PoseEndCB, void *pCookie, XnCallbackHandle &hCallback)
Register to callbacks for pose events. For full details and usage, see xnRegisterToPoseCallbacks ...
Definition: XnCppWrapper.h:4588
MapGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:2663
XnStatus GetProductionNodeByName(const XnChar *strInstanceName, ProductionNode &node) const
For full details and usage, see xnGetNodeHandleByName
Definition: XnCppWrapper.h:5794
XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetFirst(XnNodeInfoList *pList)
XN_C_API XnStatus XN_C_DECL xnTellPlayerTimestamp(XnNodeHandle hPlayer, XnUInt64 *pnTimestamp)
Reports the current timestamp of a player, i.e. the amount of time passed since the beginning of the ...
void UnregisterFromErrorStateChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToGlobalErrorStateChange(). For full details and usage, see xnUnregisterFromGlobalErrorStateChange
Definition: XnCppWrapper.h:5877
void GetMetaData(AudioMetaData &metaData) const
Gets the current audio meta data. For full details and usage, see xnGetAudioMetaData ...
Definition: XnCppWrapper.h:5058
XnStatus InitFrom(const DepthMetaData &other, XnUInt32 nXRes, XnUInt32 nYRes, const XnDepthPixel *pExternalBuffer)
Definition: XnCppWrapper.h:491
GestureGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3426
XnStatus SetJointActive(XnSkeletonJoint eJoint, XnBool bState)
Change the state of a specific joint, to be active or inactive. For full details and usage...
Definition: XnCppWrapper.h:4060
XN_C_API XnStatus XN_C_DECL xnSetJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint, XnBool bState)
Change the state of a specific joint, to be active or inactive.
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates an audio generator. For full details and usage, see xnCreateAudioGenerator ...
Definition: XnCppWrapper.h:6269
Definition: XnCppWrapper.h:1374
XN_C_API XnStatus XN_C_DECL xnGetGeneralIntRange(XnNodeHandle hNode, const XnChar *strCap, XnInt32 *pnMin, XnInt32 *pnMax, XnInt32 *pnStep, XnInt32 *pnDefault, XnBool *pbIsAutoSupported)
Gets the range of this capability values.
GeneralIntCapability GetBacklightCompensationCap()
Definition: XnCppWrapper.h:2816
XN_C_API XnStatus XN_C_DECL xnStopFrameSyncWith(XnNodeHandle hInstance, XnNodeHandle hOther)
Stops frame sync with the other node.
ErrorStateCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:1657
void InitFrom(const ImageMetaData &other)
Definition: XnCppWrapper.h:603
GeneralIntCapability GetSharpnessCap()
Definition: XnCppWrapper.h:2786
SkeletonCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:4030
XN_C_API XnStatus XN_C_DECL xnEnumerateGestures(XnNodeHandle hInstance, XnChar **pstrGestures, XnUInt16 *nGestures)
Get the names of all gestures available.
XnStatus TellFrame(const XnChar *strNodeName, XnUInt32 &nFrame) const
Reports the current frame number of a specific node played by a player. For full details and usage...
Definition: XnCppWrapper.h:2478
void UnregisterFromCroppingChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToCroppingChange(). For full details and usage, see xnUnregisterFromCroppingChange
Definition: XnCppWrapper.h:2596
XN_C_API XnStatus XN_C_DECL xnGetGlobalErrorState(XnContext *pContext)
Gets the global error state of the context. If one of the nodes in the context is in error state...
XnDirection
Definition: XnTypes.h:665
Iterator & operator--()
Definition: XnCppWrapper.h:1427
XN_C_API XnStatus XN_C_DECL xnGetSupportedWaveOutputModes(XnNodeHandle hInstance, XnWaveOutputMode *aSupportedModes, XnUInt32 *pnCount)
Definition: XnCppWrapper.h:2558
XN_C_API XnStatus XN_C_DECL xnNodeInfoListClear(XnNodeInfoList *pList)
XnStatus StartTracking(XnUserID user)
Start tracking a skeleton. For full details and usage, see xnStartSkeletonTracking ...
Definition: XnCppWrapper.h:4222
void UnregisterCalibrationCallbacks(XnCallbackHandle hCallback)
Unregister from calibration callbacks. For full details and usage, see xnUnregisterCalibrationCallbac...
Definition: XnCppWrapper.h:4316
XnUInt32 BytesPerPixel() const
Definition: XnCppWrapper.h:320
XnYUV422DoublePixel * WritableYUV422Data()
Definition: XnCppWrapper.h:700
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 xnEnumerateExistingNodes(XnContext *pContext, XnNodeInfoList **ppList)
Gets a list of all existing node in the context. Each node that was returned increases its ref count...
XN_C_API XnStatus xnRegisterToPoseDetected(XnNodeHandle hInstance, XnPoseDetectionCallback handler, void *pCookie, XnCallbackHandle *phCallback)
Register to callback when a user is in pose.
XnStatus RegisterGestureCallbacks(GestureRecognized RecognizedCB, GestureProgress ProgressCB, void *pCookie, XnCallbackHandle &hCallback)
For full details and usage, see RegisterGestureCallbacks For full details and usage, see RegisterGestureCallbacks
Definition: XnCppWrapper.h:3521
ScriptNode(const NodeWrapper &other)
Definition: XnCppWrapper.h:5255
XnStatus GetWaveOutputMode(XnWaveOutputMode &OutputMode) const
For full details and usage, see xnGetWaveOutputMode
Definition: XnCppWrapper.h:5098
XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel *pDepthMap)
For full details and usage, see xnMockDepthSetData
Definition: XnCppWrapper.h:3117
Definition: XnTypes.h:494
Resolution(const XnChar *strName)
Definition: XnCppWrapper.h:6016
Generator(const NodeWrapper &other)
Definition: XnCppWrapper.h:2166
GeneralIntCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:1698
XnDepthPixel ZRes() const
Definition: XnCppWrapper.h:517
XnStatus RegisterToUserPositionChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to user position changes. For full details and usage, see xnRegisterToUserPositionChange
Definition: XnCppWrapper.h:2964
XnStatus AllocateData(XnUInt32 nXRes, XnUInt32 nYRes)
Definition: XnCppWrapper.h:346
XnStatus SetCropping(const XnCropping &Cropping)
Sets the cropping. For full details and usage, see xnSetCropping
Definition: XnCppWrapper.h:2572
XnPixelFormat & PixelFormat()
Gets the pixel format.
Definition: XnCppWrapper.h:683
const MirrorCapability GetMirrorCap() const
Definition: XnCppWrapper.h:2285
void(* GestureReadyForNextIntermediateStage)(GestureGenerator &generator, const XnChar *strGesture, const XnPoint3D *pPosition, void *pCookie)
Definition: XnCppWrapper.h:3619
struct XnContext XnContext
Definition: XnTypes.h:77
NodeWrapper(const NodeWrapper &other)
Definition: XnCppWrapper.h:1008
UserPositionCapability(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2934
void(* CalibrationEnd)(SkeletonCapability &skeleton, XnUserID user, XnBool bSuccess, void *pCookie)
Definition: XnCppWrapper.h:4283
DeviceIdentificationCapability GetIdentificationCap()
Definition: XnCppWrapper.h:1983
#define XN_CODEC_NULL
Definition: XnCodecIDs.h:27
XnUInt32 DataSize() const
Definition: XnCppWrapper.h:153
XnPixelFormat PixelFormat() const
Gets the pixel format.
Definition: XnCppWrapper.h:681
XnStatus Remove(Iterator &it)
For full details and usage, see xnNodeInfoListRemove
Definition: XnCppWrapper.h:1575
Definition: XnCppWrapper.h:890
XN_C_API const XnChar *XN_C_DECL xnNodeInfoGetCreationInfo(XnNodeInfo *pNodeInfo)
XN_C_API XnStatus XN_C_DECL xnNodeQuerySetName(XnNodeQuery *pQuery, const XnChar *strName)
XN_C_API XnBool XN_C_DECL xnNeedPoseForSkeletonCalibration(XnNodeHandle hInstance)
Check if a specific pose is required for calibration.
XN_C_API XnUInt32 XN_C_DECL xnGetDataSize(XnNodeHandle hInstance)
Gets the size of current data, in bytes.
XnStatus SetMinVersion(const XnVersion &minVersion)
For full details and usage, see xnNodeQuerySetMinVersion
Definition: XnCppWrapper.h:1300
XN_C_API void XN_C_DECL xnUnregisterCalibrationCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from calibration callbacks.
const XnGrayscale16Pixel * GetGrayscale16ImageMap() const
Gets the current Grayscale16 image-map. This map is updated after a call to xnWaitAndUpdateData(). It is assumed that the node is currently in Grayscale16 pixel format. For full details and usage, see xnGetGrayscale16ImageMap
Definition: XnCppWrapper.h:3200
Definition: XnTypes.h:106
Definition: XnCppWrapper.h:2982
XnStatus OpenFileRecording(const XnChar *strFileName, ProductionNode &playerNode)
Opens a recording file, adding all nodes in it to the context. NOTE: when using this function...
Definition: XnCppWrapper.h:5563
XnBool operator==(const Iterator &other) const
Definition: XnCppWrapper.h:5310
XnStatus AddNeededNode(ProductionNode &needed)
Adds another node to the list of needed nodes for this node. For full details and usage...
Definition: XnCppWrapper.h:1763
struct XnModuleError * XnEnumerationErrorsIterator
Definition: XnEnumerationErrors.h:57
XN_C_API XnStatus XN_C_DECL xnGetGeneralProperty(XnNodeHandle hInstance, const XnChar *strName, XnUInt32 nBufferSize, void *pBuffer)
Gets a buffer property.
Version(const XnVersion &version)
Definition: XnCppWrapper.h:79
GeneralIntCapability GetIrisCap()
Definition: XnCppWrapper.h:2886
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6278
XN_C_API XnBool XN_C_DECL xnIsViewPointSupported(XnNodeHandle hInstance, XnNodeHandle hOther)
Checks if this generator can change its output to look like it was taken from a different location...
#define XN_CAPABILITY_CONTRAST
Definition: XnTypes.h:304
XnStatus GetIntProperty(const XnChar *strName, XnUInt64 &nValue) const
Gets an integer property. For full details and usage, see xnGetIntProperty
Definition: XnCppWrapper.h:1824
XnStatus SetMapOutputMode(const XnMapOutputMode &OutputMode)
Sets the output mode. For full details and usage, see xnSetMapOutputMode
Definition: XnCppWrapper.h:2684
XnStatus RegisterToPoseInProgress(PoseInProgress handler, void *pCookie, XnCallbackHandle &hCallback)
Register to callback for status when pose is detected. For full details and usage, see xnRegisterToPoseDetectionInProgress
Definition: XnCppWrapper.h:4698
XN_C_API XnStatus XN_C_DECL xnGetUsers(XnNodeHandle hInstance, XnUserID *pUsers, XnUInt16 *pnUsers)
Get the current users.
Definition: XnCppWrapper.h:2926
Definition: XnCppWrapper.h:993
XN_C_API XnStatus XN_C_DECL xnSetTrackingSmoothing(XnNodeHandle hInstance, XnFloat fFactor)
Change smoothing factor.
void UnregisterGestureCallbacks(XnCallbackHandle hCallback)
Unregister from gesture callbacks. For full details and usage, see xnUnregisterGestureCallbacks ...
Definition: XnCppWrapper.h:3546
XN_C_API XnResolution XN_C_DECL xnResolutionGetFromName(const XnChar *strName)
#define XN_CAPABILITY_BRIGHTNESS
Definition: XnTypes.h:303
void InitFrom(const SceneMetaData &other)
Definition: XnCppWrapper.h:908
Definition: XnCppWrapper.h:1962
XN_C_API void XN_C_DECL xnUnregisterFromGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from when a gesture is ready for its next stage.
XN_C_API void XN_C_DECL xnUnregisterFromJointConfigurationChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from joint configuration changes.
XnResolution
Definition: XnTypes.h:386
void(* CalibrationInProgress)(SkeletonCapability &skeleton, XnUserID user, XnCalibrationStatus calibrationError, void *pCookie)
Definition: XnCppWrapper.h:4364
Version(XnUInt8 nMajor, XnUInt8 nMinor, XnUInt16 nMaintenance, XnUInt32 nBuild)
Definition: XnCppWrapper.h:80
void UnregisterFromPoseInProgress(XnCallbackHandle hCallback)
Unregister from pose status callback. For full details and usage, see xnUnregisterFromPoseDetectionIn...
Definition: XnCppWrapper.h:4722
XnBool IsTracking(XnUserID user) const
Check if skeleton is being tracked. For full details and usage, see xnIsSkeletonTracking ...
Definition: XnCppWrapper.h:4133
Definition: XnCppWrapper.h:1688
XnStatus SetExistingNodeOnly(XnBool bExistingNode)
For full details and usage, see xnNodeQuerySetExistingNodeOnly
Definition: XnCppWrapper.h:1340
ProductionNode(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:1752
An iterator over enumeration errors.
Definition: XnCppWrapper.h:5300
XnBool IsCalibrating(XnUserID user) const
Check if skeleton is being calibrated. For full details and usage, see xnIsSkeletonCalibrating ...
Definition: XnCppWrapper.h:4150
const XnDepthPixel & operator()(XnUInt32 x, XnUInt32 y) const
Definition: XnCppWrapper.h:554
const XnLabel * GetLabelMap() const
Gets the label map, describing the current segmentation of the scene. For full details and usage...
Definition: XnCppWrapper.h:3749
UserPositionCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2935
XN_C_API XnStatus XN_C_DECL xnGetRefNodeHandleByName(XnContext *pContext, const XnChar *strInstanceName, XnNodeHandle *phNode)
Gets a handle to an existing production node instance using that instance name.
XN_C_API XnStatus XN_C_DECL xnNodeQuerySetVendor(XnNodeQuery *pQuery, const XnChar *strVendor)
void UnregisterFromPowerLineFrequencyChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToPowerLineFrequencyChange(). For full details and usage, see xnUnregisterFromPowerLineFrequencyChange
Definition: XnCppWrapper.h:2644
XN_C_API XnStatus XN_C_DECL xnDecodeData(XnNodeHandle hCodec, const void *pSrc, XnUInt32 nSrcSize, void *pDst, XnUInt32 nDstSize, XnUInt *pnBytesWritten)
XnStatus RegisterToNewDataAvailable(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to be called when new data is available. For full details and usage...
Definition: XnCppWrapper.h:2211
XnMapMetaData * pMap
Definition: XnTypes.h:1061
void GetRange(XnInt32 &nMin, XnInt32 &nMax, XnInt32 &nStep, XnInt32 &nDefault, XnBool &bIsAutoSupported) const
Gets the range of this capability values. For full details and usage, see xnGetGeneralIntRange ...
Definition: XnCppWrapper.h:1703
ProductionNode(const NodeWrapper &other)
Definition: XnCppWrapper.h:1753
const XnAudioMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:873
void UnregisterFromGenerationRunningChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToGenerationRunningChange(). For full details and usage, see xnUnregisterFromGenerationRunningChange
Definition: XnCppWrapper.h:2203
XnStatus AllocateData(XnUInt32 nXRes, XnUInt32 nYRes, XnPixelFormat format)
Definition: XnCppWrapper.h:634
XnStatus CopyFrom(const IRMetaData &other)
Definition: XnCppWrapper.h:792
void ReplaceUnderlyingObject(XnNodeInfoList *pList)
Definition: XnCppWrapper.h:1505
XN_C_API XnContext *XN_C_DECL xnGetRefContextFromNodeHandle(XnNodeHandle hNode)
Gets the context a node belongs to. The context ref count is increased. The user is responsible for r...
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAllocate(XnNodeInfoList **ppList)
NodeInfo(const NodeInfo &other)
Definition: XnCppWrapper.h:1156
XN_C_API XnUInt32 XN_C_DECL xnGetBytesPerPixel(XnNodeHandle hInstance)
Gets the number of bytes per pixel for this map generator.
XN_C_API XnStatus XN_C_DECL xnRemoveGesture(XnNodeHandle hInstance, const XnChar *strGesture)
Turn off gesture. The generator will no longer look for this gesture.
const XnUChar * GetAudioBuffer() const
For full details and usage, see xnGetAudioBuffer
Definition: XnCppWrapper.h:5066
XnBool IsCalibrationData(XnUInt32 nSlot) const
Check if a specific slot already holds calibration data. For full details and usage, see xnIsSkeletonCalibrationData
Definition: XnCppWrapper.h:4214
void UnlockForChanges(XnLockHandle hLock)
Unlocks a previously locked node. For full details and usage, see xnUnlockNodeForChanges ...
Definition: XnCppWrapper.h:1864
XN_C_API XnUInt32 XN_C_DECL xnResolutionGetYRes(XnResolution resolution)
MapGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2662
Capability(const NodeWrapper &node)
Definition: XnCppWrapper.h:1641
DepthGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2990
XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot)
Load previously saved calibration data.
GeneralIntCapability GetRollCap()
Definition: XnCppWrapper.h:2856
XnStatus GetRealProperty(const XnChar *strName, XnDouble &dValue) const
Gets a real property. For full details and usage, see xnGetRealProperty
Definition: XnCppWrapper.h:1832
void(* GestureRecognized)(GestureGenerator &generator, const XnChar *strGesture, const XnPoint3D *pIDPosition, const XnPoint3D *pEndPosition, void *pCookie)
Definition: XnCppWrapper.h:3506
void InitFrom(const DepthMetaData &other)
Definition: XnCppWrapper.h:477
XN_C_API XnStatus XN_C_DECL xnRegisterToFrameSyncChange(XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to view point changes.
#define XN_CAPABILITY_TILT
Definition: XnTypes.h:313
const XnProductionNodeDescription & GetDescription() const
For full details and usage, see xnNodeInfoGetDescription()
Definition: XnCppWrapper.h:1195
XnStatus CreateBasedOn(ImageGenerator &other, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6192
XnDepthPixel GetDeviceMaxDepth() const
Gets the maximum depth the device can produce. For full details and usage, see xnGetDeviceMaxDepth ...
Definition: XnCppWrapper.h:3017
XN_C_API XnStatus XN_C_DECL xnRequestSkeletonCalibration(XnNodeHandle hInstance, XnUserID user, XnBool bForce)
Request calibration when possible.
XnStatus GetSupportedMapOutputModes(XnMapOutputMode *aModes, XnUInt32 &nCount) const
Gets a list of all supported modes. The size of the array that should be passed can be obtained by ca...
Definition: XnCppWrapper.h:2676
XnStatus RegisterToGenerationRunningChange(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to be called when generation starts or stops. For full details and usag...
Definition: XnCppWrapper.h:2195
XN_C_API XnStatus XN_C_DECL xnSetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium destType, const XnChar *strDest)
Tells the recorder where to record.
XnBool IsDataNew() const
Definition: XnCppWrapper.h:158
XnStatus RegisterToEndOfFileReached(StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Registers a callback function to be called when end-of-file is reached. For full details and usage...
Definition: XnCppWrapper.h:2524
void UnregisterFromPoseDetected(XnCallbackHandle hCallback)
Unregister from pose detected callback. For full details and usage, see xnUnregisterFromPoseDetected ...
Definition: XnCppWrapper.h:4669
XnUInt32 Y
Definition: XnTypes.h:1015
XnStatus WaitOneUpdateAll(ProductionNode &node)
Updates all generators nodes in the context, waiting for a specific one to have new data...
Definition: XnCppWrapper.h:5901
virtual ~OutputMetaData()
Definition: XnCppWrapper.h:140
XN_C_API XnBool XN_C_DECL xnGetGlobalMirror(XnContext *pContext)
Gets the global mirror flag.
XN_C_API void XN_C_DECL xnUnregisterFromCalibrationInProgress(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from calibration status while in progress.
XN_C_API XnStatus XN_C_DECL xnLoadScriptFromString(XnNodeHandle hScript, const XnChar *strScript)
#define XN_CAPABILITY_ZOOM
Definition: XnTypes.h:315
XN_C_API XnStatus XN_C_DECL xnGetDeviceName(XnNodeHandle hInstance, XnChar *strBuffer, XnUInt32 *pnBufferSize)
XN_C_API XnStatus XN_C_DECL xnRegisterToGeneralIntValueChange(XnNodeHandle hNode, const XnChar *strCap, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Registers a callback function to values changes.
XnStatus StopPoseDetection(XnUserID user)
Stop detection of poses for a specific user. For full details and usage, see xnStopPoseDetection ...
Definition: XnCppWrapper.h:4580
XnStatus CreateAnyProductionTree(XnProductionNodeType type, Query *pQuery, ProductionNode &node, EnumerationErrors *pErrors=NULL)
Enumerates for production trees for a specific node type, and creates the first found tree...
Definition: XnCppWrapper.h:5700
XN_C_API void XN_C_DECL xnForceShutdown(XnContext *pContext)
Forces a context to shutdown, destroying all nodes. This function is used for backwards compatibility...
XnStatus SetGlobalMirror(XnBool bMirror)
Sets the global mirror flag. This will set all current existing nodes' mirror state, and also affect future created nodes. The default mirror flag is FALSE. For full details and usage, see xnSetGlobalMirror
Definition: XnCppWrapper.h:5844
MockDepthGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3095
XnStatus AddNodeFromAnotherList(Iterator &it)
For full details and usage, see xnNodeInfoListAddNodeFromList
Definition: XnCppWrapper.h:1541
MirrorCapability GetMirrorCap()
Definition: XnCppWrapper.h:2295
XnStatus StopGenerating()
Stops generation of the output. For full details and usage, see xnStopGenerating
Definition: XnCppWrapper.h:2187
Definition: XnTypes.h:1019
XN_C_API XnStatus XN_C_DECL xnRegisterToUserExit(XnNodeHandle hInstance, XnUserHandler handler, void *pCookie, XnCallbackHandle *phCallback)
Register to when the user exits the scene (but not lost yet)
XnStatus EnumerateExistingNodes(NodeInfoList &list) const
Gets a list of all existing node in the context. Each node that was returned increases its ref count...
Definition: XnCppWrapper.h:5750
XN_C_API XnStatus XN_C_DECL xnCreateUserGenerator(XnContext *pContext, XnNodeHandle *phUserGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates a user generator.
XnStatus SetData(const IRMetaData &irMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
Definition: XnCppWrapper.h:3398
XN_C_API void XN_C_DECL xnContextRelease(XnContext *pContext)
Releases a context object, decreasing its ref count by 1. If reference count has reached 0...
XN_C_API void XN_C_DECL xnUnregisterFromNodeErrorStateChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToNodeErrorStateChange().
XnUInt32 FullYRes() const
Definition: XnCppWrapper.h:302
void GetMetaData(DepthMetaData &metaData) const
Gets the current depth-map meta data. For full details and usage, see xnGetDepthMetaData ...
Definition: XnCppWrapper.h:3001
const XnDepthPixel & operator[](XnUInt32 nIndex) const
Definition: XnCppWrapper.h:542
XnStatus StopFrameSyncWith(Generator &other)
Stops frame sync with the other node. For full details and usage, see xnStopFrameSyncWith ...
Definition: XnCppWrapper.h:6086
XnStatus WaitNoneUpdateAll()
Updates all generator nodes in the context, without any waiting. If a node has new data...
Definition: XnCppWrapper.h:5909