Example #1
0
        //-------------------------------------------------------------------------------------------------------
        public CameraParameters(WebCamMode webCamMode)
        {
            m_HologramOpacity        = 1.0f;
            m_PixelFormat            = CapturePixelFormat.BGRA32;
            m_FrameRate              = default(float);
            m_CameraResolutionWidth  = default(int);
            m_CameraResolutionHeight = default(int);

            if (webCamMode == WebCamMode.PhotoMode)
            {
                Resolution photoCaptureCameraResolution = PhotoCapture.SupportedResolutions.OrderByDescending((res) => res.width * res.height).First();

                m_CameraResolutionWidth  = photoCaptureCameraResolution.width;
                m_CameraResolutionHeight = photoCaptureCameraResolution.height;
            }
            else if (webCamMode == WebCamMode.VideoMode)
            {
                Resolution videoCaptureCameraResolution = VideoCapture.SupportedResolutions.OrderByDescending((res) => res.width * res.height).First();
                float      cameraFramerate = VideoCapture.GetSupportedFrameRatesForResolution(videoCaptureCameraResolution).OrderByDescending((fps) => fps).First();

                m_CameraResolutionWidth  = videoCaptureCameraResolution.width;
                m_CameraResolutionHeight = videoCaptureCameraResolution.height;
                m_FrameRate = cameraFramerate;
            }
        }