Exemplo n.º 1
0
        public override Pixel ProcessPixel(Pixel originalPixel, IParameters parameters)
        {
            var origH = Convertors.GetPixelHue(originalPixel);
            var origS = Convertors.GetPixelSaturation(originalPixel);
            var origL = Convertors.GetPixelLightness(originalPixel);

            var newL = Math.Pow(origL, 1 / (parameters as GammaCorrectionParameters).GammaParameterByUser);

            return(Convertors.HSL2Pixel(origH, origS, newL));
        }
Exemplo n.º 2
0
        private void buttonApply_Click(object sender, EventArgs e)
        {
            var filter = comboBoxFilters.SelectedItem as IFilter;

            var parameters = new double[parametrControls.Count];

            for (var i = 0; i < parameters.Length; i++)
            {
                parameters[i] = (double)parametrControls[i].Value;
            }

            resultPhoto            = filter.Process(originalPhoto, parameters);
            pictureBoxResult.Image = Convertors.Photo2Bitmap(resultPhoto);

            saveToolStripMenuItem.Enabled = true;
        }
Exemplo n.º 3
0
 private void LoadPicture(Bitmap bmp)
 {
     originalPhoto            = Convertors.Bitmap2Photo(bmp);
     pictureBoxOriginal.Image = bmp;
     pictureBoxResult.Image   = null;
 }
Exemplo n.º 4
0
        private void SavePicture(Photo photo, string filename)
        {
            var bmp = Convertors.Photo2Bitmap(photo);

            bmp.Save(filename, System.Drawing.Imaging.ImageFormat.Jpeg);
        }