//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Tests.Processing.Overlays
{
using ImageSharp.PixelFormats;
using Xunit;
public class GlowTest : FileTestBase
{
[Theory]
[WithFileCollection(nameof(DefaultFiles), DefaultPixelType)]
public void ImageShouldApplyGlowFilter(TestImageProvider provider)
where TPixel : struct, IPixel
{
using (Image image = provider.GetImage())
{
image.Glow()
.DebugSave(provider, null, Extensions.Bmp);
}
}
[Theory]
[WithFileCollection(nameof(DefaultFiles), DefaultPixelType)]
public void ImageShouldApplyGlowFilterColor(TestImageProvider provider)
where TPixel : struct, IPixel
{
using (Image image = provider.GetImage())
{
image.Glow(NamedColors.Orange)
.DebugSave(provider, null, Extensions.Bmp);
}
}
[Theory]
[WithFileCollection(nameof(DefaultFiles), DefaultPixelType)]
public void ImageShouldApplyGlowFilterRadius(TestImageProvider provider)
where TPixel : struct, IPixel
{
using (Image image = provider.GetImage())
{
image.Glow(image.Width / 4F)
.DebugSave(provider, null, Extensions.Bmp);
}
}
[Theory]
[WithFileCollection(nameof(DefaultFiles), DefaultPixelType)]
public void ImageShouldApplyGlowFilterInBox(TestImageProvider provider)
where TPixel : struct, IPixel
{
using (Image source = provider.GetImage())
using (var image = new Image(source))
{
var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);
image.Glow(bounds)
.DebugSave(provider, null, Extensions.Bmp);
ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
}
}
}
}