private static void Capture(UInt64 rgb_camera_handle, UInt64 rgb_camera_image_handle) { FrameCount++; int RawDataSize = 0; if (TexturePtr == IntPtr.Zero) { m_NativeCamera.GetRawData(rgb_camera_image_handle, ref TexturePtr, ref RawDataSize); Resolution = m_NativeCamera.GetResolution(rgb_camera_image_handle); m_NativeCamera.DestroyImage(rgb_camera_image_handle); NRDebugger.Log(string.Format("[NRRgbCamera] on first fram ready textureptr:{0} rawdatasize:{1} Resolution:{2}", TexturePtr, RawDataSize, Resolution.ToString())); return; } m_NativeCamera.GetRawData(rgb_camera_image_handle, ref TexturePtr, ref RawDataSize); var timestamp = m_NativeCamera.GetHMDTimeNanos(rgb_camera_image_handle); QueueFrame(TexturePtr, RawDataSize, timestamp); if (OnImageUpdate != null) { OnImageUpdate(); } m_NativeCamera.DestroyImage(rgb_camera_image_handle); }
public NativeResolution GetResolution(UInt64 imageHandle) { NativeResolution resolution = new NativeResolution(0, 0); var result = NativeApi.NRRGBCameraImageGetResolution(m_NativeCameraHandle, imageHandle, ref resolution); NRDebugger.Log("[NativeCamera] GetResolution: " + result.ToString()); return(resolution); }
public NativeResolution GetEyeResolution(NativeEye eye = NativeEye.LEFT) { NativeResolution resolution = new NativeResolution(3840, 1080); NativeApi.NRHMDGetEyeResolution(m_HmdHandle, (int)NativeEye.LEFT, ref resolution); NRDebugger.Log("[NativeHMD GetEyeResolution]:" + resolution.ToString()); return(resolution); }
public NativeResolution GetEyeResolution(NativeEye eye) { NativeResolution resolution = new NativeResolution(3840, 1080); NativeApi.NRHMDGetEyeResolution(m_HmdHandle, (int)eye, ref resolution); NRDebugger.LogFormat("[NativeHMD GetEyeResolution] eye:{0} resolution{1}:", eye, resolution.ToString()); return(resolution); }
public NativeResolution GetResolution(UInt64 imageHandle) { NativeResolution resolution = new NativeResolution(0, 0); var result = NativeApi.NRRGBCameraImageGetResolution(m_NativeCameraHandle, imageHandle, ref resolution); NativeErrorListener.Check(result, this, "GetResolution"); return(resolution); }
public NativeResolution GetEyeResolution(NativeEye eye) { NativeResolution resolution = new NativeResolution(3840, 1080); var result = NativeApi.NRHMDGetEyeResolution(m_HmdHandle, (int)eye, ref resolution); NativeErrorListener.Check(result, this, "GetEyeResolution"); return(resolution); }
private static void Capture(UInt64 rgb_camera_handle, UInt64 rgb_camera_image_handle) { FrameCount++; if (TexturePtr == IntPtr.Zero) { m_NativeCamera.GetRawData(rgb_camera_image_handle, ref TexturePtr, ref RawDataSize); Resolution = m_NativeCamera.GetResolution(rgb_camera_image_handle); m_NativeCamera.DestroyImage(rgb_camera_image_handle); TexuteData = new byte[RawDataSize]; Debug.Log(string.Format("[NRRgbCamera] on first fram ready textureptr:{0} rawdatasize:{1} Resolution:{2}", TexturePtr, RawDataSize, Resolution.ToString())); return; } m_NativeCamera.GetRawData(rgb_camera_image_handle, ref TexturePtr, ref RawDataSize); Marshal.Copy(TexturePtr, TexuteData, 0, RawDataSize); if (OnImageUpdate != null) { OnImageUpdate(); } m_NativeCamera.DestroyImage(rgb_camera_image_handle); }
public static extern NativeResult NRRGBCameraImageGetResolution(UInt64 rgb_camera_handle, UInt64 rgb_camera_image_handle, ref NativeResolution out_image_resolution);
public static extern NativeResult NRHMDGetEyeResolution(UInt64 hmd_handle, int eye, ref NativeResolution out_eye_resolution);