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

39 lines
1.4 KiB

// 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 RotateFlipTests
{
public static readonly string[] FlipFiles = { TestImages.Bmp.F };
public static readonly TheoryData<RotateMode, FlipMode> RotateFlipValues
= new TheoryData<RotateMode, FlipMode>
{
{ RotateMode.None, FlipMode.Vertical },
{ RotateMode.None, FlipMode.Horizontal },
{ RotateMode.Rotate90, FlipMode.None },
{ RotateMode.Rotate180, FlipMode.None },
{ RotateMode.Rotate270, FlipMode.None },
};
[Theory]
[WithTestPatternImages(nameof(RotateFlipValues), 100, 50, PixelTypes.Rgba32)]
[WithTestPatternImages(nameof(RotateFlipValues), 50, 100, PixelTypes.Rgba32)]
public void RotateFlip<TPixel>(TestImageProvider<TPixel> provider, RotateMode rotateType, FlipMode flipType)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(x => x.RotateFlip(rotateType, flipType));
image.DebugSave(provider, string.Join("_", rotateType, flipType));
}
}
}
}