diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs b/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs index e9adf58449..e85a3ee972 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs @@ -6,6 +6,7 @@ using CommandLine; using CommandLine.Text; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Convolution; namespace SixLabors.ImageSharp.Tests.ProfilingSandbox; @@ -49,10 +50,12 @@ public sealed class ProcessorThroughputBenchmark { Method.Crop => this.Crop, Method.Edges => this.DetectEdges, + Method.EdgesCompass => this.EdgesCompass, Method.DrawImage => this.DrawImage, Method.BinaryThreshold => this.BinaryThreshold, Method.Histogram => this.Histogram, Method.OilPaint => this.OilPaint, + Method.GaussianBlur => this.GaussianBlur, _ => throw new NotImplementedException(), }; @@ -138,6 +141,13 @@ public sealed class ProcessorThroughputBenchmark return image.Width * image.Height; } + private int EdgesCompass() + { + using Image image = new(this.options.Width, this.options.Height); + image.Mutate(this.configuration, x => x.DetectEdges(EdgeDetectorCompassKernel.Kirsch)); + return image.Width * image.Height; + } + private int Crop() { using Image image = new(this.options.Width, this.options.Height); @@ -151,32 +161,41 @@ public sealed class ProcessorThroughputBenchmark { using Image image = new(this.options.Width, this.options.Height); using Image foreground = new(this.options.Width, this.options.Height); - image.Mutate(c => c.DrawImage(foreground, 0.5f)); + image.Mutate(this.configuration, c => c.DrawImage(foreground, 0.5f)); return image.Width * image.Height; } private int BinaryThreshold() { using Image image = new(this.options.Width, this.options.Height); - image.Mutate(c => c.BinaryThreshold(0.5f)); + image.Mutate(this.configuration, c => c.BinaryThreshold(0.5f)); return image.Width * image.Height; } private int Histogram() { using Image image = new(this.options.Width, this.options.Height); - image.Mutate(c => c.HistogramEqualization()); + image.Mutate(this.configuration, c => c.HistogramEqualization()); + return image.Width * image.Height; + } + + private int GaussianBlur() + { + using Image image = new(this.options.Width, this.options.Height); + image.Mutate(this.configuration, c => c.GaussianBlur()); return image.Width * image.Height; } private enum Method { Edges, + EdgesCompass, Crop, DrawImage, BinaryThreshold, Histogram, - OilPaint + OilPaint, + GaussianBlur, } private sealed class CommandLineOptions