/// <summary> /// Selects the resolution type for the selected file type /// </summary> /// <param name="resolution">The resolution type to select (case sensitive).</param> public void SelectFaxResolution(ResolutionType resolution) { OpenOptionsPanel(); if (!_controlPanel.ScrollPressWait("#hpid-option-fax-resolution", "#hpid-option-fax-resolution-screen", TimeSpan.FromSeconds(5))) { throw new DeviceWorkflowException("Unable to select fax resolution option."); } Pacekeeper.Sync(); _controlPanel.ScrollPressWait($"#hpid-fax-resolution-selection-{resolution.ToString().ToLower()}", ".hp-option-list"); }
public void Init() { switch (captureType) { case CaptureType.Capture: rtFormat = RenderTextureFormat.ARGB32; rtReadWrite = RenderTextureReadWrite.sRGB; rtDepth = 24; break; case CaptureType.Segmentation: rtFormat = RenderTextureFormat.ARGB32; rtReadWrite = RenderTextureReadWrite.sRGB; rtDepth = 24; break; case CaptureType.Depth: rtFormat = RenderTextureFormat.ARGB32; rtReadWrite = RenderTextureReadWrite.Linear; rtDepth = 24; break; default: break; } switch (resolutionType) { case ResolutionType.SD: videoWidth = 640; videoHeight = 480; break; case ResolutionType.HD: videoWidth = 1920; videoHeight = 1080; break; default: break; } RenderTexture activeRT = new RenderTexture(videoWidth, videoHeight, rtDepth, rtFormat, rtReadWrite) { dimension = UnityEngine.Rendering.TextureDimension.Tex2D, antiAliasing = 1, useMipMap = false, useDynamicScale = false, wrapMode = TextureWrapMode.Clamp, filterMode = FilterMode.Bilinear }; activeRT.name = captureType.ToString() + resolutionType.ToString(); activeRT.Create(); renderCam = GetComponent <Camera>(); renderCam.targetTexture = activeRT; Reader = new AsyncTextureReader <byte>(renderCam.targetTexture); GetComponentInParent <CameraSettingsManager>().AddCamera(renderCam); // TODO better way if (sensorName == "Main Camera") { GetComponentInParent <AgentSetup>().MainCam = renderCam; } addUIElement(); }
public void Init() { switch (captureType) { case CaptureType.Capture: rtFormat = RenderTextureFormat.ARGB32; rtReadWrite = RenderTextureReadWrite.sRGB; rtDepth = 24; break; case CaptureType.Segmentation: rtFormat = RenderTextureFormat.ARGB32; rtReadWrite = RenderTextureReadWrite.sRGB; rtDepth = 24; break; case CaptureType.Depth: rtFormat = RenderTextureFormat.ARGB32; rtReadWrite = RenderTextureReadWrite.Linear; rtDepth = 24; break; default: break; } switch (resolutionType) { case ResolutionType.SD: videoWidth = 640; videoHeight = 480; break; case ResolutionType.HD: videoWidth = 1920; videoHeight = 1080; break; default: break; } RenderTexture activeRT = new RenderTexture(videoWidth, videoHeight, rtDepth, rtFormat, rtReadWrite) { dimension = UnityEngine.Rendering.TextureDimension.Tex2D, antiAliasing = 1, useMipMap = false, useDynamicScale = false, wrapMode = TextureWrapMode.Clamp, filterMode = FilterMode.Bilinear }; activeRT.name = captureType.ToString() + resolutionType.ToString(); activeRT.Create(); renderCam = GetComponent <Camera>(); renderCam.targetTexture = activeRT; if (captureType == CaptureType.Segmentation) { SegmentColorer segColorer = FindObjectOfType <SegmentColorer>(); if (segColorer != null) { renderCam.SetReplacementShader(segColorer.Shader, "SegmentColor"); // TODO needs to be local ref or manager? renderCam.backgroundColor = segColorer.SkyColor; // TODO needs to be local ref or manager? renderCam.clearFlags = CameraClearFlags.SolidColor; renderCam.renderingPath = RenderingPath.Forward; } } Reader = new AsyncTextureReader <byte>(renderCam.targetTexture); GetComponentInParent <CameraSettingsManager>().AddCamera(renderCam); // TODO better way if (sensorName == "Main Camera") { GetComponentInParent <RobotSetup>().MainCam = renderCam; } addUIElement(); }
public static void SetResolution4Browser(ResolutionType type) { if (SeleniumExecutor.GetDriver() == null) { throw new Exception("Driver is null in function ResolutionTypeHelper.SetResolution4Browser"); } switch (type) { case ResolutionType.web: SeleniumExecutor.GetDriver().Manage().Window.Maximize(); break; case ResolutionType.tablet: SeleniumExecutor.GetDriver().Manage().Window.Size = new Size(974, 1200); break; case ResolutionType.mobile: SeleniumExecutor.GetDriver().Manage().Window.Size = new Size(400, 700); break; default: throw new Exception("ResolutionTypeHelper. Cannot find ResolutionType: " + type.ToString()); } }
public static string StringValue(this ResolutionType type) => type.ToString("G").Substring(1);