diff --git a/src/ImageSharp/Image/ImageFrameCollection.cs b/src/ImageSharp/Image/ImageFrameCollection.cs index aefeacce15..e85e67c741 100644 --- a/src/ImageSharp/Image/ImageFrameCollection.cs +++ b/src/ImageSharp/Image/ImageFrameCollection.cs @@ -10,7 +10,7 @@ using SixLabors.ImageSharp.PixelFormats; namespace SixLabors.ImageSharp { /// - /// Encapsulates an imaged collection of frames. + /// Encapsulates a collection of frames that make up an image. /// /// The type of the pixel. internal sealed class ImageFrameCollection : IImageFrameCollection @@ -51,10 +51,7 @@ namespace SixLabors.ImageSharp public ImageFrame RootFrame => this.frames.Count > 0 ? this.frames[0] : null; /// - public ImageFrame this[int index] - { - get => this.frames[index]; - } + public ImageFrame this[int index] => this.frames[index]; /// public int IndexOf(ImageFrame frame) => this.frames.IndexOf(frame); diff --git a/src/ImageSharp/Processing/Convolution/Processors/GaussianBlurProcessor.cs b/src/ImageSharp/Processing/Convolution/Processors/GaussianBlurProcessor.cs index 328f572352..9b3ad51b7d 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/GaussianBlurProcessor.cs +++ b/src/ImageSharp/Processing/Convolution/Processors/GaussianBlurProcessor.cs @@ -24,7 +24,7 @@ namespace SixLabors.ImageSharp.Processing.Convolution.Processors /// Initializes a new instance of the class. /// /// The 'sigma' value representing the weight of the blur. - public GaussianBlurProcessor(float sigma = 3f) + public GaussianBlurProcessor(float sigma = 3F) { this.kernelSize = ((int)Math.Ceiling(sigma) * 2) + 1; this.Sigma = sigma; diff --git a/src/ImageSharp/Processing/Convolution/Processors/GaussianSharpenProcessor.cs b/src/ImageSharp/Processing/Convolution/Processors/GaussianSharpenProcessor.cs index df5026db0a..bb55e60c9b 100644 --- a/src/ImageSharp/Processing/Convolution/Processors/GaussianSharpenProcessor.cs +++ b/src/ImageSharp/Processing/Convolution/Processors/GaussianSharpenProcessor.cs @@ -26,7 +26,7 @@ namespace SixLabors.ImageSharp.Processing.Convolution.Processors /// /// The 'sigma' value representing the weight of the sharpening. /// - public GaussianSharpenProcessor(float sigma = 3f) + public GaussianSharpenProcessor(float sigma = 3F) { this.kernelSize = ((int)Math.Ceiling(sigma) * 2) + 1; this.Sigma = sigma; diff --git a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs index e7a9fc3f76..ec342dd9fe 100644 --- a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs @@ -51,7 +51,7 @@ namespace SixLabors.ImageSharp.Processing.Processors #else catch (Exception ex) { - throw new ImageProcessingException($"An error occured when processing the image using {this.GetType().Name}. See the inner exception for more detail.", ex); + throw new ImageProcessingException($"An error occurred when processing the image using {this.GetType().Name}. See the inner exception for more detail.", ex); #endif } } diff --git a/src/ImageSharp/Processing/Transforms/Options/AnchorPosition.cs b/src/ImageSharp/Processing/Transforms/AnchorPosition.cs similarity index 96% rename from src/ImageSharp/Processing/Transforms/Options/AnchorPosition.cs rename to src/ImageSharp/Processing/Transforms/AnchorPosition.cs index 263af14ccd..4519f90f94 100644 --- a/src/ImageSharp/Processing/Transforms/Options/AnchorPosition.cs +++ b/src/ImageSharp/Processing/Transforms/AnchorPosition.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Enumerated anchor positions to apply to resized images. diff --git a/src/ImageSharp/Processing/Transforms/AutoOrient.cs b/src/ImageSharp/Processing/Transforms/AutoOrientExtensions.cs similarity index 74% rename from src/ImageSharp/Processing/Transforms/AutoOrient.cs rename to src/ImageSharp/Processing/Transforms/AutoOrientExtensions.cs index b8b31ff278..d3ac16708a 100644 --- a/src/ImageSharp/Processing/Transforms/AutoOrient.cs +++ b/src/ImageSharp/Processing/Transforms/AutoOrientExtensions.cs @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Transforms.Processors; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of auto-orientation operations to the type. /// - public static partial class ImageExtensions + public static class AutoOrientExtensions { /// /// Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs b/src/ImageSharp/Processing/Transforms/BicubicResampler.cs similarity index 87% rename from src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs rename to src/ImageSharp/Processing/Transforms/BicubicResampler.cs index be9de9edaa..5a48fd4ad3 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs +++ b/src/ImageSharp/Processing/Transforms/BicubicResampler.cs @@ -1,12 +1,12 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the bicubic kernel algorithm W(x) as described on /// Wikipedia - /// A commonly used algorithm within imageprocessing that preserves sharpness better than triangle interpolation. + /// A commonly used algorithm within image processing that preserves sharpness better than triangle interpolation. /// public class BicubicResampler : IResampler { @@ -38,4 +38,4 @@ namespace SixLabors.ImageSharp.Processing return result; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs b/src/ImageSharp/Processing/Transforms/BoxResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs rename to src/ImageSharp/Processing/Transforms/BoxResampler.cs index 5aab0d07fa..fa31ac4fb5 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs +++ b/src/ImageSharp/Processing/Transforms/BoxResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the box algorithm. Similar to nearest neighbor when upscaling. @@ -23,4 +23,4 @@ namespace SixLabors.ImageSharp.Processing return 0; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs b/src/ImageSharp/Processing/Transforms/CatmullRomResampler.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs rename to src/ImageSharp/Processing/Transforms/CatmullRomResampler.cs index 1c84676188..03723823bb 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs +++ b/src/ImageSharp/Processing/Transforms/CatmullRomResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The Catmull-Rom filter is a well known standard Cubic Filter often used as a interpolation function. @@ -23,4 +23,4 @@ namespace SixLabors.ImageSharp.Processing return ImageMaths.GetBcValue(x, B, C); } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Crop.cs b/src/ImageSharp/Processing/Transforms/CropExtensions.cs similarity index 78% rename from src/ImageSharp/Processing/Transforms/Crop.cs rename to src/ImageSharp/Processing/Transforms/CropExtensions.cs index 3fa59c2483..9e347f51cb 100644 --- a/src/ImageSharp/Processing/Transforms/Crop.cs +++ b/src/ImageSharp/Processing/Transforms/CropExtensions.cs @@ -1,17 +1,16 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Transforms.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of cropping operations to the type. /// - public static partial class ImageExtensions + public static class CropExtensions { /// /// Crops an image to the given width and height. @@ -23,7 +22,7 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext Crop(this IImageProcessingContext source, int width, int height) where TPixel : struct, IPixel - => Crop(source, new Rectangle(0, 0, width, height)); + => Crop(source, new Rectangle(0, 0, width, height)); /// /// Crops an image to the given rectangle. @@ -36,6 +35,6 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext Crop(this IImageProcessingContext source, Rectangle cropRectangle) where TPixel : struct, IPixel - => source.ApplyProcessor(new CropProcessor(cropRectangle)); + => source.ApplyProcessor(new CropProcessor(cropRectangle)); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs b/src/ImageSharp/Processing/Transforms/EntropyCrop.cs deleted file mode 100644 index cbd2b46599..0000000000 --- a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Six Labors and contributors. -// Licensed under the Apache License, Version 2.0. - -using System; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; - -namespace SixLabors.ImageSharp -{ - /// - /// Extension methods for the type. - /// - public static partial class ImageExtensions - { - /// - /// Crops an image to the area of greatest entropy. - /// - /// The pixel format. - /// The image to crop. - /// The threshold for entropic density. - /// The - public static IImageProcessingContext EntropyCrop(this IImageProcessingContext source, float threshold = .5f) - where TPixel : struct, IPixel - => source.ApplyProcessor(new EntropyCropProcessor(threshold)); - } -} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/EntropyCropExtensions.cs b/src/ImageSharp/Processing/Transforms/EntropyCropExtensions.cs new file mode 100644 index 0000000000..3ca4c72bc1 --- /dev/null +++ b/src/ImageSharp/Processing/Transforms/EntropyCropExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Transforms.Processors; + +namespace SixLabors.ImageSharp.Processing.Transforms +{ + /// + /// Adds extensions that allow the application of entropy cropping operations to the type. + /// + public static class EntropyCropExtensions + { + /// + /// Crops an image to the area of greatest entropy using a threshold for entropic density of .5F. + /// + /// The pixel format. + /// The image to crop. + /// The + public static IImageProcessingContext EntropyCrop(this IImageProcessingContext source) + where TPixel : struct, IPixel + => source.ApplyProcessor(new EntropyCropProcessor()); + + /// + /// Crops an image to the area of greatest entropy. + /// + /// The pixel format. + /// The image to crop. + /// The threshold for entropic density. + /// The + public static IImageProcessingContext EntropyCrop(this IImageProcessingContext source, float threshold) + where TPixel : struct, IPixel + => source.ApplyProcessor(new EntropyCropProcessor(threshold)); + } +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Flip.cs b/src/ImageSharp/Processing/Transforms/FlipExtensions.cs similarity index 69% rename from src/ImageSharp/Processing/Transforms/Flip.cs rename to src/ImageSharp/Processing/Transforms/FlipExtensions.cs index e153e89f28..e88074c137 100644 --- a/src/ImageSharp/Processing/Transforms/Flip.cs +++ b/src/ImageSharp/Processing/Transforms/FlipExtensions.cs @@ -1,17 +1,15 @@ // Copyright (c) Six Labors and contributors. // 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.Transforms.Processors; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of flipping operations to the type. /// - public static partial class ImageExtensions + public static class FlipExtensions { /// /// Flips an image by the given instructions. @@ -22,6 +20,6 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext Flip(this IImageProcessingContext source, FlipType flipType) where TPixel : struct, IPixel - => source.ApplyProcessor(new FlipProcessor(flipType)); + => source.ApplyProcessor(new FlipProcessor(flipType)); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Options/FlipType.cs b/src/ImageSharp/Processing/Transforms/FlipType.cs similarity index 90% rename from src/ImageSharp/Processing/Transforms/Options/FlipType.cs rename to src/ImageSharp/Processing/Transforms/FlipType.cs index 0129891f66..71a4e6fc8f 100644 --- a/src/ImageSharp/Processing/Transforms/Options/FlipType.cs +++ b/src/ImageSharp/Processing/Transforms/FlipType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Provides enumeration over how a image should be flipped. @@ -23,4 +23,4 @@ namespace SixLabors.ImageSharp.Processing /// Vertical, } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs b/src/ImageSharp/Processing/Transforms/HermiteResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs rename to src/ImageSharp/Processing/Transforms/HermiteResampler.cs index 33435059f1..f41c03e2db 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs +++ b/src/ImageSharp/Processing/Transforms/HermiteResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The Hermite filter is type of smoothed triangular interpolation Filter, @@ -22,4 +22,4 @@ namespace SixLabors.ImageSharp.Processing return ImageMaths.GetBcValue(x, B, C); } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs b/src/ImageSharp/Processing/Transforms/IResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs rename to src/ImageSharp/Processing/Transforms/IResampler.cs index 9a128a05be..fd23a4644d 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs +++ b/src/ImageSharp/Processing/Transforms/IResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Encapsulates an interpolation algorithm for resampling images. @@ -22,4 +22,4 @@ namespace SixLabors.ImageSharp.Processing /// float GetValue(float x); } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs b/src/ImageSharp/Processing/Transforms/Lanczos2Resampler.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs rename to src/ImageSharp/Processing/Transforms/Lanczos2Resampler.cs index 29568db021..c78926ed23 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs +++ b/src/ImageSharp/Processing/Transforms/Lanczos2Resampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the Lanczos kernel algorithm as described on @@ -29,4 +29,4 @@ namespace SixLabors.ImageSharp.Processing return 0F; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs b/src/ImageSharp/Processing/Transforms/Lanczos3Resampler.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs rename to src/ImageSharp/Processing/Transforms/Lanczos3Resampler.cs index 492ef69e4c..b6d08fc530 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs +++ b/src/ImageSharp/Processing/Transforms/Lanczos3Resampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the Lanczos kernel algorithm as described on @@ -29,4 +29,4 @@ namespace SixLabors.ImageSharp.Processing return 0F; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs b/src/ImageSharp/Processing/Transforms/Lanczos5Resampler.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs rename to src/ImageSharp/Processing/Transforms/Lanczos5Resampler.cs index cae152a53c..b8055f6ce9 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs +++ b/src/ImageSharp/Processing/Transforms/Lanczos5Resampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the Lanczos kernel algorithm as described on @@ -29,4 +29,4 @@ namespace SixLabors.ImageSharp.Processing return 0F; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs b/src/ImageSharp/Processing/Transforms/Lanczos8Resampler.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs rename to src/ImageSharp/Processing/Transforms/Lanczos8Resampler.cs index b390c55419..39afe11bbf 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs +++ b/src/ImageSharp/Processing/Transforms/Lanczos8Resampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the Lanczos kernel algorithm as described on @@ -29,4 +29,4 @@ namespace SixLabors.ImageSharp.Processing return 0F; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs b/src/ImageSharp/Processing/Transforms/MitchellNetravaliResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs rename to src/ImageSharp/Processing/Transforms/MitchellNetravaliResampler.cs index df351d9505..0b1685e110 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs +++ b/src/ImageSharp/Processing/Transforms/MitchellNetravaliResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the mitchell algorithm as described on @@ -21,4 +21,4 @@ namespace SixLabors.ImageSharp.Processing return ImageMaths.GetBcValue(x, B, C); } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs b/src/ImageSharp/Processing/Transforms/NearestNeighborResampler.cs similarity index 90% rename from src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs rename to src/ImageSharp/Processing/Transforms/NearestNeighborResampler.cs index 7a7785be36..c0f019a88d 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs +++ b/src/ImageSharp/Processing/Transforms/NearestNeighborResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the nearest neighbor algorithm. This uses an unscaled filter @@ -18,4 +18,4 @@ namespace SixLabors.ImageSharp.Processing return x; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Options/Orientation.cs b/src/ImageSharp/Processing/Transforms/OrientationType.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Options/Orientation.cs rename to src/ImageSharp/Processing/Transforms/OrientationType.cs index 9c8d96a71c..752ac9fe68 100644 --- a/src/ImageSharp/Processing/Transforms/Options/Orientation.cs +++ b/src/ImageSharp/Processing/Transforms/OrientationType.cs @@ -1,12 +1,12 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Enumerates the available orientation values supplied by EXIF metadata. /// - internal enum Orientation : ushort + internal enum OrientationType : ushort { /// /// Unknown rotation. diff --git a/src/ImageSharp/Processing/Transforms/Pad.cs b/src/ImageSharp/Processing/Transforms/PadExtensions.cs similarity index 80% rename from src/ImageSharp/Processing/Transforms/Pad.cs rename to src/ImageSharp/Processing/Transforms/PadExtensions.cs index 1c990f82ea..7d26cba620 100644 --- a/src/ImageSharp/Processing/Transforms/Pad.cs +++ b/src/ImageSharp/Processing/Transforms/PadExtensions.cs @@ -2,15 +2,14 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; using SixLabors.Primitives; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of padding operations to the type. /// - public static partial class ImageExtensions + public static class PadExtensions { /// /// Evenly pads an image to fit the new dimensions. @@ -30,7 +29,7 @@ namespace SixLabors.ImageSharp Sampler = Resamplers.NearestNeighbor }; - return Resize(source, options); + return source.Resize(options); } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Processors/AffineTransformProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/AffineTransformProcessor.cs index 864001d075..3846379cd7 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/AffineTransformProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/AffineTransformProcessor.cs @@ -12,7 +12,7 @@ using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// Provides the base methods to perform affine transforms on an image. @@ -208,8 +208,6 @@ namespace SixLabors.ImageSharp.Processing.Processors /// The . /// protected virtual Matrix3x2 GetProcessingMatrix(Rectangle sourceRectangle, Rectangle destinationRectangle) - { - return this.TransformMatrix; - } + => this.TransformMatrix; } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs index c118a7e866..a0a5bfa770 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/AutoOrientProcessor.cs @@ -6,7 +6,7 @@ using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. @@ -18,42 +18,42 @@ namespace SixLabors.ImageSharp.Processing.Processors /// protected override void BeforeImageApply(Image source, Rectangle sourceRectangle) { - Orientation orientation = GetExifOrientation(source); + OrientationType orientation = GetExifOrientation(source); Size size = sourceRectangle.Size; switch (orientation) { - case Orientation.TopRight: + case OrientationType.TopRight: new FlipProcessor(FlipType.Horizontal).Apply(source, sourceRectangle); break; - case Orientation.BottomRight: + case OrientationType.BottomRight: new RotateProcessor((int)RotateType.Rotate180, size).Apply(source, sourceRectangle); break; - case Orientation.BottomLeft: + case OrientationType.BottomLeft: new FlipProcessor(FlipType.Vertical).Apply(source, sourceRectangle); break; - case Orientation.LeftTop: + case OrientationType.LeftTop: new RotateProcessor((int)RotateType.Rotate90, size).Apply(source, sourceRectangle); new FlipProcessor(FlipType.Horizontal).Apply(source, sourceRectangle); break; - case Orientation.RightTop: + case OrientationType.RightTop: new RotateProcessor((int)RotateType.Rotate90, size).Apply(source, sourceRectangle); break; - case Orientation.RightBottom: + case OrientationType.RightBottom: new FlipProcessor(FlipType.Vertical).Apply(source, sourceRectangle); new RotateProcessor((int)RotateType.Rotate270, size).Apply(source, sourceRectangle); break; - case Orientation.LeftBottom: + case OrientationType.LeftBottom: new RotateProcessor((int)RotateType.Rotate270, size).Apply(source, sourceRectangle); break; - case Orientation.Unknown: - case Orientation.TopLeft: + case OrientationType.Unknown: + case OrientationType.TopLeft: default: break; } @@ -62,39 +62,39 @@ namespace SixLabors.ImageSharp.Processing.Processors /// protected override void OnFrameApply(ImageFrame sourceBase, Rectangle sourceRectangle, Configuration config) { - // all processing happens at the image level within BeforeImageApply(); + // All processing happens at the image level within BeforeImageApply(); } /// /// Returns the current EXIF orientation /// /// The image to auto rotate. - /// The - private static Orientation GetExifOrientation(Image source) + /// The + private static OrientationType GetExifOrientation(Image source) { if (source.MetaData.ExifProfile == null) { - return Orientation.Unknown; + return OrientationType.Unknown; } ExifValue value = source.MetaData.ExifProfile.GetValue(ExifTag.Orientation); if (value == null) { - return Orientation.Unknown; + return OrientationType.Unknown; } - Orientation orientation; + OrientationType orientation; if (value.DataType == ExifDataType.Short) { - orientation = (Orientation)value.Value; + orientation = (OrientationType)value.Value; } else { - orientation = (Orientation)Convert.ToUInt16(value.Value); + orientation = (OrientationType)Convert.ToUInt16(value.Value); source.MetaData.ExifProfile.RemoveValue(ExifTag.Orientation); } - source.MetaData.ExifProfile.SetValue(ExifTag.Orientation, (ushort)Orientation.TopLeft); + source.MetaData.ExifProfile.SetValue(ExifTag.Orientation, (ushort)OrientationType.TopLeft); return orientation; } diff --git a/src/ImageSharp/Processing/Transforms/Processors/CenteredAffineTransformProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/CenteredAffineTransformProcessor.cs index 6b8314d172..b9a4a6a76a 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/CenteredAffineTransformProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/CenteredAffineTransformProcessor.cs @@ -5,7 +5,7 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// A base class that provides methods to allow the automatic centering of affine transforms @@ -27,9 +27,7 @@ namespace SixLabors.ImageSharp.Processing.Processors /// protected override Matrix3x2 GetProcessingMatrix(Rectangle sourceRectangle, Rectangle destinationRectangle) - { - return TransformHelpers.GetCenteredTransformMatrix(sourceRectangle, destinationRectangle, this.TransformMatrix); - } + => TransformHelpers.GetCenteredTransformMatrix(sourceRectangle, destinationRectangle, this.TransformMatrix); private static Size GetTransformedDimensions(Size sourceDimensions, Matrix3x2 matrix) { diff --git a/src/ImageSharp/Processing/Transforms/Processors/CenteredProjectiveTransformProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/CenteredProjectiveTransformProcessor.cs index 081ea84610..513e6da323 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/CenteredProjectiveTransformProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/CenteredProjectiveTransformProcessor.cs @@ -5,7 +5,7 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// A base class that provides methods to allow the automatic centering of non-affine transforms diff --git a/src/ImageSharp/Processing/Transforms/Processors/CropProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/CropProcessor.cs index ff5011bdbe..5462b34dca 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/CropProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/CropProcessor.cs @@ -2,20 +2,21 @@ // Licensed under the Apache License, Version 2.0. using System; +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -// TODO: Convert this into a cloning processor inheriting TransformProcessor once Anton's memory PR is merged -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// Provides methods to allow the cropping of an image. /// /// The pixel format. - internal class CropProcessor : ImageProcessor + internal class CropProcessor : TransformProcessorBase where TPixel : struct, IPixel { /// @@ -33,10 +34,23 @@ namespace SixLabors.ImageSharp.Processing.Processors public Rectangle CropRectangle { get; } /// - protected override void OnFrameApply(ImageFrame source, Rectangle sourceRectangle, Configuration configuration) + protected override Image CreateDestination(Image source, Rectangle sourceRectangle) { - if (this.CropRectangle == sourceRectangle) + // We will always be creating the clone even for mutate because we may need to resize the canvas + IEnumerable> frames = source.Frames.Select(x => new ImageFrame(source.GetMemoryManager(), this.CropRectangle.Width, this.CropRectangle.Height, x.MetaData.Clone())); + + // Use the overload to prevent an extra frame being added + return new Image(source.GetConfiguration(), source.MetaData.Clone(), frames); + } + + /// + protected override void OnFrameApply(ImageFrame source, ImageFrame destination, Rectangle sourceRectangle, Configuration configuration) + { + // Handle resize dimensions identical to the original + if (source.Width == destination.Width && source.Height == destination.Height && sourceRectangle == this.CropRectangle) { + // the cloned will be blank here copy all the pixel data over + source.GetPixelSpan().CopyTo(destination.GetPixelSpan()); return; } @@ -45,25 +59,16 @@ namespace SixLabors.ImageSharp.Processing.Processors int minX = Math.Max(this.CropRectangle.X, sourceRectangle.X); int maxX = Math.Min(this.CropRectangle.Right, sourceRectangle.Right); - using (Buffer2D targetPixels = configuration.MemoryManager.Allocate2D(this.CropRectangle.Size)) - { - Parallel.For( - minY, - maxY, - configuration.ParallelOptions, - y => - { - Span sourceRow = source.GetPixelRowSpan(y).Slice(minX); - Span targetRow = targetPixels.GetRowSpan(y - minY); - SpanHelper.Copy(sourceRow, targetRow, maxX - minX); - }); - - Buffer2D.SwapContents(source.PixelBuffer, targetPixels); - } + Parallel.For( + minY, + maxY, + configuration.ParallelOptions, + y => + { + Span sourceRow = source.GetPixelRowSpan(y).Slice(minX); + Span targetRow = destination.GetPixelRowSpan(y - minY); + SpanHelper.Copy(sourceRow, targetRow, maxX - minX); + }); } - - /// - protected override void AfterImageApply(Image source, Rectangle sourceRectangle) - => TransformHelpers.UpdateDimensionalMetData(source); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Processors/EntropyCropProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/EntropyCropProcessor.cs index f263209026..668d73690d 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/EntropyCropProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/EntropyCropProcessor.cs @@ -1,22 +1,29 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; +using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Binarization.Processors; using SixLabors.ImageSharp.Processing.Convolution.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// - /// Provides methods to allow the cropping of an image to preserve areas of highest - /// entropy. + /// Provides methods to allow the cropping of an image to preserve areas of highest entropy. /// /// The pixel format. internal class EntropyCropProcessor : ImageProcessor where TPixel : struct, IPixel { + /// + /// Initializes a new instance of the class. + /// + public EntropyCropProcessor() + : this(.5F) + { + } + /// /// Initializes a new instance of the class. /// @@ -26,20 +33,25 @@ namespace SixLabors.ImageSharp.Processing.Processors /// public EntropyCropProcessor(float threshold) { - Guard.MustBeBetweenOrEqualTo(threshold, 0, 1, nameof(threshold)); + Guard.MustBeBetweenOrEqualTo(threshold, 0, 1F, nameof(threshold)); this.Threshold = threshold; } /// - /// Gets the threshold value. + /// Gets the entropy threshold value. /// public float Threshold { get; } /// - protected override void OnFrameApply(ImageFrame source, Rectangle sourceRectangle, Configuration configuration) + protected override void BeforeImageApply(Image source, Rectangle sourceRectangle) { - using (ImageFrame temp = source.Clone()) + Rectangle rectangle; + + // All frames have be the same size so we only need to calculate the correct dimensions for the first frame + using (ImageFrame temp = source.Frames.RootFrame.Clone()) { + Configuration configuration = source.GetConfiguration(); + // Detect the edges. new SobelProcessor(false).Apply(temp, sourceRectangle, configuration); @@ -47,15 +59,16 @@ namespace SixLabors.ImageSharp.Processing.Processors new BinaryThresholdProcessor(this.Threshold).Apply(temp, sourceRectangle, configuration); // Search for the first white pixels - Rectangle rectangle = ImageMaths.GetFilteredBoundingRectangle(temp, 0); + rectangle = ImageMaths.GetFilteredBoundingRectangle(temp, 0); + } - if (rectangle == sourceRectangle) - { - return; - } + new CropProcessor(rectangle).Apply(source, sourceRectangle); + } - new CropProcessor(rectangle).Apply(source, sourceRectangle, configuration); - } + /// + protected override void OnFrameApply(ImageFrame sourceBase, Rectangle sourceRectangle, Configuration config) + { + // All processing happens at the image level within BeforeImageApply(); } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs index 6c2705979d..28c1c97946 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/FlipProcessor.cs @@ -9,7 +9,7 @@ using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// Provides methods that allow the flipping of an image around its center point. @@ -48,8 +48,7 @@ namespace SixLabors.ImageSharp.Processing.Processors } /// - /// Swaps the image at the X-axis, which goes horizontally through the middle - /// at half the height of the image. + /// Swaps the image at the X-axis, which goes horizontally through the middle at half the height of the image. /// /// The source image to apply the process to. /// The configuration. @@ -81,8 +80,7 @@ namespace SixLabors.ImageSharp.Processing.Processors } /// - /// Swaps the image at the Y-axis, which goes vertically through the middle - /// at half of the width of the image. + /// Swaps the image at the Y-axis, which goes vertically through the middle at half of the width of the image. /// /// The source image to apply the process to. /// The configuration. diff --git a/src/ImageSharp/Processing/Transforms/Processors/InterpolatedTransformProcessorBase.cs b/src/ImageSharp/Processing/Transforms/Processors/InterpolatedTransformProcessorBase.cs index 27f9a1ace6..303713d6ce 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/InterpolatedTransformProcessorBase.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/InterpolatedTransformProcessorBase.cs @@ -5,7 +5,7 @@ using System; using System.Runtime.CompilerServices; using SixLabors.ImageSharp.PixelFormats; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// The base class for performing interpolated affine and non-affine transforms. @@ -31,7 +31,7 @@ namespace SixLabors.ImageSharp.Processing.Processors /// /// Calculated the weights for the given point. /// This method uses more samples than the upscaled version to ensure edge pixels are correctly rendered. - /// Additionally the weights are nomalized. + /// Additionally the weights are normalized. /// /// The minimum sampling offset /// The maximum sampling offset diff --git a/src/ImageSharp/Processing/Transforms/Processors/ProjectiveTransformProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/ProjectiveTransformProcessor.cs index dc0970a6cd..a628d8a049 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/ProjectiveTransformProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/ProjectiveTransformProcessor.cs @@ -12,11 +12,11 @@ using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +// TODO: Doesn't work yet! Implement tests + Finish implementation + Document Matrix4x4 behavior +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// Provides the base methods to perform non-affine transforms on an image. - /// TODO: Doesn't work yet! Implement tests + Finish implementation + Document Matrix4x4 behavior /// /// The pixel format. internal class ProjectiveTransformProcessor : InterpolatedTransformProcessorBase diff --git a/src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs index dfb7b84b66..6e60be8436 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/ResizeProcessor.cs @@ -10,9 +10,10 @@ using System.Threading.Tasks; using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Memory; using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// Provides methods that allow the resizing of images using various algorithms. @@ -212,38 +213,39 @@ namespace SixLabors.ImageSharp.Processing.Processors protected override Image CreateDestination(Image source, Rectangle sourceRectangle) { // We will always be creating the clone even for mutate because we may need to resize the canvas - IEnumerable> frames = source.Frames.Select(x => new ImageFrame(source.GetMemoryManager(), this.Width, this.Height, x.MetaData.Clone())); // this will create places holders + IEnumerable> frames = source.Frames.Select(x => new ImageFrame(source.GetMemoryManager(), this.Width, this.Height, x.MetaData.Clone())); // Use the overload to prevent an extra frame being added return new Image(source.GetConfiguration(), source.MetaData.Clone(), frames); } /// - protected override void BeforeFrameApply(ImageFrame source, ImageFrame destination, Rectangle sourceRectangle, Configuration configuration) + protected override void BeforeImageApply(Image source, Image destination, Rectangle sourceRectangle) { if (!(this.Sampler is NearestNeighborResampler)) { - // TODO: Optimization opportunity: if we could assume that all frames are of the same size, we can move this into 'BeforeImageApply()` + // Since all image frame dimensions have to be the same we can calculate this for all frames. + MemoryManager memoryManager = source.GetMemoryManager(); this.horizontalWeights = this.PrecomputeWeights( - source.MemoryManager, + memoryManager, this.ResizeRectangle.Width, sourceRectangle.Width); this.verticalWeights = this.PrecomputeWeights( - source.MemoryManager, + memoryManager, this.ResizeRectangle.Height, sourceRectangle.Height); } } /// - protected override void OnFrameApply(ImageFrame source, ImageFrame cloned, Rectangle sourceRectangle, Configuration configuration) + protected override void OnFrameApply(ImageFrame source, ImageFrame destination, Rectangle sourceRectangle, Configuration configuration) { - // Jump out, we'll deal with that later. - if (source.Width == cloned.Width && source.Height == cloned.Height && sourceRectangle == this.ResizeRectangle) + // Handle resize dimensions identical to the original + if (source.Width == destination.Width && source.Height == destination.Height && sourceRectangle == this.ResizeRectangle) { // the cloned will be blank here copy all the pixel data over - source.GetPixelSpan().CopyTo(cloned.GetPixelSpan()); + source.GetPixelSpan().CopyTo(destination.GetPixelSpan()); return; } @@ -275,7 +277,7 @@ namespace SixLabors.ImageSharp.Processing.Processors { // Y coordinates of source points Span sourceRow = source.GetPixelRowSpan((int)(((y - startY) * heightFactor) + sourceY)); - Span targetRow = cloned.GetPixelRowSpan(y); + Span targetRow = destination.GetPixelRowSpan(y); for (int x = minX; x < maxX; x++) { @@ -336,18 +338,18 @@ namespace SixLabors.ImageSharp.Processing.Processors { // Ensure offsets are normalized for cropping and padding. WeightsWindow window = this.verticalWeights.Weights[y - startY]; - Span targetRow = cloned.GetPixelRowSpan(y); + Span targetRow = destination.GetPixelRowSpan(y); if (this.Compand) { for (int x = 0; x < width; x++) { // Destination color components - Vector4 destination = window.ComputeWeightedColumnSum(firstPassPixels, x, sourceY); - destination = destination.Compress(); + Vector4 destinationVector = window.ComputeWeightedColumnSum(firstPassPixels, x, sourceY); + destinationVector = destinationVector.Compress(); ref TPixel pixel = ref targetRow[x]; - pixel.PackFromVector4(destination); + pixel.PackFromVector4(destinationVector); } } else @@ -355,10 +357,10 @@ namespace SixLabors.ImageSharp.Processing.Processors for (int x = 0; x < width; x++) { // Destination color components - Vector4 destination = window.ComputeWeightedColumnSum(firstPassPixels, x, sourceY); + Vector4 destinationVector = window.ComputeWeightedColumnSum(firstPassPixels, x, sourceY); ref TPixel pixel = ref targetRow[x]; - pixel.PackFromVector4(destination); + pixel.PackFromVector4(destinationVector); } } }); diff --git a/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs index fabae88fd4..9a069f1b6b 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/RotateProcessor.cs @@ -3,13 +3,14 @@ using System; using System.Threading.Tasks; + using SixLabors.ImageSharp.Advanced; using SixLabors.ImageSharp.Helpers; using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// Provides methods that allow the rotating of images. diff --git a/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs b/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs index ad0aad7bbb..5bb594f2fe 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/SkewProcessor.cs @@ -4,7 +4,7 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// Provides methods that allow the skewing of images. diff --git a/src/ImageSharp/Processing/Transforms/Processors/TransformProcessorBase.cs b/src/ImageSharp/Processing/Transforms/Processors/TransformProcessorBase.cs index 7403a400e7..0ca5ee1911 100644 --- a/src/ImageSharp/Processing/Transforms/Processors/TransformProcessorBase.cs +++ b/src/ImageSharp/Processing/Transforms/Processors/TransformProcessorBase.cs @@ -2,9 +2,10 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing.Processors +namespace SixLabors.ImageSharp.Processing.Transforms.Processors { /// /// The base class for all transform processors. Any processor that changes the dimensions of the image should inherit from this. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Resamplers.cs b/src/ImageSharp/Processing/Transforms/Resamplers.cs similarity index 98% rename from src/ImageSharp/Processing/Transforms/Resamplers/Resamplers.cs rename to src/ImageSharp/Processing/Transforms/Resamplers.cs index 599ae2dadb..791d493d9e 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Resamplers.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Contains reusable static instances of known resampling algorithms diff --git a/src/ImageSharp/Processing/Transforms/Resize.cs b/src/ImageSharp/Processing/Transforms/ResizeExtensions.cs similarity index 88% rename from src/ImageSharp/Processing/Transforms/Resize.cs rename to src/ImageSharp/Processing/Transforms/ResizeExtensions.cs index b94addb27b..1580aa6366 100644 --- a/src/ImageSharp/Processing/Transforms/Resize.cs +++ b/src/ImageSharp/Processing/Transforms/ResizeExtensions.cs @@ -2,16 +2,15 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Transforms.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of resize operations to the type. /// - public static partial class ImageExtensions + public static class ResizeExtensions { /// /// Resizes an image in accordance with the given . @@ -23,7 +22,7 @@ namespace SixLabors.ImageSharp /// Passing zero for one of height or width within the resize options will automatically preserve the aspect ratio of the original image public static IImageProcessingContext Resize(this IImageProcessingContext source, ResizeOptions options) where TPixel : struct, IPixel - => source.ApplyProcessor(new ResizeProcessor(options, source.GetCurrentSize())); + => source.ApplyProcessor(new ResizeProcessor(options, source.GetCurrentSize())); /// /// Resizes an image to the given . @@ -35,7 +34,7 @@ namespace SixLabors.ImageSharp /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size) where TPixel : struct, IPixel - => Resize(source, size.Width, size.Height, Resamplers.Bicubic, false); + => Resize(source, size.Width, size.Height, Resamplers.Bicubic, false); /// /// Resizes an image to the given . @@ -48,7 +47,7 @@ namespace SixLabors.ImageSharp /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size, bool compand) where TPixel : struct, IPixel - => Resize(source, size.Width, size.Height, Resamplers.Bicubic, compand); + => Resize(source, size.Width, size.Height, Resamplers.Bicubic, compand); /// /// Resizes an image to the given width and height. @@ -61,7 +60,7 @@ namespace SixLabors.ImageSharp /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height) where TPixel : struct, IPixel - => Resize(source, width, height, Resamplers.Bicubic, false); + => Resize(source, width, height, Resamplers.Bicubic, false); /// /// Resizes an image to the given width and height. @@ -75,7 +74,7 @@ namespace SixLabors.ImageSharp /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, bool compand) where TPixel : struct, IPixel - => Resize(source, width, height, Resamplers.Bicubic, compand); + => Resize(source, width, height, Resamplers.Bicubic, compand); /// /// Resizes an image to the given width and height with the given sampler. @@ -89,7 +88,7 @@ namespace SixLabors.ImageSharp /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler) where TPixel : struct, IPixel - => Resize(source, width, height, sampler, false); + => Resize(source, width, height, sampler, false); /// /// Resizes an image to the given width and height with the given sampler. @@ -103,7 +102,7 @@ namespace SixLabors.ImageSharp /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size, IResampler sampler, bool compand) where TPixel : struct, IPixel - => Resize(source, size.Width, size.Height, sampler, new Rectangle(0, 0, size.Width, size.Height), compand); + => Resize(source, size.Width, size.Height, sampler, new Rectangle(0, 0, size.Width, size.Height), compand); /// /// Resizes an image to the given width and height with the given sampler. @@ -118,7 +117,7 @@ namespace SixLabors.ImageSharp /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, bool compand) where TPixel : struct, IPixel - => Resize(source, width, height, sampler, new Rectangle(0, 0, width, height), compand); + => Resize(source, width, height, sampler, new Rectangle(0, 0, width, height), compand); /// /// Resizes an image to the given width and height with the given sampler and @@ -147,7 +146,7 @@ namespace SixLabors.ImageSharp Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel - => source.ApplyProcessor(new ResizeProcessor(sampler, width, height, source.GetCurrentSize(), targetRectangle, compand), sourceRectangle); + => source.ApplyProcessor(new ResizeProcessor(sampler, width, height, source.GetCurrentSize(), targetRectangle, compand), sourceRectangle); /// /// Resizes an image to the given width and height with the given sampler and source rectangle. @@ -171,6 +170,6 @@ namespace SixLabors.ImageSharp Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel - => source.ApplyProcessor(new ResizeProcessor(sampler, width, height, source.GetCurrentSize(), targetRectangle, compand)); + => source.ApplyProcessor(new ResizeProcessor(sampler, width, height, source.GetCurrentSize(), targetRectangle, compand)); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Options/ResizeHelper.cs b/src/ImageSharp/Processing/Transforms/ResizeHelper.cs similarity index 99% rename from src/ImageSharp/Processing/Transforms/Options/ResizeHelper.cs rename to src/ImageSharp/Processing/Transforms/ResizeHelper.cs index ba6f4509d8..0d500b1bce 100644 --- a/src/ImageSharp/Processing/Transforms/Options/ResizeHelper.cs +++ b/src/ImageSharp/Processing/Transforms/ResizeHelper.cs @@ -5,7 +5,7 @@ using System; using System.Linq; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Provides methods to help calculate the target rectangle when resizing using the diff --git a/src/ImageSharp/Processing/Transforms/Options/ResizeMode.cs b/src/ImageSharp/Processing/Transforms/ResizeMode.cs similarity index 96% rename from src/ImageSharp/Processing/Transforms/Options/ResizeMode.cs rename to src/ImageSharp/Processing/Transforms/ResizeMode.cs index c88808f758..248ac20f4e 100644 --- a/src/ImageSharp/Processing/Transforms/Options/ResizeMode.cs +++ b/src/ImageSharp/Processing/Transforms/ResizeMode.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Enumerated resize modes to apply to resized images. diff --git a/src/ImageSharp/Processing/Transforms/Options/ResizeOptions.cs b/src/ImageSharp/Processing/Transforms/ResizeOptions.cs similarity index 96% rename from src/ImageSharp/Processing/Transforms/Options/ResizeOptions.cs rename to src/ImageSharp/Processing/Transforms/ResizeOptions.cs index 03adf58c34..afa3142e51 100644 --- a/src/ImageSharp/Processing/Transforms/Options/ResizeOptions.cs +++ b/src/ImageSharp/Processing/Transforms/ResizeOptions.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using SixLabors.Primitives; -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The resize options for resizing images against certain modes. @@ -43,4 +43,4 @@ namespace SixLabors.ImageSharp.Processing /// public bool Compand { get; set; } = false; } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs b/src/ImageSharp/Processing/Transforms/RobidouxResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs rename to src/ImageSharp/Processing/Transforms/RobidouxResampler.cs index bd28d8da46..829e1ee9bd 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs +++ b/src/ImageSharp/Processing/Transforms/RobidouxResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the Robidoux algorithm. @@ -21,4 +21,4 @@ namespace SixLabors.ImageSharp.Processing return ImageMaths.GetBcValue(x, B, C); } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs b/src/ImageSharp/Processing/Transforms/RobidouxSharpResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs rename to src/ImageSharp/Processing/Transforms/RobidouxSharpResampler.cs index a345da3f42..4cbf13f58c 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs +++ b/src/ImageSharp/Processing/Transforms/RobidouxSharpResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the Robidoux Sharp algorithm. @@ -21,4 +21,4 @@ namespace SixLabors.ImageSharp.Processing return ImageMaths.GetBcValue(x, B, C); } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Rotate.cs b/src/ImageSharp/Processing/Transforms/RotateExtensions.cs similarity index 80% rename from src/ImageSharp/Processing/Transforms/Rotate.cs rename to src/ImageSharp/Processing/Transforms/RotateExtensions.cs index bbaa762a22..9001bc3ff5 100644 --- a/src/ImageSharp/Processing/Transforms/Rotate.cs +++ b/src/ImageSharp/Processing/Transforms/RotateExtensions.cs @@ -2,15 +2,14 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Transforms.Processors; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of rotate operations to the type. /// - public static partial class ImageExtensions + public static class RotateExtensions { /// /// Rotates and flips an image by the given instructions. @@ -21,7 +20,7 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext Rotate(this IImageProcessingContext source, RotateType rotateType) where TPixel : struct, IPixel - => Rotate(source, (float)rotateType); + => Rotate(source, (float)rotateType); /// /// Rotates an image by the given angle in degrees. @@ -32,7 +31,7 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext Rotate(this IImageProcessingContext source, float degrees) where TPixel : struct, IPixel - => Rotate(source, degrees, Resamplers.Bicubic); + => Rotate(source, degrees, Resamplers.Bicubic); /// /// Rotates an image by the given angle in degrees using the specified sampling algorithm. @@ -44,6 +43,6 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext Rotate(this IImageProcessingContext source, float degrees, IResampler sampler) where TPixel : struct, IPixel - => source.ApplyProcessor(new RotateProcessor(degrees, sampler, source.GetCurrentSize())); + => source.ApplyProcessor(new RotateProcessor(degrees, sampler, source.GetCurrentSize())); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/RotateFlip.cs b/src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs similarity index 76% rename from src/ImageSharp/Processing/Transforms/RotateFlip.cs rename to src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs index 2ddcb151b2..693c0d8ad7 100644 --- a/src/ImageSharp/Processing/Transforms/RotateFlip.cs +++ b/src/ImageSharp/Processing/Transforms/RotateFlipExtensions.cs @@ -1,16 +1,14 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of rotate-flip operations to the type. /// - public static partial class ImageExtensions + public static class RotateFlipExtensions { /// /// Rotates and flips an image by the given instructions. @@ -22,8 +20,6 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext RotateFlip(this IImageProcessingContext source, RotateType rotateType, FlipType flipType) where TPixel : struct, IPixel - { - return source.Rotate(rotateType).Flip(flipType); - } + => source.Rotate(rotateType).Flip(flipType); } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Options/RotateType.cs b/src/ImageSharp/Processing/Transforms/RotateType.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Options/RotateType.cs rename to src/ImageSharp/Processing/Transforms/RotateType.cs index 9f6d45f2bf..498ad4149a 100644 --- a/src/ImageSharp/Processing/Transforms/Options/RotateType.cs +++ b/src/ImageSharp/Processing/Transforms/RotateType.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Provides enumeration over how the image should be rotated. @@ -28,4 +28,4 @@ namespace SixLabors.ImageSharp.Processing /// Rotate270 = 270 } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Skew.cs b/src/ImageSharp/Processing/Transforms/SkewExtensions.cs similarity index 79% rename from src/ImageSharp/Processing/Transforms/Skew.cs rename to src/ImageSharp/Processing/Transforms/SkewExtensions.cs index f4a92e0100..c80619aa9a 100644 --- a/src/ImageSharp/Processing/Transforms/Skew.cs +++ b/src/ImageSharp/Processing/Transforms/SkewExtensions.cs @@ -2,15 +2,14 @@ // Licensed under the Apache License, Version 2.0. using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Transforms.Processors; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of skew operations to the type. /// - public static partial class ImageExtensions + public static class SkewExtensions { /// /// Skews an image by the given angles in degrees. @@ -22,7 +21,7 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext Skew(this IImageProcessingContext source, float degreesX, float degreesY) where TPixel : struct, IPixel - => Skew(source, degreesX, degreesY, Resamplers.Bicubic); + => Skew(source, degreesX, degreesY, Resamplers.Bicubic); /// /// Skews an image by the given angles in degrees using the specified sampling algorithm. @@ -35,6 +34,6 @@ namespace SixLabors.ImageSharp /// The public static IImageProcessingContext Skew(this IImageProcessingContext source, float degreesX, float degreesY, IResampler sampler) where TPixel : struct, IPixel - => source.ApplyProcessor(new SkewProcessor(degreesX, degreesY, sampler, source.GetCurrentSize())); + => source.ApplyProcessor(new SkewProcessor(degreesX, degreesY, sampler, source.GetCurrentSize())); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs b/src/ImageSharp/Processing/Transforms/SplineResampler.cs similarity index 91% rename from src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs rename to src/ImageSharp/Processing/Transforms/SplineResampler.cs index ac5e2dedba..3448d5fb8c 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs +++ b/src/ImageSharp/Processing/Transforms/SplineResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the spline algorithm. @@ -21,4 +21,4 @@ namespace SixLabors.ImageSharp.Processing return ImageMaths.GetBcValue(x, B, C); } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Transform.cs b/src/ImageSharp/Processing/Transforms/TransformExtensions.cs similarity index 94% rename from src/ImageSharp/Processing/Transforms/Transform.cs rename to src/ImageSharp/Processing/Transforms/TransformExtensions.cs index b82713ca94..7bd37afeff 100644 --- a/src/ImageSharp/Processing/Transforms/Transform.cs +++ b/src/ImageSharp/Processing/Transforms/TransformExtensions.cs @@ -3,16 +3,15 @@ using System.Numerics; using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Transforms.Processors; using SixLabors.Primitives; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// - /// Extension methods for the type. + /// Adds extensions that allow the application of composable transform operations to the type. /// - public static partial class ImageExtensions + public static class TransformExtensions { /// /// Transforms an image by the given matrix. @@ -77,9 +76,7 @@ namespace SixLabors.ImageSharp IResampler sampler, Size destinationSize) where TPixel : struct, IPixel - { - return source.ApplyProcessor(new AffineTransformProcessor(matrix, sampler, destinationSize)); - } + => source.ApplyProcessor(new AffineTransformProcessor(matrix, sampler, destinationSize)); /// /// Transforms an image by the given matrix. diff --git a/src/ImageSharp/Processing/Transforms/TransformHelpers.cs b/src/ImageSharp/Processing/Transforms/TransformHelpers.cs index 1567c11619..46dd134cec 100644 --- a/src/ImageSharp/Processing/Transforms/TransformHelpers.cs +++ b/src/ImageSharp/Processing/Transforms/TransformHelpers.cs @@ -7,7 +7,7 @@ using SixLabors.ImageSharp.MetaData.Profiles.Exif; using SixLabors.ImageSharp.PixelFormats; using SixLabors.Primitives; -namespace SixLabors.ImageSharp +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// Contains helper methods for working with affine and non-affine transforms diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs b/src/ImageSharp/Processing/Transforms/TriangleResampler.cs similarity index 93% rename from src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs rename to src/ImageSharp/Processing/Transforms/TriangleResampler.cs index 842da87e06..2f5783e207 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs +++ b/src/ImageSharp/Processing/Transforms/TriangleResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the triangle (bilinear) algorithm. @@ -29,4 +29,4 @@ namespace SixLabors.ImageSharp.Processing return 0F; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs b/src/ImageSharp/Processing/Transforms/WelchResampler.cs similarity index 92% rename from src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs rename to src/ImageSharp/Processing/Transforms/WelchResampler.cs index 9e18a24710..de60f9f247 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs +++ b/src/ImageSharp/Processing/Transforms/WelchResampler.cs @@ -1,7 +1,7 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -namespace SixLabors.ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing.Transforms { /// /// The function implements the welch algorithm. diff --git a/tests/ImageSharp.Benchmarks/Samplers/Crop.cs b/tests/ImageSharp.Benchmarks/Samplers/Crop.cs index 17c3933c08..166cf77fe2 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Crop.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Crop.cs @@ -9,9 +9,8 @@ namespace SixLabors.ImageSharp.Benchmarks using System.Drawing.Drawing2D; using BenchmarkDotNet.Attributes; - - using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; using CoreSize = SixLabors.Primitives.Size; diff --git a/tests/ImageSharp.Benchmarks/Samplers/Resize.cs b/tests/ImageSharp.Benchmarks/Samplers/Resize.cs index 8bba227c5b..0a47306860 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Resize.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Resize.cs @@ -12,6 +12,7 @@ namespace SixLabors.ImageSharp.Benchmarks using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; using CoreSize = SixLabors.Primitives.Size; diff --git a/tests/ImageSharp.Tests/ComplexIntegrationTests.cs b/tests/ImageSharp.Tests/ComplexIntegrationTests.cs index ad4676872f..86703959aa 100644 --- a/tests/ImageSharp.Tests/ComplexIntegrationTests.cs +++ b/tests/ImageSharp.Tests/ComplexIntegrationTests.cs @@ -3,6 +3,7 @@ using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; using SixLabors.Primitives; using Xunit; diff --git a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs index c49ba05eef..177891b94a 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs @@ -11,6 +11,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests { + using SixLabors.ImageSharp.Processing.Transforms; + public class DrawImageTest : FileTestBase { private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32; diff --git a/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs b/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs index bd06e1f1f5..da2589ed54 100644 --- a/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs @@ -13,6 +13,7 @@ namespace SixLabors.ImageSharp.Tests.Drawing { using SixLabors.ImageSharp.Primitives; using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class FillPatternBrushTests : FileTestBase { diff --git a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs index 660f01dff4..e7fd21d963 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs @@ -11,6 +11,7 @@ using SixLabors.ImageSharp.Formats.Png; namespace SixLabors.ImageSharp.Tests.Formats.Png { using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class PngSmokeTests { diff --git a/tests/ImageSharp.Tests/Image/ImageProcessingContextTests.cs b/tests/ImageSharp.Tests/Image/ImageProcessingContextTests.cs index e226e1ce8e..b60fc5ff20 100644 --- a/tests/ImageSharp.Tests/Image/ImageProcessingContextTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageProcessingContextTests.cs @@ -8,6 +8,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests { using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class ImageProcessingContextTests { diff --git a/tests/ImageSharp.Tests/Image/ImageRotationTests.cs b/tests/ImageSharp.Tests/Image/ImageRotationTests.cs index 59677ac784..a18b8326ab 100644 --- a/tests/ImageSharp.Tests/Image/ImageRotationTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageRotationTests.cs @@ -8,6 +8,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests { using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class ImageRotationTests { diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs index 161ac15e33..fb1a7f0a38 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs @@ -9,6 +9,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + public class AutoOrientTests : FileTestBase { public static readonly string[] FlipFiles = { TestImages.Bmp.F }; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs index 69515b2cbd..e9fd50b7fa 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs @@ -7,6 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class CropTest : FileTestBase { diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs index 27502df30d..da3ba6be69 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs @@ -7,6 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class EntropyCropTest : FileTestBase { diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs index 9ca3994986..7a4743e449 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs @@ -7,6 +7,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + public class FlipTests : FileTestBase { public static readonly string[] FlipFiles = { TestImages.Bmp.F }; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs index f83a08bae1..3294ecc733 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs @@ -7,6 +7,7 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class PadTest : FileTestBase { diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs index 3920aff8aa..84030adf16 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs @@ -12,6 +12,9 @@ using Xunit.Abstractions; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing.Transforms.Processors; + public class ResizeProfilingBenchmarks : MeasureFixture { public ResizeProfilingBenchmarks(ITestOutputHelper output) diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs index e2ae50aff0..38201d4d6f 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -13,6 +13,8 @@ using Xunit; // ReSharper disable InconsistentNaming namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + public class ResizeTests : FileTestBase { public static readonly string[] CommonTestImages = { TestImages.Png.CalliphoraPartial }; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs index e7415e1619..f15ed3cc7e 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs @@ -7,6 +7,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + public class RotateFlipTests : FileTestBase { public static readonly string[] FlipFiles = { TestImages.Bmp.F }; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs index b5220ea948..54e2a4a185 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs @@ -11,6 +11,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms using System; using System.Reflection; + using SixLabors.ImageSharp.Processing.Transforms; + public class RotateTests : FileTestBase { public static readonly TheoryData RotateAngles diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs index e8c5763d5e..c092881c62 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs @@ -11,6 +11,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms using System.Reflection; using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class SkewTest : FileTestBase { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/AffineTransformTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/AffineTransformTests.cs index e0797c4da9..85c35ba275 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/AffineTransformTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/AffineTransformTests.cs @@ -11,6 +11,8 @@ using SixLabors.ImageSharp.Helpers; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + public class AffineTransformTests { private readonly ITestOutputHelper Output; @@ -236,7 +238,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms private static void VerifyAllPixelsAreWhiteOrTransparent(Image image) where TPixel : struct, IPixel { - TPixel[] data = new TPixel[image.Width * image.Height]; + var data = new TPixel[image.Width * image.Height]; image.Frames.RootFrame.SavePixelData(data); var rgba = default(Rgba32); var white = new Rgb24(255, 255, 255); diff --git a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs index 20de25054c..92d4f030ba 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs @@ -1,11 +1,13 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Processing.Processors; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing.Transforms.Processors; + public class AutoOrientTests : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs index a001efc417..2cc0484de9 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs @@ -1,9 +1,8 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Transforms; +using SixLabors.ImageSharp.Processing.Transforms.Processors; using SixLabors.Primitives; using Xunit; @@ -14,10 +13,10 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms [Theory] [InlineData(10, 10)] [InlineData(12, 123)] - public void Crop_Width_height_CropProcessorWithRectangleSet(int width, int height) + public void CropWidthHeightCropProcessorWithRectangleSet(int width, int height) { this.operations.Crop(width, height); - var processor = this.Verify>(); + CropProcessor processor = this.Verify>(); Assert.Equal(new Rectangle(0, 0, width, height), processor.CropRectangle); } @@ -25,13 +24,13 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms [Theory] [InlineData(10, 10, 2, 6)] [InlineData(12, 123, 6, 2)] - public void Crop_Rectangle_CropProcessorWithRectangleSet(int x, int y, int width, int height) + public void CropRectangleCropProcessorWithRectangleSet(int x, int y, int width, int height) { - var rect = new Rectangle(x, y, width, height); - this.operations.Crop(rect); - var processor = this.Verify>(); + var cropRectangle = new Rectangle(x, y, width, height); + this.operations.Crop(cropRectangle); + CropProcessor processor = this.Verify>(); - Assert.Equal(rect, processor.CropRectangle); + Assert.Equal(cropRectangle, processor.CropRectangle); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs index c1cde48794..8ddb760791 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs @@ -1,25 +1,23 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using System; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Processing.Transforms; +using SixLabors.ImageSharp.Processing.Transforms.Processors; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { public class EntropyCropTest : BaseImageOperationsExtensionTest { - [Theory] - [InlineData(0.5f)] - [InlineData(.2f)] - public void EntropyCrop_threasholdFloat_EntropyCropProcessorWithThreshold(float threashold) + [InlineData(0.5F)] + [InlineData(.2F)] + public void EntropyCropThresholdFloatEntropyCropProcessorWithThreshold(float threshold) { - this.operations.EntropyCrop(threashold); - var processor = this.Verify>(); + this.operations.EntropyCrop(threshold); + EntropyCropProcessor processor = this.Verify>(); - Assert.Equal(threashold, processor.Threshold); + Assert.Equal(threshold, processor.Threshold); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs index 4b3e97d106..0ab9978d1b 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs @@ -9,6 +9,9 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing.Transforms.Processors; + public class FlipTests : BaseImageOperationsExtensionTest { @@ -19,7 +22,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms public void Flip_degreesFloat_RotateProcessorWithAnglesSetAndExpandTrue(FlipType flip) { this.operations.Flip(flip); - var flipProcessor = this.Verify>(); + FlipProcessor flipProcessor = this.Verify>(); Assert.Equal(flip, flipProcessor.FlipType); } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs index cf4f83ca47..bb227496d8 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs @@ -8,7 +8,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { - + using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing.Transforms.Processors; public class PadTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs index 5f3815711d..b2170069f2 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs @@ -1,14 +1,13 @@ // Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Transforms; +using SixLabors.ImageSharp.Processing.Transforms.Processors; using SixLabors.Primitives; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { - using SixLabors.ImageSharp.Processing.Processors; - public class ResizeTests : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs index 75d7067702..d1f7783104 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs @@ -1,17 +1,14 @@ // Copyright (c) Six Labors and contributors. // 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.Transforms; +using SixLabors.ImageSharp.Processing.Transforms.Processors; using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { public class RotateFlipTests : BaseImageOperationsExtensionTest { - [Theory] [InlineData(RotateType.None, FlipType.None, 0)] [InlineData(RotateType.Rotate90, FlipType.None, 90)] @@ -25,7 +22,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Transforms [InlineData(RotateType.Rotate90, FlipType.Vertical, 90)] [InlineData(RotateType.Rotate180, FlipType.Vertical, 180)] [InlineData(RotateType.Rotate270, FlipType.Vertical, 270)] - public void Rotate_degreesFloat_RotateProcessorWithAnglesSetrue(RotateType angle, FlipType flip, float expectedAngle) + public void RotateDegreesFloatRotateProcessorWithAnglesSet(RotateType angle, FlipType flip, float expectedAngle) { this.operations.RotateFlip(angle, flip); RotateProcessor rotateProcessor = this.Verify>(0); diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs index a990fa88ca..0fbc9379a1 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs @@ -7,6 +7,9 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing.Transforms.Processors; + public class RotateTests : BaseImageOperationsExtensionTest { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs index d2cc5764ed..a4da0cf2f6 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs @@ -6,6 +6,9 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + using SixLabors.ImageSharp.Processing.Transforms.Processors; + public class SkewTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Transforms/TransformsHelpersTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/TransformsHelpersTest.cs index c5b6b1ad72..3e92f0e1cb 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/TransformsHelpersTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/TransformsHelpersTest.cs @@ -7,6 +7,8 @@ using Xunit; namespace SixLabors.ImageSharp.Tests.Processing.Transforms { + using SixLabors.ImageSharp.Processing.Transforms; + public class TransformsHelpersTest { [Fact] diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs index 8e6d60a509..1e768637e8 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs @@ -14,6 +14,7 @@ namespace SixLabors.ImageSharp.Tests using Xunit; using Xunit.Abstractions; using SixLabors.ImageSharp.Processing; + using SixLabors.ImageSharp.Processing.Transforms; public class ImageComparerTests {