123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604 |
- using RootSystem = System;
- using System;
- using System.Collections.Generic;
- using System.Runtime.InteropServices;
- namespace Windows.Kinect
- {
- [RootSystem.Runtime.InteropServices.StructLayout(RootSystem.Runtime.InteropServices.LayoutKind.Sequential)]
- public struct PointF
- {
- public float X { get; set; }
- public float Y { get; set; }
- public override int GetHashCode()
- {
- return X.GetHashCode() ^ Y.GetHashCode();
- }
- public override bool Equals(object obj)
- {
- if (!(obj is PointF))
- {
- return false;
- }
- return this.Equals((ColorSpacePoint)obj);
- }
- public bool Equals(ColorSpacePoint obj)
- {
- return (X == obj.X) && (Y == obj.Y);
- }
- public static bool operator ==(PointF a, PointF b)
- {
- return a.Equals(b);
- }
- public static bool operator !=(PointF a, PointF b)
- {
- return !(a.Equals(b));
- }
- }
- public sealed partial class AudioBeamSubFrame
- {
- [RootSystem.Runtime.InteropServices.DllImport(
- "KinectUnityAddin",
- EntryPoint = "Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToArray",
- CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
- SetLastError = true)]
- private static extern void Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, RootSystem.IntPtr frameData, uint frameDataSize);
- public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
- }
- Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToIntPtr(_pNative, frameData, size);
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern RootSystem.IntPtr Windows_Kinect_AudioBeamSubFrame_LockAudioBuffer(RootSystem.IntPtr pNative);
- public Windows.Kinect.KinectBuffer LockAudioBuffer()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
- }
- RootSystem.IntPtr objectPointer = Windows_Kinect_AudioBeamSubFrame_LockAudioBuffer(_pNative);
- Helper.ExceptionHelper.CheckLastError();
- if (objectPointer == RootSystem.IntPtr.Zero)
- {
- return null;
- }
- return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
- }
- }
- public sealed partial class AudioBeamFrame
- {
- private Windows.Kinect.AudioBeamSubFrame[] _subFrames = null;
- private void Dispose(bool disposing)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- return;
- }
- if (_subFrames != null)
- {
- foreach (var subFrame in _subFrames)
- {
- subFrame.Dispose();
- }
- _subFrames = null;
- }
- __EventCleanup();
- Helper.NativeObjectCache.RemoveObject<AudioBeamFrame>(_pNative);
- Windows_Kinect_AudioBeamFrame_ReleaseObject(ref _pNative);
- if (disposing)
- {
- Windows_Kinect_AudioBeamFrame_Dispose(_pNative);
- }
- _pNative = RootSystem.IntPtr.Zero;
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
- private static extern void Windows_Kinect_AudioBeamFrame_Dispose(RootSystem.IntPtr pNative);
- public void Dispose()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- return;
- }
- Dispose(true);
- RootSystem.GC.SuppressFinalize(this);
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern int Windows_Kinect_AudioBeamFrame_get_SubFrames(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] outCollection, int outCollectionSize);
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
- private static extern int Windows_Kinect_AudioBeamFrame_get_SubFrames_Length(RootSystem.IntPtr pNative);
- public RootSystem.Collections.Generic.IList<Windows.Kinect.AudioBeamSubFrame> SubFrames
- {
- get
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("AudioBeamFrame");
- }
- if (_subFrames == null)
- {
- int collectionSize = Windows_Kinect_AudioBeamFrame_get_SubFrames_Length(_pNative);
- var outCollection = new RootSystem.IntPtr[collectionSize];
- _subFrames = new Windows.Kinect.AudioBeamSubFrame[collectionSize];
- collectionSize = Windows_Kinect_AudioBeamFrame_get_SubFrames(_pNative, outCollection, collectionSize);
- Helper.ExceptionHelper.CheckLastError();
- for (int i = 0; i < collectionSize; i++)
- {
- if (outCollection[i] == RootSystem.IntPtr.Zero)
- {
- continue;
- }
- var obj = Helper.NativeObjectCache.GetObject<Windows.Kinect.AudioBeamSubFrame>(outCollection[i]);
- if (obj == null)
- {
- obj = new Windows.Kinect.AudioBeamSubFrame(outCollection[i]);
- Helper.NativeObjectCache.AddObject<Windows.Kinect.AudioBeamSubFrame>(outCollection[i], obj);
- }
- _subFrames[i] = obj;
- }
- }
- return _subFrames;
- }
- }
- }
- public sealed partial class BodyFrame
- {
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern void Windows_Kinect_BodyFrame_GetAndRefreshBodyData(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] bodies, int bodiesSize);
- public void GetAndRefreshBodyData(RootSystem.Collections.Generic.IList<Windows.Kinect.Body> bodies)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("BodyFrame");
- }
- int _bodies_idx = 0;
- var _bodies = new RootSystem.IntPtr[bodies.Count];
- for (int i = 0; i < bodies.Count; i++)
- {
- if (bodies[i] == null)
- {
- bodies[i] = new Body();
- }
- _bodies[_bodies_idx] = bodies[i].GetIntPtr();
- _bodies_idx++;
- }
- Windows_Kinect_BodyFrame_GetAndRefreshBodyData(_pNative, _bodies, bodies.Count);
- Helper.ExceptionHelper.CheckLastError();
- for (int i = 0; i < bodies.Count; i++)
- {
- bodies[i].SetIntPtr(_bodies[i]);
- }
- }
- }
- public sealed partial class Body
- {
- internal void SetIntPtr(RootSystem.IntPtr value) { _pNative = value; }
- internal RootSystem.IntPtr GetIntPtr() { return _pNative; }
- internal Body() { }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern RootSystem.IntPtr Windows_Kinect_Body_get_Lean(RootSystem.IntPtr pNative);
- public Windows.Kinect.PointF Lean
- {
- get
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("Body");
- }
- var objectPointer = Windows_Kinect_Body_get_Lean(_pNative);
- Helper.ExceptionHelper.CheckLastError();
- var obj = (Windows.Kinect.PointF)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.PointF));
- RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
- return obj;
- }
- }
- }
- public sealed partial class ColorFrame
- {
- [RootSystem.Runtime.InteropServices.DllImport(
- "KinectUnityAddin",
- EntryPoint = "Windows_Kinect_ColorFrame_CopyRawFrameDataToArray",
- CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
- SetLastError = true)]
- private static extern void Windows_Kinect_ColorFrame_CopyRawFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
- public void CopyRawFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("ColorFrame");
- }
- Windows_Kinect_ColorFrame_CopyRawFrameDataToIntPtr(_pNative, frameData, size);
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport(
- "KinectUnityAddin",
- EntryPoint = "Windows_Kinect_ColorFrame_CopyConvertedFrameDataToArray",
- CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
- SetLastError = true)]
- private static extern void Windows_Kinect_ColorFrame_CopyConvertedFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize, Windows.Kinect.ColorImageFormat colorFormat);
- public void CopyConvertedFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size, Windows.Kinect.ColorImageFormat colorFormat)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("ColorFrame");
- }
- Windows_Kinect_ColorFrame_CopyConvertedFrameDataToIntPtr(_pNative, frameData, size, colorFormat);
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern RootSystem.IntPtr Windows_Kinect_ColorFrame_LockRawImageBuffer(RootSystem.IntPtr pNative);
- public Windows.Kinect.KinectBuffer LockRawImageBuffer()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("ColorFrame");
- }
- RootSystem.IntPtr objectPointer = Windows_Kinect_ColorFrame_LockRawImageBuffer(_pNative);
- Helper.ExceptionHelper.CheckLastError();
- if (objectPointer == RootSystem.IntPtr.Zero)
- {
- return null;
- }
- return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
- }
- }
- public sealed partial class DepthFrame
- {
- [RootSystem.Runtime.InteropServices.DllImport(
- "KinectUnityAddin",
- EntryPoint = "Windows_Kinect_DepthFrame_CopyFrameDataToArray",
- CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
- SetLastError = true)]
- private static extern void Windows_Kinect_DepthFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
- public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("DepthFrame");
- }
- Windows_Kinect_DepthFrame_CopyFrameDataToIntPtr(_pNative, frameData, size / sizeof(ushort));
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern RootSystem.IntPtr Windows_Kinect_DepthFrame_LockImageBuffer(RootSystem.IntPtr pNative);
- public Windows.Kinect.KinectBuffer LockImageBuffer()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("DepthFrame");
- }
- RootSystem.IntPtr objectPointer = Windows_Kinect_DepthFrame_LockImageBuffer(_pNative);
- Helper.ExceptionHelper.CheckLastError();
- if (objectPointer == RootSystem.IntPtr.Zero)
- {
- return null;
- }
- return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
- }
- }
- public sealed partial class BodyIndexFrame
- {
- [RootSystem.Runtime.InteropServices.DllImport(
- "KinectUnityAddin",
- EntryPoint = "Windows_Kinect_BodyIndexFrame_CopyFrameDataToArray",
- CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
- SetLastError = true)]
- private static extern void Windows_Kinect_BodyIndexFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
- public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("BodyIndexFrame");
- }
- Windows_Kinect_BodyIndexFrame_CopyFrameDataToIntPtr(_pNative, frameData, size);
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern RootSystem.IntPtr Windows_Kinect_BodyIndexFrame_LockImageBuffer(RootSystem.IntPtr pNative);
- public Windows.Kinect.KinectBuffer LockImageBuffer()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("BodyIndexFrame");
- }
- RootSystem.IntPtr objectPointer = Windows_Kinect_BodyIndexFrame_LockImageBuffer(_pNative);
- Helper.ExceptionHelper.CheckLastError();
- if (objectPointer == RootSystem.IntPtr.Zero)
- {
- return null;
- }
- return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
- }
- }
- public sealed partial class InfraredFrame
- {
- [RootSystem.Runtime.InteropServices.DllImport(
- "KinectUnityAddin",
- EntryPoint = "Windows_Kinect_InfraredFrame_CopyFrameDataToArray",
- CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
- SetLastError = true)]
- private static extern void Windows_Kinect_InfraredFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
- public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("InfraredFrame");
- }
- Windows_Kinect_InfraredFrame_CopyFrameDataToIntPtr(_pNative, frameData, size / sizeof(ushort));
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern RootSystem.IntPtr Windows_Kinect_InfraredFrame_LockImageBuffer(RootSystem.IntPtr pNative);
- public Windows.Kinect.KinectBuffer LockImageBuffer()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("InfraredFrame");
- }
- RootSystem.IntPtr objectPointer = Windows_Kinect_InfraredFrame_LockImageBuffer(_pNative);
- Helper.ExceptionHelper.CheckLastError();
- if (objectPointer == RootSystem.IntPtr.Zero)
- {
- return null;
- }
- return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
- }
- }
- public sealed partial class KinectSensor
- {
- private void Dispose(bool disposing)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- return;
- }
- if (IsOpen)
- {
- Close();
- }
- __EventCleanup();
- Helper.NativeObjectCache.RemoveObject<KinectSensor>(_pNative);
- Windows_Kinect_KinectSensor_ReleaseObject(ref _pNative);
- _pNative = RootSystem.IntPtr.Zero;
- }
- }
- public sealed partial class LongExposureInfraredFrame
- {
- [RootSystem.Runtime.InteropServices.DllImport(
- "KinectUnityAddin",
- EntryPoint = "Windows_Kinect_LongExposureInfraredFrame_CopyFrameDataToArray",
- CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl,
- SetLastError = true)]
- private static extern void Windows_Kinect_LongExposureInfraredFrame_CopyFrameDataToIntPtr(RootSystem.IntPtr pNative, IntPtr frameData, uint frameDataSize);
- public void CopyFrameDataToIntPtr(RootSystem.IntPtr frameData, uint size)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrame");
- }
- Windows_Kinect_LongExposureInfraredFrame_CopyFrameDataToIntPtr(_pNative, frameData, size / sizeof(ushort));
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern RootSystem.IntPtr Windows_Kinect_LongExposureInfraredFrame_LockImageBuffer(RootSystem.IntPtr pNative);
- public Windows.Kinect.KinectBuffer LockImageBuffer()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("LongExposureInfraredFrame");
- }
- RootSystem.IntPtr objectPointer = Windows_Kinect_LongExposureInfraredFrame_LockImageBuffer(_pNative);
- Helper.ExceptionHelper.CheckLastError();
- if (objectPointer == RootSystem.IntPtr.Zero)
- {
- return null;
- }
- return Helper.NativeObjectCache.CreateOrGetObject<Windows.Kinect.KinectBuffer>(objectPointer, n => new Windows.Kinect.KinectBuffer(n));
- }
- }
- public sealed partial class CoordinateMapper
- {
- private PointF[] _DepthFrameToCameraSpaceTable = null;
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern RootSystem.IntPtr Windows_Kinect_CoordinateMapper_GetDepthCameraIntrinsics(RootSystem.IntPtr pNative);
- public Windows.Kinect.CameraIntrinsics GetDepthCameraIntrinsics()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("CoordinateMapper");
- }
- var objectPointer = Windows_Kinect_CoordinateMapper_GetDepthCameraIntrinsics(_pNative);
- Helper.ExceptionHelper.CheckLastError();
- var obj = (Windows.Kinect.CameraIntrinsics)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.CameraIntrinsics));
- RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
- return obj;
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern int Windows_Kinect_CoordinateMapper_GetDepthFrameToCameraSpaceTable(RootSystem.IntPtr pNative, RootSystem.IntPtr outCollection, uint outCollectionSize);
- public Windows.Kinect.PointF[] GetDepthFrameToCameraSpaceTable()
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("CoordinateMapper");
- }
- if (_DepthFrameToCameraSpaceTable == null)
- {
- var desc = KinectSensor.GetDefault().DepthFrameSource.FrameDescription;
- _DepthFrameToCameraSpaceTable = new PointF[desc.Width * desc.Height];
- var pointsSmartGCHandle = new Helper.SmartGCHandle(RootSystem.Runtime.InteropServices.GCHandle.Alloc(_DepthFrameToCameraSpaceTable, RootSystem.Runtime.InteropServices.GCHandleType.Pinned));
- var _points = pointsSmartGCHandle.AddrOfPinnedObject();
- Windows_Kinect_CoordinateMapper_GetDepthFrameToCameraSpaceTable(_pNative, _points, (uint)_DepthFrameToCameraSpaceTable.Length);
- Helper.ExceptionHelper.CheckLastError();
- }
- return _DepthFrameToCameraSpaceTable;
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern void Windows_Kinect_CoordinateMapper_MapColorFrameToDepthSpace(
- RootSystem.IntPtr pNative,
- RootSystem.IntPtr depthFrameData,
- uint depthFrameDataSize,
- RootSystem.IntPtr depthSpacePoints,
- uint depthSpacePointsSize);
- public void MapColorFrameToDepthSpaceUsingIntPtr(RootSystem.IntPtr depthFrameData, uint depthFrameSize, RootSystem.IntPtr depthSpacePoints, uint depthSpacePointsSize)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("CoordinateMapper");
- }
- uint length = depthFrameSize / sizeof(UInt16);
- Windows_Kinect_CoordinateMapper_MapColorFrameToDepthSpace(_pNative, depthFrameData, length, depthSpacePoints, depthSpacePointsSize);
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern void Windows_Kinect_CoordinateMapper_MapColorFrameToCameraSpace(
- RootSystem.IntPtr pNative,
- RootSystem.IntPtr depthFrameData,
- uint depthFrameDataSize,
- RootSystem.IntPtr cameraSpacePoints,
- uint cameraSpacePointsSize);
- public void MapColorFrameToCameraSpaceUsingIntPtr(RootSystem.IntPtr depthFrameData, int depthFrameSize, RootSystem.IntPtr cameraSpacePoints, uint cameraSpacePointsSize)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("CoordinateMapper");
- }
- uint length = (uint)depthFrameSize / sizeof(UInt16);
- Windows_Kinect_CoordinateMapper_MapColorFrameToCameraSpace(_pNative, depthFrameData, length, cameraSpacePoints, cameraSpacePointsSize);
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern void Windows_Kinect_CoordinateMapper_MapDepthFrameToColorSpace(
- RootSystem.IntPtr pNative,
- RootSystem.IntPtr depthFrameData,
- uint depthFrameDataSize,
- RootSystem.IntPtr colorSpacePoints,
- uint colorSpacePointsSize);
- public void MapDepthFrameToColorSpaceUsingIntPtr(RootSystem.IntPtr depthFrameData, int depthFrameSize, RootSystem.IntPtr colorSpacePoints, uint colorSpacePointsSize)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("CoordinateMapper");
- }
- uint length = (uint)depthFrameSize / sizeof(UInt16);
- Windows_Kinect_CoordinateMapper_MapDepthFrameToColorSpace(_pNative, depthFrameData, length, colorSpacePoints, colorSpacePointsSize);
- Helper.ExceptionHelper.CheckLastError();
- }
- [RootSystem.Runtime.InteropServices.DllImport("KinectUnityAddin", CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError = true)]
- private static extern void Windows_Kinect_CoordinateMapper_MapDepthFrameToCameraSpace(
- RootSystem.IntPtr pNative,
- IntPtr depthFrameData,
- uint depthFrameDataSize,
- RootSystem.IntPtr cameraSpacePoints,
- uint cameraSpacePointsSize);
- public void MapDepthFrameToCameraSpaceUsingIntPtr(RootSystem.IntPtr depthFrameData, int depthFrameSize, RootSystem.IntPtr cameraSpacePoints, uint cameraSpacePointsSize)
- {
- if (_pNative == RootSystem.IntPtr.Zero)
- {
- throw new RootSystem.ObjectDisposedException("CoordinateMapper");
- }
- uint length = (uint)depthFrameSize / sizeof(UInt16);
- Windows_Kinect_CoordinateMapper_MapDepthFrameToCameraSpace(_pNative, depthFrameData, length, cameraSpacePoints, cameraSpacePointsSize);
- Helper.ExceptionHelper.CheckLastError();
- }
- }
- }
|