|
|
@ -53,6 +53,7 @@ public sealed class ProcessorThroughputBenchmark |
|
|
Method.BinaryThreshold => this.BinaryThreshold, |
|
|
Method.BinaryThreshold => this.BinaryThreshold, |
|
|
Method.Histogram => this.Histogram, |
|
|
Method.Histogram => this.Histogram, |
|
|
Method.OilPaint => this.OilPaint, |
|
|
Method.OilPaint => this.OilPaint, |
|
|
|
|
|
Method.GaussianBlur => this.GaussianBlur, |
|
|
_ => throw new NotImplementedException(), |
|
|
_ => throw new NotImplementedException(), |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
@ -151,21 +152,28 @@ public sealed class ProcessorThroughputBenchmark |
|
|
{ |
|
|
{ |
|
|
using Image<Rgba32> image = new(this.options.Width, this.options.Height); |
|
|
using Image<Rgba32> image = new(this.options.Width, this.options.Height); |
|
|
using Image<Rgba32> foreground = new(this.options.Width, this.options.Height); |
|
|
using Image<Rgba32> 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; |
|
|
return image.Width * image.Height; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private int BinaryThreshold() |
|
|
private int BinaryThreshold() |
|
|
{ |
|
|
{ |
|
|
using Image<Rgba32> image = new(this.options.Width, this.options.Height); |
|
|
using Image<Rgba32> 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; |
|
|
return image.Width * image.Height; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private int Histogram() |
|
|
private int Histogram() |
|
|
{ |
|
|
{ |
|
|
using Image<Rgba32> image = new(this.options.Width, this.options.Height); |
|
|
using Image<Rgba32> 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<Rgba32> image = new(this.options.Width, this.options.Height); |
|
|
|
|
|
image.Mutate(this.configuration, c => c.GaussianBlur()); |
|
|
return image.Width * image.Height; |
|
|
return image.Width * image.Height; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -176,7 +184,8 @@ public sealed class ProcessorThroughputBenchmark |
|
|
DrawImage, |
|
|
DrawImage, |
|
|
BinaryThreshold, |
|
|
BinaryThreshold, |
|
|
Histogram, |
|
|
Histogram, |
|
|
OilPaint |
|
|
OilPaint, |
|
|
|
|
|
GaussianBlur, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private sealed class CommandLineOptions |
|
|
private sealed class CommandLineOptions |
|
|
|