public Windows.Kinect.ColorSpacePoint MapCameraPointToColorSpace(Windows.Kinect.CameraSpacePoint cameraPoint)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("CoordinateMapper");
            }

            var objectPointer = Windows_Kinect_CoordinateMapper_MapCameraPointToColorSpace(_pNative, cameraPoint);

            Helper.ExceptionHelper.CheckLastError();
            var obj = (Windows.Kinect.ColorSpacePoint)RootSystem.Runtime.InteropServices.Marshal.PtrToStructure(objectPointer, typeof(Windows.Kinect.ColorSpacePoint));

            RootSystem.Runtime.InteropServices.Marshal.FreeHGlobal(objectPointer);
            return(obj);
        }
Example #2
0
        public RootSystem.Collections.Generic.IList <Windows.Kinect.CameraSpacePoint> CalculateVerticesForAlignment(Microsoft.Kinect.Face.FaceAlignment faceAlignment)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("FaceModel");
            }

            int outCollectionSize = Microsoft_Kinect_Face_FaceModel_CalculateVerticesForAlignment_Length(_pNative, Helper.NativeWrapper.GetNativePtr(faceAlignment));
            var outCollection     = new Windows.Kinect.CameraSpacePoint[outCollectionSize];
            var managedCollection = new Windows.Kinect.CameraSpacePoint[outCollectionSize];

            outCollectionSize = Microsoft_Kinect_Face_FaceModel_CalculateVerticesForAlignment(_pNative, Helper.NativeWrapper.GetNativePtr(faceAlignment), outCollection, outCollectionSize);
            Helper.ExceptionHelper.CheckLastError();
            for (int i = 0; i < outCollectionSize; i++)
            {
                managedCollection[i] = outCollection[i];
            }
            return(managedCollection);
        }
 private static extern void Microsoft_Kinect_Face_FaceAlignment_put_HeadPivotPoint(RootSystem.IntPtr pNative, Windows.Kinect.CameraSpacePoint headPivotPoint);
 private static extern RootSystem.IntPtr Windows_Kinect_CoordinateMapper_MapCameraPointToColorSpace(RootSystem.IntPtr pNative, Windows.Kinect.CameraSpacePoint cameraPoint);
Example #5
0
        public RootSystem.Collections.Generic.IList<Windows.Kinect.CameraSpacePoint> CalculateVerticesForAlignment(Microsoft.Kinect.Face.FaceAlignment faceAlignment)
        {
            if (_pNative == RootSystem.IntPtr.Zero)
            {
                throw new RootSystem.ObjectDisposedException("FaceModel");
            }

            int outCollectionSize = Microsoft_Kinect_Face_FaceModel_CalculateVerticesForAlignment_Length(_pNative, Helper.NativeWrapper.GetNativePtr(faceAlignment));
            var outCollection = new Windows.Kinect.CameraSpacePoint[outCollectionSize];
            var managedCollection = new Windows.Kinect.CameraSpacePoint[outCollectionSize];

            outCollectionSize = Microsoft_Kinect_Face_FaceModel_CalculateVerticesForAlignment(_pNative, Helper.NativeWrapper.GetNativePtr(faceAlignment), outCollection, outCollectionSize);
            Helper.ExceptionHelper.CheckLastError();
            for(int i=0;i<outCollectionSize;i++)
            {
                managedCollection[i] = outCollection[i];
            }
            return managedCollection;
        }