MultiSourceFrame.cs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. using RootSystem = System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. namespace Windows.Kinect
  5. {
  6. //
  7. // Windows.Kinect.MultiSourceFrame
  8. //
  9. public sealed partial class MultiSourceFrame : Helper.INativeWrapper
  10. {
  11. internal RootSystem.IntPtr _pNative;
  12. RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
  13. // Constructors and Finalizers
  14. internal MultiSourceFrame(RootSystem.IntPtr pNative)
  15. {
  16. _pNative = pNative;
  17. Windows_Kinect_MultiSourceFrame_AddRefObject(ref _pNative);
  18. }
  19. ~MultiSourceFrame()
  20. {
  21. Dispose(false);
  22. }
  23. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  24. private static extern void Windows_Kinect_MultiSourceFrame_ReleaseObject(ref RootSystem.IntPtr pNative);
  25. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  26. private static extern void Windows_Kinect_MultiSourceFrame_AddRefObject(ref RootSystem.IntPtr pNative);
  27. private void Dispose(bool disposing)
  28. {
  29. if (_pNative == RootSystem.IntPtr.Zero)
  30. {
  31. return;
  32. }
  33. __EventCleanup();
  34. Helper.NativeObjectCache.RemoveObject<MultiSourceFrame>(_pNative);
  35. Windows_Kinect_MultiSourceFrame_ReleaseObject(ref _pNative);
  36. _pNative = RootSystem.IntPtr.Zero;
  37. }
  38. // Public Properties
  39. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  40. private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_BodyFrameReference(RootSystem.IntPtr pNative);
  41. public Windows.Kinect.BodyFrameReference BodyFrameReference
  42. {
  43. get
  44. {
  45. if (_pNative == RootSystem.IntPtr.Zero)
  46. {
  47. throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
  48. }
  49. RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_BodyFrameReference(_pNative);
  50. Helper.ExceptionHelper.CheckLastError();
  51. if (objectPointer == RootSystem.IntPtr.Zero)
  52. {
  53. return null;
  54. }
  55. return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyFrameReference>(objectPointer, n => new Windows.Kinect.BodyFrameReference(n));
  56. }
  57. }
  58. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  59. private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_BodyIndexFrameReference(RootSystem.IntPtr pNative);
  60. public Windows.Kinect.BodyIndexFrameReference BodyIndexFrameReference
  61. {
  62. get
  63. {
  64. if (_pNative == RootSystem.IntPtr.Zero)
  65. {
  66. throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
  67. }
  68. RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_BodyIndexFrameReference(_pNative);
  69. Helper.ExceptionHelper.CheckLastError();
  70. if (objectPointer == RootSystem.IntPtr.Zero)
  71. {
  72. return null;
  73. }
  74. return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.BodyIndexFrameReference>(objectPointer, n => new Windows.Kinect.BodyIndexFrameReference(n));
  75. }
  76. }
  77. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  78. private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_ColorFrameReference(RootSystem.IntPtr pNative);
  79. public Windows.Kinect.ColorFrameReference ColorFrameReference
  80. {
  81. get
  82. {
  83. if (_pNative == RootSystem.IntPtr.Zero)
  84. {
  85. throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
  86. }
  87. RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_ColorFrameReference(_pNative);
  88. Helper.ExceptionHelper.CheckLastError();
  89. if (objectPointer == RootSystem.IntPtr.Zero)
  90. {
  91. return null;
  92. }
  93. return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.ColorFrameReference>(objectPointer, n => new Windows.Kinect.ColorFrameReference(n));
  94. }
  95. }
  96. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  97. private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_DepthFrameReference(RootSystem.IntPtr pNative);
  98. public Windows.Kinect.DepthFrameReference DepthFrameReference
  99. {
  100. get
  101. {
  102. if (_pNative == RootSystem.IntPtr.Zero)
  103. {
  104. throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
  105. }
  106. RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_DepthFrameReference(_pNative);
  107. Helper.ExceptionHelper.CheckLastError();
  108. if (objectPointer == RootSystem.IntPtr.Zero)
  109. {
  110. return null;
  111. }
  112. return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.DepthFrameReference>(objectPointer, n => new Windows.Kinect.DepthFrameReference(n));
  113. }
  114. }
  115. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  116. private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_InfraredFrameReference(RootSystem.IntPtr pNative);
  117. public Windows.Kinect.InfraredFrameReference InfraredFrameReference
  118. {
  119. get
  120. {
  121. if (_pNative == RootSystem.IntPtr.Zero)
  122. {
  123. throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
  124. }
  125. RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_InfraredFrameReference(_pNative);
  126. Helper.ExceptionHelper.CheckLastError();
  127. if (objectPointer == RootSystem.IntPtr.Zero)
  128. {
  129. return null;
  130. }
  131. return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.InfraredFrameReference>(objectPointer, n => new Windows.Kinect.InfraredFrameReference(n));
  132. }
  133. }
  134. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  135. private static extern RootSystem.IntPtr Windows_Kinect_MultiSourceFrame_get_LongExposureInfraredFrameReference(RootSystem.IntPtr pNative);
  136. public Windows.Kinect.LongExposureInfraredFrameReference LongExposureInfraredFrameReference
  137. {
  138. get
  139. {
  140. if (_pNative == RootSystem.IntPtr.Zero)
  141. {
  142. throw new RootSystem.ObjectDisposedException("MultiSourceFrame");
  143. }
  144. RootSystem.IntPtr objectPointer = Windows_Kinect_MultiSourceFrame_get_LongExposureInfraredFrameReference(_pNative);
  145. Helper.ExceptionHelper.CheckLastError();
  146. if (objectPointer == RootSystem.IntPtr.Zero)
  147. {
  148. return null;
  149. }
  150. return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.LongExposureInfraredFrameReference>(objectPointer, n => new Windows.Kinect.LongExposureInfraredFrameReference(n));
  151. }
  152. }
  153. // Public Methods
  154. private void __EventCleanup()
  155. {
  156. }
  157. }
  158. }