Exemple #1
0
        private void UpdateUiByShowingCurveOnChart(DataSetCurveType curveType, int indexOfModifiedCurve = 1)
        {
            const int CHART_AREA_INDEX = 0;
            const int SERIES_INDEX     = 0;

            try {
                Series selectedSeries = null;

                switch (curveType)
                {
                case DataSetCurveType.Ideal:
                    CurvesSettings.Set(uiCharts_Crv, Settings.Series.Ideal, SERIES_INDEX);
                    selectedSeries = DataChart.IdealCurve;
                    break;

                case DataSetCurveType.Modified:
                    CurvesSettings.Set(uiCharts_Crv, Settings.Series.Modified, SERIES_INDEX);
                    selectedSeries = DataChart.ModifiedCurves[indexOfModifiedCurve - 1];
                    break;

                case DataSetCurveType.Average:
                    CurvesSettings.Set(uiCharts_Crv, Settings.Series.Average, SERIES_INDEX);
                    selectedSeries = DataChart.AverageCurve;
                    break;
                }

                ChartAssist.Refresh(selectedSeries, uiCharts_Crv.Series[0].Color, uiCharts_Crv, CHART_AREA_INDEX, SERIES_INDEX);
            }
            catch (InvalidOperationException ex) {
                log.Error(ex.Message, ex);
                AppMessages.MainWindow.ErrorOfChartRefreshing();
            }
            catch (ArgumentOutOfRangeException ex) {
                log.Error(ex.Message, ex);
                AppMessages.MainWindow.ExclamationOfSeriesSelection();
            }
            catch (Exception ex) {
                log.Fatal(ex.Message, ex);
            }
        }
 internal void Reset()
 {
     curves = CurvesSettings.defaultSettings;
 }
 internal void Reset()
 {
     curves = CurvesSettings.defaultSettings;
 }
        public override void OnEnable()
        {
            // Tonemapping settings
            m_Tonemapping = new TonemappingSettings
            {
                tonemapper        = FindSetting((Settings x) => x.tonemapping.tonemapper),
                neutralBlackIn    = FindSetting((Settings x) => x.tonemapping.neutralBlackIn),
                neutralWhiteIn    = FindSetting((Settings x) => x.tonemapping.neutralWhiteIn),
                neutralBlackOut   = FindSetting((Settings x) => x.tonemapping.neutralBlackOut),
                neutralWhiteOut   = FindSetting((Settings x) => x.tonemapping.neutralWhiteOut),
                neutralWhiteLevel = FindSetting((Settings x) => x.tonemapping.neutralWhiteLevel),
                neutralWhiteClip  = FindSetting((Settings x) => x.tonemapping.neutralWhiteClip)
            };

            // Basic settings
            m_Basic = new BasicSettings
            {
                exposure    = FindSetting((Settings x) => x.basic.postExposure),
                temperature = FindSetting((Settings x) => x.basic.temperature),
                tint        = FindSetting((Settings x) => x.basic.tint),
                hueShift    = FindSetting((Settings x) => x.basic.hueShift),
                saturation  = FindSetting((Settings x) => x.basic.saturation),
                contrast    = FindSetting((Settings x) => x.basic.contrast)
            };

            // Channel mixer
            m_ChannelMixer = new ChannelMixerSettings
            {
                channels = new[]
                {
                    FindSetting((Settings x) => x.channelMixer.red),
                    FindSetting((Settings x) => x.channelMixer.green),
                    FindSetting((Settings x) => x.channelMixer.blue)
                },
                currentEditingChannel = FindSetting((Settings x) => x.channelMixer.currentEditingChannel)
            };

            // Color wheels
            m_ColorWheels = new ColorWheelsSettings
            {
                mode   = FindSetting((Settings x) => x.colorWheels.mode),
                log    = FindSetting((Settings x) => x.colorWheels.log),
                linear = FindSetting((Settings x) => x.colorWheels.linear)
            };

            // Curves
            m_Curves = new CurvesSettings
            {
                master = FindSetting((Settings x) => x.curves.master.curve),
                red    = FindSetting((Settings x) => x.curves.red.curve),
                green  = FindSetting((Settings x) => x.curves.green.curve),
                blue   = FindSetting((Settings x) => x.curves.blue.curve),

                hueVShue = FindSetting((Settings x) => x.curves.hueVShue.curve),
                hueVSsat = FindSetting((Settings x) => x.curves.hueVSsat.curve),
                satVSsat = FindSetting((Settings x) => x.curves.satVSsat.curve),
                lumVSsat = FindSetting((Settings x) => x.curves.lumVSsat.curve),

                currentEditingCurve = FindSetting((Settings x) => x.curves.e_CurrentEditingCurve),
                curveY = FindSetting((Settings x) => x.curves.e_CurveY),
                curveR = FindSetting((Settings x) => x.curves.e_CurveR),
                curveG = FindSetting((Settings x) => x.curves.e_CurveG),
                curveB = FindSetting((Settings x) => x.curves.e_CurveB)
            };

            // Prepare the curve editor and extract curve display settings
            m_CurveDict = new Dictionary <SerializedProperty, Color>();

            var settings = CurveEditor.Settings.defaultSettings;

            m_CurveEditor = new CurveEditor(settings);
            AddCurve(m_Curves.master, new Color(1f, 1f, 1f), 2, false);
            AddCurve(m_Curves.red, new Color(1f, 0f, 0f), 2, false);
            AddCurve(m_Curves.green, new Color(0f, 1f, 0f), 2, false);
            AddCurve(m_Curves.blue, new Color(0f, 0.5f, 1f), 2, false);
            AddCurve(m_Curves.hueVShue, new Color(1f, 1f, 1f), 0, true);
            AddCurve(m_Curves.hueVSsat, new Color(1f, 1f, 1f), 0, true);
            AddCurve(m_Curves.satVSsat, new Color(1f, 1f, 1f), 0, false);
            AddCurve(m_Curves.lumVSsat, new Color(1f, 1f, 1f), 0, false);
        }
        public override void OnEnable()
        {
            // Tonemapping settings
            m_Tonemapping = new TonemappingSettings
            {
                tonemapper = FindSetting((Settings x) => x.tonemapping.tonemapper),
                neutralBlackIn = FindSetting((Settings x) => x.tonemapping.neutralBlackIn),
                neutralWhiteIn = FindSetting((Settings x) => x.tonemapping.neutralWhiteIn),
                neutralBlackOut = FindSetting((Settings x) => x.tonemapping.neutralBlackOut),
                neutralWhiteOut = FindSetting((Settings x) => x.tonemapping.neutralWhiteOut),
                neutralWhiteLevel = FindSetting((Settings x) => x.tonemapping.neutralWhiteLevel),
                neutralWhiteClip = FindSetting((Settings x) => x.tonemapping.neutralWhiteClip)
            };

            // Basic settings
            m_Basic = new BasicSettings
            {
                exposure = FindSetting((Settings x) => x.basic.postExposure),
                temperature = FindSetting((Settings x) => x.basic.temperature),
                tint = FindSetting((Settings x) => x.basic.tint),
                hueShift = FindSetting((Settings x) => x.basic.hueShift),
                saturation = FindSetting((Settings x) => x.basic.saturation),
                contrast = FindSetting((Settings x) => x.basic.contrast)
            };

            // Channel mixer
            m_ChannelMixer = new ChannelMixerSettings
            {
                channels = new[]
                {
                    FindSetting((Settings x) => x.channelMixer.red),
                    FindSetting((Settings x) => x.channelMixer.green),
                    FindSetting((Settings x) => x.channelMixer.blue)
                },
                currentEditingChannel = FindSetting((Settings x) => x.channelMixer.currentEditingChannel)
            };

            // Color wheels
            m_ColorWheels = new ColorWheelsSettings
            {
				mode = FindSetting((Settings x) => x.colorWheels.mode),
                log = FindSetting((Settings x) => x.colorWheels.log),
                linear = FindSetting((Settings x) => x.colorWheels.linear)
            };

            // Curves
            m_Curves = new CurvesSettings
            {
                master = FindSetting((Settings x) => x.curves.master.curve),
                red = FindSetting((Settings x) => x.curves.red.curve),
                green = FindSetting((Settings x) => x.curves.green.curve),
                blue = FindSetting((Settings x) => x.curves.blue.curve),

                hueVShue = FindSetting((Settings x) => x.curves.hueVShue.curve),
                hueVSsat = FindSetting((Settings x) => x.curves.hueVSsat.curve),
                satVSsat = FindSetting((Settings x) => x.curves.satVSsat.curve),
                lumVSsat = FindSetting((Settings x) => x.curves.lumVSsat.curve),

                currentEditingCurve = FindSetting((Settings x) => x.curves.e_CurrentEditingCurve),
                curveY = FindSetting((Settings x) => x.curves.e_CurveY),
                curveR = FindSetting((Settings x) => x.curves.e_CurveR),
                curveG = FindSetting((Settings x) => x.curves.e_CurveG),
                curveB = FindSetting((Settings x) => x.curves.e_CurveB)
            };

            // Prepare the curve editor and extract curve display settings
            m_CurveDict = new Dictionary<SerializedProperty, Color>();

            var settings = CurveEditor.Settings.defaultSettings;

            m_CurveEditor = new CurveEditor(settings);
            AddCurve(m_Curves.master,   new Color(1f, 1f, 1f), 2, false);
            AddCurve(m_Curves.red,      new Color(1f, 0f, 0f), 2, false);
            AddCurve(m_Curves.green,    new Color(0f, 1f, 0f), 2, false);
            AddCurve(m_Curves.blue,     new Color(0f, 0.5f, 1f), 2, false);
            AddCurve(m_Curves.hueVShue, new Color(1f, 1f, 1f), 0, true);
            AddCurve(m_Curves.hueVSsat, new Color(1f, 1f, 1f), 0, true);
            AddCurve(m_Curves.satVSsat, new Color(1f, 1f, 1f), 0, false);
            AddCurve(m_Curves.lumVSsat, new Color(1f, 1f, 1f), 0, false);
        }
 internal void Reset()
 {
     colorPrimaries = ColorPrimariesSettings.defaultSettings;
     curves         = CurvesSettings.defaultSettings;
 }