コード例 #1
0
        private void mnuVideoFilter_DropDownOpening(object sender, EventArgs e)
        {
            VideoFilterType filterType = ConfigManager.Config.Video.VideoFilter;

            mnuNoneFilter.Checked        = (filterType == VideoFilterType.None);
            mnuNtscFilter.Checked        = (filterType == VideoFilterType.NTSC);
            mnuXBRZ2xFilter.Checked      = (filterType == VideoFilterType.xBRZ2x);
            mnuXBRZ3xFilter.Checked      = (filterType == VideoFilterType.xBRZ3x);
            mnuXBRZ4xFilter.Checked      = (filterType == VideoFilterType.xBRZ4x);
            mnuXBRZ5xFilter.Checked      = (filterType == VideoFilterType.xBRZ5x);
            mnuXBRZ6xFilter.Checked      = (filterType == VideoFilterType.xBRZ6x);
            mnuHQ2xFilter.Checked        = (filterType == VideoFilterType.HQ2x);
            mnuHQ3xFilter.Checked        = (filterType == VideoFilterType.HQ3x);
            mnuHQ4xFilter.Checked        = (filterType == VideoFilterType.HQ4x);
            mnuScale2xFilter.Checked     = (filterType == VideoFilterType.Scale2x);
            mnuScale3xFilter.Checked     = (filterType == VideoFilterType.Scale3x);
            mnuScale4xFilter.Checked     = (filterType == VideoFilterType.Scale4x);
            mnu2xSaiFilter.Checked       = (filterType == VideoFilterType._2xSai);
            mnuSuper2xSaiFilter.Checked  = (filterType == VideoFilterType.Super2xSai);
            mnuSuperEagleFilter.Checked  = (filterType == VideoFilterType.SuperEagle);
            mnuPrescale2xFilter.Checked  = (filterType == VideoFilterType.Prescale2x);
            mnuPrescale3xFilter.Checked  = (filterType == VideoFilterType.Prescale3x);
            mnuPrescale4xFilter.Checked  = (filterType == VideoFilterType.Prescale4x);
            mnuPrescale6xFilter.Checked  = (filterType == VideoFilterType.Prescale6x);
            mnuPrescale8xFilter.Checked  = (filterType == VideoFilterType.Prescale8x);
            mnuPrescale10xFilter.Checked = (filterType == VideoFilterType.Prescale10x);

            mnuBilinearInterpolation.Checked    = ConfigManager.Config.Video.UseBilinearInterpolation;
            mnuBlendHighResolutionModes.Checked = ConfigManager.Config.Video.BlendHighResolutionModes;
        }
コード例 #2
0
        private void UpdateFilterMenu(VideoFilterType filterType)
        {
            mnuNoneFilter.Checked               = (filterType == VideoFilterType.None);
            mnuNtscFilter.Checked               = (filterType == VideoFilterType.NTSC);
            mnuNtscBisqwitFullFilter.Checked    = (filterType == VideoFilterType.BisqwitNtsc);
            mnuNtscBisqwitHalfFilter.Checked    = (filterType == VideoFilterType.BisqwitNtscHalfRes);
            mnuNtscBisqwitQuarterFilter.Checked = (filterType == VideoFilterType.BisqwitNtscQuarterRes);

            mnuXBRZ2xFilter.Checked      = (filterType == VideoFilterType.xBRZ2x);
            mnuXBRZ3xFilter.Checked      = (filterType == VideoFilterType.xBRZ3x);
            mnuXBRZ4xFilter.Checked      = (filterType == VideoFilterType.xBRZ4x);
            mnuXBRZ5xFilter.Checked      = (filterType == VideoFilterType.xBRZ5x);
            mnuXBRZ6xFilter.Checked      = (filterType == VideoFilterType.xBRZ6x);
            mnuHQ2xFilter.Checked        = (filterType == VideoFilterType.HQ2x);
            mnuHQ3xFilter.Checked        = (filterType == VideoFilterType.HQ3x);
            mnuHQ4xFilter.Checked        = (filterType == VideoFilterType.HQ4x);
            mnuScale2xFilter.Checked     = (filterType == VideoFilterType.Scale2x);
            mnuScale3xFilter.Checked     = (filterType == VideoFilterType.Scale3x);
            mnuScale4xFilter.Checked     = (filterType == VideoFilterType.Scale4x);
            mnu2xSaiFilter.Checked       = (filterType == VideoFilterType._2xSai);
            mnuSuper2xSaiFilter.Checked  = (filterType == VideoFilterType.Super2xSai);
            mnuSuperEagleFilter.Checked  = (filterType == VideoFilterType.SuperEagle);
            mnuPrescale2xFilter.Checked  = (filterType == VideoFilterType.Prescale2x);
            mnuPrescale3xFilter.Checked  = (filterType == VideoFilterType.Prescale3x);
            mnuPrescale4xFilter.Checked  = (filterType == VideoFilterType.Prescale4x);
            mnuPrescale6xFilter.Checked  = (filterType == VideoFilterType.Prescale6x);
            mnuPrescale8xFilter.Checked  = (filterType == VideoFilterType.Prescale8x);
            mnuPrescale10xFilter.Checked = (filterType == VideoFilterType.Prescale10x);

            ConfigManager.Config.VideoInfo.VideoFilter = filterType;
            ConfigManager.ApplyChanges();
        }
