public Processor()
        {
            initGlyphs();

            // resizeFilter = new ResizeNearestNeighbor(1920, 1080);
            // resizeFilter = new ResizeBicubic(1920, 1080);
            resizeFilter = new ResizeBilinear(1920, 1080);
            gaussianFilter = new GaussianSharpen(4, 11);
            sharpenFilter = new Sharpen();
            brightnessFilter = new ContrastCorrection(15);

            autoEvent = new AutoResetEvent(false);

            Thread thread = new Thread(process);
            thread.Start();
        }
Example #2
0
        // On "Ok" button
        private void okButton_Click( object sender, System.EventArgs e )
        {
            try
            {
                // get new image size
                int width = Math.Max( 1, Math.Min( 5000, int.Parse( widthBox.Text ) ) );
                int height = Math.Max( 1, Math.Min( 5000, int.Parse( heightBox.Text ) ) );

                // create appropriate filter
                switch ( methodCombo.SelectedIndex )
                {
                    case 0:
                        filter = new ResizeNearestNeighbor( width, height );
                        break;
                    case 1:
                        filter = new ResizeBilinear( width, height );
                        break;
                    case 2:
                        filter = new ResizeBicubic( width, height );
                        break;
                }

                // close the dialog
                this.DialogResult = DialogResult.OK;
                this.Close( );
            }
            catch ( Exception )
            {
                MessageBox.Show( this, "Incorrect values are entered", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
            }
        }