From c2c2ee17c8142794f507dc39eb77ad49cc9aee86 Mon Sep 17 00:00:00 2001 From: Thomas Broust Date: Tue, 24 Feb 2015 17:49:20 +0100 Subject: [PATCH] Adds empty classes for rotation Former-commit-id: ae1370a66e44c69a8d0617838e5f3c0be88ebe5f Former-commit-id: 8dc8301d648ae349d7923fbb3c2a28ae3785cc56 --- src/ImageProcessor/ImageFactory.cs | 17 +++++++ src/ImageProcessor/ImageProcessor.csproj | 1 + src/ImageProcessor/Processors/RotateInside.cs | 46 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 src/ImageProcessor/Processors/RotateInside.cs diff --git a/src/ImageProcessor/ImageFactory.cs b/src/ImageProcessor/ImageFactory.cs index 6ac5e542e..a4f132325 100644 --- a/src/ImageProcessor/ImageFactory.cs +++ b/src/ImageProcessor/ImageFactory.cs @@ -895,6 +895,23 @@ namespace ImageProcessor return this; } + /// + /// Rotates the image inside its area; keeps the area straight. + /// + /// The angle at which to rotate the image in degrees + /// The current instance of the class. + /// + public ImageFactory RotateInside(float degrees) + { + if (this.ShouldProcess) + { + RotateInside rotate = new RotateInside { DynamicParameter = degrees }; + this.CurrentImageFormat.ApplyProcessor(rotate.ProcessImage, this); + } + + return this; + } + /// /// Adds rounded corners to the current image. /// diff --git a/src/ImageProcessor/ImageProcessor.csproj b/src/ImageProcessor/ImageProcessor.csproj index 88d010e60..c5187d3ed 100644 --- a/src/ImageProcessor/ImageProcessor.csproj +++ b/src/ImageProcessor/ImageProcessor.csproj @@ -233,6 +233,7 @@ + diff --git a/src/ImageProcessor/Processors/RotateInside.cs b/src/ImageProcessor/Processors/RotateInside.cs new file mode 100644 index 000000000..919f846b4 --- /dev/null +++ b/src/ImageProcessor/Processors/RotateInside.cs @@ -0,0 +1,46 @@ +// -------------------------------------------------------------------------------------------------------------------- +// +// Copyright (c) James South. +// Licensed under the Apache License, Version 2.0. +// +// +// Encapsulates methods to rotate an image. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace ImageProcessor.Processors +{ + using System; + using System.Collections.Generic; + using System.Drawing; + + /// + /// Encapsulates the methods to rotate the inside of an image + /// + public class RotateInside : IGraphicsProcessor + { + /// + /// Gets or sets the DynamicParameter. + /// + public dynamic DynamicParameter { get; set; } + + /// + /// Gets or sets any additional settings required by the processor. + /// + public Dictionary Settings { get; set; } + + /// + /// Processes the image. + /// + /// The current instance of the class containing + /// the image to process. + /// + /// The processed image from the current instance of the class. + /// + public Image ProcessImage(ImageFactory factory) + { + // TODO: Implement this method + throw new NotImplementedException(); + } + } +} \ No newline at end of file