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.
37 lines
1.1 KiB
37 lines
1.1 KiB
// <copyright file="FlipTest.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.Transforms
|
|
{
|
|
using ImageSharp.PixelFormats;
|
|
using ImageSharp.Processing;
|
|
|
|
using Xunit;
|
|
|
|
public class FlipTests : FileTestBase
|
|
{
|
|
public static readonly string[] FlipFiles = { TestImages.Bmp.F };
|
|
|
|
public static readonly TheoryData<FlipType> FlipValues
|
|
= new TheoryData<FlipType>
|
|
{
|
|
{ FlipType.None },
|
|
{ FlipType.Vertical },
|
|
{ FlipType.Horizontal },
|
|
};
|
|
|
|
[Theory]
|
|
[WithFileCollection(nameof(FlipFiles), nameof(FlipValues), DefaultPixelType)]
|
|
public void ImageShouldFlip<TPixel>(TestImageProvider<TPixel> provider, FlipType flipType)
|
|
where TPixel : struct, IPixel<TPixel>
|
|
{
|
|
using (Image<TPixel> image = provider.GetImage())
|
|
{
|
|
image.Flip(flipType)
|
|
.DebugSave(provider, flipType, Extensions.Bmp);
|
|
}
|
|
}
|
|
}
|
|
}
|