Browse Source

Merge branch 'af/non-generic-image-baseclass' into af/general-color-type

pull/908/head
Anton Firszov 7 years ago
parent
commit
aed78fd94f
  1. 10
      src/ImageSharp/Processing/AutoOrientExtensions.cs
  2. 2
      tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs

10
src/ImageSharp/Processing/AutoOrientExtensions.cs

@ -7,7 +7,7 @@ using SixLabors.ImageSharp.Processing.Processors.Transforms;
namespace SixLabors.ImageSharp.Processing namespace SixLabors.ImageSharp.Processing
{ {
/// <summary> /// <summary>
/// Defines extensions that allow the application of auto-orientation operations to an <see cref="Image{TPixel}"/> /// Defines extensions that allow the application of auto-orientation operations to an <see cref="Image"/>
/// using Mutate/Clone. /// using Mutate/Clone.
/// </summary> /// </summary>
public static class AutoOrientExtensions public static class AutoOrientExtensions
@ -15,11 +15,9 @@ namespace SixLabors.ImageSharp.Processing
/// <summary> /// <summary>
/// Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. /// Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image.
/// </summary> /// </summary>
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <param name="source">The image to auto rotate.</param> /// <param name="source">The image to auto rotate.</param>
/// <returns>The <see cref="Image{TPixel}"/></returns> /// <returns>The <see cref="IImageProcessingContext"/> to allow chaining of operations.</returns>
public static IImageProcessingContext<TPixel> AutoOrient<TPixel>(this IImageProcessingContext<TPixel> source) public static IImageProcessingContext AutoOrient(this IImageProcessingContext source)
where TPixel : struct, IPixel<TPixel> => source.ApplyProcessor(new AutoOrientProcessor());
=> source.ApplyProcessor(new AutoOrientProcessor<TPixel>());
} }
} }

2
tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs

@ -16,7 +16,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms
public void AutoOrient_AutoOrientProcessor() public void AutoOrient_AutoOrientProcessor()
{ {
this.operations.AutoOrient(); this.operations.AutoOrient();
this.Verify<AutoOrientProcessor<Rgba32>>(); this.Verify<AutoOrientProcessor>();
} }
} }
} }
Loading…
Cancel
Save