Exemple #1
0
        public void AddGestures(Gesture[] gestures)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameSource");
            }

            var _gestures_idx   = 0;
            var _gestures_array = new RootSystem.IntPtr[gestures.Count()];

            foreach (var value in gestures)
            {
                _gestures_array[_gestures_idx] = NativeWrapper.GetNativePtr(value);
                _gestures_idx++;
            }

            var gesturesSmartGCHandle = new SmartGCHandle(
                GCHandle.Alloc(_gestures_array,
                               GCHandleType.Pinned));
            var _gestures = gesturesSmartGCHandle.AddrOfPinnedObject();

            Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_AddGestures(_pNative, _gestures,
                                                                                              gestures.Length);
            ExceptionHelper.CheckLastError();
        }
        public void MapDepthPointsToColorSpace(DepthSpacePoint[] depthPoints, ushort[] depths,
                                               ColorSpacePoint[] colorPoints)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("CoordinateMapper");
            }

            var depthPointsSmartGCHandle = new SmartGCHandle(
                GCHandle.Alloc(depthPoints,
                               GCHandleType.Pinned));
            var _depthPoints        = depthPointsSmartGCHandle.AddrOfPinnedObject();
            var depthsSmartGCHandle = new SmartGCHandle(
                GCHandle.Alloc(depths,
                               GCHandleType.Pinned));
            var _depths = depthsSmartGCHandle.AddrOfPinnedObject();
            var colorPointsSmartGCHandle = new SmartGCHandle(
                GCHandle.Alloc(colorPoints,
                               GCHandleType.Pinned));
            var _colorPoints = colorPointsSmartGCHandle.AddrOfPinnedObject();

            Windows_Kinect_CoordinateMapper_MapDepthPointsToColorSpace(_pNative, _depthPoints, depthPoints.Length,
                                                                       _depths, depths.Length, _colorPoints, colorPoints.Length);
            ExceptionHelper.CheckLastError();
        }
Exemple #3
0
        // Token: 0x06002927 RID: 10535 RVA: 0x000D3368 File Offset: 0x000D1768
        public void CopyFrameDataToArray(ushort[] frameData)
        {
            if (this._pNative == IntPtr.Zero)
            {
                throw new ObjectDisposedException("DepthFrame");
            }
            SmartGCHandle smartGCHandle = new SmartGCHandle(GCHandle.Alloc(frameData, GCHandleType.Pinned));
            IntPtr        frameData2    = smartGCHandle.AddrOfPinnedObject();

            DepthFrame.Windows_Kinect_DepthFrame_CopyFrameDataToArray(this._pNative, frameData2, frameData.Length);
            ExceptionHelper.CheckLastError();
        }
Exemple #4
0
        // Token: 0x06002907 RID: 10503 RVA: 0x000D2F7C File Offset: 0x000D137C
        public void CopyConvertedFrameDataToArray(byte[] frameData, ColorImageFormat colorFormat)
        {
            if (this._pNative == IntPtr.Zero)
            {
                throw new ObjectDisposedException("ColorFrame");
            }
            SmartGCHandle smartGCHandle = new SmartGCHandle(GCHandle.Alloc(frameData, GCHandleType.Pinned));
            IntPtr        frameData2    = smartGCHandle.AddrOfPinnedObject();

            ColorFrame.Windows_Kinect_ColorFrame_CopyConvertedFrameDataToArray(this._pNative, frameData2, frameData.Length, colorFormat);
            ExceptionHelper.CheckLastError();
        }
Exemple #5
0
        // Token: 0x060029DD RID: 10717 RVA: 0x000D535C File Offset: 0x000D375C
        public void MapColorFrameToCameraSpace(ushort[] depthFrameData, CameraSpacePoint[] cameraSpacePoints)
        {
            if (this._pNative == IntPtr.Zero)
            {
                throw new ObjectDisposedException("CoordinateMapper");
            }
            SmartGCHandle smartGCHandle      = new SmartGCHandle(GCHandle.Alloc(depthFrameData, GCHandleType.Pinned));
            IntPtr        depthFrameData2    = smartGCHandle.AddrOfPinnedObject();
            SmartGCHandle smartGCHandle2     = new SmartGCHandle(GCHandle.Alloc(cameraSpacePoints, GCHandleType.Pinned));
            IntPtr        cameraSpacePoints2 = smartGCHandle2.AddrOfPinnedObject();

            CoordinateMapper.Windows_Kinect_CoordinateMapper_MapColorFrameToCameraSpace(this._pNative, depthFrameData2, depthFrameData.Length, cameraSpacePoints2, cameraSpacePoints.Length);
            ExceptionHelper.CheckLastError();
        }
Exemple #6
0
        public void CopyFrameDataToArray(byte[] frameData)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("AudioBeamSubFrame");
            }

            var frameDataSmartGCHandle = new SmartGCHandle(
                GCHandle.Alloc(frameData,
                               GCHandleType.Pinned));
            var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();

            Windows_Kinect_AudioBeamSubFrame_CopyFrameDataToArray(_pNative, _frameData, frameData.Length);
            ExceptionHelper.CheckLastError();
        }
