OpenNI 1.5.2
XnCppWrapper.h
Go to the documentation of this file.
1 /****************************************************************************
2 * *
3 * OpenNI 1.x 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_ppData(ppData), m_nAllocatedSize(0), m_pAllocatedData(NULL)
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  {
174  MakeDataWritable();
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  {
211  xnOSFreeAligned(m_pAllocatedData);
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  {
239  xnOSMemSet(m_pAllocatedData, 0, DataSize());
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));
272  m_map.pOutput = OutputMetaData::GetUnderlying();
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:
391  XnPixelFormat& PixelFormatImpl() { return m_map.PixelFormat; }
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  {
533  MakeDataWritable();
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));
771  m_ir.pMap = MapMetaData::GetUnderlying();
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 
818  inline const XnIRPixel& operator[](XnUInt32 nIndex) const
819  {
820  XN_ASSERT(nIndex < (XRes()*YRes()));
821  return Data()[nIndex];
822  }
823 
830  inline const XnIRPixel& operator()(XnUInt32 x, XnUInt32 y) const
831  {
832  XN_ASSERT(x < XRes() && y < YRes());
833  return Data()[y*XRes() + x];
834  }
835 
837  inline const xn::IRMap& IRMap() const { return m_irMap; }
839  inline xn::IRMap& WritableIRMap() { MakeDataWritable(); return m_writableIRMap; }
840 
842  inline const XnIRMetaData* GetUnderlying() const { return &m_ir; }
844  inline XnIRMetaData* GetUnderlying() { return &m_ir; }
845 
846  private:
847  // block copy ctor and assignment operator
848  IRMetaData(const IRMetaData& other);
849  IRMetaData& operator=(const IRMetaData&);
850 
851  XnIRMetaData m_ir;
852  const xn::IRMap m_irMap;
853  xn::IRMap m_writableIRMap;
854  };
855 
861  {
862  public:
864  inline AudioMetaData() : OutputMetaData(&m_audio.pData)
865  {
866  xnOSMemSet(&m_audio, 0, sizeof(XnAudioMetaData));
867  m_audio.pOutput = OutputMetaData::GetUnderlying();
868  }
869 
875  inline void InitFrom(const AudioMetaData& other)
876  {
877  xnCopyAudioMetaData(&m_audio, &other.m_audio);
878  }
879 
881  inline XnUInt8 NumberOfChannels() const { return m_audio.Wave.nChannels; }
883  inline XnUInt8& NumberOfChannels() { return m_audio.Wave.nChannels; }
884 
886  inline XnUInt32 SampleRate() const { return m_audio.Wave.nSampleRate; }
888  inline XnUInt32& SampleRate() { return m_audio.Wave.nSampleRate; }
889 
891  inline XnUInt16 BitsPerSample() const { return m_audio.Wave.nBitsPerSample; }
893  inline XnUInt16& BitsPerSample() { return m_audio.Wave.nBitsPerSample; }
894 
896  inline const XnAudioMetaData* GetUnderlying() const { return &m_audio; }
898  inline XnAudioMetaData* GetUnderlying() { return &m_audio; }
899 
900  private:
901  // block copy ctor and assignment operator
902  AudioMetaData(const AudioMetaData& other);
903  AudioMetaData& operator=(const AudioMetaData&);
904 
905  XnAudioMetaData m_audio;
906  XnBool m_bAllocated;
907  };
908 
913  class SceneMetaData : public MapMetaData
914  {
915  public:
917  inline SceneMetaData() :
918  MapMetaData(XN_PIXEL_FORMAT_GRAYSCALE_16_BIT, (const XnUInt8**)&m_scene.pData),
919  m_labelMap(const_cast<XnLabel*&>(m_scene.pData), MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y),
920  m_writableLabelMap((XnLabel*&)m_pAllocatedData, MapMetaData::GetUnderlying()->Res.X, MapMetaData::GetUnderlying()->Res.Y)
921  {
922  xnOSMemSet(&m_scene, 0, sizeof(XnSceneMetaData));
923  m_scene.pMap = MapMetaData::GetUnderlying();
924  }
925 
931  inline void InitFrom(const SceneMetaData& other)
932  {
933  xnCopySceneMetaData(&m_scene, &other.m_scene);
934  }
935 
937  inline XnStatus InitFrom(const SceneMetaData& other, XnUInt32 nXRes, XnUInt32 nYRes, const XnLabel* pExternalBuffer)
938  {
939  InitFrom(other);
940  return ReAdjust(nXRes, nYRes, pExternalBuffer);
941  }
942 
945  {
946  // copy props
947  xnCopySceneMetaData(&m_scene, &other.m_scene);
948  // and make a copy of the data (this will allocate and copy data)
949  return MakeDataWritable();
950  }
951 
953  XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnLabel* pExternalBuffer = NULL)
954  {
955  return MapMetaData::ReAdjust(nXRes, nYRes, (const XnUInt8*)pExternalBuffer);
956  }
957 
959  inline const XnLabel* Data() const { return (const XnLabel*)MapMetaData::Data(); }
961  inline const XnLabel*& Data() { return (const XnLabel*&)MapMetaData::Data(); }
964 
966  inline const xn::LabelMap& LabelMap() const { return m_labelMap; }
968  inline xn::LabelMap& WritableLabelMap() { MakeDataWritable(); return m_writableLabelMap; }
969 
975  inline const XnLabel& operator[](XnUInt32 nIndex) const
976  {
977  XN_ASSERT(nIndex < (XRes()*YRes()));
978  return Data()[nIndex];
979  }
980 
987  inline const XnLabel& operator()(XnUInt32 x, XnUInt32 y) const
988  {
989  XN_ASSERT(x < XRes() && y < YRes());
990  return (*this)[y*XRes() + x];
991  }
992 
994  inline const XnSceneMetaData* GetUnderlying() const { return &m_scene; }
996  inline XnSceneMetaData* GetUnderlying() { return &m_scene; }
997 
998  private:
999  // block copy ctor and assignment operator
1000  SceneMetaData(const SceneMetaData& other);
1001  SceneMetaData& operator=(const SceneMetaData&);
1002 
1003  XnSceneMetaData m_scene;
1004  const xn::LabelMap m_labelMap;
1005  xn::LabelMap m_writableLabelMap;
1006  };
1007 
1008  //---------------------------------------------------------------------------
1009  // NodeWrapper
1010  //---------------------------------------------------------------------------
1011 
1017  {
1018  public:
1019  friend class Context;
1020 
1026  inline NodeWrapper(XnNodeHandle hNode) : m_hNode(NULL), m_hShuttingDownCallback(NULL)
1027  {
1028  NodeWrapper::SetHandle(hNode);
1029  }
1030 
1031  inline NodeWrapper(const NodeWrapper& other) : m_hNode(NULL), m_hShuttingDownCallback(NULL)
1032  {
1034  }
1035 
1036  inline NodeWrapper& operator=(const NodeWrapper& other)
1037  {
1039  return *this;
1040  }
1041 
1042  inline ~NodeWrapper()
1043  {
1044  NodeWrapper::SetHandle(NULL);
1045  }
1046 
1047  inline operator XnNodeHandle() const { return GetHandle(); }
1048 
1050  inline XnNodeHandle GetHandle() const { return m_hNode; }
1051 
1057  inline XnBool operator==(const NodeWrapper& other)
1058  {
1059  return (GetHandle() == other.GetHandle());
1060  }
1061 
1067  inline XnBool operator!=(const NodeWrapper& other)
1068  {
1069  return (GetHandle() != other.GetHandle());
1070  }
1071 
1073  inline XnBool IsValid() const { return (GetHandle() != NULL); }
1074 
1078  const XnChar* GetName() const {return xnGetNodeName(GetHandle()); }
1079 
1083  inline XnStatus AddRef() { return xnProductionNodeAddRef(GetHandle()); }
1084 
1088  inline void Release()
1089  {
1090  NodeWrapper::SetHandle(NULL);
1091  }
1092 
1093  inline XnStatus XN_API_DEPRECATED("Please use AddRef() instead.") Ref() { return AddRef(); }
1094  inline void XN_API_DEPRECATED("Please use Release() instead.") Unref() { Release(); }
1095 
1097  inline void SetHandle(XnNodeHandle hNode)
1098  {
1099  if (m_hNode == hNode)
1100  {
1101  // Optimization: do nothing
1102  return;
1103  }
1104 
1105  // check currently held node. If we're holding a node, release it
1106  if (m_hNode != NULL)
1107  {
1108  XnContext* pContext = xnGetRefContextFromNodeHandle(m_hNode);
1109  xnContextUnregisterFromShutdown(pContext, m_hShuttingDownCallback);
1110  xnContextRelease(pContext);
1111  xnProductionNodeRelease(m_hNode);
1112  }
1113 
1114  // check new node handle, if it points to a node, add ref to it
1115  if (hNode != NULL)
1116  {
1117  XnStatus nRetVal = xnProductionNodeAddRef(hNode);
1118  XN_ASSERT(nRetVal == XN_STATUS_OK);
1119 
1120  XnContext* pContext = xnGetRefContextFromNodeHandle(hNode);
1121 
1122  nRetVal = xnContextRegisterForShutdown(pContext, ContextShuttingDownCallback, this, &m_hShuttingDownCallback);
1123  XN_ASSERT(nRetVal == XN_STATUS_OK);
1124 
1125  xnContextRelease(pContext);
1126  }
1127 
1128  m_hNode = hNode;
1129  }
1130 
1131  inline void TakeOwnership(XnNodeHandle hNode)
1132  {
1133  SetHandle(hNode);
1134 
1135  if (hNode != NULL)
1136  {
1137  xnProductionNodeRelease(hNode);
1138  }
1139  }
1140 
1141  private:
1142  XnNodeHandle m_hNode;
1143  XnCallbackHandle m_hShuttingDownCallback;
1144 
1145  static void XN_CALLBACK_TYPE ContextShuttingDownCallback(XnContext* /*pContext*/, void* pCookie)
1146  {
1147  NodeWrapper* pThis = (NodeWrapper*)pCookie;
1148  pThis->m_hNode = NULL;
1149  }
1150  };
1151 
1152  //---------------------------------------------------------------------------
1153  // Node Info
1154  //---------------------------------------------------------------------------
1155 
1160  class NodeInfo
1161  {
1162  public:
1168  NodeInfo(XnNodeInfo* pInfo) : m_pNeededNodes(NULL), m_bOwnerOfNode(FALSE)
1169  {
1170  SetUnderlyingObject(pInfo);
1171  }
1172 
1178  NodeInfo(const NodeInfo& other) : m_pNeededNodes(NULL), m_bOwnerOfNode(FALSE)
1179  {
1180  SetUnderlyingObject(other.m_pInfo);
1181  }
1182 
1185  {
1186  SetUnderlyingObject(NULL);
1187  }
1188 
1194  inline NodeInfo& operator=(const NodeInfo& other)
1195  {
1196  SetUnderlyingObject(other.m_pInfo);
1197  return *this;
1198  }
1199 
1201  inline operator XnNodeInfo*()
1202  {
1203  return m_pInfo;
1204  }
1205 
1209  inline XnStatus SetInstanceName(const XnChar* strName)
1210  {
1211  return xnNodeInfoSetInstanceName(m_pInfo, strName);
1212  }
1213 
1218  {
1219  return *xnNodeInfoGetDescription(m_pInfo);
1220  }
1221 
1225  inline const XnChar* GetInstanceName() const
1226  {
1227  return xnNodeInfoGetInstanceName(m_pInfo);
1228  }
1229 
1233  inline const XnChar* GetCreationInfo() const
1234  {
1235  return xnNodeInfoGetCreationInfo(m_pInfo);
1236  }
1237 
1241  inline NodeInfoList& GetNeededNodes() const;
1242 
1250  inline XnStatus GetInstance(ProductionNode& node) const;
1251 
1255  inline const void* GetAdditionalData() const
1256  {
1257  return xnNodeInfoGetAdditionalData(m_pInfo);
1258  }
1259 
1263  inline XnStatus GetTreeStringRepresentation(XnChar* csResultBuffer, XnUInt32 nBufferSize) const
1264  {
1265  return xnNodeInfoGetTreeStringRepresentation(m_pInfo, csResultBuffer, nBufferSize);
1266  }
1267 
1268  private:
1269  inline void SetUnderlyingObject(XnNodeInfo* pInfo);
1270 
1271  XnNodeInfo* m_pInfo;
1272  mutable NodeInfoList* m_pNeededNodes;
1273  XnBool m_bOwnerOfNode; // backwards compatibility
1274  friend class Context;
1275  };
1276 
1277  //---------------------------------------------------------------------------
1278  // Query
1279  //---------------------------------------------------------------------------
1280 
1286  class Query
1287  {
1288  public:
1290  inline Query() : m_bAllocated(TRUE)
1291  {
1292  xnNodeQueryAllocate(&m_pQuery);
1293  }
1294 
1295  inline Query(XnNodeQuery* pNodeQuery) : m_bAllocated(FALSE), m_pQuery(pNodeQuery)
1296  {
1297  }
1298 
1301  {
1302  if (m_bAllocated)
1303  {
1304  xnNodeQueryFree(m_pQuery);
1305  }
1306  }
1307 
1309  inline const XnNodeQuery* GetUnderlyingObject() const { return m_pQuery; }
1310  inline XnNodeQuery* GetUnderlyingObject() { return m_pQuery; }
1311 
1315  inline XnStatus SetVendor(const XnChar* strVendor)
1316  {
1317  return xnNodeQuerySetVendor(m_pQuery, strVendor);
1318  }
1319 
1323  inline XnStatus SetName(const XnChar* strName)
1324  {
1325  return xnNodeQuerySetName(m_pQuery, strName);
1326  }
1327 
1331  inline XnStatus SetMinVersion(const XnVersion& minVersion)
1332  {
1333  return xnNodeQuerySetMinVersion(m_pQuery, &minVersion);
1334  }
1335 
1339  inline XnStatus SetMaxVersion(const XnVersion& maxVersion)
1340  {
1341  return xnNodeQuerySetMaxVersion(m_pQuery, &maxVersion);
1342  }
1343 
1347  inline XnStatus AddSupportedCapability(const XnChar* strNeededCapability)
1348  {
1349  return xnNodeQueryAddSupportedCapability(m_pQuery, strNeededCapability);
1350  }
1351 
1356  {
1357  return xnNodeQueryAddSupportedMapOutputMode(m_pQuery, &MapOutputMode);
1358  }
1359 
1363  inline XnStatus SetSupportedMinUserPositions(const XnUInt32 nCount)
1364  {
1365  return xnNodeQuerySetSupportedMinUserPositions(m_pQuery, nCount);
1366  }
1367 
1371  inline XnStatus SetExistingNodeOnly(XnBool bExistingNode)
1372  {
1373  return xnNodeQuerySetExistingNodeOnly(m_pQuery, bExistingNode);
1374  }
1375 
1379  inline XnStatus AddNeededNode(const XnChar* strInstanceName)
1380  {
1381  return xnNodeQueryAddNeededNode(m_pQuery, strInstanceName);
1382  }
1383 
1387  inline XnStatus SetCreationInfo(const XnChar* strCreationInfo)
1388  {
1389  return xnNodeQuerySetCreationInfo(m_pQuery, strCreationInfo);
1390  }
1391 
1392  private:
1393  XnNodeQuery* m_pQuery;
1394  XnBool m_bAllocated;
1395  };
1396 
1397  //---------------------------------------------------------------------------
1398  // Node Info List
1399  //---------------------------------------------------------------------------
1400 
1406  {
1407  public:
1409  class Iterator
1410  {
1411  public:
1412  friend class NodeInfoList;
1413 
1419  XnBool operator==(const Iterator& other) const
1420  {
1421  return m_it.pCurrent == other.m_it.pCurrent;
1422  }
1423 
1429  XnBool operator!=(const Iterator& other) const
1430  {
1431  return m_it.pCurrent != other.m_it.pCurrent;
1432  }
1433 
1439  {
1440  UpdateInternalObject(xnNodeInfoListGetNext(m_it));
1441  return *this;
1442  }
1443 
1448  inline Iterator operator++(int)
1449  {
1450  XnNodeInfoListIterator curr = m_it;
1451  UpdateInternalObject(xnNodeInfoListGetNext(m_it));
1452  return Iterator(curr);
1453  }
1454 
1459  {
1460  UpdateInternalObject(xnNodeInfoListGetPrevious(m_it));
1461  return *this;
1462  }
1463 
1467  inline Iterator operator--(int)
1468  {
1469  XnNodeInfoListIterator curr = m_it;
1470  UpdateInternalObject(xnNodeInfoListGetPrevious(m_it));
1471  return Iterator(curr);
1472  }
1473 
1476  {
1477  return m_Info;
1478  }
1479 
1480  private:
1481  inline Iterator(XnNodeInfoListIterator it) : m_Info(NULL)
1482  {
1483  UpdateInternalObject(it);
1484  }
1485 
1486  inline void UpdateInternalObject(XnNodeInfoListIterator it)
1487  {
1488  m_it = it;
1490  {
1491  XnNodeInfo* pInfo = xnNodeInfoListGetCurrent(it);
1492  m_Info = NodeInfo(pInfo);
1493  }
1494  else
1495  {
1496  m_Info = NodeInfo(NULL);
1497  }
1498  }
1499 
1500  NodeInfo m_Info;
1502  };
1503 
1507  inline NodeInfoList()
1508  {
1509  xnNodeInfoListAllocate(&m_pList);
1510  m_bAllocated = TRUE;
1511  }
1512 
1519  inline NodeInfoList(XnNodeInfoList* pList) : m_pList(pList), m_bAllocated(FALSE) {}
1520 
1522  inline ~NodeInfoList()
1523  {
1524  FreeImpl();
1525  }
1526 
1528  inline XnNodeInfoList* GetUnderlyingObject() const { return m_pList; }
1529 
1537  {
1538  FreeImpl();
1539  m_pList = pList;
1540  m_bAllocated = TRUE;
1541  }
1542 
1546  inline XnStatus Add(XnProductionNodeDescription& description, const XnChar* strCreationInfo, NodeInfoList* pNeededNodes)
1547  {
1548  XnNodeInfoList* pList = (pNeededNodes == NULL) ? NULL : pNeededNodes->GetUnderlyingObject();
1549  return xnNodeInfoListAdd(m_pList, &description, strCreationInfo, pList);
1550  }
1551 
1555  inline XnStatus AddEx(XnProductionNodeDescription& description, const XnChar* strCreationInfo, NodeInfoList* pNeededNodes, const void* pAdditionalData, XnFreeHandler pFreeHandler)
1556  {
1557  XnNodeInfoList* pList = (pNeededNodes == NULL) ? NULL : pNeededNodes->GetUnderlyingObject();
1558  return xnNodeInfoListAddEx(m_pList, &description, strCreationInfo, pList, pAdditionalData, pFreeHandler);
1559  }
1560 
1564  inline XnStatus AddNode(NodeInfo& info)
1565  {
1566  return xnNodeInfoListAddNode(m_pList, info);
1567  }
1568 
1573  {
1574  return xnNodeInfoListAddNodeFromList(m_pList, it.m_it);
1575  }
1576 
1578  inline Iterator Begin() const
1579  {
1580  return Iterator(xnNodeInfoListGetFirst(m_pList));
1581  }
1582 
1584  inline Iterator End() const
1585  {
1586  XnNodeInfoListIterator it = { NULL };
1587  return Iterator(it);
1588  }
1589 
1591  inline Iterator RBegin() const
1592  {
1593  return Iterator(xnNodeInfoListGetLast(m_pList));
1594  }
1595 
1597  inline Iterator REnd() const
1598  {
1599  XnNodeInfoListIterator it = { NULL };
1600  return Iterator(it);
1601  }
1602 
1607  {
1608  return xnNodeInfoListRemove(m_pList, it.m_it);
1609  }
1610 
1614  inline XnStatus Clear()
1615  {
1616  return xnNodeInfoListClear(m_pList);
1617  }
1618 
1623  {
1624  return xnNodeInfoListAppend(m_pList, other.GetUnderlyingObject());
1625  }
1626 
1630  inline XnBool IsEmpty()
1631  {
1632  return xnNodeInfoListIsEmpty(m_pList);
1633  }
1634 
1638  inline XnStatus FilterList(Context& context, Query& query);
1639 
1640  private:
1641  inline void FreeImpl()
1642  {
1643  if (m_bAllocated)
1644  {
1645  xnNodeInfoListFree(m_pList);
1646  m_bAllocated = FALSE;
1647  m_pList = NULL;
1648  }
1649  }
1650 
1651  XnNodeInfoList* m_pList;
1652  XnBool m_bAllocated;
1653  };
1654 
1655  //---------------------------------------------------------------------------
1656  // Production Nodes Functionality
1657  //---------------------------------------------------------------------------
1658 
1663  class Capability : public NodeWrapper
1664  {
1665  public:
1672  Capability(const NodeWrapper& node) : NodeWrapper(node) {}
1673  };
1674 
1680  {
1681  public:
1689 
1693  inline XnStatus GetErrorState() const
1694  {
1695  return xnGetNodeErrorState(GetHandle());
1696  }
1697 
1702  {
1703  return _RegisterToStateChange(xnRegisterToNodeErrorStateChange, GetHandle(), handler, pCookie, hCallback);
1704  }
1705 
1710  {
1711  _UnregisterFromStateChange(xnUnregisterFromNodeErrorStateChange, GetHandle(), hCallback);
1712  }
1713  };
1714 
1720  {
1721  public:
1728  GeneralIntCapability(XnNodeHandle hNode, const XnChar* strCap) : Capability(hNode), m_strCap(strCap) {}
1730 
1734  inline void GetRange(XnInt32& nMin, XnInt32& nMax, XnInt32& nStep, XnInt32& nDefault, XnBool& bIsAutoSupported) const
1735  {
1736  xnGetGeneralIntRange(GetHandle(), m_strCap, &nMin, &nMax, &nStep, &nDefault, &bIsAutoSupported);
1737  }
1738 
1742  inline XnInt32 Get()
1743  {
1744  XnInt32 nValue;
1745  xnGetGeneralIntValue(GetHandle(), m_strCap, &nValue);
1746  return nValue;
1747  }
1748 
1752  inline XnStatus Set(XnInt32 nValue)
1753  {
1754  return xnSetGeneralIntValue(GetHandle(), m_strCap, nValue);
1755  }
1756 
1760  XnStatus RegisterToValueChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback);
1761 
1765  void UnregisterFromValueChange(XnCallbackHandle hCallback);
1766 
1767  private:
1768  const XnChar* m_strCap;
1769  };
1770 
1776  {
1777  public:
1783  inline ProductionNode(XnNodeHandle hNode = NULL) : NodeWrapper(hNode) {}
1784  inline ProductionNode(const NodeWrapper& other) : NodeWrapper(other) {}
1785 
1789  inline NodeInfo GetInfo() const { return NodeInfo(xnGetNodeInfo(GetHandle())); }
1790 
1795  {
1796  return xnAddNeededNode(GetHandle(), needed.GetHandle());
1797  }
1798 
1803  {
1804  return xnRemoveNeededNode(GetHandle(), needed.GetHandle());
1805  }
1806 
1810  inline void GetContext(Context& context) const;
1811 
1815  inline XnBool IsCapabilitySupported(const XnChar* strCapabilityName) const
1816  {
1817  return xnIsCapabilitySupported(GetHandle(), strCapabilityName);
1818  }
1819 
1823  inline XnStatus SetIntProperty(const XnChar* strName, XnUInt64 nValue)
1824  {
1825  return xnSetIntProperty(GetHandle(), strName, nValue);
1826  }
1827 
1831  inline XnStatus SetRealProperty(const XnChar* strName, XnDouble dValue)
1832  {
1833  return xnSetRealProperty(GetHandle(), strName, dValue);
1834  }
1835 
1839  inline XnStatus SetStringProperty(const XnChar* strName, const XnChar* strValue)
1840  {
1841  return xnSetStringProperty(GetHandle(), strName, strValue);
1842  }
1843 
1847  inline XnStatus SetGeneralProperty(const XnChar* strName, XnUInt32 nBufferSize, const void* pBuffer)
1848  {
1849  return xnSetGeneralProperty(GetHandle(), strName, nBufferSize, pBuffer);
1850  }
1851 
1855  inline XnStatus GetIntProperty(const XnChar* strName, XnUInt64& nValue) const
1856  {
1857  return xnGetIntProperty(GetHandle(), strName, &nValue);
1858  }
1859 
1863  inline XnStatus GetRealProperty(const XnChar* strName, XnDouble &dValue) const
1864  {
1865  return xnGetRealProperty(GetHandle(), strName, &dValue);
1866  }
1867 
1871  inline XnStatus GetStringProperty(const XnChar* strName, XnChar* csValue, XnUInt32 nBufSize) const
1872  {
1873  return xnGetStringProperty(GetHandle(), strName, csValue, nBufSize);
1874  }
1875 
1879  inline XnStatus GetGeneralProperty(const XnChar* strName, XnUInt32 nBufferSize, void* pBuffer) const
1880  {
1881  return xnGetGeneralProperty(GetHandle(), strName, nBufferSize, pBuffer);
1882  }
1883 
1888  {
1889  return xnLockNodeForChanges(GetHandle(), phLock);
1890  }
1891 
1895  inline void UnlockForChanges(XnLockHandle hLock)
1896  {
1897  xnUnlockNodeForChanges(GetHandle(), hLock);
1898  }
1899 
1904  {
1905  return xnLockedNodeStartChanges(GetHandle(), hLock);
1906  }
1907 
1912  {
1913  xnLockedNodeEndChanges(GetHandle(), hLock);
1914  }
1915 
1922  {
1923  return ErrorStateCapability(GetHandle());
1924  }
1925 
1932  {
1933  return ErrorStateCapability(GetHandle());
1934  }
1935 
1943  inline GeneralIntCapability GetGeneralIntCap(const XnChar* strCapability)
1944  {
1945  return GeneralIntCapability(GetHandle(), strCapability);
1946  }
1947  };
1948 
1954  {
1955  public:
1963 
1967  inline XnStatus GetDeviceName(XnChar* strBuffer, XnUInt32 nBufferSize)
1968  {
1969  return xnGetDeviceName(GetHandle(), strBuffer, &nBufferSize);
1970  }
1971 
1975  inline XnStatus GetVendorSpecificData(XnChar* strBuffer, XnUInt32 nBufferSize)
1976  {
1977  return xnGetVendorSpecificData(GetHandle(), strBuffer, &nBufferSize);
1978  }
1979 
1983  inline XnStatus GetSerialNumber(XnChar* strBuffer, XnUInt32 nBufferSize)
1984  {
1985  return xnGetSerialNumber(GetHandle(), strBuffer, &nBufferSize);
1986  }
1987  };
1988 
1993  class Device : public ProductionNode
1994  {
1995  public:
2001  inline Device(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
2002  inline Device(const NodeWrapper& other) : ProductionNode(other) {}
2003 
2007  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
2008 
2015  {
2016  return DeviceIdentificationCapability(GetHandle());
2017  }
2018  };
2019 
2025  {
2026  public:
2032  inline MirrorCapability(XnNodeHandle hNode) : Capability(hNode) {}
2033  MirrorCapability(const NodeWrapper& node) : Capability(node) {}
2034 
2038  inline XnStatus SetMirror(XnBool bMirror)
2039  {
2040  return xnSetMirror(GetHandle(), bMirror);
2041  }
2042 
2046  inline XnBool IsMirrored() const
2047  {
2048  return xnIsMirrored(GetHandle());
2049  }
2050 
2054  inline XnStatus RegisterToMirrorChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
2055  {
2056  return _RegisterToStateChange(xnRegisterToMirrorChange, GetHandle(), handler, pCookie, hCallback);
2057  }
2058 
2063  {
2064  _UnregisterFromStateChange(xnUnregisterFromMirrorChange, GetHandle(), hCallback);
2065  }
2066  };
2067 
2073  {
2074  public:
2082 
2086  inline XnBool IsViewPointSupported(ProductionNode& otherNode) const
2087  {
2088  return xnIsViewPointSupported(GetHandle(), otherNode.GetHandle());
2089  }
2090 
2095  {
2096  return xnSetViewPoint(GetHandle(), otherNode.GetHandle());
2097  }
2098 
2103  {
2104  return xnResetViewPoint(GetHandle());
2105  }
2106 
2110  inline XnBool IsViewPointAs(ProductionNode& otherNode) const
2111  {
2112  return xnIsViewPointAs(GetHandle(), otherNode.GetHandle());
2113  }
2114 
2118  inline XnStatus RegisterToViewPointChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
2119  {
2120  return _RegisterToStateChange(xnRegisterToViewPointChange, GetHandle(), handler, pCookie, hCallback);
2121  }
2122 
2127  {
2128  _UnregisterFromStateChange(xnUnregisterFromViewPointChange, GetHandle(), hCallback);
2129  }
2130  };
2131 
2137  {
2138  public:
2144  inline FrameSyncCapability(XnNodeHandle hNode) : Capability(hNode) {}
2146 
2150  inline XnBool CanFrameSyncWith(Generator& other) const;
2151 
2155  inline XnStatus FrameSyncWith(Generator& other);
2156 
2160  inline XnStatus StopFrameSyncWith(Generator& other);
2161 
2165  inline XnBool IsFrameSyncedWith(Generator& other) const;
2166 
2170  inline XnStatus RegisterToFrameSyncChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
2171  {
2172  return _RegisterToStateChange(xnRegisterToFrameSyncChange, GetHandle(), handler, pCookie, hCallback);
2173  }
2174 
2179  {
2180  _UnregisterFromStateChange(xnUnregisterFromFrameSyncChange, GetHandle(), hCallback);
2181  }
2182  };
2183 
2188  class Generator : public ProductionNode
2189  {
2190  public:
2196  inline Generator(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
2197  inline Generator(const NodeWrapper& other) : ProductionNode(other) {}
2198 
2203  {
2204  return xnStartGenerating(GetHandle());
2205  }
2206 
2210  inline XnBool IsGenerating() const
2211  {
2212  return xnIsGenerating(GetHandle());
2213  }
2214 
2219  {
2220  return xnStopGenerating(GetHandle());
2221  }
2222 
2227  {
2228  return _RegisterToStateChange(xnRegisterToGenerationRunningChange, GetHandle(), handler, pCookie, hCallback);
2229  }
2230 
2235  {
2236  _UnregisterFromStateChange(xnUnregisterFromGenerationRunningChange, GetHandle(), hCallback);
2237  }
2238 
2243  {
2244  return _RegisterToStateChange(xnRegisterToNewDataAvailable, GetHandle(), handler, pCookie, hCallback);
2245  }
2246 
2251  {
2252  _UnregisterFromStateChange(xnUnregisterFromNewDataAvailable, GetHandle(), hCallback);
2253  }
2254 
2258  inline XnBool IsNewDataAvailable(XnUInt64* pnTimestamp = NULL) const
2259  {
2260  return xnIsNewDataAvailable(GetHandle(), pnTimestamp);
2261  }
2262 
2267  {
2268  return xnWaitAndUpdateData(GetHandle());
2269  }
2270 
2274  inline XnBool IsDataNew() const
2275  {
2276  return xnIsDataNew(GetHandle());
2277  }
2278 
2282  inline const void* GetData()
2283  {
2284  return xnGetData(GetHandle());
2285  }
2286 
2290  inline XnUInt32 GetDataSize() const
2291  {
2292  return xnGetDataSize(GetHandle());
2293  }
2294 
2298  inline XnUInt64 GetTimestamp() const
2299  {
2300  return xnGetTimestamp(GetHandle());
2301  }
2302 
2306  inline XnUInt32 GetFrameID() const
2307  {
2308  return xnGetFrameID(GetHandle());
2309  }
2310 
2316  inline const MirrorCapability GetMirrorCap() const
2317  {
2318  return MirrorCapability(GetHandle());
2319  }
2320 
2327  {
2328  return MirrorCapability(GetHandle());
2329  }
2330 
2337  {
2338  return AlternativeViewPointCapability(GetHandle());
2339  }
2340 
2347  {
2348  return AlternativeViewPointCapability(GetHandle());
2349  }
2350 
2357  {
2358  return FrameSyncCapability(GetHandle());
2359  }
2360 
2367  {
2368  return FrameSyncCapability(GetHandle());
2369  }
2370  };
2371 
2376  class Recorder : public ProductionNode
2377  {
2378  public:
2384  inline Recorder(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
2385  inline Recorder(const NodeWrapper& other) : ProductionNode(other) {}
2386 
2390  inline XnStatus Create(Context& context, const XnChar* strFormatName = NULL);
2391 
2395  inline XnStatus SetDestination(XnRecordMedium destType, const XnChar* strDest)
2396  {
2397  return xnSetRecorderDestination(GetHandle(), destType, strDest);
2398  }
2399 
2400  inline XnStatus GetDestination(XnRecordMedium& destType, XnChar* strDest, XnUInt32 nBufSize)
2401  {
2402  return xnGetRecorderDestination(GetHandle(), &destType, strDest, nBufSize);
2403  }
2404 
2409  {
2410  return xnAddNodeToRecording(GetHandle(), Node.GetHandle(), compression);
2411  }
2412 
2417  {
2418  return xnRemoveNodeFromRecording(GetHandle(), Node.GetHandle());
2419  }
2420 
2424  inline XnStatus Record()
2425  {
2426  return xnRecord(GetHandle());
2427  }
2428  };
2429 
2434  class Player : public ProductionNode
2435  {
2436  public:
2442  inline Player(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
2443  inline Player(const NodeWrapper& other) : ProductionNode(other) {}
2444 
2448  inline XnStatus Create(Context& context, const XnChar* strFormatName);
2449 
2453  inline XnStatus SetRepeat(XnBool bRepeat)
2454  {
2455  return xnSetPlayerRepeat(GetHandle(), bRepeat);
2456  }
2457 
2461  inline XnStatus SetSource(XnRecordMedium sourceType, const XnChar* strSource)
2462  {
2463  return xnSetPlayerSource(GetHandle(), sourceType, strSource);
2464  }
2465 
2469  inline XnStatus GetSource(XnRecordMedium &sourceType, XnChar* strSource, XnUInt32 nBufSize) const
2470  {
2471  return xnGetPlayerSource(GetHandle(), &sourceType, strSource, nBufSize);
2472  }
2473 
2478  {
2479  return xnPlayerReadNext(GetHandle());
2480  }
2481 
2485  inline XnStatus SeekToTimeStamp(XnInt64 nTimeOffset, XnPlayerSeekOrigin origin)
2486  {
2487  return xnSeekPlayerToTimeStamp(GetHandle(), nTimeOffset, origin);
2488  }
2489 
2493  inline XnStatus SeekToFrame(const XnChar* strNodeName, XnInt32 nFrameOffset, XnPlayerSeekOrigin origin)
2494  {
2495  return xnSeekPlayerToFrame(GetHandle(), strNodeName, nFrameOffset, origin);
2496  }
2497 
2501  inline XnStatus TellTimestamp(XnUInt64& nTimestamp) const
2502  {
2503  return xnTellPlayerTimestamp(GetHandle(), &nTimestamp);
2504  }
2505 
2509  inline XnStatus TellFrame(const XnChar* strNodeName, XnUInt32& nFrame) const
2510  {
2511  return xnTellPlayerFrame(GetHandle(), strNodeName, &nFrame);
2512  }
2513 
2517  inline XnStatus GetNumFrames(const XnChar* strNodeName, XnUInt32& nFrames) const
2518  {
2519  return xnGetPlayerNumFrames(GetHandle(), strNodeName, &nFrames);
2520  }
2521 
2525  inline const XnChar* GetSupportedFormat() const
2526  {
2527  return xnGetPlayerSupportedFormat(GetHandle());
2528  }
2529 
2534  {
2535  XnNodeInfoList* pList;
2536  XnStatus nRetVal = xnEnumeratePlayerNodes(GetHandle(), &pList);
2537  XN_IS_STATUS_OK(nRetVal);
2538 
2539  list.ReplaceUnderlyingObject(pList);
2540 
2541  return (XN_STATUS_OK);
2542  }
2543 
2547  inline XnBool IsEOF() const
2548  {
2549  return xnIsPlayerAtEOF(GetHandle());
2550  }
2551 
2556  {
2557  return _RegisterToStateChange(xnRegisterToEndOfFileReached, GetHandle(), handler, pCookie, hCallback);
2558  }
2559 
2564  {
2565  _UnregisterFromStateChange(xnUnregisterFromEndOfFileReached, GetHandle(), hCallback);
2566  }
2567 
2571  inline XnStatus SetPlaybackSpeed(XnDouble dSpeed)
2572  {
2573  return xnSetPlaybackSpeed(GetHandle(), dSpeed);
2574  }
2575 
2579  inline XnDouble GetPlaybackSpeed() const
2580  {
2581  return xnGetPlaybackSpeed(GetHandle());
2582  }
2583  };
2584 
2590  {
2591  public:
2597  inline CroppingCapability(XnNodeHandle hNode) : Capability(hNode) {}
2599 
2603  inline XnStatus SetCropping(const XnCropping& Cropping)
2604  {
2605  return xnSetCropping(GetHandle(), &Cropping);
2606  }
2607 
2611  inline XnStatus GetCropping(XnCropping& Cropping) const
2612  {
2613  return xnGetCropping(GetHandle(), &Cropping);
2614  }
2615 
2619  inline XnStatus RegisterToCroppingChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
2620  {
2621  return _RegisterToStateChange(xnRegisterToCroppingChange, GetHandle(), handler, pCookie, hCallback);
2622  }
2623 
2628  {
2629  _UnregisterFromStateChange(xnUnregisterFromCroppingChange, GetHandle(), hCallback);
2630  }
2631  };
2632 
2638  {
2639  public:
2647 
2652  {
2653  return xnSetPowerLineFrequency(GetHandle(), nFrequency);
2654  }
2655 
2660  {
2661  return xnGetPowerLineFrequency(GetHandle());
2662  }
2663 
2668  {
2669  return _RegisterToStateChange(xnRegisterToPowerLineFrequencyChange, GetHandle(), handler, pCookie, hCallback);
2670  }
2671 
2676  {
2677  _UnregisterFromStateChange(xnUnregisterFromPowerLineFrequencyChange, GetHandle(), hCallback);
2678  }
2679  };
2680 
2685  class MapGenerator : public Generator
2686  {
2687  public:
2693  inline MapGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
2694  inline MapGenerator(const NodeWrapper& other) : Generator(other) {}
2695 
2699  inline XnUInt32 GetSupportedMapOutputModesCount() const
2700  {
2701  return xnGetSupportedMapOutputModesCount(GetHandle());
2702  }
2703 
2707  inline XnStatus GetSupportedMapOutputModes(XnMapOutputMode* aModes, XnUInt32& nCount) const
2708  {
2709  return xnGetSupportedMapOutputModes(GetHandle(), aModes, &nCount);
2710  }
2711 
2715  inline XnStatus SetMapOutputMode(const XnMapOutputMode& OutputMode)
2716  {
2717  return xnSetMapOutputMode(GetHandle(), &OutputMode);
2718  }
2719 
2723  inline XnStatus GetMapOutputMode(XnMapOutputMode &OutputMode) const
2724  {
2725  return xnGetMapOutputMode(GetHandle(), &OutputMode);
2726  }
2727 
2731  inline XnUInt32 GetBytesPerPixel() const
2732  {
2733  return xnGetBytesPerPixel(GetHandle());
2734  }
2735 
2740  {
2741  return _RegisterToStateChange(xnRegisterToMapOutputModeChange, GetHandle(), handler, pCookie, hCallback);
2742  }
2743 
2748  {
2749  _UnregisterFromStateChange(xnUnregisterFromMapOutputModeChange, GetHandle(), hCallback);
2750  }
2751 
2757  inline const CroppingCapability GetCroppingCap() const
2758  {
2759  return CroppingCapability(GetHandle());
2760  }
2761 
2768  {
2769  return CroppingCapability(GetHandle());
2770  }
2771 
2778  {
2779  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_BRIGHTNESS);
2780  }
2781 
2788  {
2789  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_CONTRAST);
2790  }
2791 
2798  {
2799  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_HUE);
2800  }
2801 
2808  {
2809  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_SATURATION);
2810  }
2811 
2818  {
2819  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_SHARPNESS);
2820  }
2821 
2828  {
2829  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_GAMMA);
2830  }
2831 
2838  {
2840  }
2841 
2848  {
2850  }
2851 
2858  {
2859  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_GAIN);
2860  }
2861 
2868  {
2869  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_PAN);
2870  }
2871 
2878  {
2879  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_TILT);
2880  }
2881 
2888  {
2889  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_ROLL);
2890  }
2891 
2898  {
2899  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_ZOOM);
2900  }
2901 
2908  {
2909  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_EXPOSURE);
2910  }
2911 
2918  {
2919  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_IRIS);
2920  }
2921 
2928  {
2929  return GeneralIntCapability(GetHandle(), XN_CAPABILITY_FOCUS);
2930  }
2931 
2938  {
2940  }
2941 
2948  {
2949  return AntiFlickerCapability(GetHandle());
2950  }
2951  };
2952 
2958  {
2959  public:
2965  inline UserPositionCapability(XnNodeHandle hNode = NULL) : Capability(hNode) {}
2967 
2971  inline XnUInt32 GetSupportedUserPositionsCount() const
2972  {
2973  return xnGetSupportedUserPositionsCount(GetHandle());
2974  }
2975 
2979  inline XnStatus SetUserPosition(XnUInt32 nIndex, const XnBoundingBox3D& Position)
2980  {
2981  return xnSetUserPosition(GetHandle(), nIndex, &Position);
2982  }
2983 
2987  inline XnStatus GetUserPosition(XnUInt32 nIndex, XnBoundingBox3D& Position) const
2988  {
2989  return xnGetUserPosition(GetHandle(), nIndex, &Position);
2990  }
2991 
2996  {
2997  return _RegisterToStateChange(xnRegisterToUserPositionChange, GetHandle(), handler, pCookie, hCallback);
2998  }
2999 
3004  {
3005  _UnregisterFromStateChange(xnUnregisterFromUserPositionChange, GetHandle(), hCallback);
3006  }
3007  };
3008 
3014  {
3015  public:
3021  inline DepthGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
3022  inline DepthGenerator(const NodeWrapper& other) : MapGenerator(other) {}
3023 
3027  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3028 
3032  inline void GetMetaData(DepthMetaData& metaData) const
3033  {
3034  xnGetDepthMetaData(GetHandle(), metaData.GetUnderlying());
3035  }
3036 
3040  inline const XnDepthPixel* GetDepthMap() const
3041  {
3042  return xnGetDepthMap(GetHandle());
3043  }
3044 
3049  {
3050  return xnGetDeviceMaxDepth(GetHandle());
3051  }
3052 
3057  {
3058  return xnGetDepthFieldOfView(GetHandle(), &FOV);
3059  }
3060 
3065  {
3066  return _RegisterToStateChange(xnRegisterToDepthFieldOfViewChange, GetHandle(), handler, pCookie, hCallback);
3067  }
3068 
3073  {
3074  _UnregisterFromStateChange(xnUnregisterFromDepthFieldOfViewChange, GetHandle(), hCallback);
3075  }
3076 
3080  inline XnStatus ConvertProjectiveToRealWorld(XnUInt32 nCount, const XnPoint3D aProjective[], XnPoint3D aRealWorld[]) const
3081  {
3082  return xnConvertProjectiveToRealWorld(GetHandle(), nCount, aProjective, aRealWorld);
3083  }
3084 
3088  inline XnStatus ConvertRealWorldToProjective(XnUInt32 nCount, const XnPoint3D aRealWorld[], XnPoint3D aProjective[]) const
3089  {
3090  return xnConvertRealWorldToProjective(GetHandle(), nCount, aRealWorld, aProjective);
3091  }
3092 
3099  {
3100  return UserPositionCapability(GetHandle());
3101  }
3102 
3109  {
3110  return UserPositionCapability(GetHandle());
3111  }
3112  };
3113 
3119  {
3120  public:
3126  inline MockDepthGenerator(XnNodeHandle hNode = NULL) : DepthGenerator(hNode) {}
3127  inline MockDepthGenerator(const NodeWrapper& other) : DepthGenerator(other) {}
3128 
3135  XnStatus Create(Context& context, const XnChar* strName = NULL);
3136 
3143  XnStatus CreateBasedOn(DepthGenerator& other, const XnChar* strName = NULL);
3144 
3148  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel* pDepthMap)
3149  {
3150  return xnMockDepthSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pDepthMap);
3151  }
3152 
3160  inline XnStatus SetData(const DepthMetaData& depthMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
3161  {
3162  return SetData(nFrameID, nTimestamp, depthMD.DataSize(), depthMD.Data());
3163  }
3164 
3170  inline XnStatus SetData(const DepthMetaData& depthMD)
3171  {
3172  return SetData(depthMD, depthMD.FrameID(), depthMD.Timestamp());
3173  }
3174  };
3175 
3181  {
3182  public:
3188  inline ImageGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
3189  inline ImageGenerator(const NodeWrapper& other) : MapGenerator(other) {}
3190 
3194  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3195 
3199  inline void GetMetaData(ImageMetaData& metaData) const
3200  {
3201  xnGetImageMetaData(GetHandle(), metaData.GetUnderlying());
3202  }
3203 
3207  inline const XnRGB24Pixel* GetRGB24ImageMap() const
3208  {
3209  return xnGetRGB24ImageMap(GetHandle());
3210  }
3211 
3216  {
3217  return xnGetYUV422ImageMap(GetHandle());
3218  }
3219 
3224  {
3225  return xnGetGrayscale8ImageMap(GetHandle());
3226  }
3227 
3232  {
3233  return xnGetGrayscale16ImageMap(GetHandle());
3234  }
3235 
3239  inline const XnUInt8* GetImageMap() const
3240  {
3241  return xnGetImageMap(GetHandle());
3242  }
3243 
3247  inline XnBool IsPixelFormatSupported(XnPixelFormat Format) const
3248  {
3249  return xnIsPixelFormatSupported(GetHandle(), Format);
3250  }
3251 
3256  {
3257  return xnSetPixelFormat(GetHandle(), Format);
3258  }
3259 
3264  {
3265  return xnGetPixelFormat(GetHandle());
3266  }
3267 
3272  {
3273  return _RegisterToStateChange(xnRegisterToPixelFormatChange, GetHandle(), handler, pCookie, hCallback);
3274  }
3275 
3280  {
3281  _UnregisterFromStateChange(xnUnregisterFromPixelFormatChange, GetHandle(), hCallback);
3282  }
3283  };
3284 
3290  {
3291  public:
3297  inline MockImageGenerator(XnNodeHandle hNode = NULL) : ImageGenerator(hNode) {}
3298  inline MockImageGenerator(const NodeWrapper& other) : ImageGenerator(other) {}
3299 
3306  XnStatus Create(Context& context, const XnChar* strName = NULL);
3307 
3314  XnStatus CreateBasedOn(ImageGenerator& other, const XnChar* strName = NULL);
3315 
3319  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pImageMap)
3320  {
3321  return xnMockImageSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pImageMap);
3322  }
3323 
3331  inline XnStatus SetData(const ImageMetaData& imageMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
3332  {
3333  return SetData(nFrameID, nTimestamp, imageMD.DataSize(), imageMD.Data());
3334  }
3335 
3341  inline XnStatus SetData(const ImageMetaData& imageMD)
3342  {
3343  return SetData(imageMD, imageMD.FrameID(), imageMD.Timestamp());
3344  }
3345  };
3346 
3351  class IRGenerator : public MapGenerator
3352  {
3353  public:
3359  inline IRGenerator(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
3360  inline IRGenerator(const NodeWrapper& other) : MapGenerator(other) {}
3361 
3365  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3366 
3370  inline void GetMetaData(IRMetaData& metaData) const
3371  {
3372  xnGetIRMetaData(GetHandle(), metaData.GetUnderlying());
3373  }
3374 
3378  inline const XnIRPixel* GetIRMap() const
3379  {
3380  return xnGetIRMap(GetHandle());
3381  }
3382  };
3383 
3389  {
3390  public:
3396  inline MockIRGenerator(XnNodeHandle hNode = NULL) : IRGenerator(hNode) {}
3397  inline MockIRGenerator(const NodeWrapper& other) : IRGenerator(other) {}
3398 
3405  XnStatus Create(Context& context, const XnChar* strName = NULL);
3412  XnStatus CreateBasedOn(IRGenerator& other, const XnChar* strName = NULL);
3413 
3417  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnIRPixel* pIRMap)
3418  {
3419  return xnMockIRSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pIRMap);
3420  }
3421 
3429  inline XnStatus SetData(const IRMetaData& irMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
3430  {
3431  return SetData(nFrameID, nTimestamp, irMD.DataSize(), irMD.Data());
3432  }
3433 
3439  inline XnStatus SetData(const IRMetaData& irMD)
3440  {
3441  return SetData(irMD, irMD.FrameID(), irMD.Timestamp());
3442  }
3443  };
3444 
3450  {
3451  public:
3457  inline GestureGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
3458  inline GestureGenerator(const NodeWrapper& other) : Generator(other) {}
3459 
3463  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3464 
3468  inline XnStatus AddGesture(const XnChar* strGesture, XnBoundingBox3D* pArea)
3469  {
3470  return xnAddGesture(GetHandle(), strGesture, pArea);
3471  }
3472 
3476  inline XnStatus RemoveGesture(const XnChar* strGesture)
3477  {
3478  return xnRemoveGesture(GetHandle(), strGesture);
3479  }
3480 
3484  inline XnStatus GetActiveGestures(XnChar*& astrGestures, XnUInt16& nGestures) const
3485  {
3486  return xnGetActiveGestures(GetHandle(), &astrGestures, &nGestures);
3487  }
3488 
3492  inline XnStatus GetAllActiveGestures(XnChar** astrGestures, XnUInt32 nNameLength, XnUInt16& nGestures) const
3493  {
3494  return xnGetAllActiveGestures(GetHandle(), astrGestures, nNameLength, &nGestures);
3495  }
3496 
3500  inline XnStatus EnumerateGestures(XnChar*& astrGestures, XnUInt16& nGestures) const
3501  {
3502  return xnEnumerateGestures(GetHandle(), &astrGestures, &nGestures);
3503  }
3504 
3508  inline XnUInt16 GetNumberOfAvailableGestures() const
3509  {
3510  return xnGetNumberOfAvailableGestures(GetHandle());
3511  }
3512 
3516  inline XnStatus EnumerateAllGestures(XnChar** astrGestures, XnUInt32 nNameLength, XnUInt16& nGestures) const
3517  {
3518  return xnEnumerateAllGestures(GetHandle(), astrGestures, nNameLength, &nGestures);
3519  }
3520 
3524  inline XnBool IsGestureAvailable(const XnChar* strGesture) const
3525  {
3526  return xnIsGestureAvailable(GetHandle(), strGesture);
3527  }
3528 
3532  inline XnBool IsGestureProgressSupported(const XnChar* strGesture) const
3533  {
3534  return xnIsGestureProgressSupported(GetHandle(), strGesture);
3535  }
3536 
3546  typedef void (XN_CALLBACK_TYPE* GestureRecognized)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pIDPosition, const XnPoint3D* pEndPosition, void* pCookie);
3556  typedef void (XN_CALLBACK_TYPE* GestureProgress)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pPosition, XnFloat fProgress, void* pCookie);
3557 
3561  XnStatus RegisterGestureCallbacks(GestureRecognized RecognizedCB, GestureProgress ProgressCB, void* pCookie, XnCallbackHandle& hCallback)
3562  {
3563  XnStatus nRetVal = XN_STATUS_OK;
3564 
3565  GestureCookie* pGestureCookie;
3566  XN_VALIDATE_ALLOC(pGestureCookie, GestureCookie);
3567  pGestureCookie->recognizedHandler = RecognizedCB;
3568  pGestureCookie->progressHandler = ProgressCB;
3569  pGestureCookie->pUserCookie = pCookie;
3570 
3571  nRetVal = xnRegisterGestureCallbacks(GetHandle(), GestureRecognizedCallback, GestureProgressCallback, pGestureCookie, &pGestureCookie->hCallback);
3572  if (nRetVal != XN_STATUS_OK)
3573  {
3574  xnOSFree(pGestureCookie);
3575  return (nRetVal);
3576  }
3577 
3578  hCallback = pGestureCookie;
3579 
3580  return (XN_STATUS_OK);
3581  }
3582 
3587  {
3588  GestureCookie* pGestureCookie = (GestureCookie*)hCallback;
3589  xnUnregisterGestureCallbacks(GetHandle(), pGestureCookie->hCallback);
3590  xnOSFree(pGestureCookie);
3591  }
3592 
3596  inline XnStatus RegisterToGestureChange(StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
3597  {
3598  return _RegisterToStateChange(xnRegisterToGestureChange, GetHandle(), handler, pCookie, hCallback);
3599  }
3600 
3605  {
3606  _UnregisterFromStateChange(xnUnregisterFromGestureChange, GetHandle(), hCallback);
3607  }
3608 
3617  typedef void (XN_CALLBACK_TYPE* GestureIntermediateStageCompleted)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
3621  XnStatus RegisterToGestureIntermediateStageCompleted(GestureIntermediateStageCompleted handler, void* pCookie, XnCallbackHandle& hCallback)
3622  {
3623  XnStatus nRetVal = XN_STATUS_OK;
3624 
3625  GestureIntermediateStageCompletedCookie* pGestureCookie;
3626  XN_VALIDATE_ALLOC(pGestureCookie, GestureIntermediateStageCompletedCookie);
3627  pGestureCookie->handler = handler;
3628  pGestureCookie->pUserCookie = pCookie;
3629 
3630  nRetVal = xnRegisterToGestureIntermediateStageCompleted(GetHandle(), GestureIntermediateStageCompletedCallback, pGestureCookie, &pGestureCookie->hCallback);
3631  if (nRetVal != XN_STATUS_OK)
3632  {
3633  xnOSFree(pGestureCookie);
3634  return (nRetVal);
3635  }
3636 
3637  hCallback = pGestureCookie;
3638 
3639  return (XN_STATUS_OK);
3640  }
3645  {
3646  GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)hCallback;
3647  xnUnregisterFromGestureIntermediateStageCompleted(GetHandle(), pGestureCookie->hCallback);
3648  xnOSFree(pGestureCookie);
3649  }
3650 
3659  typedef void (XN_CALLBACK_TYPE* GestureReadyForNextIntermediateStage)(GestureGenerator& generator, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie);
3663  XnStatus RegisterToGestureReadyForNextIntermediateStage(GestureReadyForNextIntermediateStage handler, void* pCookie, XnCallbackHandle& hCallback)
3664  {
3665  XnStatus nRetVal = XN_STATUS_OK;
3666 
3667  GestureReadyForNextIntermediateStageCookie* pGestureCookie;
3668  XN_VALIDATE_ALLOC(pGestureCookie, GestureReadyForNextIntermediateStageCookie);
3669  pGestureCookie->handler = handler;
3670  pGestureCookie->pUserCookie = pCookie;
3671 
3672  nRetVal = xnRegisterToGestureReadyForNextIntermediateStage(GetHandle(), GestureReadyForNextIntermediateStageCallback, pGestureCookie, &pGestureCookie->hCallback);
3673  if (nRetVal != XN_STATUS_OK)
3674  {
3675  xnOSFree(pGestureCookie);
3676  return (nRetVal);
3677  }
3678 
3679  hCallback = pGestureCookie;
3680 
3681  return (XN_STATUS_OK);
3682  }
3683 
3688  {
3689  GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)hCallback;
3690  xnUnregisterFromGestureReadyForNextIntermediateStage(GetHandle(), pGestureCookie->hCallback);
3691  xnOSFree(pGestureCookie);
3692  }
3693 
3694  private:
3695  typedef struct GestureCookie
3696  {
3697  GestureRecognized recognizedHandler;
3698  GestureProgress progressHandler;
3699  void* pUserCookie;
3700  XnCallbackHandle hCallback;
3701  } GestureCookie;
3702 
3703  static void XN_CALLBACK_TYPE GestureRecognizedCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pIDPosition, const XnPoint3D* pEndPosition, void* pCookie)
3704  {
3705  GestureCookie* pGestureCookie = (GestureCookie*)pCookie;
3706  GestureGenerator gen(hNode);
3707  if (pGestureCookie->recognizedHandler != NULL)
3708  {
3709  pGestureCookie->recognizedHandler(gen, strGesture, pIDPosition, pEndPosition, pGestureCookie->pUserCookie);
3710  }
3711  }
3712 
3713  static void XN_CALLBACK_TYPE GestureProgressCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, XnFloat fProgress, void* pCookie)
3714  {
3715  GestureCookie* pGestureCookie = (GestureCookie*)pCookie;
3716  GestureGenerator gen(hNode);
3717  if (pGestureCookie->progressHandler != NULL)
3718  {
3719  pGestureCookie->progressHandler(gen, strGesture, pPosition, fProgress, pGestureCookie->pUserCookie);
3720  }
3721  }
3722 
3723  typedef struct GestureIntermediateStageCompletedCookie
3724  {
3725  GestureIntermediateStageCompleted handler;
3726  void* pUserCookie;
3727  XnCallbackHandle hCallback;
3728  } GestureIntermediateStageCompletedCookie;
3729 
3730  static void XN_CALLBACK_TYPE GestureIntermediateStageCompletedCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie)
3731  {
3732  GestureIntermediateStageCompletedCookie* pGestureCookie = (GestureIntermediateStageCompletedCookie*)pCookie;
3733  GestureGenerator gen(hNode);
3734  if (pGestureCookie->handler != NULL)
3735  {
3736  pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
3737  }
3738  }
3739 
3740  typedef struct GestureReadyForNextIntermediateStageCookie
3741  {
3742  GestureReadyForNextIntermediateStage handler;
3743  void* pUserCookie;
3744  XnCallbackHandle hCallback;
3745  } GestureReadyForNextIntermediateStageCookie;
3746 
3747  static void XN_CALLBACK_TYPE GestureReadyForNextIntermediateStageCallback(XnNodeHandle hNode, const XnChar* strGesture, const XnPoint3D* pPosition, void* pCookie)
3748  {
3749  GestureReadyForNextIntermediateStageCookie* pGestureCookie = (GestureReadyForNextIntermediateStageCookie*)pCookie;
3750  GestureGenerator gen(hNode);
3751  if (pGestureCookie->handler != NULL)
3752  {
3753  pGestureCookie->handler(gen, strGesture, pPosition, pGestureCookie->pUserCookie);
3754  }
3755  }
3756  };
3757 
3763  {
3764  public:
3770  inline SceneAnalyzer(XnNodeHandle hNode = NULL) : MapGenerator(hNode) {}
3771  inline SceneAnalyzer(const NodeWrapper& other) : MapGenerator(other) {}
3772 
3776  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3777 
3781  inline void GetMetaData(SceneMetaData& metaData) const
3782  {
3783  xnGetSceneMetaData(GetHandle(), metaData.GetUnderlying());
3784  }
3785 
3789  inline const XnLabel* GetLabelMap() const
3790  {
3791  return xnGetLabelMap(GetHandle());
3792  }
3793 
3797  inline XnStatus GetFloor(XnPlane3D& Plane) const
3798  {
3799  return xnGetFloor(GetHandle(), &Plane);
3800  }
3801  };
3802 
3808  {
3809  public:
3817 
3828  typedef void (XN_CALLBACK_TYPE* HandTouchingFOVEdge)(HandTouchingFOVEdgeCapability& touchingfov, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie);
3832  inline XnStatus RegisterToHandTouchingFOVEdge(HandTouchingFOVEdge handler, void* pCookie, XnCallbackHandle& hCallback)
3833  {
3834  XnStatus nRetVal = XN_STATUS_OK;
3835 
3836  HandTouchingFOVEdgeCookie* pHandCookie;
3837  XN_VALIDATE_ALLOC(pHandCookie, HandTouchingFOVEdgeCookie);
3838  pHandCookie->handler = handler;
3839  pHandCookie->pUserCookie = pCookie;
3840 
3841  nRetVal = xnRegisterToHandTouchingFOVEdge(GetHandle(), HandTouchingFOVEdgeCB, pHandCookie, &pHandCookie->hCallback);
3842  if (nRetVal != XN_STATUS_OK)
3843  {
3844  xnOSFree(pHandCookie);
3845  return (nRetVal);
3846  }
3847 
3848  hCallback = pHandCookie;
3849 
3850  return (XN_STATUS_OK);
3851  }
3852 
3857  {
3858  HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)hCallback;
3859  xnUnregisterFromHandTouchingFOVEdge(GetHandle(), pHandCookie->hCallback);
3860  xnOSFree(pHandCookie);
3861  }
3862  private:
3863  typedef struct HandTouchingFOVEdgeCookie
3864  {
3865  HandTouchingFOVEdge handler;
3866  void* pUserCookie;
3867  XnCallbackHandle hCallback;
3868  } HandTouchingFOVEdgeCookie;
3869 
3870  static void XN_CALLBACK_TYPE HandTouchingFOVEdgeCB(XnNodeHandle hNode, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, XnDirection eDir, void* pCookie)
3871  {
3872  HandTouchingFOVEdgeCookie* pHandCookie = (HandTouchingFOVEdgeCookie*)pCookie;
3873  HandTouchingFOVEdgeCapability cap(hNode);
3874  if (pHandCookie->handler != NULL)
3875  {
3876  pHandCookie->handler(cap, user, pPosition, fTime, eDir, pHandCookie->pUserCookie);
3877  }
3878  }
3879 
3880  };
3885  class HandsGenerator : public Generator
3886  {
3887  public:
3893  inline HandsGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
3894  inline HandsGenerator(const NodeWrapper& other) : Generator(other) {}
3895 
3899  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
3900 
3910  typedef void (XN_CALLBACK_TYPE* HandCreate)(HandsGenerator& generator, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie);
3920  typedef void (XN_CALLBACK_TYPE* HandUpdate)(HandsGenerator& generator, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie);
3929  typedef void (XN_CALLBACK_TYPE* HandDestroy)(HandsGenerator& generator, XnUserID user, XnFloat fTime, void* pCookie);
3930 
3934  inline XnStatus RegisterHandCallbacks(HandCreate CreateCB, HandUpdate UpdateCB, HandDestroy DestroyCB, void* pCookie, XnCallbackHandle& hCallback)
3935  {
3936  XnStatus nRetVal = XN_STATUS_OK;
3937 
3938  HandCookie* pHandCookie;
3939  XN_VALIDATE_ALLOC(pHandCookie, HandCookie);
3940  pHandCookie->createHandler = CreateCB;
3941  pHandCookie->updateHandler = UpdateCB;
3942  pHandCookie->destroyHandler = DestroyCB;
3943  pHandCookie->pUserCookie = pCookie;
3944 
3945  nRetVal = xnRegisterHandCallbacks(GetHandle(), HandCreateCB, HandUpdateCB, HandDestroyCB, pHandCookie, &pHandCookie->hCallback);
3946  if (nRetVal != XN_STATUS_OK)
3947  {
3948  xnOSFree(pHandCookie);
3949  return (nRetVal);
3950  }
3951 
3952  hCallback = pHandCookie;
3953 
3954  return (XN_STATUS_OK);
3955  }
3956 
3961  {
3962  HandCookie* pHandCookie = (HandCookie*)hCallback;
3963  xnUnregisterHandCallbacks(GetHandle(), pHandCookie->hCallback);
3964  xnOSFree(pHandCookie);
3965  }
3966 
3971  {
3972  return xnStopTracking(GetHandle(), user);
3973  }
3974 
3979  {
3980  return xnStopTrackingAll(GetHandle());
3981  }
3982 
3986  inline XnStatus StartTracking(const XnPoint3D& ptPosition)
3987  {
3988  return xnStartTracking(GetHandle(), &ptPosition);
3989  }
3990 
3994  inline XnStatus SetSmoothing(XnFloat fSmoothingFactor)
3995  {
3996  return xnSetTrackingSmoothing(GetHandle(), fSmoothingFactor);
3997  }
3998 
4005  {
4006  return HandTouchingFOVEdgeCapability(GetHandle());
4007  }
4008 
4015  {
4016  return HandTouchingFOVEdgeCapability(GetHandle());
4017  }
4018 
4019  private:
4020  typedef struct HandCookie
4021  {
4022  HandCreate createHandler;
4023  HandUpdate updateHandler;
4024  HandDestroy destroyHandler;
4025  void* pUserCookie;
4026  XnCallbackHandle hCallback;
4027  } HandCookie;
4028 
4029  static void XN_CALLBACK_TYPE HandCreateCB(XnNodeHandle hNode, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie)
4030  {
4031  HandCookie* pHandCookie = (HandCookie*)pCookie;
4032  HandsGenerator gen(hNode);
4033  if (pHandCookie->createHandler != NULL)
4034  {
4035  pHandCookie->createHandler(gen, user, pPosition, fTime, pHandCookie->pUserCookie);
4036  }
4037  }
4038  static void XN_CALLBACK_TYPE HandUpdateCB(XnNodeHandle hNode, XnUserID user, const XnPoint3D* pPosition, XnFloat fTime, void* pCookie)
4039  {
4040  HandCookie* pHandCookie = (HandCookie*)pCookie;
4041  HandsGenerator gen(hNode);
4042  if (pHandCookie->updateHandler != NULL)
4043  {
4044  pHandCookie->updateHandler(gen, user, pPosition, fTime, pHandCookie->pUserCookie);
4045  }
4046  }
4047  static void XN_CALLBACK_TYPE HandDestroyCB(XnNodeHandle hNode, XnUserID user, XnFloat fTime, void* pCookie)
4048  {
4049  HandCookie* pHandCookie = (HandCookie*)pCookie;
4050  HandsGenerator gen(hNode);
4051  if (pHandCookie->destroyHandler != NULL)
4052  {
4053  pHandCookie->destroyHandler(gen, user, fTime, pHandCookie->pUserCookie);
4054  }
4055  }
4056  };
4057 
4063  {
4064  public:
4070  inline SkeletonCapability(XnNodeHandle hNode) : Capability(hNode) {}
4072 
4076  inline XnBool IsJointAvailable(XnSkeletonJoint eJoint) const
4077  {
4078  return xnIsJointAvailable(GetHandle(), eJoint);
4079  }
4080 
4084  inline XnBool IsProfileAvailable(XnSkeletonProfile eProfile) const
4085  {
4086  return xnIsProfileAvailable(GetHandle(), eProfile);
4087  }
4088 
4093  {
4094  return xnSetSkeletonProfile(GetHandle(), eProfile);
4095  }
4096 
4100  inline XnStatus SetJointActive(XnSkeletonJoint eJoint, XnBool bState)
4101  {
4102  return xnSetJointActive(GetHandle(), eJoint, bState);
4103  }
4104 
4108  XN_API_DEPRECATED("Use the version with one argument")
4109  inline XnBool IsJointActive(XnSkeletonJoint eJoint, XnBool /*bState*/) const
4110  {
4111  return xnIsJointActive(GetHandle(), eJoint);
4112  }
4113 
4117  inline XnBool IsJointActive(XnSkeletonJoint eJoint) const
4118  {
4119  return xnIsJointActive(GetHandle(), eJoint);
4120  }
4121 
4126  {
4127  return _RegisterToStateChange(xnRegisterToJointConfigurationChange, GetHandle(), handler, pCookie, hCallback);
4128  }
4129 
4134  {
4135  _UnregisterFromStateChange(xnUnregisterFromJointConfigurationChange, GetHandle(), hCallback);
4136  }
4137 
4141  inline XnStatus EnumerateActiveJoints(XnSkeletonJoint* pJoints, XnUInt16& nJoints) const
4142  {
4143  return xnEnumerateActiveJoints(GetHandle(), pJoints, &nJoints);
4144  }
4145 
4150  {
4151  return xnGetSkeletonJoint(GetHandle(), user, eJoint, &Joint);
4152  }
4153 
4158  {
4159  return xnGetSkeletonJointPosition(GetHandle(), user, eJoint, &Joint);
4160  }
4161 
4166  {
4167  return xnGetSkeletonJointOrientation(GetHandle(), user, eJoint, &Joint);
4168  }
4169 
4173  inline XnBool IsTracking(XnUserID user) const
4174  {
4175  return xnIsSkeletonTracking(GetHandle(), user);
4176  }
4177 
4181  inline XnBool IsCalibrated(XnUserID user) const
4182  {
4183  return xnIsSkeletonCalibrated(GetHandle(), user);
4184  }
4185 
4189  inline XnBool IsCalibrating(XnUserID user) const
4190  {
4191  return xnIsSkeletonCalibrating(GetHandle(), user);
4192  }
4193 
4197  inline XnStatus RequestCalibration(XnUserID user, XnBool bForce)
4198  {
4199  return xnRequestSkeletonCalibration(GetHandle(), user, bForce);
4200  }
4201 
4206  {
4207  return xnAbortSkeletonCalibration(GetHandle(), user);
4208  }
4209 
4213  inline XnStatus SaveCalibrationDataToFile(XnUserID user, const XnChar* strFileName)
4214  {
4215  return xnSaveSkeletonCalibrationDataToFile(GetHandle(), user, strFileName);
4216  }
4217 
4221  inline XnStatus LoadCalibrationDataFromFile(XnUserID user, const XnChar* strFileName)
4222  {
4223  return xnLoadSkeletonCalibrationDataFromFile(GetHandle(), user, strFileName);
4224  }
4225 
4229  inline XnStatus SaveCalibrationData(XnUserID user, XnUInt32 nSlot)
4230  {
4231  return xnSaveSkeletonCalibrationData(GetHandle(), user, nSlot);
4232  }
4233 
4237  inline XnStatus LoadCalibrationData(XnUserID user, XnUInt32 nSlot)
4238  {
4239  return xnLoadSkeletonCalibrationData(GetHandle(), user, nSlot);
4240  }
4241 
4245  inline XnStatus ClearCalibrationData(XnUInt32 nSlot)
4246  {
4247  return xnClearSkeletonCalibrationData(GetHandle(), nSlot);
4248  }
4249 
4253  inline XnBool IsCalibrationData(XnUInt32 nSlot) const
4254  {
4255  return xnIsSkeletonCalibrationData(GetHandle(), nSlot);
4256  }
4257 
4262  {
4263  return xnStartSkeletonTracking(GetHandle(), user);
4264  }
4265 
4270  {
4271  return xnStopSkeletonTracking(GetHandle(), user);
4272  }
4273 
4277  inline XnStatus Reset(XnUserID user)
4278  {
4279  return xnResetSkeleton(GetHandle(), user);
4280  }
4281 
4285  inline XnBool NeedPoseForCalibration() const
4286  {
4287  return xnNeedPoseForSkeletonCalibration(GetHandle());
4288  }
4289 
4293  inline XnStatus GetCalibrationPose(XnChar* strPose) const
4294  {
4295  return xnGetSkeletonCalibrationPose(GetHandle(), strPose);
4296  }
4297 
4301  inline XnStatus SetSmoothing(XnFloat fSmoothingFactor)
4302  {
4303  return xnSetSkeletonSmoothing(GetHandle(), fSmoothingFactor);
4304  }
4305 
4313  typedef void (XN_CALLBACK_TYPE* CalibrationStart)(SkeletonCapability& skeleton, XnUserID user, void* pCookie);
4322  typedef void (XN_CALLBACK_TYPE* CalibrationEnd)(SkeletonCapability& skeleton, XnUserID user, XnBool bSuccess, void* pCookie);
4323 
4327  inline XnStatus XN_API_DEPRECATED("Please use RegisterToCalibrationStart/Complete") RegisterCalibrationCallbacks(CalibrationStart CalibrationStartCB, CalibrationEnd CalibrationEndCB, void* pCookie, XnCallbackHandle& hCallback)
4328  {
4329  XnStatus nRetVal = XN_STATUS_OK;
4330 
4331  SkeletonCookie* pSkeletonCookie;
4332  XN_VALIDATE_ALLOC(pSkeletonCookie, SkeletonCookie);
4333  pSkeletonCookie->startHandler = CalibrationStartCB;
4334  pSkeletonCookie->endHandler = CalibrationEndCB;
4335  pSkeletonCookie->pUserCookie = pCookie;
4336 
4337 #pragma warning (push)
4338 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
4339  nRetVal = xnRegisterCalibrationCallbacks(GetHandle(), CalibrationStartBundleCallback, CalibrationEndBundleCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
4340 #pragma warning (pop)
4341  if (nRetVal != XN_STATUS_OK)
4342  {
4343  xnOSFree(pSkeletonCookie);
4344  return (nRetVal);
4345  }
4346 
4347  hCallback = pSkeletonCookie;
4348 
4349  return (XN_STATUS_OK);
4350  }
4351 
4355  inline void XN_API_DEPRECATED("Please use UnregisterFromCalibrationStart/Complete") UnregisterCalibrationCallbacks(XnCallbackHandle hCallback)
4356  {
4357  SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)hCallback;
4358 #pragma warning (push)
4359 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
4360  xnUnregisterCalibrationCallbacks(GetHandle(), pSkeletonCookie->hCallback);
4361 #pragma warning (pop)
4362  xnOSFree(pSkeletonCookie);
4363  }
4364 
4368  inline XnStatus RegisterToCalibrationStart(CalibrationStart handler, void* pCookie, XnCallbackHandle& hCallback)
4369  {
4370  XnStatus nRetVal = XN_STATUS_OK;
4371  CalibrationStartCookie* pCalibrationCookie;
4372  XN_VALIDATE_ALLOC(pCalibrationCookie, CalibrationStartCookie);
4373  pCalibrationCookie->handler = handler;
4374  pCalibrationCookie->pUserCookie = pCookie;
4375  nRetVal = xnRegisterToCalibrationStart(GetHandle(), CalibrationStartCallback, pCalibrationCookie, &pCalibrationCookie->hCallback);
4376  if (nRetVal != XN_STATUS_OK)
4377  {
4378  xnOSFree(pCalibrationCookie);
4379  return nRetVal;
4380  }
4381  hCallback = pCalibrationCookie;
4382  return XN_STATUS_OK;
4383  }
4384 
4392  {
4393  CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)hCallback;
4394  xnUnregisterFromCalibrationStart(GetHandle(), pCalibrationCookie->hCallback);
4395  xnOSFree(pCalibrationCookie);
4396  return XN_STATUS_OK;
4397  }
4398 
4407  typedef void (XN_CALLBACK_TYPE* CalibrationInProgress)(SkeletonCapability& skeleton, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
4408 
4412  inline XnStatus RegisterToCalibrationInProgress(CalibrationInProgress handler, void* pCookie, XnCallbackHandle& hCallback)
4413  {
4414  XnStatus nRetVal = XN_STATUS_OK;
4415 
4416  CalibrationInProgressCookie* pSkeletonCookie;
4417  XN_VALIDATE_ALLOC(pSkeletonCookie, CalibrationInProgressCookie);
4418  pSkeletonCookie->handler = handler;
4419  pSkeletonCookie->pUserCookie = pCookie;
4420 
4421  nRetVal = xnRegisterToCalibrationInProgress(GetHandle(), CalibrationInProgressCallback, 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  CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)hCallback;
4439  xnUnregisterFromCalibrationInProgress(GetHandle(), pSkeletonCookie->hCallback);
4440  xnOSFree(pSkeletonCookie);
4441  }
4442 
4451  typedef void (XN_CALLBACK_TYPE* CalibrationComplete)(SkeletonCapability& skeleton, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie);
4455  inline XnStatus RegisterToCalibrationComplete(CalibrationComplete handler, void* pCookie, XnCallbackHandle& hCallback)
4456  {
4457  XnStatus nRetVal = XN_STATUS_OK;
4458 
4459  CalibrationCompleteCookie* pSkeletonCookie;
4460  XN_VALIDATE_ALLOC(pSkeletonCookie, CalibrationCompleteCookie);
4461  pSkeletonCookie->handler = handler;
4462  pSkeletonCookie->pUserCookie = pCookie;
4463 
4464  nRetVal = xnRegisterToCalibrationComplete(GetHandle(), CalibrationCompleteCallback, pSkeletonCookie, &pSkeletonCookie->hCallback);
4465  if (nRetVal != XN_STATUS_OK)
4466  {
4467  xnOSFree(pSkeletonCookie);
4468  return (nRetVal);
4469  }
4470 
4471  hCallback = pSkeletonCookie;
4472 
4473  return (XN_STATUS_OK);
4474  }
4475 
4480  {
4481  CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)hCallback;
4482  xnUnregisterFromCalibrationComplete(GetHandle(), pSkeletonCookie->hCallback);
4483  xnOSFree(pSkeletonCookie);
4484  }
4485  private:
4486  typedef struct SkeletonCookie
4487  {
4488  CalibrationStart startHandler;
4489  CalibrationEnd endHandler;
4490  void* pUserCookie;
4491  XnCallbackHandle hCallback;
4492  } SkeletonCookie;
4493 
4494  static void XN_CALLBACK_TYPE CalibrationStartBundleCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
4495  {
4496  SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
4497  SkeletonCapability cap(hNode);
4498  if (pSkeletonCookie->startHandler != NULL)
4499  {
4500  pSkeletonCookie->startHandler(cap, user, pSkeletonCookie->pUserCookie);
4501  }
4502  }
4503 
4504  static void XN_CALLBACK_TYPE CalibrationEndBundleCallback(XnNodeHandle hNode, XnUserID user, XnBool bSuccess, void* pCookie)
4505  {
4506  SkeletonCookie* pSkeletonCookie = (SkeletonCookie*)pCookie;
4507  SkeletonCapability cap(hNode);
4508  if (pSkeletonCookie->endHandler != NULL)
4509  {
4510  pSkeletonCookie->endHandler(cap, user, bSuccess, pSkeletonCookie->pUserCookie);
4511  }
4512  }
4513  typedef struct CalibrationStartCookie
4514  {
4515  CalibrationStart handler;
4516  void* pUserCookie;
4517  XnCallbackHandle hCallback;
4518  } CalibrationStartCookie;
4519 
4520  static void XN_CALLBACK_TYPE CalibrationStartCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
4521  {
4522  CalibrationStartCookie* pCalibrationCookie = (CalibrationStartCookie*)pCookie;
4523  SkeletonCapability cap(hNode);
4524  if (pCalibrationCookie->handler != NULL)
4525  {
4526  pCalibrationCookie->handler(cap, user, pCalibrationCookie->pUserCookie);
4527  }
4528  }
4529  typedef struct CalibrationInProgressCookie
4530  {
4531  CalibrationInProgress handler;
4532  void* pUserCookie;
4533  XnCallbackHandle hCallback;
4534  } CalibrationInProgressCookie;
4535 
4536  static void XN_CALLBACK_TYPE CalibrationInProgressCallback(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie)
4537  {
4538  CalibrationInProgressCookie* pSkeletonCookie = (CalibrationInProgressCookie*)pCookie;
4539  SkeletonCapability cap(hNode);
4540  if (pSkeletonCookie->handler != NULL)
4541  {
4542  pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
4543  }
4544  }
4545 
4546  typedef struct CalibrationCompleteCookie
4547  {
4548  CalibrationComplete handler;
4549  void* pUserCookie;
4550  XnCallbackHandle hCallback;
4551  } CalibrationCompleteCookie;
4552 
4553  static void XN_CALLBACK_TYPE CalibrationCompleteCallback(XnNodeHandle hNode, XnUserID user, XnCalibrationStatus calibrationError, void* pCookie)
4554  {
4555  CalibrationCompleteCookie* pSkeletonCookie = (CalibrationCompleteCookie*)pCookie;
4556  SkeletonCapability cap(hNode);
4557  if (pSkeletonCookie->handler != NULL)
4558  {
4559  pSkeletonCookie->handler(cap, user, calibrationError, pSkeletonCookie->pUserCookie);
4560  }
4561  }
4562  };
4563 
4569  {
4570  public:
4578 
4587  typedef void (XN_CALLBACK_TYPE* PoseDetection)(PoseDetectionCapability& pose, const XnChar* strPose, XnUserID user, void* pCookie);
4588 
4592  inline XnUInt32 GetNumberOfPoses() const
4593  {
4594  return xnGetNumberOfPoses(GetHandle());
4595  }
4596 
4600  inline XnStatus GetAvailablePoses(XnChar** pstrPoses, XnUInt32& nPoses) const
4601  {
4602  return xnGetAvailablePoses(GetHandle(), pstrPoses, &nPoses);
4603  }
4607  inline XnStatus GetAllAvailablePoses(XnChar** pstrPoses, XnUInt32 nNameLength, XnUInt32& nPoses) const
4608  {
4609  return xnGetAllAvailablePoses(GetHandle(), pstrPoses, nNameLength, &nPoses);
4610  }
4611 
4612  inline XnBool IsPoseSupported(const XnChar* strPose)
4613  {
4614  return xnIsPoseSupported(GetHandle(), strPose);
4615  }
4616 
4617  inline XnStatus GetPoseStatus(XnUserID userID, const XnChar* poseName, XnUInt64& poseTime, XnPoseDetectionStatus& eStatus, XnPoseDetectionState& eState)
4618  {
4619  return xnGetPoseStatus(GetHandle(), userID, poseName, &poseTime, &eStatus, &eState);
4620  }
4621 
4625  inline XnStatus StartPoseDetection(const XnChar* strPose, XnUserID user)
4626  {
4627  return xnStartPoseDetection(GetHandle(), strPose, user);
4628  }
4629 
4634  {
4635  return xnStopPoseDetection(GetHandle(), user);
4636  }
4637 
4641  inline XnStatus StopSinglePoseDetection(XnUserID user, const XnChar* strPose)
4642  {
4643  return xnStopSinglePoseDetection(GetHandle(), user, strPose);
4644  }
4645 
4649  inline XnStatus XN_API_DEPRECATED("Please use RegisterToPoseDetected/RegisterToOutOfPose instead") RegisterToPoseCallbacks(PoseDetection PoseStartCB, PoseDetection PoseEndCB, void* pCookie, XnCallbackHandle& hCallback)
4650  {
4651  XnStatus nRetVal = XN_STATUS_OK;
4652 
4653  PoseCookie* pPoseCookie;
4654  XN_VALIDATE_ALLOC(pPoseCookie, PoseCookie);
4655  pPoseCookie->startHandler = PoseStartCB;
4656  pPoseCookie->endHandler = PoseEndCB;
4657  pPoseCookie->pPoseCookie = pCookie;
4658 
4659 #pragma warning (push)
4660 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
4661  nRetVal = xnRegisterToPoseCallbacks(GetHandle(), PoseDetectionStartBundleCallback, PoseDetectionStartEndBundleCallback, pPoseCookie, &pPoseCookie->hCallback);
4662 #pragma warning (pop)
4663  if (nRetVal != XN_STATUS_OK)
4664  {
4665  xnOSFree(pPoseCookie);
4666  return (nRetVal);
4667  }
4668 
4669  hCallback = pPoseCookie;
4670 
4671  return (XN_STATUS_OK);
4672  }
4673 
4677  inline void XN_API_DEPRECATED("Please use UnregisterFromPoseDetected/UnregisterFromOutOfPose instead") UnregisterFromPoseCallbacks(XnCallbackHandle hCallback)
4678  {
4679  PoseCookie* pPoseCookie = (PoseCookie*)hCallback;
4680 #pragma warning (push)
4681 #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
4682  xnUnregisterFromPoseCallbacks(GetHandle(), pPoseCookie->hCallback);
4683 #pragma warning (pop)
4684  xnOSFree(pPoseCookie);
4685  }
4686 
4690  inline XnStatus RegisterToPoseDetected(PoseDetection handler, void* pCookie, XnCallbackHandle& hCallback)
4691  {
4692  XnStatus nRetVal = XN_STATUS_OK;
4693  PoseDetectionCookie* pPoseCookie;
4694  XN_VALIDATE_ALLOC(pPoseCookie, PoseDetectionCookie);
4695  pPoseCookie->handler = handler;
4696  pPoseCookie->pPoseCookie = pCookie;
4697 
4698  nRetVal = xnRegisterToPoseDetected(GetHandle(), PoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
4699  if (nRetVal != XN_STATUS_OK)
4700  {
4701  xnOSFree(pPoseCookie);
4702  return nRetVal;
4703  }
4704  hCallback = pPoseCookie;
4705  return XN_STATUS_OK;
4706  }
4710  inline XnStatus RegisterToOutOfPose(PoseDetection handler, void* pCookie, XnCallbackHandle& hCallback)
4711  {
4712  XnStatus nRetVal = XN_STATUS_OK;
4713  PoseDetectionCookie* pPoseCookie;
4714  XN_VALIDATE_ALLOC(pPoseCookie, PoseDetectionCookie);
4715  pPoseCookie->handler = handler;
4716  pPoseCookie->pPoseCookie = pCookie;
4717 
4718  nRetVal = xnRegisterToOutOfPose(GetHandle(), PoseDetectionCallback, pPoseCookie, &pPoseCookie->hCallback);
4719  if (nRetVal != XN_STATUS_OK)
4720  {
4721  xnOSFree(pPoseCookie);
4722  return nRetVal;
4723  }
4724  hCallback = pPoseCookie;
4725  return XN_STATUS_OK;
4726  }
4731  {
4732  PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
4733  xnUnregisterFromPoseDetected(GetHandle(), pPoseCookie->hCallback);
4734  xnOSFree(pPoseCookie);
4735  }
4740  {
4741  PoseDetectionCookie* pPoseCookie = (PoseDetectionCookie*)hCallback;
4742  xnUnregisterFromOutOfPose(GetHandle(), pPoseCookie->hCallback);
4743  xnOSFree(pPoseCookie);
4744  }
4745 
4755  typedef void (XN_CALLBACK_TYPE* PoseInProgress)(PoseDetectionCapability& pose, const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseError, void* pCookie);
4759  inline XnStatus RegisterToPoseInProgress(PoseInProgress handler, void* pCookie, XnCallbackHandle& hCallback)
4760  {
4761  XnStatus nRetVal = XN_STATUS_OK;
4762 
4763  PoseInProgressCookie* pPoseCookie;
4764  XN_VALIDATE_ALLOC(pPoseCookie, PoseInProgressCookie);
4765  pPoseCookie->handler = handler;
4766  pPoseCookie->pPoseCookie = pCookie;
4767 
4768  nRetVal = xnRegisterToPoseDetectionInProgress(GetHandle(), PoseDetectionInProgressCallback, pPoseCookie, &pPoseCookie->hCallback);
4769  if (nRetVal != XN_STATUS_OK)
4770  {
4771  xnOSFree(pPoseCookie);
4772  return (nRetVal);
4773  }
4774 
4775  hCallback = pPoseCookie;
4776 
4777  return (XN_STATUS_OK);
4778  }
4779 
4784  {
4785  PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)hCallback;
4786  xnUnregisterFromPoseDetectionInProgress(GetHandle(), pPoseCookie->hCallback);
4787  xnOSFree(pPoseCookie);
4788  }
4789 
4790  private:
4791  typedef struct PoseCookie
4792  {
4793  PoseDetection startHandler;
4794  PoseDetection endHandler;
4795  void* pPoseCookie;
4796  XnCallbackHandle hCallback;
4797  } PoseCookie;
4798 
4799  static void XN_CALLBACK_TYPE PoseDetectionStartBundleCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
4800  {
4801  PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
4802  PoseDetectionCapability cap(hNode);
4803  if (pPoseCookie->startHandler != NULL)
4804  {
4805  pPoseCookie->startHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
4806  }
4807  }
4808 
4809  static void XN_CALLBACK_TYPE PoseDetectionStartEndBundleCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
4810  {
4811  PoseCookie* pPoseCookie = (PoseCookie*)pCookie;
4812  PoseDetectionCapability cap(hNode);
4813  if (pPoseCookie->endHandler != NULL)
4814  {
4815  pPoseCookie->endHandler(cap, strPose, user, pPoseCookie->pPoseCookie);
4816  }
4817  }
4818  typedef struct PoseDetectionCookie
4819  {
4820  PoseDetection handler;
4821  void* pPoseCookie;
4822  XnCallbackHandle hCallback;
4823  } PoseDetectionCookie;
4824  static void XN_CALLBACK_TYPE PoseDetectionCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, void* pCookie)
4825  {
4826  PoseDetectionCookie* pPoseDetectionCookie = (PoseDetectionCookie*)pCookie;
4827  PoseDetectionCapability cap(hNode);
4828  if (pPoseDetectionCookie->handler != NULL)
4829  {
4830  pPoseDetectionCookie->handler(cap, strPose, user, pPoseDetectionCookie->pPoseCookie);
4831  }
4832  }
4833 
4834  typedef struct PoseInProgressCookie
4835  {
4836  PoseInProgress handler;
4837  void* pPoseCookie;
4838  XnCallbackHandle hCallback;
4839  } PoseInProgressCookie;
4840 
4841  static void XN_CALLBACK_TYPE PoseDetectionInProgressCallback(XnNodeHandle hNode, const XnChar* strPose, XnUserID user, XnPoseDetectionStatus poseErrors, void* pCookie)
4842  {
4843  PoseInProgressCookie* pPoseCookie = (PoseInProgressCookie*)pCookie;
4844  PoseDetectionCapability cap(hNode);
4845  if (pPoseCookie->handler != NULL)
4846  {
4847  pPoseCookie->handler(cap, strPose, user, poseErrors, pPoseCookie->pPoseCookie);
4848  }
4849  }
4850  };
4851 
4856  class UserGenerator : public Generator
4857  {
4858  public:
4864  inline UserGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
4865  inline UserGenerator(const NodeWrapper& other) : Generator(other) {}
4866 
4870  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
4871 
4872  typedef void (XN_CALLBACK_TYPE* UserHandler)(UserGenerator& generator, XnUserID user, void* pCookie);
4873 
4877  inline XnUInt16 GetNumberOfUsers() const
4878  {
4879  return xnGetNumberOfUsers(GetHandle());
4880  }
4881 
4885  inline XnStatus GetUsers(XnUserID aUsers[], XnUInt16& nUsers) const
4886  {
4887  return xnGetUsers(GetHandle(), aUsers, &nUsers);
4888  }
4889 
4893  inline XnStatus GetCoM(XnUserID user, XnPoint3D& com) const
4894  {
4895  return xnGetUserCoM(GetHandle(), user, &com);
4896  }
4897 
4902  {
4903  return xnGetUserPixels(GetHandle(), user, smd.GetUnderlying());
4904  }
4905 
4909  inline XnStatus RegisterUserCallbacks(UserHandler NewUserCB, UserHandler LostUserCB, void* pCookie, XnCallbackHandle& hCallback)
4910  {
4911  XnStatus nRetVal = XN_STATUS_OK;
4912 
4913  UserCookie* pUserCookie;
4914  XN_VALIDATE_ALLOC(pUserCookie, UserCookie);
4915  pUserCookie->newHandler = NewUserCB;
4916  pUserCookie->lostHandler = LostUserCB;
4917  pUserCookie->pUserCookie = pCookie;
4918 
4919  nRetVal = xnRegisterUserCallbacks(GetHandle(), NewUserCallback, LostUserCallback, pUserCookie, &pUserCookie->hCallback);
4920  if (nRetVal != XN_STATUS_OK)
4921  {
4922  xnOSFree(pUserCookie);
4923  return (nRetVal);
4924  }
4925 
4926  hCallback = pUserCookie;
4927 
4928  return (XN_STATUS_OK);
4929  }
4930 
4935  {
4936  UserCookie* pUserCookie = (UserCookie*)hCallback;
4937  xnUnregisterUserCallbacks(GetHandle(), pUserCookie->hCallback);
4938  xnOSFree(pUserCookie);
4939  }
4940 
4946  inline const SkeletonCapability GetSkeletonCap() const
4947  {
4948  return SkeletonCapability(GetHandle());
4949  }
4950 
4957  {
4958  return SkeletonCapability(GetHandle());
4959  }
4960 
4967  {
4968  return PoseDetectionCapability(GetHandle());
4969  }
4970 
4977  {
4978  return PoseDetectionCapability(GetHandle());
4979  }
4980 
4984  inline XnStatus RegisterToUserExit(UserHandler handler, void* pCookie, XnCallbackHandle& hCallback)
4985  {
4986  XnStatus nRetVal = XN_STATUS_OK;
4987 
4988  UserSingleCookie* pUserCookie;
4989  XN_VALIDATE_ALLOC(pUserCookie, UserSingleCookie);
4990  pUserCookie->handler = handler;
4991  pUserCookie->pUserCookie = pCookie;
4992 
4993  nRetVal = xnRegisterToUserExit(GetHandle(), UserSingleCallback, pUserCookie, &pUserCookie->hCallback);
4994  if (nRetVal != XN_STATUS_OK)
4995  {
4996  xnOSFree(pUserCookie);
4997  return (nRetVal);
4998  }
4999 
5000  hCallback = pUserCookie;
5001 
5002  return (XN_STATUS_OK);
5003  }
5004 
5009  {
5010  UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
5011  xnUnregisterFromUserExit(GetHandle(), pUserCookie->hCallback);
5012  xnOSFree(pUserCookie);
5013  }
5014 
5018  inline XnStatus RegisterToUserReEnter(UserHandler handler, void* pCookie, XnCallbackHandle& hCallback)
5019  {
5020  XnStatus nRetVal = XN_STATUS_OK;
5021 
5022  UserSingleCookie* pUserCookie;
5023  XN_VALIDATE_ALLOC(pUserCookie, UserSingleCookie);
5024  pUserCookie->handler = handler;
5025  pUserCookie->pUserCookie = pCookie;
5026 
5027  nRetVal = xnRegisterToUserReEnter(GetHandle(), UserSingleCallback, pUserCookie, &pUserCookie->hCallback);
5028  if (nRetVal != XN_STATUS_OK)
5029  {
5030  xnOSFree(pUserCookie);
5031  return (nRetVal);
5032  }
5033 
5034  hCallback = pUserCookie;
5035 
5036  return (XN_STATUS_OK);
5037  }
5038 
5043  {
5044  UserSingleCookie* pUserCookie = (UserSingleCookie*)hCallback;
5045  xnUnregisterFromUserReEnter(GetHandle(), pUserCookie->hCallback);
5046  xnOSFree(pUserCookie);
5047  }
5048 
5049  private:
5050  typedef struct UserCookie
5051  {
5052  UserHandler newHandler;
5053  UserHandler lostHandler;
5054  void* pUserCookie;
5055  XnCallbackHandle hCallback;
5056  } UserCookie;
5057 
5058  static void XN_CALLBACK_TYPE NewUserCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
5059  {
5060  UserCookie* pUserCookie = (UserCookie*)pCookie;
5061  UserGenerator gen(hNode);
5062  if (pUserCookie->newHandler != NULL)
5063  {
5064  pUserCookie->newHandler(gen, user, pUserCookie->pUserCookie);
5065  }
5066  }
5067 
5068  static void XN_CALLBACK_TYPE LostUserCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
5069  {
5070  UserCookie* pUserCookie = (UserCookie*)pCookie;
5071  UserGenerator gen(hNode);
5072  if (pUserCookie->lostHandler != NULL)
5073  {
5074  pUserCookie->lostHandler(gen, user, pUserCookie->pUserCookie);
5075  }
5076  }
5077 
5078  typedef struct UserSingleCookie
5079  {
5080  UserHandler handler;
5081  void* pUserCookie;
5082  XnCallbackHandle hCallback;
5083  } UserSingleCookie;
5084 
5085  static void XN_CALLBACK_TYPE UserSingleCallback(XnNodeHandle hNode, XnUserID user, void* pCookie)
5086  {
5087  UserSingleCookie* pUserCookie = (UserSingleCookie*)pCookie;
5088  UserGenerator gen(hNode);
5089  if (pUserCookie->handler != NULL)
5090  {
5091  pUserCookie->handler(gen, user, pUserCookie->pUserCookie);
5092  }
5093  }
5094  };
5095 
5100  class AudioGenerator : public Generator
5101  {
5102  public:
5108  inline AudioGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
5109  inline AudioGenerator(const NodeWrapper& other) : Generator(other) {}
5110 
5114  inline XnStatus Create(Context& context, Query* pQuery = NULL, EnumerationErrors* pErrors = NULL);
5115 
5119  inline void GetMetaData(AudioMetaData& metaData) const
5120  {
5121  xnGetAudioMetaData(GetHandle(), metaData.GetUnderlying());
5122  }
5123 
5127  inline const XnUChar* GetAudioBuffer() const
5128  {
5129  return xnGetAudioBuffer(GetHandle());
5130  }
5131 
5135  inline XnUInt32 GetSupportedWaveOutputModesCount() const
5136  {
5137  return xnGetSupportedWaveOutputModesCount(GetHandle());
5138  }
5139 
5143  inline XnStatus GetSupportedWaveOutputModes(XnWaveOutputMode* aSupportedModes, XnUInt32& nCount) const
5144  {
5145  return xnGetSupportedWaveOutputModes(GetHandle(), aSupportedModes, &nCount);
5146  }
5147 
5151  inline XnStatus SetWaveOutputMode(const XnWaveOutputMode& OutputMode)
5152  {
5153  return xnSetWaveOutputMode(GetHandle(), &OutputMode);
5154  }
5155 
5159  inline XnStatus GetWaveOutputMode(XnWaveOutputMode& OutputMode) const
5160  {
5161  return xnGetWaveOutputMode(GetHandle(), &OutputMode);
5162  }
5163 
5168  {
5169  return _RegisterToStateChange(xnRegisterToWaveOutputModeChanges, GetHandle(), handler, pCookie, hCallback);
5170  }
5171 
5176  {
5177  _UnregisterFromStateChange(xnUnregisterFromWaveOutputModeChanges, GetHandle(), hCallback);
5178  }
5179  };
5180 
5186  {
5187  public:
5193  inline MockAudioGenerator(XnNodeHandle hNode = NULL) : AudioGenerator(hNode) {}
5194  inline MockAudioGenerator(const NodeWrapper& other) : AudioGenerator(other) {}
5195 
5202  XnStatus Create(Context& context, const XnChar* strName = NULL);
5203 
5210  XnStatus CreateBasedOn(AudioGenerator& other, const XnChar* strName = NULL);
5211 
5215  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnUInt8* pAudioBuffer)
5216  {
5217  return xnMockAudioSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pAudioBuffer);
5218  }
5219 
5227  inline XnStatus SetData(const AudioMetaData& audioMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
5228  {
5229  return SetData(nFrameID, nTimestamp, audioMD.DataSize(), audioMD.Data());
5230  }
5231 
5237  inline XnStatus SetData(const AudioMetaData& audioMD)
5238  {
5239  return SetData(audioMD, audioMD.FrameID(), audioMD.Timestamp());
5240  }
5241  };
5242 
5244  {
5245  public:
5246  MockRawGenerator(XnNodeHandle hNode = NULL) : Generator(hNode) {}
5247  MockRawGenerator(const NodeWrapper& other) : Generator(other) {}
5248 
5249  inline XnStatus Create(Context& context, const XnChar* strName = NULL);
5250 
5251  inline XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void* pData)
5252  {
5253  return xnMockRawSetData(GetHandle(), nFrameID, nTimestamp, nDataSize, pData);
5254  }
5255 
5256  };
5257 
5262  class Codec : public ProductionNode
5263  {
5264  public:
5270  inline Codec(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
5271  inline Codec(const NodeWrapper& other) : ProductionNode(other) {}
5272 
5276  inline XnStatus Create(Context& context, XnCodecID codecID, ProductionNode& initializerNode);
5277 
5281  inline XnCodecID GetCodecID() const
5282  {
5283  return xnGetCodecID(GetHandle());
5284  }
5285 
5289  inline XnStatus EncodeData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const
5290  {
5291  return xnEncodeData(GetHandle(), pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
5292  }
5293 
5297  inline XnStatus DecodeData(const void* pSrc, XnUInt32 nSrcSize, void* pDst, XnUInt32 nDstSize, XnUInt* pnBytesWritten) const
5298  {
5299  return xnDecodeData(GetHandle(), pSrc, nSrcSize, pDst, nDstSize, pnBytesWritten);
5300  }
5301  };
5302 
5308  {
5309  public:
5315  inline ScriptNode(XnNodeHandle hNode = NULL) : ProductionNode(hNode) {}
5316  inline ScriptNode(const NodeWrapper& other) : ProductionNode(other) {}
5317 
5318  inline XnStatus Create(Context& context, const XnChar* strFormat);
5319 
5320  inline const XnChar* GetSupportedFormat()
5321  {
5322  return xnScriptNodeGetSupportedFormat(GetHandle());
5323  }
5324 
5325  inline XnStatus LoadScriptFromFile(const XnChar* strFileName)
5326  {
5327  return xnLoadScriptFromFile(GetHandle(), strFileName);
5328  }
5329 
5330  inline XnStatus LoadScriptFromString(const XnChar* strScript)
5331  {
5332  return xnLoadScriptFromString(GetHandle(), strScript);
5333  }
5334 
5335  inline XnStatus Run(EnumerationErrors* pErrors);
5336  };
5337 
5338  //---------------------------------------------------------------------------
5339  // EnumerationErrors
5340  //---------------------------------------------------------------------------
5346  {
5347  public:
5349  inline EnumerationErrors() : m_bAllocated(TRUE), m_pErrors(NULL) { xnEnumerationErrorsAllocate(&m_pErrors); }
5350 
5357  inline EnumerationErrors(XnEnumerationErrors* pErrors, XnBool bOwn = FALSE) : m_bAllocated(bOwn), m_pErrors(pErrors) {}
5358 
5360  ~EnumerationErrors() { Free(); }
5361 
5363  class Iterator
5364  {
5365  public:
5366  friend class EnumerationErrors;
5367 
5373  XnBool operator==(const Iterator& other) const
5374  {
5375  return m_it == other.m_it;
5376  }
5377 
5383  XnBool operator!=(const Iterator& other) const
5384  {
5385  return m_it != other.m_it;
5386  }
5387 
5393  {
5394  m_it = xnEnumerationErrorsGetNext(m_it);
5395  return *this;
5396  }
5397 
5402  inline Iterator operator++(int)
5403  {
5404  return Iterator(xnEnumerationErrorsGetNext(m_it));
5405  }
5406 
5411 
5412  private:
5413  inline Iterator(XnEnumerationErrorsIterator it) : m_it(it) {}
5414 
5416  };
5417 
5419  inline Iterator Begin() const { return Iterator(xnEnumerationErrorsGetFirst(m_pErrors)); }
5421  inline Iterator End() const { return Iterator(NULL); }
5422 
5426  inline XnStatus ToString(XnChar* csBuffer, XnUInt32 nSize)
5427  {
5428  return xnEnumerationErrorsToString(m_pErrors, csBuffer, nSize);
5429  }
5430 
5434  inline void Free()
5435  {
5436  if (m_bAllocated)
5437  {
5438  xnEnumerationErrorsFree(m_pErrors);
5439  m_pErrors = NULL;
5440  m_bAllocated = FALSE;
5441  }
5442  }
5443 
5445  inline XnEnumerationErrors* GetUnderlying() { return m_pErrors; }
5446 
5447  private:
5448  XnEnumerationErrors* m_pErrors;
5449  XnBool m_bAllocated;
5450  };
5451 
5452  //---------------------------------------------------------------------------
5453  // Context
5454  //---------------------------------------------------------------------------
5455 
5460  class Context
5461  {
5462  public:
5464  inline Context() : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL) {}
5465 
5471  inline Context(XnContext* pContext) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
5472  {
5473  SetHandle(pContext);
5474  }
5475 
5482  inline Context(const Context& other) : m_pContext(NULL), m_bUsingDeprecatedAPI(FALSE), m_bAllocated(FALSE), m_hShuttingDownCallback(NULL)
5483  {
5484  SetHandle(other.m_pContext);
5485  }
5486 
5489  {
5490  SetHandle(NULL);
5491  }
5492 
5493  inline Context& operator=(const Context& other)
5494  {
5495  SetHandle(other.m_pContext);
5496  return *this;
5497  }
5498 
5500  inline XnContext* GetUnderlyingObject() const { return m_pContext; }
5501 
5505  inline XnStatus Init()
5506  {
5507  XnContext* pContext = NULL;
5508  XnStatus nRetVal = xnInit(&pContext);
5509  XN_IS_STATUS_OK(nRetVal);
5510 
5511  TakeOwnership(pContext);
5512  m_bAllocated = TRUE;
5513 
5514  return (XN_STATUS_OK);
5515  }
5516 
5520  inline XnStatus XN_API_DEPRECATED("Use other overload!") RunXmlScript(const XnChar* strScript, EnumerationErrors* pErrors = NULL)
5521  {
5522  m_bUsingDeprecatedAPI = TRUE;
5523  #pragma warning (push)
5524  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5525  return xnContextRunXmlScript(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5526  #pragma warning (pop)
5527  }
5528 
5532  inline XnStatus RunXmlScript(const XnChar* strScript, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
5533  {
5534  XnStatus nRetVal = XN_STATUS_OK;
5535 
5536  XnNodeHandle hScriptNode;
5537  nRetVal = xnContextRunXmlScriptEx(m_pContext, strScript, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
5538  XN_IS_STATUS_OK(nRetVal);
5539 
5540  scriptNode.TakeOwnership(hScriptNode);
5541 
5542  return (XN_STATUS_OK);
5543  }
5544 
5548  inline XnStatus XN_API_DEPRECATED("Use other overload!") RunXmlScriptFromFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
5549  {
5550  m_bUsingDeprecatedAPI = TRUE;
5551  #pragma warning (push)
5552  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5553  return xnContextRunXmlScriptFromFile(m_pContext, strFileName, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5554  #pragma warning (pop)
5555  }
5556 
5560  inline XnStatus RunXmlScriptFromFile(const XnChar* strFileName, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
5561  {
5562  XnStatus nRetVal = XN_STATUS_OK;
5563 
5564  XnNodeHandle hScriptNode;
5565  nRetVal = xnContextRunXmlScriptFromFileEx(m_pContext, strFileName, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
5566  XN_IS_STATUS_OK(nRetVal);
5567 
5568  scriptNode.TakeOwnership(hScriptNode);
5569 
5570  return (XN_STATUS_OK);
5571  }
5572 
5576  inline XnStatus XN_API_DEPRECATED("Use other overload!") InitFromXmlFile(const XnChar* strFileName, EnumerationErrors* pErrors = NULL)
5577  {
5578  XnContext* pContext = NULL;
5579  m_bUsingDeprecatedAPI = TRUE;
5580 
5581  #pragma warning (push)
5582  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5583  XnStatus nRetVal = xnInitFromXmlFile(strFileName, &pContext, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5584  #pragma warning (pop)
5585  XN_IS_STATUS_OK(nRetVal);
5586 
5587  TakeOwnership(pContext);
5588  m_bAllocated = TRUE;
5589 
5590  return (XN_STATUS_OK);
5591  }
5592 
5596  inline XnStatus InitFromXmlFile(const XnChar* strFileName, ScriptNode& scriptNode, EnumerationErrors* pErrors = NULL)
5597  {
5598  XnContext* pContext = NULL;
5599 
5600  XnNodeHandle hScriptNode;
5601  XnStatus nRetVal = xnInitFromXmlFileEx(strFileName, &pContext, pErrors == NULL ? NULL : pErrors->GetUnderlying(), &hScriptNode);
5602  XN_IS_STATUS_OK(nRetVal);
5603 
5604  scriptNode.TakeOwnership(hScriptNode);
5605  TakeOwnership(pContext);
5606  m_bAllocated = TRUE;
5607 
5608  return (XN_STATUS_OK);
5609  }
5610 
5614  inline XnStatus XN_API_DEPRECATED("Use other overload!") OpenFileRecording(const XnChar* strFileName)
5615  {
5616  m_bUsingDeprecatedAPI = TRUE;
5617  #pragma warning (push)
5618  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5619  return xnContextOpenFileRecording(m_pContext, strFileName);
5620  #pragma warning (pop)
5621  }
5622 
5626  inline XnStatus OpenFileRecording(const XnChar* strFileName, ProductionNode& playerNode)
5627  {
5628  XnStatus nRetVal = XN_STATUS_OK;
5629 
5630  XnNodeHandle hPlayer;
5631  nRetVal = xnContextOpenFileRecordingEx(m_pContext, strFileName, &hPlayer);
5632  XN_IS_STATUS_OK(nRetVal);
5633 
5634  playerNode.TakeOwnership(hPlayer);
5635 
5636  return (XN_STATUS_OK);
5637  }
5638 
5642  inline XnStatus CreateMockNode(XnProductionNodeType type, const XnChar* strName, ProductionNode& mockNode)
5643  {
5644  XnStatus nRetVal = XN_STATUS_OK;
5645 
5646  XnNodeHandle hMockNode;
5647  nRetVal = xnCreateMockNode(m_pContext, type, strName, &hMockNode);
5648  XN_IS_STATUS_OK(nRetVal);
5649 
5650  mockNode.TakeOwnership(hMockNode);
5651 
5652  return (XN_STATUS_OK);
5653  }
5654 
5658  inline XnStatus CreateMockNodeBasedOn(ProductionNode& originalNode, const XnChar* strName, ProductionNode& mockNode)
5659  {
5660  XnStatus nRetVal = XN_STATUS_OK;
5661 
5662  XnNodeHandle hMockNode;
5663  nRetVal = xnCreateMockNodeBasedOn(m_pContext, originalNode, strName, &hMockNode);
5664  XN_IS_STATUS_OK(nRetVal);
5665 
5666  mockNode.TakeOwnership(hMockNode);
5667 
5668  return (XN_STATUS_OK);
5669  }
5670 
5674  inline XnStatus CreateCodec(XnCodecID codecID, ProductionNode& initializerNode, Codec& codec)
5675  {
5676  XnStatus nRetVal = XN_STATUS_OK;
5677 
5678  XnNodeHandle hCodec;
5679  nRetVal = xnCreateCodec(m_pContext, codecID, initializerNode.GetHandle(), &hCodec);
5680  XN_IS_STATUS_OK(nRetVal);
5681 
5682  codec.TakeOwnership(hCodec);
5683 
5684  return (XN_STATUS_OK);
5685  }
5686 
5690  inline XnStatus AddRef()
5691  {
5692  return xnContextAddRef(m_pContext);
5693  }
5694 
5698  inline void Release()
5699  {
5700  SetHandle(NULL);
5701  }
5702 
5706  inline void XN_API_DEPRECATED("You may use Release() instead, or count on dtor") Shutdown()
5707  {
5708  if (m_pContext != NULL)
5709  {
5710  #pragma warning (push)
5711  #pragma warning (disable: XN_DEPRECATED_WARNING_IDS)
5712  xnShutdown(m_pContext);
5713  #pragma warning (pop)
5714  m_pContext = NULL;
5715  }
5716  }
5717 
5721  inline XnStatus AddLicense(const XnLicense& License)
5722  {
5723  return xnAddLicense(m_pContext, &License);
5724  }
5725 
5729  inline XnStatus EnumerateLicenses(XnLicense*& aLicenses, XnUInt32& nCount) const
5730  {
5731  return xnEnumerateLicenses(m_pContext, &aLicenses, &nCount);
5732  }
5733 
5737  inline static void FreeLicensesList(XnLicense aLicenses[])
5738  {
5739  xnFreeLicensesList(aLicenses);
5740  }
5741 
5745  XnStatus EnumerateProductionTrees(XnProductionNodeType Type, const Query* pQuery, NodeInfoList& TreesList, EnumerationErrors* pErrors = NULL) const
5746  {
5747  XnStatus nRetVal = XN_STATUS_OK;
5748 
5749  const XnNodeQuery* pInternalQuery = (pQuery != NULL) ? pQuery->GetUnderlyingObject() : NULL;
5750 
5751  XnNodeInfoList* pList = NULL;
5752  nRetVal = xnEnumerateProductionTrees(m_pContext, Type, pInternalQuery, &pList, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5753  XN_IS_STATUS_OK(nRetVal);
5754 
5755  TreesList.ReplaceUnderlyingObject(pList);
5756 
5757  return (XN_STATUS_OK);
5758  }
5759 
5764  {
5765  XnStatus nRetVal = XN_STATUS_OK;
5766 
5767  XnNodeQuery* pInternalQuery = (pQuery != NULL) ? pQuery->GetUnderlyingObject() : NULL;
5768 
5769  XnNodeHandle hNode;
5770  nRetVal = xnCreateAnyProductionTree(m_pContext, type, pInternalQuery, &hNode, pErrors == NULL ? NULL : pErrors->GetUnderlying());
5771  XN_IS_STATUS_OK(nRetVal);
5772 
5773  node.TakeOwnership(hNode);
5774 
5775  return (XN_STATUS_OK);
5776  }
5777 
5781  XnStatus XN_API_DEPRECATED("Please use other overload") CreateProductionTree(NodeInfo& Tree)
5782  {
5783  XnStatus nRetVal = XN_STATUS_OK;
5784 
5785  XnNodeHandle hNode;
5786  nRetVal = xnCreateProductionTree(m_pContext, Tree, &hNode);
5787  XN_IS_STATUS_OK(nRetVal);
5788 
5789  Tree.m_bOwnerOfNode = TRUE;
5790 
5791  return (XN_STATUS_OK);
5792  }
5793 
5798  {
5799  XnStatus nRetVal = XN_STATUS_OK;
5800 
5801  XnNodeHandle hNode;
5802  nRetVal = xnCreateProductionTree(m_pContext, Tree, &hNode);
5803  XN_IS_STATUS_OK(nRetVal);
5804 
5805  node.TakeOwnership(hNode);
5806 
5807  return (XN_STATUS_OK);
5808  }
5809 
5814  {
5815  XnNodeInfoList* pList;
5816  XnStatus nRetVal = xnEnumerateExistingNodes(m_pContext, &pList);
5817  XN_IS_STATUS_OK(nRetVal);
5818 
5819  list.ReplaceUnderlyingObject(pList);
5820 
5821  return (XN_STATUS_OK);
5822  }
5823 
5828  {
5829  XnNodeInfoList* pList;
5830  XnStatus nRetVal = xnEnumerateExistingNodesByType(m_pContext, type, &pList);
5831  XN_IS_STATUS_OK(nRetVal);
5832 
5833  list.ReplaceUnderlyingObject(pList);
5834 
5835  return (XN_STATUS_OK);
5836  }
5837 
5842  {
5843  XnStatus nRetVal = XN_STATUS_OK;
5844 
5845  XnNodeHandle hNode;
5846  nRetVal = xnFindExistingRefNodeByType(m_pContext, type, &hNode);
5847  XN_IS_STATUS_OK(nRetVal);
5848 
5849  node.TakeOwnership(hNode);
5850 
5851  return (XN_STATUS_OK);
5852  }
5853 
5857  XnStatus GetProductionNodeByName(const XnChar* strInstanceName, ProductionNode& node) const
5858  {
5859  XnStatus nRetVal = XN_STATUS_OK;
5860 
5861  XnNodeHandle hNode;
5862  nRetVal = xnGetRefNodeHandleByName(m_pContext, strInstanceName, &hNode);
5863  XN_IS_STATUS_OK(nRetVal);
5864 
5865  node.TakeOwnership(hNode);
5866 
5867  return (XN_STATUS_OK);
5868  }
5869 
5873  XnStatus GetProductionNodeInfoByName(const XnChar* strInstanceName, NodeInfo& nodeInfo) const
5874  {
5875  XnStatus nRetVal = XN_STATUS_OK;
5876 
5877  XnNodeHandle hNode;
5878  nRetVal = xnGetRefNodeHandleByName(m_pContext, strInstanceName, &hNode);
5879  XN_IS_STATUS_OK(nRetVal);
5880 
5881  xnProductionNodeRelease(hNode);
5882 
5883  nodeInfo = NodeInfo(xnGetNodeInfo(hNode));
5884 
5885  return (XN_STATUS_OK);
5886  }
5887 
5892  {
5893  return xnStartGeneratingAll(m_pContext);
5894  }
5895 
5900  {
5901  return xnStopGeneratingAll(m_pContext);
5902  }
5903 
5907  inline XnStatus SetGlobalMirror(XnBool bMirror)
5908  {
5909  return xnSetGlobalMirror(m_pContext, bMirror);
5910  }
5911 
5915  inline XnBool GetGlobalMirror()
5916  {
5917  return xnGetGlobalMirror(m_pContext);
5918  }
5919 
5924  {
5925  return xnGetGlobalErrorState(m_pContext);
5926  }
5927 
5932  {
5933  return xnRegisterToGlobalErrorStateChange(m_pContext, handler, pCookie, &hCallback);
5934  }
5935 
5940  {
5941  xnUnregisterFromGlobalErrorStateChange(m_pContext, hCallback);
5942  }
5943 
5948  {
5949  return xnWaitAndUpdateAll(m_pContext);
5950  }
5951 
5956  {
5957  return xnWaitAnyUpdateAll(m_pContext);
5958  }
5959 
5964  {
5965  return xnWaitOneUpdateAll(m_pContext, node.GetHandle());
5966  }
5967 
5972  {
5973  return xnWaitNoneUpdateAll(m_pContext);
5974  }
5975 
5979  inline XnStatus AutoEnumerateOverSingleInput(NodeInfoList& List, XnProductionNodeDescription& description, const XnChar* strCreationInfo, XnProductionNodeType InputType, EnumerationErrors* pErrors, Query* pQuery = NULL) const
5980  {
5981  return xnAutoEnumerateOverSingleInput(m_pContext, List.GetUnderlyingObject(), &description, strCreationInfo, InputType, pErrors == NULL ? NULL : pErrors->GetUnderlying(), pQuery == NULL ? NULL : pQuery->GetUnderlyingObject());
5982  }
5983 
5985  inline void SetHandle(XnContext* pContext)
5986  {
5987  if (m_pContext == pContext)
5988  {
5989  return;
5990  }
5991 
5992  if (m_pContext != NULL)
5993  {
5994  if (m_bUsingDeprecatedAPI && m_bAllocated)
5995  {
5996  // Backwards compatibility: call shutdown instead of release, to make old programs get the
5997  // exact same behavior they used to have.
5998  xnForceShutdown(m_pContext);
5999  }
6000  else
6001  {
6002  xnContextUnregisterFromShutdown(m_pContext, m_hShuttingDownCallback);
6003  xnContextRelease(m_pContext);
6004  }
6005  }
6006 
6007  if (pContext != NULL)
6008  {
6009  XnStatus nRetVal = xnContextAddRef(pContext);
6010  XN_ASSERT(nRetVal == XN_STATUS_OK);
6011 
6012  nRetVal = xnContextRegisterForShutdown(pContext, ContextShuttingDownCallback, this, &m_hShuttingDownCallback);
6013  XN_ASSERT(nRetVal == XN_STATUS_OK);
6014  }
6015 
6016  m_pContext = pContext;
6017  }
6018 
6019  inline void TakeOwnership(XnContext* pContext)
6020  {
6021  SetHandle(pContext);
6022 
6023  if (pContext != NULL)
6024  {
6025  xnContextRelease(pContext);
6026  }
6027  }
6028 
6029  private:
6030  static void XN_CALLBACK_TYPE ContextShuttingDownCallback(XnContext* /*pContext*/, void* pCookie)
6031  {
6032  Context* pThis = (Context*)pCookie;
6033  pThis->m_pContext = NULL;
6034  }
6035 
6036  XnContext* m_pContext;
6037  XnBool m_bUsingDeprecatedAPI;
6038  XnBool m_bAllocated;
6039  XnCallbackHandle m_hShuttingDownCallback;
6040  };
6041 
6047  {
6048  public:
6054  inline Resolution(XnResolution res) : m_Res(res)
6055  {
6056  m_nXRes = xnResolutionGetXRes(res);
6057  m_nYRes = xnResolutionGetYRes(res);
6058  m_strName = xnResolutionGetName(res);
6059  }
6060 
6067  inline Resolution(XnUInt32 xRes, XnUInt32 yRes) : m_nXRes(xRes), m_nYRes(yRes)
6068  {
6069  m_Res = xnResolutionGetFromXYRes(xRes, yRes);
6070  m_strName = xnResolutionGetName(m_Res);
6071  }
6072 
6078  inline Resolution(const XnChar* strName)
6079  {
6080  m_Res = xnResolutionGetFromName(strName);
6081  m_nXRes = xnResolutionGetXRes(m_Res);
6082  m_nYRes = xnResolutionGetYRes(m_Res);
6083  m_strName = xnResolutionGetName(m_Res);
6084  }
6085 
6087  inline XnResolution GetResolution() const { return m_Res; }
6089  inline XnUInt32 GetXResolution() const { return m_nXRes; }
6091  inline XnUInt32 GetYResolution() const { return m_nYRes; }
6093  inline const XnChar* GetName() const { return m_strName; }
6094 
6095  private:
6096  XnResolution m_Res;
6097  XnUInt32 m_nXRes;
6098  XnUInt32 m_nYRes;
6099  const XnChar* m_strName;
6100  };
6101 
6102  //---------------------------------------------------------------------------
6103  // Functions Implementation
6104  //---------------------------------------------------------------------------
6106  {
6107  return xnNodeQueryFilterList(context.GetUnderlyingObject(), query.GetUnderlyingObject(), m_pList);
6108  }
6109 
6110  inline void ProductionNode::GetContext(Context& context) const
6111  {
6112  context.TakeOwnership(xnGetRefContextFromNodeHandle(GetHandle()));
6113  }
6114 
6116  {
6117  if (m_pNeededNodes == NULL)
6118  {
6119  XnNodeInfoList* pList = xnNodeInfoGetNeededNodes(m_pInfo);
6120  m_pNeededNodes = XN_NEW(NodeInfoList, pList);
6121  }
6122 
6123  return *m_pNeededNodes;
6124  }
6125 
6126  inline void NodeInfo::SetUnderlyingObject(XnNodeInfo* pInfo)
6127  {
6128  if (m_pNeededNodes != NULL)
6129  {
6130  XN_DELETE(m_pNeededNodes);
6131  }
6132 
6133  m_bOwnerOfNode = FALSE;
6134  m_pInfo = pInfo;
6135  m_pNeededNodes = NULL;
6136  }
6137 
6139  {
6140  return xnCanFrameSyncWith(GetHandle(), other.GetHandle());
6141  }
6142 
6144  {
6145  return xnFrameSyncWith(GetHandle(), other.GetHandle());
6146  }
6147 
6149  {
6150  return xnStopFrameSyncWith(GetHandle(), other.GetHandle());
6151  }
6152 
6154  {
6155  return xnIsFrameSyncedWith(GetHandle(), other.GetHandle());
6156  }
6157 
6159  {
6160  if (m_pInfo == NULL)
6161  {
6162  return XN_STATUS_INVALID_OPERATION;
6163  }
6164 
6165  XnNodeHandle hNode = xnNodeInfoGetRefHandle(m_pInfo);
6166  node.TakeOwnership(hNode);
6167 
6168  if (m_bOwnerOfNode)
6169  {
6170  xnProductionNodeRelease(hNode);
6171  }
6172 
6173  return (XN_STATUS_OK);
6174  }
6175 
6176  //---------------------------------------------------------------------------
6177  // Node creation functions
6178  //---------------------------------------------------------------------------
6179 
6180  inline XnStatus Device::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6181  {
6182  XnNodeHandle hNode;
6183  XnStatus nRetVal = xnCreateDevice(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6184  XN_IS_STATUS_OK(nRetVal);
6185  TakeOwnership(hNode);
6186  return (XN_STATUS_OK);
6187  }
6188 
6189  inline XnStatus Recorder::Create(Context& context, const XnChar* strFormatName /*= NULL*/)
6190  {
6191  XnNodeHandle hNode;
6192  XnStatus nRetVal = xnCreateRecorder(context.GetUnderlyingObject(), strFormatName, &hNode);
6193  XN_IS_STATUS_OK(nRetVal);
6194  TakeOwnership(hNode);
6195  return (XN_STATUS_OK);
6196  }
6197 
6198  inline XnStatus Player::Create(Context& context, const XnChar* strFormatName)
6199  {
6200  XnNodeHandle hNode;
6201  XnStatus nRetVal = xnCreatePlayer(context.GetUnderlyingObject(), strFormatName, &hNode);
6202  XN_IS_STATUS_OK(nRetVal);
6203  TakeOwnership(hNode);
6204  return (XN_STATUS_OK);
6205  }
6206 
6207  inline XnStatus DepthGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6208  {
6209  XnNodeHandle hNode;
6210  XnStatus nRetVal = xnCreateDepthGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6211  XN_IS_STATUS_OK(nRetVal);
6212  TakeOwnership(hNode);
6213  return (XN_STATUS_OK);
6214  }
6215 
6216  inline XnStatus MockDepthGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
6217  {
6218  XnNodeHandle hNode;
6219  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_DEPTH, strName, &hNode);
6220  XN_IS_STATUS_OK(nRetVal);
6221  TakeOwnership(hNode);
6222  return (XN_STATUS_OK);
6223  }
6224 
6225  inline XnStatus MockDepthGenerator::CreateBasedOn(DepthGenerator& other, const XnChar* strName /* = NULL */)
6226  {
6227  Context context;
6228  other.GetContext(context);
6229  XnNodeHandle hNode;
6230  XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
6231  XN_IS_STATUS_OK(nRetVal);
6232  TakeOwnership(hNode);
6233  return (XN_STATUS_OK);
6234  }
6235 
6236  inline XnStatus ImageGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6237  {
6238  XnNodeHandle hNode;
6239  XnStatus nRetVal = xnCreateImageGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6240  XN_IS_STATUS_OK(nRetVal);
6241  TakeOwnership(hNode);
6242  return (XN_STATUS_OK);
6243  }
6244 
6245  inline XnStatus MockImageGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
6246  {
6247  XnNodeHandle hNode;
6248  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_IMAGE, strName, &hNode);
6249  XN_IS_STATUS_OK(nRetVal);
6250  TakeOwnership(hNode);
6251  return (XN_STATUS_OK);
6252  }
6253 
6254  inline XnStatus MockImageGenerator::CreateBasedOn(ImageGenerator& other, const XnChar* strName /* = NULL */)
6255  {
6256  Context context;
6257  other.GetContext(context);
6258  XnNodeHandle hNode;
6259  XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
6260  XN_IS_STATUS_OK(nRetVal);
6261  TakeOwnership(hNode);
6262  return (XN_STATUS_OK);
6263  }
6264 
6265  inline XnStatus IRGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6266  {
6267  XnNodeHandle hNode;
6268  XnStatus nRetVal = xnCreateIRGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6269  XN_IS_STATUS_OK(nRetVal);
6270  TakeOwnership(hNode);
6271  return (XN_STATUS_OK);
6272  }
6273 
6274  inline XnStatus MockIRGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
6275  {
6276  XnNodeHandle hNode;
6277  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_IR, strName, &hNode);
6278  XN_IS_STATUS_OK(nRetVal);
6279  TakeOwnership(hNode);
6280  return (XN_STATUS_OK);
6281  }
6282 
6283  inline XnStatus MockIRGenerator::CreateBasedOn(IRGenerator& other, const XnChar* strName /* = NULL */)
6284  {
6285  Context context;
6286  other.GetContext(context);
6287  XnNodeHandle hNode;
6288  XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
6289  XN_IS_STATUS_OK(nRetVal);
6290  TakeOwnership(hNode);
6291  return (XN_STATUS_OK);
6292  }
6293 
6294  inline XnStatus GestureGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6295  {
6296  XnNodeHandle hNode;
6297  XnStatus nRetVal = xnCreateGestureGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6298  XN_IS_STATUS_OK(nRetVal);
6299  TakeOwnership(hNode);
6300  return (XN_STATUS_OK);
6301  }
6302 
6303  inline XnStatus SceneAnalyzer::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6304  {
6305  //You're creating a scene!
6306  XnNodeHandle hNode;
6307  XnStatus nRetVal = xnCreateSceneAnalyzer(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6308  XN_IS_STATUS_OK(nRetVal);
6309  TakeOwnership(hNode);
6310  return (XN_STATUS_OK);
6311  }
6312 
6313  inline XnStatus HandsGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6314  {
6315  XnNodeHandle hNode;
6316  XnStatus nRetVal = xnCreateHandsGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6317  XN_IS_STATUS_OK(nRetVal);
6318  TakeOwnership(hNode);
6319  return (XN_STATUS_OK);
6320  }
6321 
6322  inline XnStatus UserGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6323  {
6324  XnNodeHandle hNode;
6325  XnStatus nRetVal = xnCreateUserGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6326  XN_IS_STATUS_OK(nRetVal);
6327  TakeOwnership(hNode);
6328  return (XN_STATUS_OK);
6329  }
6330 
6331  inline XnStatus AudioGenerator::Create(Context& context, Query* pQuery/*=NULL*/, EnumerationErrors* pErrors/*=NULL*/)
6332  {
6333  XnNodeHandle hNode;
6334  XnStatus nRetVal = xnCreateAudioGenerator(context.GetUnderlyingObject(), &hNode, pQuery == NULL ? NULL : pQuery->GetUnderlyingObject(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6335  XN_IS_STATUS_OK(nRetVal);
6336  TakeOwnership(hNode);
6337  return (XN_STATUS_OK);
6338  }
6339 
6340  inline XnStatus MockAudioGenerator::Create(Context& context, const XnChar* strName /* = NULL */)
6341  {
6342  XnNodeHandle hNode;
6343  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_AUDIO, strName, &hNode);
6344  XN_IS_STATUS_OK(nRetVal);
6345  TakeOwnership(hNode);
6346  return (XN_STATUS_OK);
6347  }
6348 
6349  inline XnStatus MockAudioGenerator::CreateBasedOn(AudioGenerator& other, const XnChar* strName /* = NULL */)
6350  {
6351  Context context;
6352  other.GetContext(context);
6353  XnNodeHandle hNode;
6354  XnStatus nRetVal = xnCreateMockNodeBasedOn(context.GetUnderlyingObject(), other.GetHandle(), strName, &hNode);
6355  XN_IS_STATUS_OK(nRetVal);
6356  TakeOwnership(hNode);
6357  return (XN_STATUS_OK);
6358  }
6359 
6360  inline XnStatus MockRawGenerator::Create(Context& context, const XnChar* strName /*= NULL*/)
6361  {
6362  XnNodeHandle hNode;
6363  XnStatus nRetVal = xnCreateMockNode(context.GetUnderlyingObject(), XN_NODE_TYPE_GENERATOR, strName, &hNode);
6364  XN_IS_STATUS_OK(nRetVal);
6365  TakeOwnership(hNode);
6366  return (XN_STATUS_OK);
6367  }
6368 
6369  inline XnStatus Codec::Create(Context& context, XnCodecID codecID, ProductionNode& initializerNode)
6370  {
6371  XnNodeHandle hNode;
6372  XnStatus nRetVal = xnCreateCodec(context.GetUnderlyingObject(), codecID, initializerNode.GetHandle(), &hNode);
6373  XN_IS_STATUS_OK(nRetVal);
6374  TakeOwnership(hNode);
6375  return (XN_STATUS_OK);
6376  }
6377 
6379  {
6380  return xnScriptNodeRun(GetHandle(), pErrors == NULL ? NULL : pErrors->GetUnderlying());
6381  }
6382 
6383  inline XnStatus ScriptNode::Create(Context& context, const XnChar* strFormat)
6384  {
6385  XnNodeHandle hNode;
6386  XnStatus nRetVal = xnCreateScriptNode(context.GetUnderlyingObject(), strFormat, &hNode);
6387  XN_IS_STATUS_OK(nRetVal);
6388  TakeOwnership(hNode);
6389  return (XN_STATUS_OK);
6390  }
6391 
6392  //---------------------------------------------------------------------------
6393  // Global Helper Functions
6394  //---------------------------------------------------------------------------
6395 
6400  {
6401  xnGetVersion(&Version);
6402  }
6403 
6404  //---------------------------------------------------------------------------
6405  // Internal Helper Classes and Functions
6406  //---------------------------------------------------------------------------
6407 
6409  {
6410  public:
6411  StateChangedCallbackTranslator(StateChangedHandler handler, void* pCookie) : m_UserHandler(handler), m_pUserCookie(pCookie), m_hCallback(NULL) {}
6412 
6413  XnStatus Register(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
6414  {
6415  return xnFunc(hNode, StateChangedCallback, this, &m_hCallback);
6416  }
6417 
6418  void Unregister(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
6419  {
6420  xnFunc(hNode, m_hCallback);
6421  }
6422 
6423  static XnStatus RegisterToUnderlying(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
6424  {
6425  XnStatus nRetVal = XN_STATUS_OK;
6426 
6428  XN_VALIDATE_NEW(pTrans, StateChangedCallbackTranslator, handler, pCookie);
6429 
6430  nRetVal = pTrans->Register(xnFunc, hNode);
6431  if (nRetVal != XN_STATUS_OK)
6432  {
6433  XN_DELETE(pTrans);
6434  return (nRetVal);
6435  }
6436 
6437  hCallback = pTrans;
6438 
6439  return (XN_STATUS_OK);
6440  }
6441 
6442  static XnStatus UnregisterFromUnderlying(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback)
6443  {
6445  pTrans->Unregister(xnFunc, hNode);
6446  XN_DELETE(pTrans);
6447  return XN_STATUS_OK;
6448  }
6449 
6450  private:
6451  friend class GeneralIntCapability;
6452 
6453  typedef struct StateChangeCookie
6454  {
6455  StateChangedHandler userHandler;
6456  void* pUserCookie;
6457  XnCallbackHandle hCallback;
6458  } StateChangeCookie;
6459 
6460  static void XN_CALLBACK_TYPE StateChangedCallback(XnNodeHandle hNode, void* pCookie)
6461  {
6463  ProductionNode node(hNode);
6464  pTrans->m_UserHandler(node, pTrans->m_pUserCookie);
6465  }
6466 
6467  StateChangedHandler m_UserHandler;
6468  void* m_pUserCookie;
6469  XnCallbackHandle m_hCallback;
6470  };
6471 
6472  static XnStatus _RegisterToStateChange(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void* pCookie, XnCallbackHandle& hCallback)
6473  {
6474  return StateChangedCallbackTranslator::RegisterToUnderlying(xnFunc, hNode, handler, pCookie, hCallback);
6475  }
6476 
6477  static void _UnregisterFromStateChange(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback)
6478  {
6480  }
6481 
6483  {
6484  XnStatus nRetVal = XN_STATUS_OK;
6485 
6487  XN_VALIDATE_NEW(pTrans, StateChangedCallbackTranslator, handler, pCookie);
6488 
6489  nRetVal = xnRegisterToGeneralIntValueChange(GetHandle(), m_strCap, pTrans->StateChangedCallback, pTrans, &pTrans->m_hCallback);
6490  if (nRetVal != XN_STATUS_OK)
6491  {
6492  XN_DELETE(pTrans);
6493  return (nRetVal);
6494  }
6495 
6496  hCallback = pTrans;
6497 
6498  return (XN_STATUS_OK);
6499  }
6500 
6502  {
6504  xnUnregisterFromGeneralIntValueChange(GetHandle(), m_strCap, pTrans->m_hCallback);
6505  XN_DELETE(pTrans);
6506  }
6507 
6509 };
6510 
6511 #endif // __XN_CPP_WRAPPER_H__
XnUInt32 & FullXRes()
Definition: XnCppWrapper.h:299
Definition: XnTypes.h:482
const PoseDetectionCapability GetPoseDetectionCap() const
Definition: XnCppWrapper.h:4966
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:1409
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:3080
SkeletonCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:4071
XN_C_API const void *XN_C_DECL xnNodeInfoGetAdditionalData(XnNodeInfo *pNodeInfo)
XnStatus SetData(const IRMetaData &irMD)
Definition: XnCppWrapper.h:3439
Definition: XnCppWrapper.h:2637
XnUInt32 GetSupportedWaveOutputModesCount() const
For full details and usage, see xnGetSupportedWaveOutputModesCount
Definition: XnCppWrapper.h:5135
XnNodeHandle GetHandle() const
Gets the underlying C handle.
Definition: XnCppWrapper.h:1050
XN_C_API XnUInt32 XN_C_DECL xnGetNumberOfPoses(XnNodeHandle hInstance)
Get the number of the supported poses.
AlternativeViewPointCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:2080
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:1073
XnStatus SetData(const ImageMetaData &imageMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
Definition: XnCppWrapper.h:3331
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:2170
void Unregister(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
Definition: XnCppWrapper.h:6418
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:5151
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:4285
#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:4197
Query()
Ctor.
Definition: XnCppWrapper.h:1290
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:6399
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:3771
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:5246
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:5923
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:2461
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:3770
XnStatus ClearCalibrationData(XnUInt32 nSlot)
Clear the requested slot from any saved calibration data. For full details and usage, see xnClearSkeletonCalibrationData
Definition: XnCppWrapper.h:4245
XN_C_API XnStatus XN_C_DECL xnStopSinglePoseDetection(XnNodeHandle hInstance, XnUserID user, const XnChar *strPose)
Stop detection of a specific pose for a specific user.
XnUInt32 & FPS()
Definition: XnCppWrapper.h:309
GeneralIntCapability GetHueCap()
Definition: XnCppWrapper.h:2797
XnStatus SetSmoothing(XnFloat fSmoothingFactor)
Change smoothing factor. For full details and usage, see xnSetTrackingSmoothing
Definition: XnCppWrapper.h:3994
const XnDepthPixel * Data() const
Definition: XnCppWrapper.h:522
XN_C_API XnInt32 XN_C_DECL xnVersionCompare(const XnVersion *pVersion1, const XnVersion *pVersion2)
void UnregisterHandCallbacks(XnCallbackHandle hCallback)
Unregister from hands callbacks. For full details and usage, see xnUnregisterHandCallbacks ...
Definition: XnCppWrapper.h:3960
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:5345
xn::DepthMap & WritableDepthMap()
Gets a light object wrapping the writable depth-map.
Definition: XnCppWrapper.h:531
XnStatus SetData(const ImageMetaData &imageMD)
Definition: XnCppWrapper.h:3341
CroppingCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2598
XnStatus SetData(const AudioMetaData &audioMD)
Definition: XnCppWrapper.h:5237
Definition: XnCppWrapper.h:2685
XN_C_API XnStatus XN_C_DECL xnGetSkeletonJoint(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation *pJoint)
Get a specific joint&#39;s full information.
XnStatus SetMaxVersion(const XnVersion &maxVersion)
For full details and usage, see xnNodeQuerySetMaxVersion
Definition: XnCppWrapper.h:1339
XnStatus GetCropping(XnCropping &Cropping) const
Gets current cropping configuration. For full details and usage, see xnGetCropping ...
Definition: XnCppWrapper.h:2611
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:5642
#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:3468
#define FALSE
Definition: XnPlatform.h:85
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates a user generator. For full details and usage, see xnCreateUserGenerator
Definition: XnCppWrapper.h:6322
NodeWrapper(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1026
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&#39;s orientation. For full details and usage, see xnGetSkeletonJointOrientation ...
Definition: XnCppWrapper.h:4165
XnStatus LockForChanges(XnLockHandle *phLock)
Locks a node, not allowing any changes (any "set" function). For full details and usage...
Definition: XnCppWrapper.h:1887
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:864
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:2927
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:6143
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:5410
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:2807
XnBool IsDataNew() const
Checks whether current data is new. Meaning, did the data change on the last call to xnWaitAndUpdateA...
Definition: XnCppWrapper.h:2274
void UnregisterFromErrorStateChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToNodeErrorStateChange(). For full details and usage, see xnUnregisterFromNodeErrorStateChange
Definition: XnCppWrapper.h:1709
struct XnEnumerationErrors XnEnumerationErrors
Definition: XnTypes.h:214
#define XN_VALIDATE_ALLOC_PTR(x)
Definition: XnOS.h:128
XnStatus GetCalibrationPose(XnChar *strPose) const
Get the pose that is required for calibration. For full details and usage, see xnGetSkeletonCalibrati...
Definition: XnCppWrapper.h:4293
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:4710
XnStatus StopTracking(XnUserID user)
Stop tracking a skeleton. For full details and usage, see xnStopSkeletonTracking
Definition: XnCppWrapper.h:4269
const AlternativeViewPointCapability GetAlternativeViewPointCap() const
Definition: XnCppWrapper.h:2336
Resolution(XnResolution res)
Definition: XnCppWrapper.h:6054
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:3223
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:5320
GeneralIntCapability GetBrightnessCap()
Definition: XnCppWrapper.h:2777
#define XN_CAPABILITY_SHARPNESS
Definition: XnTypes.h:307
XnUInt32 GetYResolution() const
Gets the Y resolution.
Definition: XnCppWrapper.h:6091
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:4568
XnBool GetGlobalMirror()
Gets the global mirror flag. For full details and usage, see xnGetGlobalMirror
Definition: XnCppWrapper.h:5915
const XnNodeQuery * GetUnderlyingObject() const
Gets the underlying C object.
Definition: XnCppWrapper.h:1309
void Release()
Releases a context object, decreasing its ref count by 1. If reference count has reached 0...
Definition: XnCppWrapper.h:5698
XN_C_API XnUInt32 XN_C_DECL xnGetSupportedWaveOutputModesCount(XnNodeHandle hInstance)
XnUInt32 XnLockHandle
Definition: XnTypes.h:87
void(* XnFreeHandler)(const void *pData)
Definition: XnTypes.h:242
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:6245
XnUInt32 FullXRes() const
Definition: XnCppWrapper.h:297
XnStatus AddSupportedMapOutputMode(const XnMapOutputMode &MapOutputMode)
For full details and usage, see xnNodeQueryAddSupportedMapOutputMode
Definition: XnCppWrapper.h:1355
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:5827
XnStatus StopTrackingAll()
Stop tracking all hands. For full details and usage, see xnStopTrackingAll
Definition: XnCppWrapper.h:3978
const xn::DepthMap & DepthMap() const
Gets a light object wrapping the depth-map.
Definition: XnCppWrapper.h:529
XnIRMetaData * GetUnderlying()
Definition: XnCppWrapper.h:844
#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:2046
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:4141
Definition: XnTypes.h:492
XnStatus LoadScriptFromFile(const XnChar *strFileName)
Definition: XnCppWrapper.h:5325
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:1429
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:1943
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:2493
AntiFlickerCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2646
XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot)
Save the calibration data.
GeneralIntCapability GetTiltCap()
Definition: XnCppWrapper.h:2877
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:6153
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:4739
XnStatus ReadNext()
Reads the next data element from the player. For full details and usage, see xnPlayerReadNext ...
Definition: XnCppWrapper.h:2477
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:3297
XnStatus ResetViewPoint()
Sets the view point of this generator to its normal one. For full details and usage, see xnResetViewPoint
Definition: XnCppWrapper.h:2102
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:5289
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:2086
ErrorStateCapability GetErrorStateCap()
Definition: XnCppWrapper.h:1931
XN_C_API void XN_C_DECL xnNodeQueryFree(XnNodeQuery *pQuery)
HandTouchingFOVEdgeCapability GetHandTouchingFOVEdgeCap()
Definition: XnCppWrapper.h:4014
const XnLabel & operator()(XnUInt32 x, XnUInt32 y) const
Definition: XnCppWrapper.h:987
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:2356
PoseDetectionCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:4577
Definition: XnCppWrapper.h:2024
XnStatus GetVendorSpecificData(XnChar *strBuffer, XnUInt32 nBufferSize)
For full details and usage, see xnGetVendorSpecificData
Definition: XnCppWrapper.h:1975
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:5434
Definition: XnCppWrapper.h:1679
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:3781
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:3476
XnStatus GetMapOutputMode(XnMapOutputMode &OutputMode) const
Gets the current output mode. For full details and usage, see xnGetMapOutputMode
Definition: XnCppWrapper.h:2723
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:3970
Iterator & operator++()
Definition: XnCppWrapper.h:1438
ImageGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3189
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.
XnStatus Append(NodeInfoList &other)
For full details and usage, see xnNodeInfoListAppend
Definition: XnCppWrapper.h:1622
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:2424
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:3604
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:2767
const xn::IRMap & IRMap() const
Gets a light object wrapping the IR map.
Definition: XnCppWrapper.h:837
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...
XN_C_API XnBool XN_C_DECL xnIsPoseSupported(XnNodeHandle hInstance, const XnChar *strPose)
Tests if a pose is supported.
XnStatus AddSupportedCapability(const XnChar *strNeededCapability)
For full details and usage, see xnNodeQueryAddSupportedCapability
Definition: XnCppWrapper.h:1347
const XnUInt8 * GetImageMap() const
Gets the current image-map as a byte buffer. For full details, see xnGetImageMap().
Definition: XnCppWrapper.h:3239
XN_C_API XnStatus XN_C_DECL xnScriptNodeRun(XnNodeHandle hScript, XnEnumerationErrors *pErrors)
Device(const NodeWrapper &other)
Definition: XnCppWrapper.h:2002
Iterator RBegin() const
Gets an iterator to the last item in the list.
Definition: XnCppWrapper.h:1591
void UnregisterFromFieldOfViewChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToDepthFieldOfViewChange. For full details and usage, see xnUnregisterFromDepthFieldOfViewChange
Definition: XnCppWrapper.h:3072
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:4934
XN_C_API XnBool XN_C_DECL xnIsGenerating(XnNodeHandle hInstance)
Checks if this node is currently generating.
~EnumerationErrors()
Dtor.
Definition: XnCppWrapper.h:5360
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:3396
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:5979
void UnregisterFromJointConfigurationChange(XnCallbackHandle hCallback)
Unregister from joint configuration changes. For full details and usage, see xnUnregisterFromJointCon...
Definition: XnCppWrapper.h:4133
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.
Definition: XnCppWrapper.h:6408
Definition: XnCppWrapper.h:457
GeneralIntCapability GetExposureCap()
Definition: XnCppWrapper.h:2907
void SetHandle(XnNodeHandle hNode)
Replaces the object being pointed.
Definition: XnCppWrapper.h:1097
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:2110
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6216
XnRecordMedium
Definition: XnTypes.h:811
XnStatus StopGeneratingAll()
Stop all generators from generating data. For full details and usage, see xnStopGeneratingAll ...
Definition: XnCppWrapper.h:5899
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:2054
Definition: XnTypes.h:1142
const CroppingCapability GetCroppingCap() const
Definition: XnCppWrapper.h:2757
Codec(const NodeWrapper &other)
Definition: XnCppWrapper.h:5271
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:4391
XnUInt32 XOffset() const
Definition: XnCppWrapper.h:287
Definition: XnCppWrapper.h:5262
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsGetCurrentError(XnEnumerationErrorsIterator it)
GeneralIntCapability GetContrastCap()
Definition: XnCppWrapper.h:2787
XnStatus Reset(XnUserID user)
Reset the skeleton - discard calibration. For full details and usage, see xnResetSkeleton ...
Definition: XnCppWrapper.h:4277
XnEnumerationErrors * GetUnderlying()
Gets the underlying C object.
Definition: XnCppWrapper.h:5445
const XnLabel & operator[](XnUInt32 nIndex) const
Definition: XnCppWrapper.h:975
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:2032
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:1962
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:4877
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:2290
Iterator REnd() const
Gets an iterator marking the start of the list. This iterator does not point to a valid item...
Definition: XnCppWrapper.h:1597
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:5419
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.
XnUInt32 GetXResolution() const
Gets the X resolution.
Definition: XnCppWrapper.h:6089
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:3500
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
XN_C_API XnDepthPixel *XN_C_DECL xnGetDepthMap(XnNodeHandle hInstance)
Gets the current depth-map. This map is updated after a call to xnWaitAndUpdateData().
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:1233
AntiFlickerCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:2645
XnStatus Set(XnInt32 nValue)
Sets the current value of this capability. For full details and usage, see xnSetGeneralIntValue ...
Definition: XnCppWrapper.h:1752
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:4984
~Context()
Dtor.
Definition: XnCppWrapper.h:5488
XnUInt16 & BitsPerSample()
Gets the number of bits per channel in a sample.
Definition: XnCppWrapper.h:893
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:3319
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:3832
XnStatus AbortCalibration(XnUserID user)
stop calibration For full details and usage, see xnAbortSkeletonCalibration
Definition: XnCppWrapper.h:4205
XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void *pData)
Definition: XnCppWrapper.h:5251
XnUInt32 FPS() const
Definition: XnCppWrapper.h:307
void GetContext(Context &context) const
For full details and usage, see xnGetContextFromNodeHandle
Definition: XnCppWrapper.h:6110
XnUInt64 & Timestamp()
Definition: XnCppWrapper.h:145
XnStatus GetInstance(ProductionNode &node) const
Definition: XnCppWrapper.h:6158
XnDepthPixel * WritableData()
Definition: XnCppWrapper.h:526
const XnUInt8 * Data() const
Definition: XnCppWrapper.h:168
AlternativeViewPointCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2081
XnStatus SetData(const DepthMetaData &depthMD)
Definition: XnCppWrapper.h:3170
~NodeInfo()
Dtor.
Definition: XnCppWrapper.h:1184
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&#39; 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:5167
XN_C_API XnStatus XN_C_DECL xnFindExistingRefNodeByType(XnContext *pContext, XnProductionNodeType type, XnNodeHandle *phNode)
Returns the first found existing node of the specified type.
XnUInt16 GetNumberOfAvailableGestures() const
Get the number of all gestures available. For full details and usage, see xnGetNumberOfAvailableGestu...
Definition: XnCppWrapper.h:3508
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:2416
const SkeletonCapability GetSkeletonCap() const
Definition: XnCppWrapper.h:4946
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.
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:3807
XnPowerLineFrequency
Definition: XnTypes.h:517
XnStatus InitFrom(const SceneMetaData &other, XnUInt32 nXRes, XnUInt32 nYRes, const XnLabel *pExternalBuffer)
Definition: XnCppWrapper.h:937
XnUInt32 & YRes()
Definition: XnCppWrapper.h:284
XnStatus ToString(XnChar *csBuffer, XnUInt32 nSize)
For full details and usage, see xnEnumerationErrorsToString
Definition: XnCppWrapper.h:5426
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:2651
GeneralIntCapability GetWhiteBalanceCap()
Definition: XnCppWrapper.h:2837
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:4956
#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:6313
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:4625
#define XN_VALIDATE_NEW(ptr, type,...)
Definition: XnOS.h:168
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:2619
const void * GetAdditionalData() const
For full details and usage, see xnNodeInfoGetAdditionalData
Definition: XnCppWrapper.h:1255
Definition: XnTypes.h:568
MockIRGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3397
const XnOutputMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:163
XN_C_API XnUInt16 XN_C_DECL xnGetNumberOfAvailableGestures(XnNodeHandle hInstance)
Get the number of all gestures available.
XnBool operator==(const NodeWrapper &other)
Definition: XnCppWrapper.h:1057
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:5891
HandsGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3893
AudioGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:5109
XnStatus SetMirror(XnBool bMirror)
Sets current mirror configuration. For full details and usage, see xnSetMirror
Definition: XnCppWrapper.h:2038
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:5985
Definition: XnTypes.h:465
XnStatus SetSupportedMinUserPositions(const XnUInt32 nCount)
For full details and usage, see xnNodeQuerySetSupportedMinUserPositions
Definition: XnCppWrapper.h:1363
MockAudioGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:5193
XnStatus Create(Context &context, XnCodecID codecID, ProductionNode &initializerNode)
For full details and usage, see xnCreateCodec
Definition: XnCppWrapper.h:6369
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:2282
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:2517
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:959
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:1967
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:4181
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:1310
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:6207
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:4856
void UnregisterFromValueChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToGeneralIntValueChange(). For full details and usage, see xnUnregisterFromGeneralIntValueChange
Definition: XnCppWrapper.h:6501
void UnregisterFromUserExit(XnCallbackHandle hCallback)
Unregister from when a user exits the scene. For full details and usage, see xnUnregisterFromUserExit...
Definition: XnCppWrapper.h:5008
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:3986
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)
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:6482
const xn::RGB24Map & RGB24Map() const
Gets a light object wrapping the image-map.
Definition: XnCppWrapper.h:722
PoseDetectionCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:4576
XnStatus GetProductionNodeInfoByName(const XnChar *strInstanceName, NodeInfo &nodeInfo) const
For full details and usage, see xnGetNodeHandleByName
Definition: XnCppWrapper.h:5873
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:2145
void InitFrom(const AudioMetaData &other)
Definition: XnCppWrapper.h:875
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:3040
Definition: XnCppWrapper.h:579
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6360
UserPositionCapability GetUserPositionCap()
Definition: XnCppWrapper.h:3108
XnStatus Create(Context &context, const XnChar *strFormatName)
Creates a player. For full details and usage, see xnCreatePlayer
Definition: XnCppWrapper.h:6198
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:2667
StateChangedCallbackTranslator(StateChangedHandler handler, void *pCookie)
Definition: XnCppWrapper.h:6411
MirrorCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2033
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:2699
XnStatus GetGeneralProperty(const XnChar *strName, XnUInt32 nBufferSize, void *pBuffer) const
Gets a buffer property. For full details and usage, see xnGetGeneralProperty
Definition: XnCppWrapper.h:1879
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:3378
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:3271
#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:1903
~NodeWrapper()
Definition: XnCppWrapper.h:1042
NodeInfo operator*()
Gets the NodeInfo object pointed by the iterator.
Definition: XnCppWrapper.h:1475
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:1225
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:4864
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:1467
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates an image generator. For full details and usage, see xnCreateImageGenerator ...
Definition: XnCppWrapper.h:6236
XnStatus SetIntProperty(const XnChar *strName, XnUInt64 nValue)
Sets an integer property. For full details and usage, see xnSetIntProperty
Definition: XnCppWrapper.h:1823
const XnChar * GetName() const
Gets the instance name of a node by its handle. For full details and usage, see xnGetNodeName() ...
Definition: XnCppWrapper.h:1078
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:2987
XnStatus LoadCalibrationData(XnUserID user, XnUInt32 nSlot)
Load previously saved calibration data. For full details and usage, see xnLoadSkeletonCalibrationData...
Definition: XnCppWrapper.h:4237
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:3762
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:4885
Definition: XnTypes.h:1110
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:4901
XnStatus Register(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode)
Definition: XnCppWrapper.h:6413
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:3885
#define XN_VALIDATE_ALLOC(x, y)
Definition: XnOS.h:131
XnInt32 Get()
Gets the current value of this capability. For full details and usage, see xnGetGeneralIntValue ...
Definition: XnCppWrapper.h:1742
XnStatus CreateCodec(XnCodecID codecID, ProductionNode &initializerNode, Codec &codec)
For full details and usage, see xnCreateCodec
Definition: XnCppWrapper.h:5674
XnUInt32 GetFrameID() const
Gets the frame ID of current data. For full details and usage, see xnGetFrameID
Definition: XnCppWrapper.h:2306
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:2258
XnStatus GetDestination(XnRecordMedium &destType, XnChar *strDest, XnUInt32 nBufSize)
Definition: XnCppWrapper.h:2400
XnStatus GetSkeletonJointPosition(XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition &Joint) const
Get a specific joint&#39;s position. For full details and usage, see xnGetSkeletonJointPosition ...
Definition: XnCppWrapper.h:4157
XN_C_API XnBool XN_C_DECL xnIsPixelFormatSupported(XnNodeHandle hInstance, XnPixelFormat Format)
Checks if a specific pixel format is supported.
Definition: XnCppWrapper.h:3118
const XnIRPixel & operator[](XnUInt32 nIndex) const
Definition: XnCppWrapper.h:818
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:5357
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:5215
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:6225
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:3255
XnStatus GetSource(XnRecordMedium &sourceType, XnChar *strSource, XnUInt32 nBufSize) const
Gets the player&#39;s source, i.e where the played events come from. For full details and usage...
Definition: XnCppWrapper.h:2469
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:3088
AntiFlickerCapability GetAntiFlickerCap()
Definition: XnCppWrapper.h:2947
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:5797
XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointOrientation(XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation *pJoint)
Get a specific joint&#39;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:5194
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:1815
MockImageGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3298
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:2385
XnStatus WaitAndUpdateData()
Updates the data to the latest available one. If needed, the call will block until new data is availa...
Definition: XnCppWrapper.h:2266
GeneralIntCapability(XnNodeHandle hNode, const XnChar *strCap)
Definition: XnCppWrapper.h:1728
Definition: XnTypes.h:444
void(* XnErrorStateChangedHandler)(XnStatus errorState, void *pCookie)
Definition: XnTypes.h:235
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:3596
XnLabel * WritableData()
Definition: XnCppWrapper.h:963
void UnregisterFromEndOfFileReached(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToEndOfFileReached(). For full details and usage, see xnUnregisterFromEndOfFileReached
Definition: XnCppWrapper.h:2563
XN_C_API XnStatus XN_C_DECL xnMockRawSetData(XnNodeHandle hInstance, XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const void *pData)
void UnregisterFromHandTouchingFOVEdge(XnCallbackHandle hCallback)
Unregister from hand approaching the edge of the FOV. For full details and usage, see xnUnregisterFro...
Definition: XnCppWrapper.h:3856
XnUInt32 GetBytesPerPixel() const
Gets the number of bytes per pixel for this map generator. For full details and usage, see xnGetBytesPerPixel
Definition: XnCppWrapper.h:2731
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:891
Definition: XnCppWrapper.h:5185
void UnregisterFromCalibrationInProgress(XnCallbackHandle hCallback)
Unregister from calibration status while in progress. For full details and usage, see xnUnregisterFro...
Definition: XnCppWrapper.h:4436
Definition: XnCppWrapper.h:1663
Capability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1671
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:5931
void(* XnStateChangedHandler)(XnNodeHandle hNode, void *pCookie)
Definition: XnTypes.h:227
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:3359
NodeInfo & operator=(const NodeInfo &other)
Definition: XnCppWrapper.h:1194
XnNodeInfoList * GetUnderlyingObject() const
Gets the underlying C object.
Definition: XnCppWrapper.h:1528
Definition: XnTypes.h:1123
XnStatus GetPoseStatus(XnUserID userID, const XnChar *poseName, XnUInt64 &poseTime, XnPoseDetectionStatus &eStatus, XnPoseDetectionState &eState)
Definition: XnCppWrapper.h:4617
MockDepthGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3127
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:2408
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates a device node. For full details and usage, see xnCreateDevice
Definition: XnCppWrapper.h:6180
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:3064
XnUInt32 & SampleRate()
Gets the rate in which audio is sampled.
Definition: XnCppWrapper.h:888
OutputMetaData(const XnUInt8 **ppData)
Definition: XnCppWrapper.h:132
Definition: XnCppWrapper.h:5307
XnBool operator==(const Iterator &other) const
Definition: XnCppWrapper.h:1419
XN_C_API void XN_C_DECL xnOSMemCopy(void *pDest, const void *pSource, XnSizeT nCount)
MockRawGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:5247
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:5658
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:2971
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&#39;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:2485
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:81
XnContext * GetUnderlyingObject() const
Gets the underlying C object.
Definition: XnCppWrapper.h:5500
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:5421
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:4455
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:2210
#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:4368
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...
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:5281
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:4690
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:2867
XnStatus SetDestination(XnRecordMedium destType, const XnChar *strDest)
Tells the recorder where to record. For full details and usage, see xnSetRecorderDestination ...
Definition: XnCppWrapper.h:2395
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:996
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:5729
ImageGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3188
XnPoseDetectionState
Definition: XnTypes.h:654
~NodeInfoList()
Dtor.
Definition: XnCppWrapper.h:1522
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:968
XnStatus GetSupportedWaveOutputModes(XnWaveOutputMode *aSupportedModes, XnUInt32 &nCount) const
For full details and usage, see xnGetSupportedWaveOutputModes
Definition: XnCppWrapper.h:5143
void UnregisterFromViewPointChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToViewPointChange(). For full details and usage, see xnUnregisterFromViewPointChange
Definition: XnCppWrapper.h:2126
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:4412
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:1614
XnPowerLineFrequency GetPowerLineFrequency()
Gets the power line frequency. For full details and usage, see xnGetPowerLineFrequency ...
Definition: XnCppWrapper.h:2659
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:1154
HandTouchingFOVEdgeCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:3816
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:3003
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:4909
Player(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2442
Definition: XnCppWrapper.h:1160
XN_C_API XnStatus XN_C_DECL xnGetRecorderDestination(XnNodeHandle hRecorder, XnRecordMedium *pDestType, XnChar *strDest, XnUInt32 nBufSize)
Returns the recoder&#39;s destination.
#define XN_NEW(type,...)
Definition: XnOS.h:326
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:3022
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:4893
GeneralIntCapability GetZoomCap()
Definition: XnCppWrapper.h:2897
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:3524
void UnregisterFromNewDataAvailable(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToNewDataAvailable(). For full details and usage, see xnUnregisterFromNewDataAvailable
Definition: XnCppWrapper.h:2250
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:4221
XnStatus SetRealProperty(const XnChar *strName, XnDouble dValue)
Sets a real property. For full details and usage, see xnSetRealProperty
Definition: XnCppWrapper.h:1831
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:2547
XnStatus RemoveNeededNode(ProductionNode &needed)
Removes a needed node from the list of needed nodes. For full details and usage, see xnRemoveNeededNo...
Definition: XnCppWrapper.h:1802
XnStatus Add(XnProductionNodeDescription &description, const XnChar *strCreationInfo, NodeInfoList *pNeededNodes)
For full details and usage, see xnNodeInfoListAdd
Definition: XnCppWrapper.h:1546
Recorder(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2384
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates a Gesture Generator. For full details and usage, see xnCreateGestureGenerator ...
Definition: XnCppWrapper.h:6294
XnGrayscale16Pixel XnIRPixel
Definition: XnTypes.h:284
CroppingCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:2597
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:2118
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:6105
XnStatus AddRef()
References a production node, increasing its reference count by 1. For full details and usage...
Definition: XnCppWrapper.h:1083
Definition: XnCppWrapper.h:5100
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:1555
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&#39;s position.
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:5596
GeneralIntCapability GetGammaCap()
Definition: XnCppWrapper.h:2827
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:5392
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:4600
XnStatus SetUserPosition(XnUInt32 nIndex, const XnBoundingBox3D &Position)
Sets the current user position. For full details and usage, see xnSetUserPosition ...
Definition: XnCppWrapper.h:2979
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:1131
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:2094
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:3417
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:5315
XnPixelFormat GetPixelFormat() const
Gets current pixel format. For full details and usage, see xnGetPixelFormat
Definition: XnCppWrapper.h:3263
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.
XN_C_API XnStatus XN_C_DECL xnCreateGestureGenerator(XnContext *pContext, XnNodeHandle *phGestureGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates a Gesture Generator.
HandsGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3894
PoseDetectionCapability GetPoseDetectionCap()
Definition: XnCppWrapper.h:4976
#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.
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:3207
XN_C_API XnStatus XN_C_DECL xnCreateAudioGenerator(XnContext *pContext, XnNodeHandle *phAudioGenerator, XnNodeQuery *pQuery, XnEnumerationErrors *pErrors)
Creates an audio generator.
Definition: XnCppWrapper.h:1286
XnUInt64 GetTimestamp() const
Gets the timestamp of current data, in microseconds. For full details and usage, see xnGetTimestamp ...
Definition: XnCppWrapper.h:2298
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:3279
Definition: XnCppWrapper.h:3351
Definition: XnCppWrapper.h:5460
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:2196
XnStatus RunXmlScriptFromFile(const XnChar *strFileName, ScriptNode &scriptNode, EnumerationErrors *pErrors=NULL)
Runs an XML script in the given context. For full details and usage, see xnContextRunXmlScriptFromFil...
Definition: XnCppWrapper.h:5560
XnCalibrationStatus
Definition: XnTypes.h:661
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:994
Definition: XnTypes.h:456
~Query()
Dtor.
Definition: XnCppWrapper.h:1300
XnStatus SaveCalibrationDataToFile(XnUserID user, const XnChar *strFileName)
Save the calibration data to file. For full details and usage, see xnSaveSkeletonCalibrationDataToFil...
Definition: XnCppWrapper.h:4213
XnStatus SetData(const DepthMetaData &depthMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
Definition: XnCppWrapper.h:3160
Iterator End() const
Gets an iterator marking the end of the list. This iterator does not point to a valid item...
Definition: XnCppWrapper.h:1584
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:2202
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:1168
Context & operator=(const Context &other)
Definition: XnCppWrapper.h:5493
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 Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates an scene analyzer. For full details and usage, see xnCreateSceneAnalyzer
Definition: XnCppWrapper.h:6303
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:5505
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:1295
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 &#39;in progress&#39; callbacks. For full details and usage...
Definition: XnCppWrapper.h:3532
DeviceIdentificationCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1961
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
#define XN_CAPABILITY_ROLL
Definition: XnTypes.h:314
NodeInfoList & GetNeededNodes() const
For full details and usage, see xnNodeInfoGetNeededNodes
Definition: XnCppWrapper.h:6115
XnStatus SetName(const XnChar *strName)
For full details and usage, see xnNodeQuerySetName()
Definition: XnCppWrapper.h:1323
const XnIRMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:842
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:5532
Definition: XnCppWrapper.h:2072
static XnStatus UnregisterFromUnderlying(_XnUnregisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, XnCallbackHandle hCallback)
Definition: XnCppWrapper.h:6442
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:3492
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:818
XnStatus StopSinglePoseDetection(XnUserID user, const XnChar *strPose)
Stop detection of a specific pose for a specific user. For full details and usage, see xnStopSinglePoseDetection
Definition: XnCppWrapper.h:4641
const XnLabel *& Data()
Definition: XnCppWrapper.h:961
XnDouble GetPlaybackSpeed() const
Gets the playback speed. see xnSetPlaybackSpeed() for more details. For full details and usage...
Definition: XnCppWrapper.h:2579
XnBool IsPixelFormatSupported(XnPixelFormat Format) const
Checks if a specific pixel format is supported. For full details and usage, see xnIsPixelFormatSuppor...
Definition: XnCppWrapper.h:3247
void UnregisterFromMapOutputModeChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToMapOutputModeChange. For full details and usage, see xnUnregisterFromMapOutputModeChange
Definition: XnCppWrapper.h:2747
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:1387
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:3687
Definition: XnTypes.h:493
NodeWrapper & operator=(const NodeWrapper &other)
Definition: XnCppWrapper.h:1036
XN_C_API XnStatus XN_C_DECL xnNodeInfoGetTreeStringRepresentation(XnNodeInfo *pNodeInfo, XnChar *csResult, XnUInt32 nSize)
const ErrorStateCapability GetErrorStateCap() const
Definition: XnCppWrapper.h:1921
XN_C_API XnStatus XN_C_DECL xnEnumerateLicenses(XnContext *pContext, XnLicense **paLicenses, XnUInt32 *pnCount)
Definition: XnCppWrapper.h:3289
const XnGrayscale16Pixel *& Grayscale16Data()
Definition: XnCppWrapper.h:712
XnStatus SetVendor(const XnChar *strVendor)
For full details and usage, see xnNodeQuerySetVendor()
Definition: XnCppWrapper.h:1315
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:4607
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:1088
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:3934
XN_C_API XnStatus XN_C_DECL xnCreateScriptNode(XnContext *pContext, const XnChar *strFormat, XnNodeHandle *phScript)
void UnregisterFromGestureIntermediateStageCompleted(XnCallbackHandle hCallback)
Unregister from when a gesture is in progress. For full details and usage, see xnUnregisterFromGestur...
Definition: XnCppWrapper.h:3644
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:4076
XnStatus SetInstanceName(const XnChar *strName)
For full details and usage, see xnNodeInfoSetInstanceName
Definition: XnCppWrapper.h:1209
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:2062
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:1701
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:839
const XnProductionNodeDescription & Description()
Gets the description of the failing node this iterator points to.
Definition: XnCppWrapper.h:5408
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:4865
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:5737
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:1983
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:1564
XnStatus CopyFrom(const SceneMetaData &other)
Definition: XnCppWrapper.h:944
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.
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...
XN_C_API const XnChar *XN_C_DECL xnNodeInfoGetInstanceName(XnNodeInfo *pNodeInfo)
Definition: XnCppWrapper.h:1775
XnStatus ReAdjust(XnUInt32 nXRes, XnUInt32 nYRes, const XnLabel *pExternalBuffer=NULL)
Definition: XnCppWrapper.h:953
void GetMetaData(IRMetaData &metaData) const
Gets the current IR-map meta data. For full details and usage, see xnGetIRMetaData ...
Definition: XnCppWrapper.h:3370
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:6067
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddNodeFromList(XnNodeInfoList *pList, XnNodeInfoListIterator otherListIt)
const UserPositionCapability GetUserPositionCap() const
Definition: XnCppWrapper.h:3098
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:1789
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:6046
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:4125
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:2144
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:5464
Definition: XnCppWrapper.h:3180
SceneMetaData()
Ctor.
Definition: XnCppWrapper.h:917
NodeInfoList(XnNodeInfoList *pList)
Definition: XnCppWrapper.h:1519
EnumerationErrors()
Ctor.
Definition: XnCppWrapper.h:5349
XnDepthPixel & ZRes()
Definition: XnCppWrapper.h:519
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:886
XnStatus WaitAndUpdateAll()
Updates all generators nodes in the context, waiting for all to have new data. For full details and u...
Definition: XnCppWrapper.h:5947
XnStatus SetSmoothing(XnFloat fSmoothingFactor)
Set the skeleton&#39;s smoothing factor. For full details and usage, see xnSetSkeletonSmoothing ...
Definition: XnCppWrapper.h:4301
const XnChar * GetSupportedFormat() const
Gets the name of the format supported by a player. For full details and usage, see xnGetPlayerSupport...
Definition: XnCppWrapper.h:2525
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:3056
const xn::LabelMap & LabelMap() const
Gets a light object wrapping the label map.
Definition: XnCppWrapper.h:966
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:4229
#define XN_DELETE(p)
Definition: XnOS.h:336
XnStatus DecodeData(const void *pSrc, XnUInt32 nSrcSize, void *pDst, XnUInt32 nDstSize, XnUInt *pnBytesWritten) const
For full details and usage, see xnDecodeData
Definition: XnCppWrapper.h:5297
XnBool IsPoseSupported(const XnChar *strPose)
Definition: XnCppWrapper.h:4612
XN_C_API XnNodeInfoList *XN_C_DECL xnNodeInfoGetNeededNodes(XnNodeInfo *pNodeInfo)
Definition: XnCppWrapper.h:2434
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:5721
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:5745
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:3621
XnStatus Run(EnumerationErrors *pErrors)
Definition: XnCppWrapper.h:6378
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:2533
Device(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2001
Definition: XnCppWrapper.h:1953
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:1067
Definition: XnCppWrapper.h:3449
void GetMetaData(ImageMetaData &metaData) const
Gets the current image-map meta data. For full details and usage, see xnGetImageMetaData ...
Definition: XnCppWrapper.h:3199
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:3516
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:6087
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 &#39;in progress&#39; 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:3215
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:2571
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:2501
XnBool IsProfileAvailable(XnSkeletonProfile eProfile) const
Check if generator supports a specific profile. For full details and usage, see xnIsProfileAvailable ...
Definition: XnCppWrapper.h:4084
void Release()
Unreference a production node, decreasing its reference count by 1. If the reference count reaches ze...
Definition: XnCppWrapper.h:1088
void TakeOwnership(XnContext *pContext)
Definition: XnCppWrapper.h:6019
XN_C_API XnStatus XN_C_DECL xnNodeQueryAddSupportedCapability(XnNodeQuery *pQuery, const XnChar *strNeededCapability)
Definition: XnCppWrapper.h:2188
XnStatus Create(Context &context, const XnChar *strFormatName=NULL)
Creates a recorder. For full details and usage, see xnCreateRecorder
Definition: XnCppWrapper.h:6189
XnStatus SetRepeat(XnBool bRepeat)
Determines whether the player will automatically rewind to the beginning of the recording when reachi...
Definition: XnCppWrapper.h:2453
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:5018
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:1839
void UnregisterFromUserReEnter(XnCallbackHandle hCallback)
Unregister from when a user re-enters the scene. For full details and usage, see xnUnregisterFromUser...
Definition: XnCppWrapper.h:5042
XnStatus SetData(const AudioMetaData &audioMD, XnUInt32 nFrameID, XnUInt64 nTimestamp)
Definition: XnCppWrapper.h:5227
GestureGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3458
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:5175
XnStatus GetStringProperty(const XnChar *strName, XnChar *csValue, XnUInt32 nBufSize) const
Gets a string property. For full details and usage, see xnGetStringProperty
Definition: XnCppWrapper.h:1871
Context(const Context &other)
Definition: XnCppWrapper.h:5482
XnStatus CreateBasedOn(IRGenerator &other, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6283
MapMetaData(XnPixelFormat format, const XnUInt8 **ppData)
Definition: XnCppWrapper.h:269
XnStatus CreateBasedOn(AudioGenerator &other, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6349
Definition: XnCppWrapper.h:5243
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.
XN_C_API XnStatus xnGetPoseStatus(XnNodeHandle hInstance, XnUserID userID, const XnChar *poseName, XnUInt64 *poseTime, XnPoseDetectionStatus *eStatus, XnPoseDetectionState *eState)
Gets the current pose status.
Definition: XnTypes.h:552
XnStatus AddNeededNode(const XnChar *strInstanceName)
For full details and usage, see xnNodeQueryAddNeededNode
Definition: XnCppWrapper.h:1379
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:1507
XN_C_API XnBool XN_C_DECL xnIsJointActive(XnNodeHandle hInstance, XnSkeletonJoint eJoint)
Check if joint is currently active.
FrameSyncCapability GetFrameSyncCap()
Definition: XnCppWrapper.h:2366
#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:2136
Definition: XnCppWrapper.h:860
Definition: XnTypes.h:1133
const XnRGB24Pixel * RGB24Data() const
Definition: XnCppWrapper.h:689
XN_C_API XnStatus XN_C_DECL xnSetSkeletonSmoothing(XnNodeHandle hInstance, XnFloat fFactor)
Set the skeleton&#39;s smoothing factor.
Iterator operator++(int)
Definition: XnCppWrapper.h:1448
const XnChar * GetName() const
Gets the name of the resolution.
Definition: XnCppWrapper.h:6093
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:5955
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:3663
Definition: XnCppWrapper.h:4062
XN_C_API XnStatus XN_C_DECL xnNodeQuerySetMinVersion(XnNodeQuery *pQuery, const XnVersion *pMinVersion)
XnSkeletonProfile
Definition: XnTypes.h:623
GeneralIntCapability GetLowLightCompensationCap()
Definition: XnCppWrapper.h:2937
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:4117
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:3797
XnStatus Create(Context &context, Query *pQuery=NULL, EnumerationErrors *pErrors=NULL)
Creates an IR generator. For full details and usage, see xnCreateIRGenerator
Definition: XnCppWrapper.h:6265
AudioGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:5108
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:2443
XN_C_API XnUChar *XN_C_DECL xnGetAudioBuffer(XnNodeHandle hInstance)
IRGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:3360
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:2739
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:5690
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&#39;s full information. For full details and usage, see xnGetSkeletonJoint ...
Definition: XnCppWrapper.h:4149
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:4092
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:5270
XnStatus FindExistingNode(XnProductionNodeType type, ProductionNode &node) const
For full details and usage, see xnFindExistingNodeByType
Definition: XnCppWrapper.h:5841
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:2376
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:4479
XnBool operator!=(const Iterator &other) const
Definition: XnCppWrapper.h:5383
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:3388
AlternativeViewPointCapability GetAlternativeViewPointCap()
Definition: XnCppWrapper.h:2346
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:4004
XnStatus GetErrorState() const
Gets current error state of this node. For full details and usage, see xnGetNodeErrorState ...
Definition: XnCppWrapper.h:1693
XN_C_API void XN_C_DECL xnUnregisterUserCallbacks(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from user callbacks.
Iterator operator++(int)
Definition: XnCppWrapper.h:5402
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:3484
XnUInt8 NumberOfChannels() const
Gets the number of channels in every sample.
Definition: XnCppWrapper.h:881
XnStatus LoadScriptFromString(const XnChar *strScript)
Definition: XnCppWrapper.h:5330
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6274
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:883
XnBool IsEmpty()
For full details and usage, see xnNodeInfoListIsEmpty
Definition: XnCppWrapper.h:1630
XnUInt32 GetNumberOfPoses() const
Get the number of the supported poses. For full details and usage, see xnGetNumberOfPoses ...
Definition: XnCppWrapper.h:4592
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:2178
HandTouchingFOVEdgeCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:3815
Iterator Begin() const
Gets an iterator to the first item in the list.
Definition: XnCppWrapper.h:1578
ErrorStateCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:1687
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:898
GeneralIntCapability GetGainCap()
Definition: XnCppWrapper.h:2857
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:1847
Context(XnContext *pContext)
Definition: XnCppWrapper.h:5471
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:6138
void LockedNodeEndChanges(XnLockHandle hLock)
Ends changes request on a locked node. For full details and usage, see xnLockedNodeEndChanges ...
Definition: XnCppWrapper.h:1911
static XnStatus RegisterToUnderlying(_XnRegisterStateChangeFuncPtr xnFunc, XnNodeHandle hNode, StateChangedHandler handler, void *pCookie, XnCallbackHandle &hCallback)
Definition: XnCppWrapper.h:6423
MapGenerator(const NodeWrapper &other)
Definition: XnCppWrapper.h:2694
XnStatus GetProductionNodeByName(const XnChar *strInstanceName, ProductionNode &node) const
For full details and usage, see xnGetNodeHandleByName
Definition: XnCppWrapper.h:5857
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:5939
void GetMetaData(AudioMetaData &metaData) const
Gets the current audio meta data. For full details and usage, see xnGetAudioMetaData ...
Definition: XnCppWrapper.h:5119
XnStatus InitFrom(const DepthMetaData &other, XnUInt32 nXRes, XnUInt32 nYRes, const XnDepthPixel *pExternalBuffer)
Definition: XnCppWrapper.h:491
GestureGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3457
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:4100
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:6331
Definition: XnCppWrapper.h:1405
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:2847
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:1688
void InitFrom(const ImageMetaData &other)
Definition: XnCppWrapper.h:603
GeneralIntCapability GetSharpnessCap()
Definition: XnCppWrapper.h:2817
SkeletonCapability(XnNodeHandle hNode)
Definition: XnCppWrapper.h:4070
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:2509
void UnregisterFromCroppingChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToCroppingChange(). For full details and usage, see xnUnregisterFromCroppingChange
Definition: XnCppWrapper.h:2627
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:677
Iterator & operator--()
Definition: XnCppWrapper.h:1458
XN_C_API XnStatus XN_C_DECL xnGetSupportedWaveOutputModes(XnNodeHandle hInstance, XnWaveOutputMode *aSupportedModes, XnUInt32 *pnCount)
Definition: XnCppWrapper.h:2589
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:4261
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:3561
ScriptNode(const NodeWrapper &other)
Definition: XnCppWrapper.h:5316
XnStatus GetWaveOutputMode(XnWaveOutputMode &OutputMode) const
For full details and usage, see xnGetWaveOutputMode
Definition: XnCppWrapper.h:5159
XnStatus SetData(XnUInt32 nFrameID, XnUInt64 nTimestamp, XnUInt32 nDataSize, const XnDepthPixel *pDepthMap)
For full details and usage, see xnMockDepthSetData
Definition: XnCppWrapper.h:3148
Definition: XnTypes.h:494
Resolution(const XnChar *strName)
Definition: XnCppWrapper.h:6078
Generator(const NodeWrapper &other)
Definition: XnCppWrapper.h:2197
GeneralIntCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:1729
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:2995
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:2603
XnPixelFormat & PixelFormat()
Gets the pixel format.
Definition: XnCppWrapper.h:683
const MirrorCapability GetMirrorCap() const
Definition: XnCppWrapper.h:2316
struct XnContext XnContext
Definition: XnTypes.h:77
NodeWrapper(const NodeWrapper &other)
Definition: XnCppWrapper.h:1031
UserPositionCapability(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2965
DeviceIdentificationCapability GetIdentificationCap()
Definition: XnCppWrapper.h:2014
#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:1606
Definition: XnCppWrapper.h:913
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:1331
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:3231
Definition: XnTypes.h:106
Definition: XnCppWrapper.h:3013
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:5626
XnBool operator==(const Iterator &other) const
Definition: XnCppWrapper.h:5373
XnStatus AddNeededNode(ProductionNode &needed)
Adds another node to the list of needed nodes for this node. For full details and usage...
Definition: XnCppWrapper.h:1794
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:2917
XnStatus Create(Context &context, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6340
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:1855
XnStatus SetMapOutputMode(const XnMapOutputMode &OutputMode)
Sets the output mode. For full details and usage, see xnSetMapOutputMode
Definition: XnCppWrapper.h:2715
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:4759
XN_C_API XnStatus XN_C_DECL xnGetUsers(XnNodeHandle hInstance, XnUserID *pUsers, XnUInt16 *pnUsers)
Get the current users.
Definition: XnCppWrapper.h:2957
Definition: XnCppWrapper.h:1016
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:3586
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:931
Definition: XnCppWrapper.h:1993
XN_C_API void XN_C_DECL xnUnregisterFromGestureReadyForNextIntermediateStage(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from when a gesture is ready for its next stage.
Definition: XnCppWrapper.h:34
XN_C_API void XN_C_DECL xnUnregisterFromJointConfigurationChange(XnNodeHandle hInstance, XnCallbackHandle hCallback)
Unregister from joint configuration changes.
XnResolution
Definition: XnTypes.h:386
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:4783
XnBool IsTracking(XnUserID user) const
Check if skeleton is being tracked. For full details and usage, see xnIsSkeletonTracking ...
Definition: XnCppWrapper.h:4173
Definition: XnCppWrapper.h:1719
XnStatus SetExistingNodeOnly(XnBool bExistingNode)
For full details and usage, see xnNodeQuerySetExistingNodeOnly
Definition: XnCppWrapper.h:1371
ProductionNode(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:1783
An iterator over enumeration errors.
Definition: XnCppWrapper.h:5363
XnBool IsCalibrating(XnUserID user) const
Check if skeleton is being calibrated. For full details and usage, see xnIsSkeletonCalibrating ...
Definition: XnCppWrapper.h:4189
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:3789
UserPositionCapability(const NodeWrapper &node)
Definition: XnCppWrapper.h:2966
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:2675
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:2242
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:1734
ProductionNode(const NodeWrapper &other)
Definition: XnCppWrapper.h:1784
const XnAudioMetaData * GetUnderlying() const
Definition: XnCppWrapper.h:896
void UnregisterFromGenerationRunningChange(XnCallbackHandle hCallback)
Unregisters a callback function which was registered using xnRegisterToGenerationRunningChange(). For full details and usage, see xnUnregisterFromGenerationRunningChange
Definition: XnCppWrapper.h:2234
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:1536
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...
void(* StateChangedHandler)(ProductionNode &node, void *pCookie)
Definition: XnCppWrapper.h:62
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAllocate(XnNodeInfoList **ppList)
NodeInfo(const NodeInfo &other)
Definition: XnCppWrapper.h:1178
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:5127
XnBool IsCalibrationData(XnUInt32 nSlot) const
Check if a specific slot already holds calibration data. For full details and usage, see xnIsSkeletonCalibrationData
Definition: XnCppWrapper.h:4253
XnStatus GetTreeStringRepresentation(XnChar *csResultBuffer, XnUInt32 nBufferSize) const
For full details and usage, see xnNodeInfoGetTreeStringRepresentation
Definition: XnCppWrapper.h:1263
void UnlockForChanges(XnLockHandle hLock)
Unlocks a previously locked node. For full details and usage, see xnUnlockNodeForChanges ...
Definition: XnCppWrapper.h:1895
XN_C_API XnUInt32 XN_C_DECL xnResolutionGetYRes(XnResolution resolution)
MapGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:2693
Capability(const NodeWrapper &node)
Definition: XnCppWrapper.h:1672
DepthGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3021
XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationData(XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot)
Load previously saved calibration data.
GeneralIntCapability GetRollCap()
Definition: XnCppWrapper.h:2887
XnStatus GetRealProperty(const XnChar *strName, XnDouble &dValue) const
Gets a real property. For full details and usage, see xnGetRealProperty
Definition: XnCppWrapper.h:1863
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:1217
XnStatus CreateBasedOn(ImageGenerator &other, const XnChar *strName=NULL)
Definition: XnCppWrapper.h:6254
XnDepthPixel GetDeviceMaxDepth() const
Gets the maximum depth the device can produce. For full details and usage, see xnGetDeviceMaxDepth ...
Definition: XnCppWrapper.h:3048
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:2707
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:2226
XnStatus Create(Context &context, const XnChar *strFormat)
Definition: XnCppWrapper.h:6383
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:2555
void UnregisterFromPoseDetected(XnCallbackHandle hCallback)
Unregister from pose detected callback. For full details and usage, see xnUnregisterFromPoseDetected ...
Definition: XnCppWrapper.h:4730
XnStatus WaitOneUpdateAll(ProductionNode &node)
Updates all generators nodes in the context, waiting for a specific one to have new data...
Definition: XnCppWrapper.h:5963
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:4633
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:5763
const XnIRPixel & operator()(XnUInt32 x, XnUInt32 y) const
Definition: XnCppWrapper.h:830
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&#39; mirror state, and also affect future created nodes. The default mirror flag is FALSE. For full details and usage, see xnSetGlobalMirror
Definition: XnCppWrapper.h:5907
MockDepthGenerator(XnNodeHandle hNode=NULL)
Definition: XnCppWrapper.h:3126
XnStatus AddNodeFromAnotherList(Iterator &it)
For full details and usage, see xnNodeInfoListAddNodeFromList
Definition: XnCppWrapper.h:1572
MirrorCapability GetMirrorCap()
Definition: XnCppWrapper.h:2326
XnStatus StopGenerating()
Stops generation of the output. For full details and usage, see xnStopGenerating
Definition: XnCppWrapper.h:2218
Definition: XnTypes.h:1071
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:5813
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:3429
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:3032
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:6148
XnStatus WaitNoneUpdateAll()
Updates all generator nodes in the context, without any waiting. If a node has new data...
Definition: XnCppWrapper.h:5971