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(); } }
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); }
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); }
public static string GetExtendedError() { var message = OniCAPI.oniGetExtendedError(); return(message); }
public static void SetLogOutputFolder(string outputFolder) { OniCAPI.oniSetLogOutputFolder(outputFolder).ThrowExectionIfStatusIsNotOk(); }
public static void SetLogFileOutput(bool fileOutput) { OniCAPI.oniSetLogFileOutput(fileOutput ? 1 : 0).ThrowExectionIfStatusIsNotOk(); }
public static void SetLogConsoleOutput(bool consoleOutput) { OniCAPI.oniSetLogConsoleOutput(consoleOutput ? 1 : 0).ThrowExectionIfStatusIsNotOk(); }
public static void SetLogMinSeverity(int minSeverity) { OniCAPI.oniSetLogMinSeverity(minSeverity).ThrowExectionIfStatusIsNotOk(); }
public static OpenNIVersion GetVersion() => OniCAPI.oniGetVersion().ToManaged();
public static void Shutdown() { OniCAPI.oniShutdown(); }
public static void Initialize() { OniCAPI.oniInitialize(OniCAPI.ONI_VERSION).ThrowExectionIfStatusIsNotOk(); }
public static int BytesPerPixel(this PixelFormat pixelFormat) => OniCAPI.oniFormatBytesPerPixel(pixelFormat.ToNative());