/// <summary>
 /// Create a sharpening fitler.
 /// </summary>
 public Sharpen()
 {
     Amount = 0.1;
     runGSFilter = (GSImage image) =>
     {
         Gimp.Procedure procedure =
             new Gimp.Procedure("plug_in_sharpen");
         procedure.Run(image.Image, image.Drawable,
             (int)(Amount * 100));
     };
 }
 /// <summary>
 /// Create a new smootening filter.
 /// </summary>
 public Smoothen()
 {
     Radius = 5;
     runGSFilter = (GSImage image) =>
     {
         Gimp.Procedure procedure =
             new Gimp.Procedure("plug_in_gauss");
         procedure.Run(image.Image, image.Drawable,
             Radius, Radius, 0);
         image.Drawable.Levels(Gimp.HistogramChannel.Value,
             110, 145, 1.0, 0, 255);
     };
 }
示例#3
0
            static Samples()
            {
                _list = new List<ImageGenerator>();

                rippleEffect = new GSImageFilter()
                {
                    Name = "Ripple 2x",
                    Description = "period: 20, amplitude: 5, vert. + horiz.",
                    runGSFilter = (GSImage image) =>
                    {
                        Gimp.Procedure procedure =
                           new Gimp.Procedure("plug_in_ripple");
                        procedure.Run(image.Image, image.Drawable,
                            20, 5, 0, 1, 1, 1, 0);
                        procedure.Run(image.Image, image.Drawable,
                            20, 5, 1, 1, 1, 1, 0);
                    }
                };
                _list.Add(new ImageGenerator() {
                    Name = "Euclid + ripple",
                    SpotFunction = SpotFunction.Samples.euclidDot,
                    Effects = { rippleEffect }
                });

                noiseEffect = new GSImageFilter()
                {
                    Name = "Noise",
                    Description = "RGB noise, independent, corelated, amount: 0.2",
                    runGSFilter = (GSImage image) =>
                    {
                        Gimp.Procedure procedure =
                           new Gimp.Procedure("plug_in_rgb_noise");
                        procedure.Run(image.Image, image.Drawable,
                            1, 1, 0.2);
                    }
                };
                _list.Add(new ImageGenerator()
                {
                    Name = "Euclid + noise",
                    SpotFunction = SpotFunction.Samples.euclidDot,
                    Effects = { noiseEffect }
                });

                pixelizeEffect = new GSImageFilter()
                {
                    Name = "Pixelize",
                    Description = "block: 4px",
                    runGSFilter = (GSImage image) =>
                    {
                        Gimp.Procedure procedure =
                            new Gimp.Procedure("plug_in_pixelize");
                        procedure.Run(image.Image, image.Drawable, 4);
                    }
                };
                _list.Add(new ImageGenerator()
                {
                    Name = "Euclid + pixelize",
                    SpotFunction = SpotFunction.Samples.euclidDot,
                    Effects = { pixelizeEffect }
                });

                canvasEffect = new GSImageFilter()
                {
                    Name = "Canvas",
                    Description = "direction: 0, depth: 4",
                    runGSFilter = (GSImage image) =>
                    {
                        Gimp.Procedure procedure =
                           new Gimp.Procedure("plug_in_apply_canvas");
                        procedure.Run(image.Image, image.Drawable, 0, 4);
                    }
                };
                _list.Add(new ImageGenerator()
                {
                    Name = "Euclid + canvas",
                    SpotFunction = SpotFunction.Samples.euclidDot,
                    Effects = { canvasEffect }
                });

                _list.Add(new ImageGenerator()
                {
                    Name = "Euclid + pixelize + ripple",
                    SpotFunction = SpotFunction.Samples.euclidDot,
                    Effects = { pixelizeEffect, rippleEffect }
                });

                patternEffect = new GSImageFilter()
                {
                    Name = "Pattern",
                    Description = "Veryovka-Buchanan: current pattern + histogram equalization",
                    runGSFilter = (GSImage image) =>
                    {
                        image.Drawable.Fill(Gimp.FillType.Pattern);
                        image.Drawable.Equalize(false);
                    }
                };
                _list.Add(new ImageGenerator()
                {
                    Name = "Veryovka-Buchanan",
                    SpotFunction = SpotFunction.Samples.nullSpot,
                    Effects = { patternEffect }
                });
            }