コード例 #3
0
        protected override bool ValidateInput()
        {
            VideoFilterType orgFilter = ((VideoInfo)Entity).VideoFilter;

            UpdateObject();
            UpdateCustomRatioVisibility();
            UpdatePalette();
            VideoFilterType filter = ((VideoInfo)Entity).VideoFilter;

            if (filter == VideoFilterType.NTSC)
            {
                tlpNtscFilter1.Visible = true;
                tlpNtscFilter2.Visible = false;
                grpNtscFilter.Visible  = true;
            }
            else if (filter == VideoFilterType.BisqwitNtsc || filter == VideoFilterType.BisqwitNtscHalfRes || filter == VideoFilterType.BisqwitNtscQuarterRes)
            {
                tlpNtscFilter1.Visible = false;
                tlpNtscFilter2.Visible = true;
                grpNtscFilter.Visible  = true;
            }
            else
            {
                grpNtscFilter.Visible = false;
            }

            VideoInfo.ApplyConfig();
            return(true);
        }
コード例 #4
0
 private void SetVideoFilter(VideoFilterType type)
 {
     if (!_fullscreenMode)
     {
         _customSize = false;
     }
     InteropEmu.SetVideoFilter(type);
     UpdateFilterMenu(type);
 }
コード例 #5
0
        public static VideoFilter GetFilterForType(VideoFilterType type)
        {
            var filterName = type.ToString();
            var filterType = Type.GetType($"Encoder.Filters.Video.{filterName}.{filterName}VideoFilter");

            if (filterType != null)
            {
                return((VideoFilter)Activator.CreateInstance(filterType));
            }

            throw new NotImplementedException("Filter not implemented, named incorrectly, or in wrong namespace");
        }
コード例 #6
0
        protected override bool ValidateInput()
        {
            UpdateObject();
            UpdateCustomRatioVisibility();

            VideoFilterType filter = ((VideoConfig)Entity).VideoFilter;

            grpNtscFilter.Visible = (filter == VideoFilterType.NTSC);

            ((VideoConfig)this.Entity).ApplyConfig();

            return(true);
        }
コード例 #7
0
ファイル: frmVideoConfig.cs プロジェクト: mkwong98/Mesen
        protected override bool ValidateInput()
        {
            UpdateObject();
            UpdateCustomRatioVisibility();
            UpdatePalette();
            VideoFilterType filter = ((VideoInfo)Entity).VideoFilter;

            if (filter == VideoFilterType.NTSC)
            {
                tlpNtscFilter1.Visible           = true;
                tlpNtscFilter2.Visible           = false;
                chkMergeFields.Visible           = true;
                chkColorimetryCorrection.Visible = false;
                grpNtscFilter.Visible            = true;
            }
            else if (filter == VideoFilterType.BisqwitNtsc || filter == VideoFilterType.BisqwitNtscHalfRes || filter == VideoFilterType.BisqwitNtscQuarterRes)
            {
                tlpNtscFilter1.Visible           = true;
                tlpNtscFilter2.Visible           = true;
                chkMergeFields.Visible           = false;
                chkColorimetryCorrection.Visible = true;
                grpNtscFilter.Visible            = true;
            }
            else
            {
                grpNtscFilter.Visible = false;
            }

            VideoInfo.ApplyConfig();

            if (chkEnableGameSpecificOverscan.Checked)
            {
                InteropEmu.SetOverscanDimensions(
                    (UInt32)nudGameSpecificOverscanLeft.Value,
                    (UInt32)nudGameSpecificOverscanRight.Value,
                    (UInt32)nudGameSpecificOverscanTop.Value,
                    (UInt32)nudGameSpecificOverscanBottom.Value
                    );
            }

            return(true);
        }
コード例 #8
0
        private static string GetEqFFMpegFilterStringPart(VideoFilterDescriptor[] c, VideoFilterType type, string val, double min, double med, double max)
        {
            var item = c.FirstOrDefault(s => s.Type == type);

            if (item != null && item.Value != 0.0)
            {
                var    dec = item.Value * 50;
                double calc;
                if (dec >= 0)
                {
                    calc = ((dec) / 50) * (max - med) + med;
                }
                else
                {
                    calc = ((dec) / 50) * (med - min) + med;
                }
                return(string.Format(CultureInfo.InvariantCulture, "{0}={1:F2}", val, calc));
            }
            return(null);
        }
コード例 #9
0
ファイル: ShortcutHandler.cs プロジェクト: piepacker/mesens
 public void SetVideoFilter(VideoFilterType filter)
 {
     ConfigManager.Config.Video.VideoFilter = filter;
     ConfigManager.Config.Video.ApplyConfig();
     ConfigManager.ApplyChanges();
 }
コード例 #10
0
ファイル: InteropEmu.cs プロジェクト: seem-sky/Mesen
 [DllImport(DLLPath)] public static extern void SetVideoFilter(VideoFilterType filter);