Browse Source

Renamed AutoRotateProcessor to AutoOrientProcessor.

af/merge-core
Dirk Lemstra 9 years ago
parent
commit
b81af72fb4
  1. 8
      src/ImageSharp/Processing/Processors/Transforms/AutoOrientProcessor.cs
  2. 5
      src/ImageSharp/Processing/Transforms/AutoOrient.cs
  3. 7
      tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs

8
src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs → src/ImageSharp/Processing/Processors/Transforms/AutoOrientProcessor.cs

@ -2,8 +2,6 @@
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System; using System;
using System.Threading.Tasks;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.Primitives; using SixLabors.Primitives;
@ -14,13 +12,13 @@ namespace SixLabors.ImageSharp.Processing.Processors
/// 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> /// <typeparam name="TPixel">The pixel format.</typeparam>
internal class AutoRotateProcessor<TPixel> : ImageProcessor<TPixel> internal class AutoOrientProcessor<TPixel> : ImageProcessor<TPixel>
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="AutoRotateProcessor{TPixel}"/> class. /// Initializes a new instance of the <see cref="AutoOrientProcessor{TPixel}"/> class.
/// </summary> /// </summary>
public AutoRotateProcessor() public AutoOrientProcessor()
{ {
} }

5
src/ImageSharp/Processing/Transforms/AutoOrient.cs

@ -1,9 +1,8 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System;
using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors;
namespace SixLabors.ImageSharp namespace SixLabors.ImageSharp
{ {
@ -20,6 +19,6 @@ namespace SixLabors.ImageSharp
/// <returns>The <see cref="Image{TPixel}"/></returns> /// <returns>The <see cref="Image{TPixel}"/></returns>
public static IImageProcessingContext<TPixel> AutoOrient<TPixel>(this IImageProcessingContext<TPixel> source) public static IImageProcessingContext<TPixel> AutoOrient<TPixel>(this IImageProcessingContext<TPixel> source)
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
=> source.ApplyProcessor(new Processing.Processors.AutoRotateProcessor<TPixel>()); => source.ApplyProcessor(new AutoOrientProcessor<TPixel>());
} }
} }

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

@ -1,9 +1,6 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors; using SixLabors.ImageSharp.Processing.Processors;
using Xunit; using Xunit;
@ -12,10 +9,10 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms
public class AutoOrientTests : BaseImageOperationsExtensionTest public class AutoOrientTests : BaseImageOperationsExtensionTest
{ {
[Fact] [Fact]
public void AutoOrient_AutoRotateProcessor() public void AutoOrient_AutoOrientProcessor()
{ {
this.operations.AutoOrient(); this.operations.AutoOrient();
this.Verify<AutoRotateProcessor<Rgba32>>(); this.Verify<AutoOrientProcessor<Rgba32>>();
} }
} }
} }
Loading…
Cancel
Save