📷 A modern, cross-platform, 2D Graphics library for .NET
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.
 
 

50 lines
1.8 KiB

// <copyright file="GaussianSharpenTest.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
namespace ImageSharp.Tests.Processing.Convolution
{
using ImageSharp.PixelFormats;
using SixLabors.Primitives;
using Xunit;
public class GaussianSharpenTest : FileTestBase
{
public static readonly TheoryData<int> GaussianSharpenValues
= new TheoryData<int>
{
3,
5
};
[Theory]
[WithFileCollection(nameof(DefaultFiles), nameof(GaussianSharpenValues), DefaultPixelType)]
public void ImageShouldApplyGaussianSharpenFilter<TPixel>(TestImageProvider<TPixel> provider, int value)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage())
{
image.GaussianSharpen(value)
.DebugSave(provider, value, Extensions.Bmp);
}
}
[Theory]
[WithFileCollection(nameof(DefaultFiles), nameof(GaussianSharpenValues), DefaultPixelType)]
public void ImageShouldApplyGaussianSharpenFilterInBox<TPixel>(TestImageProvider<TPixel> provider, int value)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> source = provider.GetImage())
using (var image = new Image<TPixel>(source))
{
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.GaussianSharpen(value, bounds)
.DebugSave(provider, value, Extensions.Bmp);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
}