From 113ff65a7063bfafd48c301b235656e140444ceb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 30 Dec 2016 18:53:53 +1100 Subject: [PATCH] Simplify proecessing code --- .../Image/ImageProcessingExtensions.cs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/ImageSharp/Image/ImageProcessingExtensions.cs b/src/ImageSharp/Image/ImageProcessingExtensions.cs index 3d33e73c45..68a3ab2160 100644 --- a/src/ImageSharp/Image/ImageProcessingExtensions.cs +++ b/src/ImageSharp/Image/ImageProcessingExtensions.cs @@ -41,27 +41,14 @@ namespace ImageSharp internal static Image Process(this Image source, Rectangle sourceRectangle, IImageProcessor processor) where TColor : struct, IPackedPixel, IEquatable { - return PerformAction(source, (sourceImage) => processor.Apply(sourceImage, sourceRectangle)); - } - - /// - /// Performs the given action on the source image. - /// - /// The pixel format. - /// The image to perform the action against. - /// The to perform against the image. - /// The . - private static Image PerformAction(Image source, Action> action) - where TColor : struct, IPackedPixel, IEquatable - { - action(source); + processor.Apply(source, sourceRectangle); foreach (ImageFrame sourceFrame in source.Frames) { - action(sourceFrame); + processor.Apply(sourceFrame, sourceRectangle); } return source; } } -} +} \ No newline at end of file