Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }