t1 / TFDContents / Assets / Standard Assets / Windows / Kinect / FrameDescription.cs @ 9
이력 | 보기 | 이력해설 | 다운로드 (6.35 KB)
1 | 3 | KTH | #if !(UNITY_WSA_10_0 && NETFX_CORE) |
---|---|---|---|
2 | using RootSystem = System; |
||
3 | using System.Linq; |
||
4 | using System.Collections.Generic; |
||
5 | namespace Windows.Kinect |
||
6 | { |
||
7 | // |
||
8 | // Windows.Kinect.FrameDescription |
||
9 | // |
||
10 | public sealed partial class FrameDescription : Helper.INativeWrapper |
||
11 | |||
12 | { |
||
13 | internal RootSystem.IntPtr _pNative; |
||
14 | RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } } |
||
15 | |||
16 | // Constructors and Finalizers |
||
17 | internal FrameDescription(RootSystem.IntPtr pNative) |
||
18 | { |
||
19 | _pNative = pNative; |
||
20 | Windows_Kinect_FrameDescription_AddRefObject(ref _pNative); |
||
21 | } |
||
22 | |||
23 | ~FrameDescription() |
||
24 | { |
||
25 | Dispose(false); |
||
26 | } |
||
27 | |||
28 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
29 | private static extern void Windows_Kinect_FrameDescription_ReleaseObject(ref RootSystem.IntPtr pNative); |
||
30 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
31 | private static extern void Windows_Kinect_FrameDescription_AddRefObject(ref RootSystem.IntPtr pNative); |
||
32 | private void Dispose(bool disposing) |
||
33 | { |
||
34 | if (_pNative == RootSystem.IntPtr.Zero) |
||
35 | { |
||
36 | return; |
||
37 | } |
||
38 | |||
39 | __EventCleanup(); |
||
40 | |||
41 | Helper.NativeObjectCache.RemoveObject<FrameDescription>(_pNative); |
||
42 | Windows_Kinect_FrameDescription_ReleaseObject(ref _pNative); |
||
43 | |||
44 | _pNative = RootSystem.IntPtr.Zero; |
||
45 | } |
||
46 | |||
47 | |||
48 | // Public Properties |
||
49 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
50 | private static extern uint Windows_Kinect_FrameDescription_get_BytesPerPixel(RootSystem.IntPtr pNative); |
||
51 | public uint BytesPerPixel |
||
52 | { |
||
53 | get |
||
54 | { |
||
55 | if (_pNative == RootSystem.IntPtr.Zero) |
||
56 | { |
||
57 | throw new RootSystem.ObjectDisposedException("FrameDescription"); |
||
58 | } |
||
59 | |||
60 | return Windows_Kinect_FrameDescription_get_BytesPerPixel(_pNative); |
||
61 | } |
||
62 | } |
||
63 | |||
64 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
65 | private static extern float Windows_Kinect_FrameDescription_get_DiagonalFieldOfView(RootSystem.IntPtr pNative); |
||
66 | public float DiagonalFieldOfView |
||
67 | { |
||
68 | get |
||
69 | { |
||
70 | if (_pNative == RootSystem.IntPtr.Zero) |
||
71 | { |
||
72 | throw new RootSystem.ObjectDisposedException("FrameDescription"); |
||
73 | } |
||
74 | |||
75 | return Windows_Kinect_FrameDescription_get_DiagonalFieldOfView(_pNative); |
||
76 | } |
||
77 | } |
||
78 | |||
79 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
80 | private static extern int Windows_Kinect_FrameDescription_get_Height(RootSystem.IntPtr pNative); |
||
81 | public int Height |
||
82 | { |
||
83 | get |
||
84 | { |
||
85 | if (_pNative == RootSystem.IntPtr.Zero) |
||
86 | { |
||
87 | throw new RootSystem.ObjectDisposedException("FrameDescription"); |
||
88 | } |
||
89 | |||
90 | return Windows_Kinect_FrameDescription_get_Height(_pNative); |
||
91 | } |
||
92 | } |
||
93 | |||
94 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
95 | private static extern float Windows_Kinect_FrameDescription_get_HorizontalFieldOfView(RootSystem.IntPtr pNative); |
||
96 | public float HorizontalFieldOfView |
||
97 | { |
||
98 | get |
||
99 | { |
||
100 | if (_pNative == RootSystem.IntPtr.Zero) |
||
101 | { |
||
102 | throw new RootSystem.ObjectDisposedException("FrameDescription"); |
||
103 | } |
||
104 | |||
105 | return Windows_Kinect_FrameDescription_get_HorizontalFieldOfView(_pNative); |
||
106 | } |
||
107 | } |
||
108 | |||
109 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
110 | private static extern uint Windows_Kinect_FrameDescription_get_LengthInPixels(RootSystem.IntPtr pNative); |
||
111 | public uint LengthInPixels |
||
112 | { |
||
113 | get |
||
114 | { |
||
115 | if (_pNative == RootSystem.IntPtr.Zero) |
||
116 | { |
||
117 | throw new RootSystem.ObjectDisposedException("FrameDescription"); |
||
118 | } |
||
119 | |||
120 | return Windows_Kinect_FrameDescription_get_LengthInPixels(_pNative); |
||
121 | } |
||
122 | } |
||
123 | |||
124 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
125 | private static extern float Windows_Kinect_FrameDescription_get_VerticalFieldOfView(RootSystem.IntPtr pNative); |
||
126 | public float VerticalFieldOfView |
||
127 | { |
||
128 | get |
||
129 | { |
||
130 | if (_pNative == RootSystem.IntPtr.Zero) |
||
131 | { |
||
132 | throw new RootSystem.ObjectDisposedException("FrameDescription"); |
||
133 | } |
||
134 | |||
135 | return Windows_Kinect_FrameDescription_get_VerticalFieldOfView(_pNative); |
||
136 | } |
||
137 | } |
||
138 | |||
139 | [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)] |
||
140 | private static extern int Windows_Kinect_FrameDescription_get_Width(RootSystem.IntPtr pNative); |
||
141 | public int Width |
||
142 | { |
||
143 | get |
||
144 | { |
||
145 | if (_pNative == RootSystem.IntPtr.Zero) |
||
146 | { |
||
147 | throw new RootSystem.ObjectDisposedException("FrameDescription"); |
||
148 | } |
||
149 | |||
150 | return Windows_Kinect_FrameDescription_get_Width(_pNative); |
||
151 | } |
||
152 | } |
||
153 | |||
154 | private void __EventCleanup() |
||
155 | { |
||
156 | } |
||
157 | } |
||
158 | |||
159 | } |
||
160 | #endif |