📷 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.
 
 

32 lines
969 B

// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.PixelFormats;
using Xunit;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
{
using SixLabors.ImageSharp.Processing;
public class EntropyCropTest : FileTestBase
{
public static readonly TheoryData<float> EntropyCropValues
= new TheoryData<float>
{
.25F,
.75F
};
[Theory]
[WithFileCollection(nameof(DefaultFiles), nameof(EntropyCropValues), DefaultPixelType)]
public void ImageShouldEntropyCrop<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.EntropyCrop(value));
image.DebugSave(provider, value);
}
}
}
}