示例#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;
            }
        }
示例#2
0
 public CameraParameters(WebCamMode webCamMode)
 {
     this.m_HologramOpacity        = 1f;
     this.m_PixelFormat            = CapturePixelFormat.BGRA32;
     this.m_FrameRate              = 0f;
     this.m_CameraResolutionWidth  = 0;
     this.m_CameraResolutionHeight = 0;
     if (webCamMode == WebCamMode.PhotoMode)
     {
         Resolution resolution = (from res in PhotoCapture.SupportedResolutions
                                  orderby res.width * res.height descending
                                  select res).First <Resolution>();
         this.m_CameraResolutionWidth  = resolution.width;
         this.m_CameraResolutionHeight = resolution.height;
     }
     else if (webCamMode == WebCamMode.VideoMode)
     {
         Resolution resolution2 = (from res in VideoCapture.SupportedResolutions
                                   orderby res.width * res.height descending
                                   select res).First <Resolution>();
         float frameRate = (from fps in VideoCapture.GetSupportedFrameRatesForResolution(resolution2)
                            orderby fps descending
                            select fps).First <float>();
         this.m_CameraResolutionWidth  = resolution2.width;
         this.m_CameraResolutionHeight = resolution2.height;
         this.m_FrameRate = frameRate;
     }
 }
示例#3
0
 public CameraParameters(WebCamMode webCamMode)
 {
     this.m_HologramOpacity        = 1f;
     this.m_PixelFormat            = CapturePixelFormat.BGRA32;
     this.m_FrameRate              = 0f;
     this.m_CameraResolutionWidth  = 0;
     this.m_CameraResolutionHeight = 0;
     if (webCamMode == WebCamMode.PhotoMode)
     {
         if (< > f__am$cache0 == null)
         {
 public CameraParameters(WebCamMode webCamMode)
 {
     this.m_HologramOpacity = 1f;
     this.m_PixelFormat = CapturePixelFormat.BGRA32;
     this.m_FrameRate = 0f;
     this.m_CameraResolutionWidth = 0;
     this.m_CameraResolutionHeight = 0;
     if (webCamMode == WebCamMode.PhotoMode)
     {
         if (<>f__am$cache0 == null)
         {