//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp.Tests.Processing.Transforms
{
using ImageSharp.PixelFormats;
using ImageSharp.Processing;
using Xunit;
public class RotateFlipTests : FileTestBase
{
public static readonly string[] FlipFiles = { TestImages.Bmp.F };
public static readonly TheoryData RotateFlipValues
= new TheoryData
{
{ RotateType.None, FlipType.Vertical },
{ RotateType.None, FlipType.Horizontal },
{ RotateType.Rotate90, FlipType.None },
{ RotateType.Rotate180, FlipType.None },
{ RotateType.Rotate270, FlipType.None },
};
[Theory]
[WithFileCollection(nameof(FlipFiles), nameof(RotateFlipValues), DefaultPixelType)]
public void ImageShouldRotateFlip(TestImageProvider provider, RotateType rotateType, FlipType flipType)
where TPixel : struct, IPixel
{
using (Image image = provider.GetImage())
{
image.RotateFlip(rotateType, flipType)
.DebugSave(provider, string.Join("_", rotateType, flipType), Extensions.Bmp);
}
}
}
}