Exemple #7
0
        // Token: 0x060029D5 RID: 10709 RVA: 0x000D5180 File Offset: 0x000D3580
        public void MapDepthPointsToColorSpace(DepthSpacePoint[] depthPoints, ushort[] depths, ColorSpacePoint[] colorPoints)
        {
            if (this._pNative == IntPtr.Zero)
            {
                throw new ObjectDisposedException("CoordinateMapper");
            }
            SmartGCHandle smartGCHandle  = new SmartGCHandle(GCHandle.Alloc(depthPoints, GCHandleType.Pinned));
            IntPtr        depthPoints2   = smartGCHandle.AddrOfPinnedObject();
            SmartGCHandle smartGCHandle2 = new SmartGCHandle(GCHandle.Alloc(depths, GCHandleType.Pinned));
            IntPtr        depths2        = smartGCHandle2.AddrOfPinnedObject();
            SmartGCHandle smartGCHandle3 = new SmartGCHandle(GCHandle.Alloc(colorPoints, GCHandleType.Pinned));
            IntPtr        colorPoints2   = smartGCHandle3.AddrOfPinnedObject();

            CoordinateMapper.Windows_Kinect_CoordinateMapper_MapDepthPointsToColorSpace(this._pNative, depthPoints2, depthPoints.Length, depths2, depths.Length, colorPoints2, colorPoints.Length);
            ExceptionHelper.CheckLastError();
        }
Exemple #8
0
        public void CopyConvertedFrameDataToArray(byte[] frameData, ColorImageFormat colorFormat)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("ColorFrame");
            }

            var frameDataSmartGCHandle = new SmartGCHandle(
                GCHandle.Alloc(frameData,
                               GCHandleType.Pinned));
            var _frameData = frameDataSmartGCHandle.AddrOfPinnedObject();

            Windows_Kinect_ColorFrame_CopyConvertedFrameDataToArray(_pNative, _frameData, frameData.Length,
                                                                    colorFormat);
            ExceptionHelper.CheckLastError();
        }
Exemple #9
0
 // Token: 0x060029B4 RID: 10676 RVA: 0x000D4A5C File Offset: 0x000D2E5C
 public PointF[] GetDepthFrameToCameraSpaceTable()
 {
     if (this._pNative == IntPtr.Zero)
     {
         throw new ObjectDisposedException("CoordinateMapper");
     }
     if (this._DepthFrameToCameraSpaceTable == null)
     {
         FrameDescription frameDescription = KinectSensor.GetDefault().DepthFrameSource.FrameDescription;
         this._DepthFrameToCameraSpaceTable = new PointF[frameDescription.Width * frameDescription.Height];
         SmartGCHandle smartGCHandle = new SmartGCHandle(GCHandle.Alloc(this._DepthFrameToCameraSpaceTable, GCHandleType.Pinned));
         IntPtr        outCollection = smartGCHandle.AddrOfPinnedObject();
         CoordinateMapper.Windows_Kinect_CoordinateMapper_GetDepthFrameToCameraSpaceTable(this._pNative, outCollection, (uint)this._DepthFrameToCameraSpaceTable.Length);
         ExceptionHelper.CheckLastError();
     }
     return(this._DepthFrameToCameraSpaceTable);
 }
        public void MapColorFrameToCameraSpace(ushort[] depthFrameData,
                                               CameraSpacePoint[] cameraSpacePoints)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("CoordinateMapper");
            }

            var depthFrameDataSmartGCHandle = new SmartGCHandle(
                GCHandle.Alloc(depthFrameData,
                               GCHandleType.Pinned));
            var _depthFrameData = depthFrameDataSmartGCHandle.AddrOfPinnedObject();
            var cameraSpacePointsSmartGCHandle = new SmartGCHandle(
                GCHandle.Alloc(cameraSpacePoints,
                               GCHandleType.Pinned));
            var _cameraSpacePoints = cameraSpacePointsSmartGCHandle.AddrOfPinnedObject();

            Windows_Kinect_CoordinateMapper_MapColorFrameToCameraSpace(_pNative, _depthFrameData, depthFrameData.Length,
                                                                       _cameraSpacePoints, cameraSpacePoints.Length);
            ExceptionHelper.CheckLastError();
        }
Exemple #11
0
        public 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 SmartGCHandle(
                    GCHandle.Alloc(_DepthFrameToCameraSpaceTable,
                                   GCHandleType.Pinned));
                var _points = pointsSmartGCHandle.AddrOfPinnedObject();
                Windows_Kinect_CoordinateMapper_GetDepthFrameToCameraSpaceTable(_pNative, _points,
                                                                                (uint)_DepthFrameToCameraSpaceTable.Length);
                ExceptionHelper.CheckLastError();
            }

            return(_DepthFrameToCameraSpaceTable);
        }