private void _btnOk_Click(object sender, System.EventArgs e)
 {
     //Update command values
     ColorSpace = TranslateType();
     _HistogramEqualizeCommand.Type = ColorSpace;
     _initialColorSpace             = ColorSpace;
     this.DialogResult = DialogResult.OK;
 }
Example #2
0
        private void _btnOk_Click(object sender, System.EventArgs e)
        {
            ColorSpace = (HistogramEqualizeType)Constants.GetValueFromName(
                typeof(HistogramEqualizeType),
                (string)_cbColorSpace.SelectedItem,
                _initialColorSpace);

            _initialColorSpace = ColorSpace;
        }
Example #3
0
        private void EqualizerDialog_Load(object sender, EventArgs e)
        {
            HistogramEqualizeCommand command = new HistogramEqualizeCommand();

            _initialColorSpace = command.Type;

            ColorSpace = _initialColorSpace;
            Tools.FillComboBoxWithEnum(_cbColorSpace, typeof(HistogramEqualizeType), ColorSpace, new object[] { HistogramEqualizeType.None });
        }
Example #4
0
        private void HistogramEqualizeDialog_Load(object sender, System.EventArgs e)
        {
            if (_firstTimer)
            {
                _firstTimer = false;
                HistogramEqualizeCommand command = new HistogramEqualizeCommand();
                _initialColorSpace = command.Type;
            }

            ColorSpace = _initialColorSpace;

            Tools.FillComboBoxWithEnum(_cbColorSpace, typeof(HistogramEqualizeType), ColorSpace, new object[] { HistogramEqualizeType.None });
        }
Example #5
0
        private void _btnOk_Click(object sender, EventArgs e)
        {
            nWidth       = (int)_numWidth.Value;
            nHeight      = (int)_numHeight.Value;
            nWidthExt    = (int)_numWidthExt.Value;
            nHeightExt   = (int)_numHeightExt.Value;
            nSmooth      = (int)_numSmooth.Value;
            EqualizeType = (HistogramEqualizeType)Constants.GetValueFromName(
                typeof(HistogramEqualizeType),
                (string)_cbEqualizeType.SelectedItem,
                _initialEqualizeType);

            _numWidth.Value      = nWidth;
            _numHeight.Value     = nHeight;
            _numWidthExt.Value   = nWidthExt;
            _numHeightExt.Value  = nHeightExt;
            _numSmooth.Value     = nSmooth;
            _initialEqualizeType = EqualizeType;
        }
        private void ApplyFilter()
        {
            int orignalPage = _cell.Image.Page;

            _cell.Image.Page = _cell.ActiveSubCell + 1;
            _region          = _cell.Image.GetRegion(null);
            _cell.RemoveRegion();
            HistogramEqualizeType type = HistogramEqualizeType.None;

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

            case 1:
                type = HistogramEqualizeType.Yuv;
                break;

            case 2:
                type = HistogramEqualizeType.Gray;
                break;
            }

            HistogramEqualizeCommand command = new HistogramEqualizeCommand(type);

            _mainForm.FilterRunCommand(command, false, true);


            _cell.Image.SetRegion(null, _region, RasterRegionCombineMode.Set);
            if (_cell.Image.BitsPerPixel == 8)
            {
                _cell.SetWindowLevel(_cell.ActiveSubCell, 255, 128);
            }
            else if (_cell.Image.BitsPerPixel == 16)
            {
                _cell.SetWindowLevel(_cell.ActiveSubCell, 65000, 32000);
            }

            _cell.Image.Page = orignalPage;
            _cell.Invalidate();
        }
Example #7
0
        private void LocalEqualizerDialog_Load(object sender, EventArgs e)
        {
            LocalHistogramEqualizeCommand command = new LocalHistogramEqualizeCommand();

            _initialWidth        = command.Width;
            _initialHeight       = command.Height;
            _initialWidthExt     = command.WidthExtension;
            _initialHeightExt    = command.HeightExtension;
            _initialSmooth       = command.Smooth;
            _initialEqualizeType = command.Type;


            nWidth       = _initialWidth;
            nHeight      = _initialHeight;
            nWidthExt    = _initialWidthExt;
            nHeightExt   = _initialHeightExt;
            nSmooth      = _initialSmooth;
            EqualizeType = _initialEqualizeType;

            _numWidth.Value     = nWidth;
            _numHeight.Value    = nHeight;
            _numWidthExt.Value  = nWidthExt;
            _numHeightExt.Value = nHeightExt;
            _numSmooth.Value    = nSmooth;

            _numWidth.Maximum    = _width;
            _numWidth.Minimum    = 1;
            _numWidthExt.Maximum = _width;
            _numWidthExt.Minimum = 0;

            _numHeight.Maximum    = _height;
            _numHeight.Minimum    = 1;
            _numHeightExt.Maximum = _height;
            _numHeightExt.Minimum = 0;

            _numWidth.Value  = _width;
            _numHeight.Value = _height;

            Tools.FillComboBoxWithEnum(_cbEqualizeType, typeof(HistogramEqualizeType), EqualizeType, new object[] { UnsharpMaskCommandColorType.None });
        }
        private void HistogramEqualizeDialog_Load(object sender, System.EventArgs e)
        {
            if (_firstTimer)
            {
                _firstTimer        = false;
                _initialColorSpace = _HistogramEqualizeCommand.Type;
            }

            ColorSpace = _initialColorSpace;

            //Set command default values
            string[] names;
            names = Enum.GetNames(typeof(HistogramEqualizeType));
            foreach (string name in names)
            {
                if (name != "None")
                {
                    _cmbColorSpace.Items.Add(name);
                }
            }
            _cmbColorSpace.SelectedIndex = _cmbColorSpace.Items.IndexOf(ColorSpace.ToString());
        }