mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
960 B
33 lines
960 B
namespace ImageProcessorCore.Benchmarks.Image
|
|
{
|
|
using System.Drawing;
|
|
|
|
using BenchmarkDotNet.Attributes;
|
|
|
|
using CoreColor = ImageProcessorCore.Color;
|
|
using CoreImage = ImageProcessorCore.Image;
|
|
using SystemColor = System.Drawing.Color;
|
|
|
|
public class GetSetPixel
|
|
{
|
|
[Benchmark(Baseline = true, Description = "System.Drawing GetSet Pixel")]
|
|
public SystemColor ResizeSystemDrawing()
|
|
{
|
|
using (Bitmap source = new Bitmap(400, 400))
|
|
{
|
|
source.SetPixel(200, 200, SystemColor.White);
|
|
return source.GetPixel(200, 200);
|
|
}
|
|
}
|
|
|
|
[Benchmark(Description = "ImageProcessorCore GetSet Pixel")]
|
|
public CoreColor ResizeCore()
|
|
{
|
|
using (CoreImage image = new CoreImage(400, 400))
|
|
{
|
|
image[200, 200] = CoreColor.White;
|
|
return image[200, 200];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|