void OnGUI() { if (screenshotState == ScreenshotState.Idle) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Screenshot")) { screenshotState = ScreenshotState.Start; } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } GUILayout.BeginHorizontal(); if (screenshotState == ScreenshotState.Idle) { if (GUILayout.Button("<")) { filterType = (FilterType)(((int)filterType + (int)FilterType.Count - 1) % (int)FilterType.Count); } if (GUILayout.Button(">")) { filterType = (FilterType)(((int)filterType + 1) % (int)FilterType.Count); } } GUILayout.Box(filterType.ToString()); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); if (!float.IsInfinity(psnr)) { GUILayout.BeginHorizontal(); GUILayout.Box(string.Format("PSNR {0:F2}dB", psnr)); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); } }
void TakeScreenshot() { filterType = (FilterType)(((int)filterType + 1) % (int)FilterType.Count); string name = "YCoCg-Screenshot-" + filterType.ToString() + ".png"; ScreenCapture.CaptureScreenshot(name); Debug.Log(name); if (filterType == FilterType.None) { screenshotState = ScreenshotState.Stop; } }
void OnPostRender() { if (screenshotState == ScreenshotState.Stop) { screenshotState = ScreenshotState.Idle; } if (screenshotState == ScreenshotState.Taking) { TakeScreenshot(); } if (screenshotState == ScreenshotState.Start) { filterType = FilterType.None; screenshotState = ScreenshotState.Taking; } }
public BaseMatcher SetScreenshot(ScreenshotState screenshot) { _screenshot = screenshot; return(this); }