Browse Source

Adds empty classes for rotation

Former-commit-id: ae1370a66e44c69a8d0617838e5f3c0be88ebe5f
Former-commit-id: 8dc8301d648ae349d7923fbb3c2a28ae3785cc56
af/merge-core
Thomas Broust 11 years ago
parent
commit
c2c2ee17c8
  1. 17
      src/ImageProcessor/ImageFactory.cs
  2. 1
      src/ImageProcessor/ImageProcessor.csproj
  3. 46
      src/ImageProcessor/Processors/RotateInside.cs

17
src/ImageProcessor/ImageFactory.cs

@ -895,6 +895,23 @@ namespace ImageProcessor
return this;
}
/// <summary>
/// Rotates the image inside its area; keeps the area straight.
/// </summary>
/// <param name="degrees">The angle at which to rotate the image in degrees</param>
/// The current instance of the <see cref="T:ImageProcessor.ImageFactory"/> class.
/// </returns>
public ImageFactory RotateInside(float degrees)
{
if (this.ShouldProcess)
{
RotateInside rotate = new RotateInside { DynamicParameter = degrees };
this.CurrentImageFormat.ApplyProcessor(rotate.ProcessImage, this);
}
return this;
}
/// <summary>
/// Adds rounded corners to the current image.
/// </summary>

1
src/ImageProcessor/ImageProcessor.csproj

@ -233,6 +233,7 @@
<Compile Include="Processors\Overlay.cs" />
<Compile Include="Processors\Pixelate.cs" />
<Compile Include="Processors\ReplaceColor.cs" />
<Compile Include="Processors\RotateInside.cs" />
<Compile Include="Processors\RoundedCorners.cs" />
<Compile Include="Processors\Saturation.cs" />
<Compile Include="Processors\Flip.cs" />

46
src/ImageProcessor/Processors/RotateInside.cs

@ -0,0 +1,46 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Rotate.cs" company="James South">
// Copyright (c) James South.
// Licensed under the Apache License, Version 2.0.
// </copyright>
// <summary>
// Encapsulates methods to rotate an image.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Processors
{
using System;
using System.Collections.Generic;
using System.Drawing;
/// <summary>
/// Encapsulates the methods to rotate the inside of an image
/// </summary>
public class RotateInside : IGraphicsProcessor
{
/// <summary>
/// Gets or sets the DynamicParameter.
/// </summary>
public dynamic DynamicParameter { get; set; }
/// <summary>
/// Gets or sets any additional settings required by the processor.
/// </summary>
public Dictionary<string, string> Settings { get; set; }
/// <summary>
/// Processes the image.
/// </summary>
/// <param name="factory">The current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class containing
/// the image to process.</param>
/// <returns>
/// The processed image from the current instance of the <see cref="T:ImageProcessor.ImageFactory" /> class.
/// </returns>
public Image ProcessImage(ImageFactory factory)
{
// TODO: Implement this method
throw new NotImplementedException();
}
}
}
Loading…
Cancel
Save