mirror of https://github.com/SixLabors/ImageSharp
Browse Source
Use jagged instead of multidimensional array Former-commit-id: 7d19a23161b8d00d111f09c7d1a7db0ed2b00489 Former-commit-id: ebbf751a3c568ee41ff17c941a21df44060441a2 Former-commit-id: d3c9b2f302a528ec10f58889000792c894e3cf88pull/1/head
committed by
GitHub
8 changed files with 130 additions and 65 deletions
@ -0,0 +1,47 @@ |
|||
// <copyright file="DetectEdges.cs" company="James Jackson-South">
|
|||
// Copyright (c) James Jackson-South and contributors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
// </copyright>
|
|||
|
|||
|
|||
namespace ImageProcessorCore.Benchmarks |
|||
{ |
|||
using System.IO; |
|||
|
|||
using BenchmarkDotNet.Attributes; |
|||
|
|||
using CoreImage = ImageProcessorCore.Image; |
|||
|
|||
public class DetectEdges |
|||
{ |
|||
private CoreImage image; |
|||
|
|||
[Setup] |
|||
public void ReadImage() |
|||
{ |
|||
if (image == null) |
|||
{ |
|||
using(FileStream stream = File.OpenRead("../ImageProcessorCore.Tests/TestImages/Formats/Bmp/Car.bmp")) |
|||
{ |
|||
image = new CoreImage(stream); |
|||
} |
|||
} |
|||
} |
|||
|
|||
[Benchmark(Description = "ImageProcessorCore DetectEdges")] |
|||
public void ImageProcessorCoreDetectEdges() |
|||
{ |
|||
image.DetectEdges(EdgeDetection.Kayyali); |
|||
image.DetectEdges(EdgeDetection.Kayyali); |
|||
image.DetectEdges(EdgeDetection.Kirsch); |
|||
image.DetectEdges(EdgeDetection.Lapacian3X3); |
|||
image.DetectEdges(EdgeDetection.Lapacian5X5); |
|||
image.DetectEdges(EdgeDetection.LaplacianOfGaussian); |
|||
image.DetectEdges(EdgeDetection.Prewitt); |
|||
image.DetectEdges(EdgeDetection.RobertsCross); |
|||
image.DetectEdges(EdgeDetection.Robinson); |
|||
image.DetectEdges(EdgeDetection.Scharr); |
|||
image.DetectEdges(EdgeDetection.Sobel); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue