FrameDescription.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. using RootSystem = System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. namespace Windows.Kinect
  5. {
  6. //
  7. // Windows.Kinect.FrameDescription
  8. //
  9. public sealed partial class FrameDescription : Helper.INativeWrapper
  10. {
  11. internal RootSystem.IntPtr _pNative;
  12. RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
  13. // Constructors and Finalizers
  14. internal FrameDescription(RootSystem.IntPtr pNative)
  15. {
  16. _pNative = pNative;
  17. Windows_Kinect_FrameDescription_AddRefObject(ref _pNative);
  18. }
  19. ~FrameDescription()
  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_FrameDescription_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_FrameDescription_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<FrameDescription>(_pNative);
  35. Windows_Kinect_FrameDescription_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 uint Windows_Kinect_FrameDescription_get_BytesPerPixel(RootSystem.IntPtr pNative);
  41. public uint BytesPerPixel
  42. {
  43. get
  44. {
  45. if (_pNative == RootSystem.IntPtr.Zero)
  46. {
  47. throw new RootSystem.ObjectDisposedException("FrameDescription");
  48. }
  49. return Windows_Kinect_FrameDescription_get_BytesPerPixel(_pNative);
  50. }
  51. }
  52. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  53. private static extern float Windows_Kinect_FrameDescription_get_DiagonalFieldOfView(RootSystem.IntPtr pNative);
  54. public float DiagonalFieldOfView
  55. {
  56. get
  57. {
  58. if (_pNative == RootSystem.IntPtr.Zero)
  59. {
  60. throw new RootSystem.ObjectDisposedException("FrameDescription");
  61. }
  62. return Windows_Kinect_FrameDescription_get_DiagonalFieldOfView(_pNative);
  63. }
  64. }
  65. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  66. private static extern int Windows_Kinect_FrameDescription_get_Height(RootSystem.IntPtr pNative);
  67. public int Height
  68. {
  69. get
  70. {
  71. if (_pNative == RootSystem.IntPtr.Zero)
  72. {
  73. throw new RootSystem.ObjectDisposedException("FrameDescription");
  74. }
  75. return Windows_Kinect_FrameDescription_get_Height(_pNative);
  76. }
  77. }
  78. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  79. private static extern float Windows_Kinect_FrameDescription_get_HorizontalFieldOfView(RootSystem.IntPtr pNative);
  80. public float HorizontalFieldOfView
  81. {
  82. get
  83. {
  84. if (_pNative == RootSystem.IntPtr.Zero)
  85. {
  86. throw new RootSystem.ObjectDisposedException("FrameDescription");
  87. }
  88. return Windows_Kinect_FrameDescription_get_HorizontalFieldOfView(_pNative);
  89. }
  90. }
  91. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  92. private static extern uint Windows_Kinect_FrameDescription_get_LengthInPixels(RootSystem.IntPtr pNative);
  93. public uint LengthInPixels
  94. {
  95. get
  96. {
  97. if (_pNative == RootSystem.IntPtr.Zero)
  98. {
  99. throw new RootSystem.ObjectDisposedException("FrameDescription");
  100. }
  101. return Windows_Kinect_FrameDescription_get_LengthInPixels(_pNative);
  102. }
  103. }
  104. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  105. private static extern float Windows_Kinect_FrameDescription_get_VerticalFieldOfView(RootSystem.IntPtr pNative);
  106. public float VerticalFieldOfView
  107. {
  108. get
  109. {
  110. if (_pNative == RootSystem.IntPtr.Zero)
  111. {
  112. throw new RootSystem.ObjectDisposedException("FrameDescription");
  113. }
  114. return Windows_Kinect_FrameDescription_get_VerticalFieldOfView(_pNative);
  115. }
  116. }
  117. [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
  118. private static extern int Windows_Kinect_FrameDescription_get_Width(RootSystem.IntPtr pNative);
  119. public int Width
  120. {
  121. get
  122. {
  123. if (_pNative == RootSystem.IntPtr.Zero)
  124. {
  125. throw new RootSystem.ObjectDisposedException("FrameDescription");
  126. }
  127. return Windows_Kinect_FrameDescription_get_Width(_pNative);
  128. }
  129. }
  130. private void __EventCleanup()
  131. {
  132. }
  133. }
  134. }