Пример #1
0
 protected override void Dispose(bool disposing)
 {
     if (disposing == false)
     {
         return;
     }
     OniCAPI.oniFrameRelease(_pFrame);
 }
 public static unsafe void DepthToColor(SensorStream depthStream, SensorStream colorStream, int depthX, int depthY, ushort depthZ, ref int colorX, ref int colorY)
 {
     fixed(int *pColorX = &colorX)
     fixed(int *pColorY = &colorY)
     {
         OniCAPI.oniCoordinateConverterDepthToColor(depthStream.Handler, colorStream.Handler, depthX, depthY, depthZ, pColorX, pColorY).ThrowExectionIfStatusIsNotOk();
     }
 }
 public static unsafe void DepthToWorld(SensorStream depthStream, float depthX, float depthY, float depthZ, ref float worldX, ref float worldY, ref float worldZ)
 {
     fixed(float *pWorldX = &worldX)
     fixed(float *pWorldY = &worldY)
     fixed(float *pWorldZ = &worldZ)
     {
         OniCAPI.oniCoordinateConverterDepthToWorld(depthStream.Handler, depthX, depthY, depthZ, pWorldX, pWorldY, pWorldZ).ThrowExectionIfStatusIsNotOk();
     }
 }
 public static unsafe void WorldToDepth(SensorStream depthStream, float worldX, float worldY, float worldZ, ref float depthX, ref float depthY, ref float depthZ)
 {
     fixed(float *pDepthX = &depthX)
     fixed(float *pDepthY = &depthY)
     fixed(float *pDepthZ = &depthZ)
     {
         OniCAPI.oniCoordinateConverterWorldToDepth(depthStream.Handler, worldX, worldY, worldZ, pDepthX, pDepthY, pDepthZ).ThrowExectionIfStatusIsNotOk();
     }
 }
Пример #5
0
        public static unsafe string GetLogFileName()
        {
            const int MAX_PATH  = 260;
            void *    pFileName = stackalloc byte[MAX_PATH];

            OniCAPI.oniGetLogFileName((byte *)pFileName, MAX_PATH).ThrowExectionIfStatusIsNotOk();
            var fileName = Marshal.PtrToStringAnsi((IntPtr)pFileName);

            return(fileName);
        }
Пример #6
0
        public static unsafe DeviceInfo[] GetDevices()
        {
            OniDeviceInfo *pDevices = null;
            var            count    = 0;

            OniCAPI.oniGetDeviceList(&pDevices, &count).ThrowExectionIfStatusIsNotOk();

            var devices = new DeviceInfo[count];

            for (var i = 0; i < count; i++)
            {
                var oniDeviceInfo = pDevices[i];

                devices[i] = oniDeviceInfo.ToManaged();
            }

            OniCAPI.oniReleaseDeviceList(pDevices).ThrowExectionIfStatusIsNotOk();

            return(devices);
        }
Пример #7
0
        public static string GetExtendedError()
        {
            var message = OniCAPI.oniGetExtendedError();

            return(message);
        }
Пример #8
0
 public static void SetLogOutputFolder(string outputFolder)
 {
     OniCAPI.oniSetLogOutputFolder(outputFolder).ThrowExectionIfStatusIsNotOk();
 }
Пример #9
0
 public static void SetLogFileOutput(bool fileOutput)
 {
     OniCAPI.oniSetLogFileOutput(fileOutput ? 1 : 0).ThrowExectionIfStatusIsNotOk();
 }
Пример #10
0
 public static void SetLogConsoleOutput(bool consoleOutput)
 {
     OniCAPI.oniSetLogConsoleOutput(consoleOutput ? 1 : 0).ThrowExectionIfStatusIsNotOk();
 }
Пример #11
0
 public static void SetLogMinSeverity(int minSeverity)
 {
     OniCAPI.oniSetLogMinSeverity(minSeverity).ThrowExectionIfStatusIsNotOk();
 }
Пример #12
0
 public static OpenNIVersion GetVersion() => OniCAPI.oniGetVersion().ToManaged();
Пример #13
0
 public static void Shutdown()
 {
     OniCAPI.oniShutdown();
 }
Пример #14
0
 public static void Initialize()
 {
     OniCAPI.oniInitialize(OniCAPI.ONI_VERSION).ThrowExectionIfStatusIsNotOk();
 }
 public static int BytesPerPixel(this PixelFormat pixelFormat)
 => OniCAPI.oniFormatBytesPerPixel(pixelFormat.ToNative());