Exemple #1
0
        private void UnsharpMaskDialog_Load(object sender, System.EventArgs e)
        {
            if (_firstTimer)
            {
                _firstTimer = false;
                UnsharpMaskCommand command = new UnsharpMaskCommand();
                _initialAmount     = command.Amount;
                _initialRadius     = command.Radius;
                _initialThreshold  = command.Threshold;
                _initialColorSpace = command.ColorType;
            }

            Amount     = _initialAmount;
            Radius     = _initialRadius;
            Threshold  = _initialThreshold;
            ColorSpace = _initialColorSpace;

            _numAmount.Value    = Amount;
            _numRadius.Value    = Radius;
            _numThreshold.Value = Threshold;

            _cbColorSpace.Items.AddRange(Enum.GetNames(typeof(UnsharpMaskCommandColorType)));
            _cbColorSpace.Items.RemoveAt(0);
            _cbColorSpace.SelectedIndex = 0;
        }
Exemple #2
0
        private void _btnOk_Click(object sender, System.EventArgs e)
        {
            Amount    = (int)_numAmount.Value;
            Radius    = (int)_numRadius.Value;
            Threshold = (int)_numThreshold.Value;

            ColorSpace = (UnsharpMaskCommandColorType)Enum.Parse(typeof(UnsharpMaskCommandColorType), (string)_cbColorSpace.SelectedItem);

            _initialAmount     = Amount;
            _initialRadius     = Radius;
            _initialThreshold  = Threshold;
            _initialColorSpace = ColorSpace;
        }
Exemple #3
0
        private void _btnOk_Click(object sender, EventArgs e)
        {
            Amount    = (int)_numAmount.Value;
            Radius    = (int)_numRadius.Value;
            Threshold = (int)_numThreshold.Value;

            ColorSpace = (UnsharpMaskCommandColorType)Constants.GetValueFromName(
                typeof(UnsharpMaskCommandColorType),
                (string)_cbColorSpace.SelectedItem,
                _initialColorSpace);

            _initialAmount     = Amount;
            _initialRadius     = Radius;
            _initialThreshold  = Threshold;
            _initialColorSpace = ColorSpace;
        }
Exemple #4
0
        private void ApplyFilter()
        {
            UnsharpMaskCommandColorType type = UnsharpMaskCommandColorType.None;

            switch (_cbColorSpace.SelectedIndex)
            {
            case 0:
                type = UnsharpMaskCommandColorType.Rgb;
                break;

            case 1:
                type = UnsharpMaskCommandColorType.Yuv;
                break;
            }

            UnsharpMaskCommand command = new UnsharpMaskCommand(Convert.ToInt32(_numAmount.Value), Convert.ToInt32(_numRadius.Value), Convert.ToInt32(_numThreshold.Value), type);

            _mainForm.FilterRunCommand(command, true, false);
        }
Exemple #5
0
        private void UnSharpenDailog_Load(object sender, EventArgs e)
        {
            UnsharpMaskCommand command = new UnsharpMaskCommand();

            _initialAmount     = command.Amount;
            _initialRadius     = command.Radius;
            _initialThreshold  = command.Threshold;
            _initialColorSpace = command.ColorType;

            Amount     = _initialAmount;
            Radius     = _initialRadius;
            Threshold  = _initialThreshold;
            ColorSpace = _initialColorSpace;

            _numAmount.Value    = Amount;
            _numRadius.Value    = Radius;
            _numThreshold.Value = Threshold;

            Tools.FillComboBoxWithEnum(_cbColorSpace, typeof(UnsharpMaskCommandColorType), ColorSpace, new object[] { UnsharpMaskCommandColorType.None });
        }