Browse Source

smaller Bike.png, optimized RotateTests & RotateFlipTests

pull/298/head
Anton Firszov 9 years ago
parent
commit
81ee6d0453
  1. 3
      tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs
  2. 11
      tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs
  3. BIN
      tests/Images/Input/Png/Bike.png
  4. BIN
      tests/Images/Input/Png/BikeGrayscale.png

3
tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs

@ -25,7 +25,8 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
[Theory]
[WithFileCollection(nameof(FlipFiles), nameof(RotateFlipValues), DefaultPixelType)]
[WithTestPatternImages(nameof(RotateFlipValues), 100, 50, DefaultPixelType)]
[WithTestPatternImages(nameof(RotateFlipValues), 50, 100, DefaultPixelType)]
public void ImageShouldRotateFlip<TPixel>(TestImageProvider<TPixel> provider, RotateType rotateType, FlipType flipType)
where TPixel : struct, IPixel<TPixel>
{

11
tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs

@ -3,6 +3,7 @@
// Licensed under the Apache License, Version 2.0.
// </copyright>
// ReSharper disable InconsistentNaming
namespace ImageSharp.Tests.Processing.Processors.Transforms
{
using ImageSharp.PixelFormats;
@ -29,8 +30,9 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
};
[Theory]
[WithFileCollection(nameof(DefaultFiles), nameof(RotateFloatValues), DefaultPixelType)]
public void ImageShouldRotate<TPixel>(TestImageProvider<TPixel> provider, float value)
[WithTestPatternImages(nameof(RotateFloatValues), 100, 50, DefaultPixelType)]
[WithTestPatternImages(nameof(RotateFloatValues), 50, 100, DefaultPixelType)]
public void Rotate<TPixel>(TestImageProvider<TPixel> provider, float value)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage())
@ -41,8 +43,9 @@ namespace ImageSharp.Tests.Processing.Processors.Transforms
}
[Theory]
[WithFileCollection(nameof(DefaultFiles), nameof(RotateEnumValues), DefaultPixelType)]
public void ImageShouldRotateEnum<TPixel>(TestImageProvider<TPixel> provider, RotateType value)
[WithTestPatternImages(nameof(RotateEnumValues), 100, 50, DefaultPixelType)]
[WithTestPatternImages(nameof(RotateEnumValues), 50, 100, DefaultPixelType)]
public void Rotate_WithRotateTypeEnum<TPixel>(TestImageProvider<TPixel> provider, RotateType value)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage())

BIN
tests/Images/Input/Png/Bike.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

After

Width:  |  Height:  |  Size: 286 KiB

BIN
tests/Images/Input/Png/BikeGrayscale.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Loading…
Cancel
Save