示例#1
0
        internal bool CanCaptureHDRFrames()
        {
            bool isGameViewInput = imageInputSettings.InputType == typeof(GameViewInput);
            bool isFormatExr     = OutputFormat == ImageRecorderOutputFormat.EXR;

            return(!isGameViewInput && isFormatExr && CameraInputSettings.UsingHDRP());
        }
示例#2
0
        protected override void FileTypeAndFormatGUI()
        {
            EditorGUILayout.PropertyField(m_OutputFormat, Styles.FormatLabel);
            var imageSettings = (ImageRecorderSettings)target;

            if (!CameraInputSettings.UsingHDRP())
            {
                using (new EditorGUI.DisabledScope(!imageSettings.CanCaptureAlpha()))
                {
                    EditorGUILayout.PropertyField(m_CaptureAlpha, Styles.CaptureAlphaLabel);
                }
            }

            string[] list_of_colorspaces = new[] { "sRGB, sRGB", "Linear, sRGB (unclamped)" };

            if (imageSettings.CanCaptureHDRFrames())
            {
                m_ColorSpace.intValue =
                    EditorGUILayout.Popup(Styles.ColorSpace, m_ColorSpace.intValue, list_of_colorspaces);
            }
            else
            {
                using (new EditorGUI.DisabledScope(!imageSettings.CanCaptureHDRFrames()))
                {
                    EditorGUILayout.Popup(Styles.ColorSpace, 0, list_of_colorspaces);
                }
            }
        }
示例#3
0
        internal bool CanCaptureAlpha()
        {
            bool formatSupportAlpha = OutputFormat == ImageRecorderOutputFormat.PNG ||
                                      OutputFormat == ImageRecorderOutputFormat.EXR;
            bool inputSupportAlpha = imageInputSettings.SupportsTransparent;

            return(formatSupportAlpha && inputSupportAlpha && !CameraInputSettings.UsingHDRP());
        }
        public override void OnBehaviourPlay(Playable playable, FrameData info)
        {
            if (session == null)
            {
                return;
            }

            // Assumption: OnPlayStateChanged( PlayState.Playing ) ONLY EVER CALLED ONCE for this type of playable.
            m_PlayState = PlayState.Playing;
            // case FTV-251 the Options.useCameraCaptureCallbacks is enabled
            // too late for the RecorderClip when recording from the timeline
            // to workaround this problem also enable the
            // CaptureCallbackInputStrategy if HDRP is available

            Options.useCameraCaptureCallbacks = CameraInputSettings.IsHDRPAvailable();
            session.BeginRecording();
        }
        public void CameraInputSettings_ShouldHaveProperPublicAPI()
        {
            var input = new CameraInputSettings
            {
                Source          = ImageSource.MainCamera,
                OutputWidth     = 640,
                OutputHeight    = 480,
                CameraTag       = "AAA",
                CaptureUI       = true,
                FlipFinalOutput = false
            };

            Assert.AreEqual(640, input.OutputWidth);
            Assert.AreEqual(480, input.OutputHeight);

            Assert.NotNull(input);
        }
示例#6
0
        public void CameraInputSettings_ShouldHaveProperPublicAPI()
        {
            var input = new CameraInputSettings
            {
                source            = ImageSource.MainCamera,
                outputWidth       = 640,
                outputHeight      = 480,
                cameraTag         = "AAA",
                allowTransparency = true,
                captureUI         = true,
                flipFinalOutput   = false
            };

            Assert.AreEqual(640, input.outputWidth);
            Assert.AreEqual(480, input.outputHeight);

            Assert.NotNull(input);
        }
        protected override void FileTypeAndFormatGUI()
        {
            EditorGUILayout.PropertyField(m_OutputFormat, Styles.FormatLabel);
            var imageSettings = (ImageRecorderSettings)target;

            if (!CameraInputSettings.UsingHDRP())
            {
                using (new EditorGUI.DisabledScope(!imageSettings.CanCaptureAlpha()))
                {
                    ++EditorGUI.indentLevel;
                    EditorGUILayout.PropertyField(m_CaptureAlpha, Styles.CaptureAlphaLabel);
                    --EditorGUI.indentLevel;
                }
            }

            using (new EditorGUI.DisabledScope(!imageSettings.CanCaptureHDRFrames()))
            {
                ++EditorGUI.indentLevel;
                EditorGUILayout.PropertyField(m_CaptureHDR, Styles.CaptureHDRLabel);
                --EditorGUI.indentLevel;
            }
        }