From f026778e4727a47a4be99f3954ae92775ad3a55b Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Sat, 1 Jul 2017 20:09:35 +0100 Subject: [PATCH 01/33] migrate to a Image.Generate/Image.Mutate context api --- samples/AvatarWithRoundedCorner/Program.cs | 17 +-- src/ImageSharp.Drawing/DrawImage.cs | 14 +- src/ImageSharp.Drawing/FillRegion.cs | 14 +- src/ImageSharp.Drawing/Paths/DrawBeziers.cs | 12 +- src/ImageSharp.Drawing/Paths/DrawLines.cs | 12 +- src/ImageSharp.Drawing/Paths/DrawPath.cs | 12 +- .../Paths/DrawPathCollection.cs | 12 +- src/ImageSharp.Drawing/Paths/DrawPolygon.cs | 12 +- src/ImageSharp.Drawing/Paths/DrawRectangle.cs | 12 +- .../Paths/FillPathBuilder.cs | 8 +- .../Paths/FillPathCollection.cs | 8 +- src/ImageSharp.Drawing/Paths/FillPaths.cs | 8 +- src/ImageSharp.Drawing/Paths/FillPolygon.cs | 8 +- src/ImageSharp.Drawing/Paths/FillRectangle.cs | 8 +- .../Processors/DrawImageProcessor.cs | 2 +- src/ImageSharp.Drawing/Text/DrawText.Path.cs | 21 ++- src/ImageSharp.Drawing/Text/DrawText.cs | 21 ++- .../Text/TextGraphicsOptions.cs | 9 -- src/ImageSharp/ApplyProcessors.cs | 100 ++++++++++++++ src/ImageSharp/Formats/Bmp/ImageExtensions.cs | 19 ++- src/ImageSharp/Formats/Gif/ImageExtensions.cs | 21 +-- .../Formats/Jpeg/ImageExtensions.cs | 21 +-- src/ImageSharp/Formats/Png/ImageExtensions.cs | 21 +-- src/ImageSharp/IImageOperations{TPixel}.cs | 36 +++++ src/ImageSharp/Image/IImageProcessor.cs | 2 +- src/ImageSharp/Image/ImageBase{TPixel}.cs | 10 -- .../Image/ImageProcessingExtensions.cs | 4 +- src/ImageSharp/Image/Image{TPixel}.cs | 8 +- src/ImageSharp/ImageOperations.cs | 62 +++++++++ src/ImageSharp/Numerics/ValueSize.cs | 124 ++++++++++++++++++ .../Binarization/BinaryThreshold.cs | 7 +- .../Processing/Binarization/Dither.cs | 14 +- .../Processing/ColorMatrix/BlackWhite.cs | 7 +- .../Processing/ColorMatrix/ColorBlindness.cs | 48 +++---- .../Processing/ColorMatrix/Grayscale.cs | 20 +-- src/ImageSharp/Processing/ColorMatrix/Hue.cs | 7 +- .../Processing/ColorMatrix/Kodachrome.cs | 7 +- .../Processing/ColorMatrix/Lomograph.cs | 13 +- .../Processing/ColorMatrix/Polaroid.cs | 11 +- .../Processing/ColorMatrix/Saturation.cs | 7 +- .../Processing/ColorMatrix/Sepia.cs | 13 +- .../Processing/Convolution/BoxBlur.cs | 13 +- .../Processing/Convolution/DetectEdges.cs | 80 +++++------ .../Processing/Convolution/GaussianBlur.cs | 13 +- .../Processing/Convolution/GaussianSharpen.cs | 13 +- .../Processing/DelegateImageProcessor.cs | 44 +++++++ src/ImageSharp/Processing/Effects/Alpha.cs | 13 +- .../Processing/Effects/BackgroundColor.cs | 17 +-- .../Processing/Effects/Brightness.cs | 13 +- src/ImageSharp/Processing/Effects/Contrast.cs | 13 +- src/ImageSharp/Processing/Effects/Invert.cs | 13 +- .../Processing/Effects/OilPainting.cs | 26 +--- src/ImageSharp/Processing/Effects/Pixelate.cs | 18 +-- src/ImageSharp/Processing/ImageProcessor.cs | 66 +++++++++- src/ImageSharp/Processing/Overlays/Glow.cs | 79 ++++++----- .../Processing/Overlays/Vignette.cs | 54 ++++---- .../ColorMatrix/PolaroidProcessor.cs | 2 +- .../Effects/OilPaintingProcessor.cs | 5 + .../Processors/Effects/PixelateProcessor.cs | 13 +- .../Processors/Overlays/GlowProcessor.cs | 11 +- .../Processors/Overlays/VignetteProcessor.cs | 28 +++- .../Transforms/AutoRotateProcessor.cs | 103 +++++++++++++++ .../Transforms/ResamplingWeightedProcessor.cs | 12 +- .../Processing/Transforms/AutoOrient.cs | 64 +-------- src/ImageSharp/Processing/Transforms/Crop.cs | 15 +-- .../Processing/Transforms/EntropyCrop.cs | 9 +- src/ImageSharp/Processing/Transforms/Flip.cs | 9 +- src/ImageSharp/Processing/Transforms/Pad.cs | 2 +- .../Processing/Transforms/Resize.cs | 118 ++++++++++++----- .../Processing/Transforms/Rotate.cs | 17 +-- .../Processing/Transforms/RotateFlip.cs | 2 +- src/ImageSharp/Processing/Transforms/Skew.cs | 11 +- src/ImageSharp/Quantizers/Quantize.cs | 45 ++++--- .../Drawing/DrawBeziers.cs | 4 +- .../Drawing/DrawLines.cs | 4 +- .../Drawing/DrawPolygon.cs | 4 +- .../Drawing/FillPolygon.cs | 8 +- .../Drawing/FillRectangle.cs | 6 +- .../Drawing/FillWithPattern.cs | 2 +- tests/ImageSharp.Benchmarks/Samplers/Crop.cs | 2 +- .../Samplers/DetectEdges.cs | 22 ++-- tests/ImageSharp.Benchmarks/Samplers/Glow.cs | 2 +- .../ImageSharp.Benchmarks/Samplers/Resize.cs | 2 +- .../ImageSharp.Tests/Drawing/BeziersTests.cs | 12 +- .../ImageSharp.Tests/Drawing/BlendedShapes.cs | 42 +++--- .../ImageSharp.Tests/Drawing/DrawImageTest.cs | 4 +- .../ImageSharp.Tests/Drawing/DrawPathTests.cs | 16 +-- .../Drawing/FillPatternTests.cs | 7 +- .../Drawing/FillRegionProcessorTests.cs | 6 +- .../Drawing/FillSolidBrushTests.cs | 15 ++- .../Drawing/LineComplexPolygonTests.cs | 30 ++--- tests/ImageSharp.Tests/Drawing/LineTests.cs | 88 ++++++------- .../Drawing/Paths/FillPath.cs | 8 +- .../Drawing/Paths/FillPathCollection.cs | 8 +- .../Drawing/Paths/FillPolygon.cs | 8 +- .../Drawing/Paths/FillRectangle.cs | 8 +- .../ImageSharp.Tests/Drawing/PolygonTests.cs | 28 ++-- .../Drawing/RecolorImageTest.cs | 8 +- .../Drawing/SolidBezierTests.cs | 16 +-- .../Drawing/SolidComplexPolygonTests.cs | 18 +-- .../Drawing/SolidPolygonTests.cs | 62 ++++----- .../Drawing/Text/DrawText.Path.cs | 63 +++------ .../ImageSharp.Tests/Drawing/Text/DrawText.cs | 63 +++------ .../Drawing/Text/OutputText.cs | 4 +- .../Formats/GeneralFormatTests.cs | 14 +- .../Formats/Jpg/JpegEncoderTests.cs | 3 +- .../Formats/Png/PngSmokeTests.cs | 2 +- .../Image/PixelAccessorTests.cs | 5 +- tests/ImageSharp.Tests/ImageComparer.cs | 6 +- .../Binarization/BinaryThresholdTest.cs | 8 +- .../Processing/Binarization/DitherTest.cs | 16 +-- .../Processing/ColorMatrix/BlackWhiteTest.cs | 8 +- .../ColorMatrix/ColorBlindnessTest.cs | 8 +- .../Processing/ColorMatrix/GrayscaleTest.cs | 6 +- .../Processing/ColorMatrix/HueTest.cs | 8 +- .../Processing/ColorMatrix/KodachromeTest.cs | 8 +- .../Processing/ColorMatrix/LomographTest.cs | 8 +- .../Processing/ColorMatrix/PolaroidTest.cs | 8 +- .../Processing/ColorMatrix/SaturationTest.cs | 8 +- .../Processing/ColorMatrix/SepiaTest.cs | 8 +- .../Processing/Convolution/BoxBlurTest.cs | 8 +- .../Processing/Convolution/DetectEdgesTest.cs | 8 +- .../Convolution/GaussianBlurTest.cs | 8 +- .../Convolution/GaussianSharpenTest.cs | 8 +- .../Processing/Effects/AlphaTest.cs | 8 +- .../Processing/Effects/BackgroundColorTest.cs | 8 +- .../Processing/Effects/BrightnessTest.cs | 8 +- .../Processing/Effects/ContrastTest.cs | 8 +- .../Processing/Effects/InvertTest.cs | 8 +- .../Processing/Effects/OilPaintTest.cs | 8 +- .../Processing/Effects/PixelateTest.cs | 8 +- .../Processing/Overlays/GlowTest.cs | 16 +-- .../Processing/Overlays/VignetteTest.cs | 16 +-- .../Processing/Transforms/AutoOrientTests.cs | 9 +- .../Processing/Transforms/CropTest.cs | 4 +- .../Processing/Transforms/EntropyCropTest.cs | 4 +- .../Processing/Transforms/FlipTests.cs | 4 +- .../Processing/Transforms/PadTest.cs | 4 +- .../Transforms/ResizeProfilingBenchmarks.cs | 2 +- .../Processing/Transforms/ResizeTests.cs | 44 +++---- .../Processing/Transforms/RotateFlipTests.cs | 4 +- .../Processing/Transforms/RotateTests.cs | 8 +- .../Processing/Transforms/SkewTest.cs | 4 +- .../ImageProviders/SolidProvider.cs | 3 +- .../ImageProviders/TestImageProvider.cs | 10 ++ .../Tests/TestUtilityExtensionsTests.cs | 3 +- 146 files changed, 1504 insertions(+), 1146 deletions(-) create mode 100644 src/ImageSharp/ApplyProcessors.cs create mode 100644 src/ImageSharp/IImageOperations{TPixel}.cs create mode 100644 src/ImageSharp/ImageOperations.cs create mode 100644 src/ImageSharp/Numerics/ValueSize.cs create mode 100644 src/ImageSharp/Processing/DelegateImageProcessor.cs create mode 100644 src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index b164c8d3bc..45fe1e3c86 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -23,13 +23,14 @@ private static void GenerateAvatar(string source, string destination, Size size, { using (var image = Image.Load(source)) { - image.Resize(new ImageSharp.Processing.ResizeOptions - { - Size = size, - Mode = ImageSharp.Processing.ResizeMode.Crop - }); + image.Mutate(x => x + .Resize(new ImageSharp.Processing.ResizeOptions + { + Size = size, + Mode = ImageSharp.Processing.ResizeMode.Crop + }) + .Run(i=>ApplyRoundedCourners(i, cornerRadius))); - ApplyRoundedCourners(image, cornerRadius); image.Save(destination); } } @@ -38,10 +39,10 @@ public static void ApplyRoundedCourners(Image img, float cornerRadius) { var corners = BuildCorners(img.Width, img.Height, cornerRadius); // now we have our corners time to draw them - img.Fill(Rgba32.Transparent, corners, new GraphicsOptions(true) + img.Mutate(x => x.Fill(Rgba32.Transparent, corners, new GraphicsOptions(true) { BlenderMode = ImageSharp.PixelFormats.PixelBlenderMode.Src // enforces that any part of this shape that has color is punched out of the background - }); + })); } public static IPathCollection BuildCorners(int imageWidth, int imageHeight, float cornerRadius) diff --git a/src/ImageSharp.Drawing/DrawImage.cs b/src/ImageSharp.Drawing/DrawImage.cs index 03eb7be289..bd51e4ac0a 100644 --- a/src/ImageSharp.Drawing/DrawImage.cs +++ b/src/ImageSharp.Drawing/DrawImage.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The location to draw the blended image. /// The options. /// The . - public static Image DrawImage(this Image source, Image image, Size size, Point location, GraphicsOptions options) + public static IImageOperations DrawImage(this IImageOperations source, Image image, Size size, Point location, GraphicsOptions options) where TPixel : struct, IPixel { if (size == default(Size)) @@ -37,7 +37,7 @@ public static Image DrawImage(this Image source, Image(image, size, location, options), source.Bounds); + source.ApplyProcessor(new DrawImageProcessor(image, size, location, options)); return source; } @@ -49,7 +49,7 @@ public static Image DrawImage(this Image source, ImageThe image to blend with the currently processing image. /// The opacity of the image image to blend. Must be between 0 and 1. /// The . - public static Image Blend(this Image source, Image image, float percent) + public static IImageOperations Blend(this IImageOperations source, Image image, float percent) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -66,7 +66,7 @@ public static Image Blend(this Image source, ImageThe blending mode. /// The opacity of the image image to blend. Must be between 0 and 1. /// The . - public static Image Blend(this Image source, Image image, PixelBlenderMode blender, float percent) + public static IImageOperations Blend(this IImageOperations source, Image image, PixelBlenderMode blender, float percent) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -83,7 +83,7 @@ public static Image Blend(this Image source, ImageThe image to blend with the currently processing image. /// The options, including the blending type and belnding amount. /// The . - public static Image Blend(this Image source, Image image, GraphicsOptions options) + public static IImageOperations Blend(this IImageOperations source, Image image, GraphicsOptions options) where TPixel : struct, IPixel { return DrawImage(source, image, default(Size), default(Point), options); @@ -99,7 +99,7 @@ public static Image Blend(this Image source, ImageThe size to draw the blended image. /// The location to draw the blended image. /// The . - public static Image DrawImage(this Image source, Image image, float percent, Size size, Point location) + public static IImageOperations DrawImage(this IImageOperations source, Image image, float percent, Size size, Point location) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -118,7 +118,7 @@ public static Image DrawImage(this Image source, ImageThe size to draw the blended image. /// The location to draw the blended image. /// The . - public static Image DrawImage(this Image source, Image image, PixelBlenderMode blender, float percent, Size size, Point location) + public static IImageOperations DrawImage(this IImageOperations source, Image image, PixelBlenderMode blender, float percent, Size size, Point location) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; diff --git a/src/ImageSharp.Drawing/FillRegion.cs b/src/ImageSharp.Drawing/FillRegion.cs index b3ee2ed996..d8bb78e906 100644 --- a/src/ImageSharp.Drawing/FillRegion.cs +++ b/src/ImageSharp.Drawing/FillRegion.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The details how to fill the region of interest. /// The graphics options. /// The . - public static Image Fill(this Image source, IBrush brush, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, GraphicsOptions options) where TPixel : struct, IPixel { return source.Apply(new FillProcessor(brush, options)); @@ -36,7 +36,7 @@ public static Image Fill(this Image source, IBrushThe image this method extends. /// The details how to fill the region of interest. /// The . - public static Image Fill(this Image source, IBrush brush) + public static IImageOperations Fill(this IImageOperations source, IBrush brush) where TPixel : struct, IPixel { return source.Fill(brush, GraphicsOptions.Default); @@ -49,7 +49,7 @@ public static Image Fill(this Image source, IBrushThe image this method extends. /// The color. /// The . - public static Image Fill(this Image source, TPixel color) + public static IImageOperations Fill(this IImageOperations source, TPixel color) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color)); @@ -64,7 +64,7 @@ public static Image Fill(this Image source, TPixel color /// The region. /// The graphics options. /// The . - public static Image Fill(this Image source, IBrush brush, Region region, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, Region region, GraphicsOptions options) where TPixel : struct, IPixel { return source.Apply(new FillRegionProcessor(brush, region, options)); @@ -78,7 +78,7 @@ public static Image Fill(this Image source, IBrushThe brush. /// The region. /// The . - public static Image Fill(this Image source, IBrush brush, Region region) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, Region region) where TPixel : struct, IPixel { return source.Fill(brush, region, GraphicsOptions.Default); @@ -93,7 +93,7 @@ public static Image Fill(this Image source, IBrushThe region. /// The options. /// The . - public static Image Fill(this Image source, TPixel color, Region region, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, TPixel color, Region region, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), region, options); @@ -107,7 +107,7 @@ public static Image Fill(this Image source, TPixel color /// The color. /// The region. /// The . - public static Image Fill(this Image source, TPixel color, Region region) + public static IImageOperations Fill(this IImageOperations source, TPixel color, Region region) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), region); diff --git a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs index 59bcf40363..d332f1d05a 100644 --- a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs +++ b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static Image DrawBeziers(this Image source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawBeziers(this IImageOperations source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points)), options); @@ -43,7 +43,7 @@ public static Image DrawBeziers(this Image source, IBrus /// The thickness. /// The points. /// The . - public static Image DrawBeziers(this Image source, IBrush brush, float thickness, PointF[] points) + public static IImageOperations DrawBeziers(this IImageOperations source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points))); @@ -58,7 +58,7 @@ public static Image DrawBeziers(this Image source, IBrus /// The thickness. /// The points. /// The . - public static Image DrawBeziers(this Image source, TPixel color, float thickness, PointF[] points) + public static IImageOperations DrawBeziers(this IImageOperations source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawBeziers(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static Image DrawBeziers(this Image source, TPixe /// The points. /// The options. /// The . - public static Image DrawBeziers(this Image source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawBeziers(this IImageOperations source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawBeziers(new SolidBrush(color), thickness, points, options); @@ -89,7 +89,7 @@ public static Image DrawBeziers(this Image source, TPixe /// The points. /// The options. /// The . - public static Image DrawBeziers(this Image source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawBeziers(this IImageOperations source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new CubicBezierLineSegment(points)), options); @@ -103,7 +103,7 @@ public static Image DrawBeziers(this Image source, IPen< /// The pen. /// The points. /// The . - public static Image DrawBeziers(this Image source, IPen pen, PointF[] points) + public static IImageOperations DrawBeziers(this IImageOperations source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new CubicBezierLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/DrawLines.cs b/src/ImageSharp.Drawing/Paths/DrawLines.cs index 3ce0dc4da6..db1e46af8a 100644 --- a/src/ImageSharp.Drawing/Paths/DrawLines.cs +++ b/src/ImageSharp.Drawing/Paths/DrawLines.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static Image DrawLines(this Image source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawLines(this IImageOperations source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points)), options); @@ -43,7 +43,7 @@ public static Image DrawLines(this Image source, IBrush< /// The thickness. /// The points. /// The . - public static Image DrawLines(this Image source, IBrush brush, float thickness, PointF[] points) + public static IImageOperations DrawLines(this IImageOperations source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points))); @@ -58,7 +58,7 @@ public static Image DrawLines(this Image source, IBrush< /// The thickness. /// The points. /// The . - public static Image DrawLines(this Image source, TPixel color, float thickness, PointF[] points) + public static IImageOperations DrawLines(this IImageOperations source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawLines(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static Image DrawLines(this Image source, TPixel /// The points. /// The options. /// The .> - public static Image DrawLines(this Image source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawLines(this IImageOperations source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawLines(new SolidBrush(color), thickness, points, options); @@ -89,7 +89,7 @@ public static Image DrawLines(this Image source, TPixel /// The points. /// The options. /// The . - public static Image DrawLines(this Image source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawLines(this IImageOperations source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new LinearLineSegment(points)), options); @@ -103,7 +103,7 @@ public static Image DrawLines(this Image source, IPenThe pen. /// The points. /// The . - public static Image DrawLines(this Image source, IPen pen, PointF[] points) + public static IImageOperations DrawLines(this IImageOperations source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new LinearLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/DrawPath.cs b/src/ImageSharp.Drawing/Paths/DrawPath.cs index 1fba06370d..57ce2032a9 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPath.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPath.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The path. /// The options. /// The . - public static Image Draw(this Image source, IPen pen, IPath path, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, IPen pen, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(pen.StrokeFill, new ShapePath(path, pen), options); @@ -39,7 +39,7 @@ public static Image Draw(this Image source, IPen /// The pen. /// The path. /// The . - public static Image Draw(this Image source, IPen pen, IPath path) + public static IImageOperations Draw(this IImageOperations source, IPen pen, IPath path) where TPixel : struct, IPixel { return source.Draw(pen, path, GraphicsOptions.Default); @@ -55,7 +55,7 @@ public static Image Draw(this Image source, IPen /// The shape. /// The options. /// The . - public static Image Draw(this Image source, IBrush brush, float thickness, IPath path, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), path, options); @@ -70,7 +70,7 @@ public static Image Draw(this Image source, IBrushThe thickness. /// The path. /// The . - public static Image Draw(this Image source, IBrush brush, float thickness, IPath path) + public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, IPath path) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), path); @@ -86,7 +86,7 @@ public static Image Draw(this Image source, IBrushThe path. /// The options. /// The . - public static Image Draw(this Image source, TPixel color, float thickness, IPath path, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, path, options); @@ -101,7 +101,7 @@ public static Image Draw(this Image source, TPixel color /// The thickness. /// The path. /// The . - public static Image Draw(this Image source, TPixel color, float thickness, IPath path) + public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, IPath path) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, path); diff --git a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs b/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs index 877737653d..f909e98da6 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The paths. /// The options. /// The . - public static Image Draw(this Image source, IPen pen, IPathCollection paths, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, IPen pen, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { foreach (IPath path in paths) @@ -44,7 +44,7 @@ public static Image Draw(this Image source, IPen /// The pen. /// The paths. /// The . - public static Image Draw(this Image source, IPen pen, IPathCollection paths) + public static IImageOperations Draw(this IImageOperations source, IPen pen, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(pen, paths, GraphicsOptions.Default); @@ -60,7 +60,7 @@ public static Image Draw(this Image source, IPen /// The shapes. /// The options. /// The . - public static Image Draw(this Image source, IBrush brush, float thickness, IPathCollection paths, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), paths, options); @@ -75,7 +75,7 @@ public static Image Draw(this Image source, IBrushThe thickness. /// The paths. /// The . - public static Image Draw(this Image source, IBrush brush, float thickness, IPathCollection paths) + public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), paths); @@ -91,7 +91,7 @@ public static Image Draw(this Image source, IBrushThe paths. /// The options. /// The . - public static Image Draw(this Image source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, paths, options); @@ -106,7 +106,7 @@ public static Image Draw(this Image source, TPixel color /// The thickness. /// The paths. /// The . - public static Image Draw(this Image source, TPixel color, float thickness, IPathCollection paths) + public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, paths); diff --git a/src/ImageSharp.Drawing/Paths/DrawPolygon.cs b/src/ImageSharp.Drawing/Paths/DrawPolygon.cs index 4fa469a496..b787afcd58 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPolygon.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPolygon.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static Image DrawPolygon(this Image source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawPolygon(this IImageOperations source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Polygon(new LinearLineSegment(points)), options); @@ -43,7 +43,7 @@ public static Image DrawPolygon(this Image source, IBrus /// The thickness. /// The points. /// The . - public static Image DrawPolygon(this Image source, IBrush brush, float thickness, PointF[] points) + public static IImageOperations DrawPolygon(this IImageOperations source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Polygon(new LinearLineSegment(points))); @@ -58,7 +58,7 @@ public static Image DrawPolygon(this Image source, IBrus /// The thickness. /// The points. /// The . - public static Image DrawPolygon(this Image source, TPixel color, float thickness, PointF[] points) + public static IImageOperations DrawPolygon(this IImageOperations source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawPolygon(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static Image DrawPolygon(this Image source, TPixe /// The points. /// The options. /// The . - public static Image DrawPolygon(this Image source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawPolygon(this IImageOperations source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawPolygon(new SolidBrush(color), thickness, points, options); @@ -88,7 +88,7 @@ public static Image DrawPolygon(this Image source, TPixe /// The pen. /// The points. /// The . - public static Image DrawPolygon(this Image source, IPen pen, PointF[] points) + public static IImageOperations DrawPolygon(this IImageOperations source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Polygon(new LinearLineSegment(points)), GraphicsOptions.Default); @@ -103,7 +103,7 @@ public static Image DrawPolygon(this Image source, IPen< /// The points. /// The options. /// The . - public static Image DrawPolygon(this Image source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageOperations DrawPolygon(this IImageOperations source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Polygon(new LinearLineSegment(points)), options); diff --git a/src/ImageSharp.Drawing/Paths/DrawRectangle.cs b/src/ImageSharp.Drawing/Paths/DrawRectangle.cs index b3f0e6fc3b..544ca2fe96 100644 --- a/src/ImageSharp.Drawing/Paths/DrawRectangle.cs +++ b/src/ImageSharp.Drawing/Paths/DrawRectangle.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The shape. /// The options. /// The . - public static Image Draw(this Image source, IPen pen, RectangleF shape, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, IPen pen, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height), options); @@ -39,7 +39,7 @@ public static Image Draw(this Image source, IPen /// The pen. /// The shape. /// The . - public static Image Draw(this Image source, IPen pen, RectangleF shape) + public static IImageOperations Draw(this IImageOperations source, IPen pen, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(pen, shape, GraphicsOptions.Default); @@ -55,7 +55,7 @@ public static Image Draw(this Image source, IPen /// The shape. /// The options. /// The . - public static Image Draw(this Image source, IBrush brush, float thickness, RectangleF shape, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), shape, options); @@ -70,7 +70,7 @@ public static Image Draw(this Image source, IBrushThe thickness. /// The shape. /// The . - public static Image Draw(this Image source, IBrush brush, float thickness, RectangleF shape) + public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), shape); @@ -86,7 +86,7 @@ public static Image Draw(this Image source, IBrushThe shape. /// The options. /// The . - public static Image Draw(this Image source, TPixel color, float thickness, RectangleF shape, GraphicsOptions options) + public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, shape, options); @@ -101,7 +101,7 @@ public static Image Draw(this Image source, TPixel color /// The thickness. /// The shape. /// The . - public static Image Draw(this Image source, TPixel color, float thickness, RectangleF shape) + public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, shape); diff --git a/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs b/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs index abb5ef73a7..eae34f0342 100644 --- a/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs +++ b/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The shape. /// The graphics options. /// The . - public static Image Fill(this Image source, IBrush brush, Action path, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, Action path, GraphicsOptions options) where TPixel : struct, IPixel { var pb = new PathBuilder(); @@ -42,7 +42,7 @@ public static Image Fill(this Image source, IBrushThe brush. /// The path. /// The . - public static Image Fill(this Image source, IBrush brush, Action path) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, Action path) where TPixel : struct, IPixel { return source.Fill(brush, path, GraphicsOptions.Default); @@ -57,7 +57,7 @@ public static Image Fill(this Image source, IBrushThe path. /// The options. /// The . - public static Image Fill(this Image source, TPixel color, Action path, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, TPixel color, Action path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path, options); @@ -71,7 +71,7 @@ public static Image Fill(this Image source, TPixel color /// The color. /// The path. /// The . - public static Image Fill(this Image source, TPixel color, Action path) + public static IImageOperations Fill(this IImageOperations source, TPixel color, Action path) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path); diff --git a/src/ImageSharp.Drawing/Paths/FillPathCollection.cs b/src/ImageSharp.Drawing/Paths/FillPathCollection.cs index 3ea9fb94b8..662245dc30 100644 --- a/src/ImageSharp.Drawing/Paths/FillPathCollection.cs +++ b/src/ImageSharp.Drawing/Paths/FillPathCollection.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shapes. /// The graphics options. /// The . - public static Image Fill(this Image source, IBrush brush, IPathCollection paths, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { foreach (IPath s in paths) @@ -43,7 +43,7 @@ public static Image Fill(this Image source, IBrushThe brush. /// The paths. /// The . - public static Image Fill(this Image source, IBrush brush, IPathCollection paths) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, IPathCollection paths) where TPixel : struct, IPixel { return source.Fill(brush, paths, GraphicsOptions.Default); @@ -58,7 +58,7 @@ public static Image Fill(this Image source, IBrushThe paths. /// The options. /// The . - public static Image Fill(this Image source, TPixel color, IPathCollection paths, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, TPixel color, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), paths, options); @@ -72,7 +72,7 @@ public static Image Fill(this Image source, TPixel color /// The color. /// The paths. /// The . - public static Image Fill(this Image source, TPixel color, IPathCollection paths) + public static IImageOperations Fill(this IImageOperations source, TPixel color, IPathCollection paths) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), paths); diff --git a/src/ImageSharp.Drawing/Paths/FillPaths.cs b/src/ImageSharp.Drawing/Paths/FillPaths.cs index f579c4ad02..07342d47b9 100644 --- a/src/ImageSharp.Drawing/Paths/FillPaths.cs +++ b/src/ImageSharp.Drawing/Paths/FillPaths.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shape. /// The graphics options. /// The . - public static Image Fill(this Image source, IBrush brush, IPath path, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new ShapeRegion(path), options); @@ -38,7 +38,7 @@ public static Image Fill(this Image source, IBrushThe brush. /// The path. /// The . - public static Image Fill(this Image source, IBrush brush, IPath path) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, IPath path) where TPixel : struct, IPixel { return source.Fill(brush, new ShapeRegion(path), GraphicsOptions.Default); @@ -53,7 +53,7 @@ public static Image Fill(this Image source, IBrushThe path. /// The options. /// The . - public static Image Fill(this Image source, TPixel color, IPath path, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, TPixel color, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path, options); @@ -67,7 +67,7 @@ public static Image Fill(this Image source, TPixel color /// The color. /// The path. /// The . - public static Image Fill(this Image source, TPixel color, IPath path) + public static IImageOperations Fill(this IImageOperations source, TPixel color, IPath path) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path); diff --git a/src/ImageSharp.Drawing/Paths/FillPolygon.cs b/src/ImageSharp.Drawing/Paths/FillPolygon.cs index 6266d3bd64..7feac5b0a4 100644 --- a/src/ImageSharp.Drawing/Paths/FillPolygon.cs +++ b/src/ImageSharp.Drawing/Paths/FillPolygon.cs @@ -27,7 +27,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static Image FillPolygon(this Image source, IBrush brush, PointF[] points, GraphicsOptions options) + public static IImageOperations FillPolygon(this IImageOperations source, IBrush brush, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new Polygon(new LinearLineSegment(points)), options); @@ -41,7 +41,7 @@ public static Image FillPolygon(this Image source, IBrus /// The brush. /// The points. /// The . - public static Image FillPolygon(this Image source, IBrush brush, PointF[] points) + public static IImageOperations FillPolygon(this IImageOperations source, IBrush brush, PointF[] points) where TPixel : struct, IPixel { return source.Fill(brush, new Polygon(new LinearLineSegment(points))); @@ -56,7 +56,7 @@ public static Image FillPolygon(this Image source, IBrus /// The points. /// The options. /// The . - public static Image FillPolygon(this Image source, TPixel color, PointF[] points, GraphicsOptions options) + public static IImageOperations FillPolygon(this IImageOperations source, TPixel color, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), new Polygon(new LinearLineSegment(points)), options); @@ -70,7 +70,7 @@ public static Image FillPolygon(this Image source, TPixe /// The color. /// The points. /// The . - public static Image FillPolygon(this Image source, TPixel color, PointF[] points) + public static IImageOperations FillPolygon(this IImageOperations source, TPixel color, PointF[] points) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), new Polygon(new LinearLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/FillRectangle.cs b/src/ImageSharp.Drawing/Paths/FillRectangle.cs index bd6460cf90..52512ca1cb 100644 --- a/src/ImageSharp.Drawing/Paths/FillRectangle.cs +++ b/src/ImageSharp.Drawing/Paths/FillRectangle.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shape. /// The options. /// The . - public static Image Fill(this Image source, IBrush brush, RectangleF shape, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height), options); @@ -38,7 +38,7 @@ public static Image Fill(this Image source, IBrushThe brush. /// The shape. /// The . - public static Image Fill(this Image source, IBrush brush, RectangleF shape) + public static IImageOperations Fill(this IImageOperations source, IBrush brush, RectangleF shape) where TPixel : struct, IPixel { return source.Fill(brush, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height)); @@ -53,7 +53,7 @@ public static Image Fill(this Image source, IBrushThe shape. /// The options. /// The . - public static Image Fill(this Image source, TPixel color, RectangleF shape, GraphicsOptions options) + public static IImageOperations Fill(this IImageOperations source, TPixel color, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), shape, options); @@ -67,7 +67,7 @@ public static Image Fill(this Image source, TPixel color /// The color. /// The shape. /// The . - public static Image Fill(this Image source, TPixel color, RectangleF shape) + public static IImageOperations Fill(this IImageOperations source, TPixel color, RectangleF shape) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), shape); diff --git a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs index 62344b1012..07a3ae8c29 100644 --- a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs @@ -70,7 +70,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan { if (targetImage.Bounds.Size != this.Size) { - targetImage = disposableImage = new Image(this.Image).Resize(this.Size.Width, this.Size.Height); + targetImage = disposableImage = this.Image.Generate(x => x.Resize(this.Size.Width, this.Size.Height)); } // Align start/end positions. diff --git a/src/ImageSharp.Drawing/Text/DrawText.Path.cs b/src/ImageSharp.Drawing/Text/DrawText.Path.cs index 523813188a..459d5de0d8 100644 --- a/src/ImageSharp.Drawing/Text/DrawText.Path.cs +++ b/src/ImageSharp.Drawing/Text/DrawText.Path.cs @@ -31,7 +31,7 @@ public static partial class ImageExtensions /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, TPixel color, IPath path) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, TPixel color, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, color, path, TextGraphicsOptions.Default); @@ -50,7 +50,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, TPixel color, IPath path, TextGraphicsOptions options) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, TPixel color, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, Brushes.Solid(color), null, path, options); @@ -68,7 +68,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IBrush brush, IPath path) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, path, TextGraphicsOptions.Default); @@ -87,7 +87,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IBrush brush, IPath path, TextGraphicsOptions options) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, null, path, options); @@ -105,7 +105,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IPen pen, IPath path) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IPen pen, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, pen, path, TextGraphicsOptions.Default); @@ -124,7 +124,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IPen pen, IPath path, TextGraphicsOptions options) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IPen pen, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, null, pen, path, options); @@ -143,7 +143,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IBrush brush, IPen pen, IPath path) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPen pen, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, pen, path, TextGraphicsOptions.Default); @@ -163,16 +163,11 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IBrush brush, IPen pen, IPath path, TextGraphicsOptions options) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPen pen, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { float dpiX = DefaultTextDpi; float dpiY = DefaultTextDpi; - if (options.UseImageResolution) - { - dpiX = (float)source.MetaData.HorizontalResolution; - dpiY = (float)source.MetaData.VerticalResolution; - } var style = new RendererOptions(font, dpiX, dpiY) { diff --git a/src/ImageSharp.Drawing/Text/DrawText.cs b/src/ImageSharp.Drawing/Text/DrawText.cs index 6352836a9c..989322a739 100644 --- a/src/ImageSharp.Drawing/Text/DrawText.cs +++ b/src/ImageSharp.Drawing/Text/DrawText.cs @@ -34,7 +34,7 @@ public static partial class ImageExtensions /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, TPixel color, PointF location) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, TPixel color, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, color, location, TextGraphicsOptions.Default); @@ -53,7 +53,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, TPixel color, PointF location, TextGraphicsOptions options) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, TPixel color, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, Brushes.Solid(color), null, location, options); @@ -71,7 +71,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IBrush brush, PointF location) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, location, TextGraphicsOptions.Default); @@ -90,7 +90,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IBrush brush, PointF location, TextGraphicsOptions options) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, null, location, options); @@ -108,7 +108,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IPen pen, PointF location) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IPen pen, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, pen, location, TextGraphicsOptions.Default); @@ -127,7 +127,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IPen pen, PointF location, TextGraphicsOptions options) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IPen pen, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, null, pen, location, options); @@ -146,7 +146,7 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IBrush brush, IPen pen, PointF location) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPen pen, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, pen, location, TextGraphicsOptions.Default); @@ -166,16 +166,11 @@ public static Image DrawText(this Image source, string t /// /// The . /// - public static Image DrawText(this Image source, string text, Font font, IBrush brush, IPen pen, PointF location, TextGraphicsOptions options) + public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPen pen, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { float dpiX = DefaultTextDpi; float dpiY = DefaultTextDpi; - if (options.UseImageResolution) - { - dpiX = (float)source.MetaData.HorizontalResolution; - dpiY = (float)source.MetaData.VerticalResolution; - } var style = new RendererOptions(font, dpiX, dpiY, location) { diff --git a/src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs b/src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs index 593ac36d4f..e360e8aeed 100644 --- a/src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs +++ b/src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs @@ -29,8 +29,6 @@ public struct TextGraphicsOptions private PixelBlenderMode blenderMode; - private bool? useImageResolution; - private float wrapTextWidth; private SixLabors.Fonts.HorizontalAlignment? horizontalAlignment; @@ -44,7 +42,6 @@ public TextGraphicsOptions(bool enableAntialiasing) { this.applyKerning = true; this.tabWidth = 4; - this.useImageResolution = false; this.wrapTextWidth = 0; this.horizontalAlignment = HorizontalAlignment.Left; this.verticalAlignment = VerticalAlignment.Top; @@ -89,12 +86,6 @@ public TextGraphicsOptions(bool enableAntialiasing) /// public float TabWidth { get => this.tabWidth ?? 4; set => this.tabWidth = value; } - /// - /// Gets or sets a value indicating whether to use the current image resultion to for point size scaling. - /// If this is [false] the text renders at 72dpi otherwise it renders at Image resolution - /// - public bool UseImageResolution { get => this.useImageResolution ?? false; set => this.useImageResolution = value; } - /// /// Gets or sets a value indicating if greater than zero determine the width at which text should wrap. /// diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs new file mode 100644 index 0000000000..2a9c3ccbef --- /dev/null +++ b/src/ImageSharp/ApplyProcessors.cs @@ -0,0 +1,100 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp +{ + using System; + + using ImageSharp.PixelFormats; + + using ImageSharp.Processing; + + /// + /// Extension methods for the type. + /// + public static partial class ImageExtensions + { + /// + /// Mutates the image by applying the operations to it. + /// + /// The pixel format. + /// The image to rotate, flip, or both. + /// The operations to perform on the source. + public static void Mutate(this Image source, Action> operations) + where TPixel : struct, IPixel + { + Guard.NotNull(operations, nameof(operations)); + + // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing + var operationsRunner = new ImageOperations(source); + operations(operationsRunner); + } + + /// + /// Mutates the image by applying the operations to it. + /// + /// The pixel format. + /// The image to rotate, flip, or both. + /// The operations to perform on the source. + public static void Mutate(this Image source, params IImageProcessor[] operations) + where TPixel : struct, IPixel + { + Guard.NotNull(operations, nameof(operations)); + + // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing + var operationsRunner = new ImageOperations(source); + operationsRunner.ApplyProcessors(operations); + } + + /// + /// Mutates the image by applying the operations to it. + /// + /// The pixel format. + /// The image to rotate, flip, or both. + /// The operations to perform on the source. + /// Anew Image which has teh data from the but with the applied. + public static Image Generate(this Image source, Action> operations) + where TPixel : struct, IPixel + { + Guard.NotNull(operations, nameof(operations)); + var generated = new Image(source); + + // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing + var operationsRunner = new ImageOperations(generated); + operations(operationsRunner); + return generated; + } + + /// + /// Mutates the image by applying the operations to it. + /// + /// The pixel format. + /// The image to rotate, flip, or both. + /// The operations to perform on the source. + /// Anew Image which has teh data from the but with the applied. + public static Image Generate(this Image source, params IImageProcessor[] operations) + where TPixel : struct, IPixel + { + Guard.NotNull(operations, nameof(operations)); + var generated = new Image(source); + + // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing + var operationsRunner = new ImageOperations(generated); + operationsRunner.ApplyProcessors(operations); + return generated; + } + + /// + /// Mutates the image by applying the operations to it. + /// + /// The pixel format. + /// The image to rotate, flip, or both. + /// The operations to perform on the source. + /// returns the current optinoatins class to allow chaining of oprations. + public static IImageOperations Run(this IImageOperations source, Action> operation) + where TPixel : struct, IPixel + => source.ApplyProcessor(new DelegateImageProcessor(operation)); + } +} diff --git a/src/ImageSharp/Formats/Bmp/ImageExtensions.cs b/src/ImageSharp/Formats/Bmp/ImageExtensions.cs index aba24f9997..96d0ceb9f2 100644 --- a/src/ImageSharp/Formats/Bmp/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Bmp/ImageExtensions.cs @@ -24,11 +24,20 @@ public static partial class ImageExtensions /// The image this method extends. /// The stream to save the image to. /// Thrown if the stream is null. - /// - /// The . - /// - public static Image SaveAsBmp(this Image source, Stream stream) + public static void SaveAsBmp(this Image source, Stream stream) where TPixel : struct, IPixel - => source.Save(stream, new BmpEncoder()); + => source.SaveAsBmp(stream, null); + + /// + /// Saves the image to the given stream with the bmp format. + /// + /// The pixel format. + /// The image this method extends. + /// The stream to save the image to. + /// The encoder to save the image with. + /// Thrown if the stream is null. + public static void SaveAsBmp(this Image source, Stream stream, BmpEncoder encoder) + where TPixel : struct, IPixel + => source.Save(stream, encoder ?? source.Configuration.FindEncoder(ImageFormats.Bitmap)); } } diff --git a/src/ImageSharp/Formats/Gif/ImageExtensions.cs b/src/ImageSharp/Formats/Gif/ImageExtensions.cs index ea9c9b5047..717df44238 100644 --- a/src/ImageSharp/Formats/Gif/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Gif/ImageExtensions.cs @@ -24,14 +24,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The stream to save the image to. /// Thrown if the stream is null. - /// - /// The . - /// - public static Image SaveAsGif(this Image source, Stream stream) + public static void SaveAsGif(this Image source, Stream stream) where TPixel : struct, IPixel - { - return SaveAsGif(source, stream, null); - } + => source.SaveAsGif(stream, null); /// /// Saves the image to the given stream with the gif format. @@ -41,16 +36,8 @@ public static Image SaveAsGif(this Image source, Stream /// The stream to save the image to. /// The options for the encoder. /// Thrown if the stream is null. - /// - /// The . - /// - public static Image SaveAsGif(this Image source, Stream stream, GifEncoder encoder) + public static void SaveAsGif(this Image source, Stream stream, GifEncoder encoder) where TPixel : struct, IPixel - { - encoder = encoder ?? new GifEncoder(); - encoder.Encode(source, stream); - - return source; - } + => source.Save(stream, encoder ?? source.Configuration.FindEncoder(ImageFormats.Gif)); } } diff --git a/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs b/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs index 8fbf9e5a74..c69007e664 100644 --- a/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs @@ -24,14 +24,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The stream to save the image to. /// Thrown if the stream is null. - /// - /// The . - /// - public static Image SaveAsJpeg(this Image source, Stream stream) + public static void SaveAsJpeg(this Image source, Stream stream) where TPixel : struct, IPixel - { - return SaveAsJpeg(source, stream, null); - } + => SaveAsJpeg(source, stream, null); /// /// Saves the image to the given stream with the jpeg format. @@ -41,16 +36,8 @@ public static Image SaveAsJpeg(this Image source, Stream /// The stream to save the image to. /// The options for the encoder. /// Thrown if the stream is null. - /// - /// The . - /// - public static Image SaveAsJpeg(this Image source, Stream stream, JpegEncoder encoder) + public static void SaveAsJpeg(this Image source, Stream stream, JpegEncoder encoder) where TPixel : struct, IPixel - { - encoder = encoder ?? new JpegEncoder(); - encoder.Encode(source, stream); - - return source; - } + => source.Save(stream, encoder ?? source.Configuration.FindEncoder(ImageFormats.Jpeg)); } } diff --git a/src/ImageSharp/Formats/Png/ImageExtensions.cs b/src/ImageSharp/Formats/Png/ImageExtensions.cs index c817385760..697380c19f 100644 --- a/src/ImageSharp/Formats/Png/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Png/ImageExtensions.cs @@ -23,14 +23,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The stream to save the image to. /// Thrown if the stream is null. - /// - /// The . - /// - public static Image SaveAsPng(this Image source, Stream stream) + public static void SaveAsPng(this Image source, Stream stream) where TPixel : struct, IPixel - { - return SaveAsPng(source, stream, null); - } + => SaveAsPng(source, stream, null); /// /// Saves the image to the given stream with the png format. @@ -40,16 +35,8 @@ public static Image SaveAsPng(this Image source, Stream /// The stream to save the image to. /// The options for the encoder. /// Thrown if the stream is null. - /// - /// The . - /// - public static Image SaveAsPng(this Image source, Stream stream, PngEncoder encoder) + public static void SaveAsPng(this Image source, Stream stream, PngEncoder encoder) where TPixel : struct, IPixel - { - encoder = encoder ?? new PngEncoder(); - encoder.Encode(source, stream); - - return source; - } + => source.Save(stream, encoder ?? source.Configuration.FindEncoder(ImageFormats.Png)); } } diff --git a/src/ImageSharp/IImageOperations{TPixel}.cs b/src/ImageSharp/IImageOperations{TPixel}.cs new file mode 100644 index 0000000000..a176c0e28a --- /dev/null +++ b/src/ImageSharp/IImageOperations{TPixel}.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp +{ + using System; + using ImageSharp.Formats; + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using SixLabors.Primitives; + + /// + /// The static collection of all the default image formats + /// + /// The pixel format + public interface IImageOperations + where TPixel : struct, IPixel + { + /// + /// Adds the processor to the current setr of image operations to be applied. + /// + /// The processor to apply + /// The area to apply it to + /// returns the current optinoatins class to allow chaining of oprations. + IImageOperations ApplyProcessor(IImageProcessor processor, Rectangle rectangle); + + /// + /// Adds the processor to the current setr of image operations to be applied. + /// + /// The processor to apply + /// returns the current optinoatins class to allow chaining of oprations. + IImageOperations ApplyProcessor(IImageProcessor processor); + } +} \ No newline at end of file diff --git a/src/ImageSharp/Image/IImageProcessor.cs b/src/ImageSharp/Image/IImageProcessor.cs index 8687766d5e..1e144e835c 100644 --- a/src/ImageSharp/Image/IImageProcessor.cs +++ b/src/ImageSharp/Image/IImageProcessor.cs @@ -42,6 +42,6 @@ public interface IImageProcessor /// /// doesnt fit the dimension of the image. /// - void Apply(ImageBase source, Rectangle sourceRectangle); + void Apply(Image source, Rectangle sourceRectangle); } } diff --git a/src/ImageSharp/Image/ImageBase{TPixel}.cs b/src/ImageSharp/Image/ImageBase{TPixel}.cs index 20b891f2dd..d4a7af9ca4 100644 --- a/src/ImageSharp/Image/ImageBase{TPixel}.cs +++ b/src/ImageSharp/Image/ImageBase{TPixel}.cs @@ -194,16 +194,6 @@ public Span GetRowSpan(int x, int y) return this.Pixels.Slice((y * this.Width) + x, this.Width - x); } - /// - /// Applies the processor. - /// - /// The processor. - /// The rectangle. - public virtual void ApplyProcessor(IImageProcessor processor, Rectangle rectangle) - { - processor.Apply(this, rectangle); - } - /// public void Dispose() { diff --git a/src/ImageSharp/Image/ImageProcessingExtensions.cs b/src/ImageSharp/Image/ImageProcessingExtensions.cs index 8eed103d10..44fcba7cfe 100644 --- a/src/ImageSharp/Image/ImageProcessingExtensions.cs +++ b/src/ImageSharp/Image/ImageProcessingExtensions.cs @@ -22,10 +22,10 @@ public static partial class ImageExtensions /// The image this method extends. /// The processor to apply to the image. /// The . - public static Image Apply(this Image source, IImageProcessor processor) + public static IImageOperations Apply(this IImageOperations source, IImageProcessor processor) where TPixel : struct, IPixel { - source.ApplyProcessor(processor, source.Bounds); + source.ApplyProcessor(processor); return source; } } diff --git a/src/ImageSharp/Image/Image{TPixel}.cs b/src/ImageSharp/Image/Image{TPixel}.cs index 5e8bcab31b..13b8655211 100644 --- a/src/ImageSharp/Image/Image{TPixel}.cs +++ b/src/ImageSharp/Image/Image{TPixel}.cs @@ -138,14 +138,10 @@ internal Image(Configuration configuration, int width, int height, ImageMetaData /// /// The processor to apply to the image. /// The structure that specifies the portion of the image object to draw. - public override void ApplyProcessor(IImageProcessor processor, Rectangle rectangle) + public virtual void ApplyProcessor(IImageProcessor processor, Rectangle rectangle) { // we want to put this on on here as it gives us a really go place to test/verify processor settings - base.ApplyProcessor(processor, rectangle); - foreach (ImageFrame sourceFrame in this.Frames) - { - sourceFrame.ApplyProcessor(processor, rectangle); - } + processor.Apply(this, rectangle); } /// diff --git a/src/ImageSharp/ImageOperations.cs b/src/ImageSharp/ImageOperations.cs new file mode 100644 index 0000000000..dde3153d16 --- /dev/null +++ b/src/ImageSharp/ImageOperations.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp +{ + using System.Collections.Generic; + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using SixLabors.Primitives; + + /// + /// The static collection of all the default image formats + /// + /// The pixel format + internal class ImageOperations : IImageOperations + where TPixel : struct, IPixel + { + private readonly Image image; + + /// + /// Initializes a new instance of the class. + /// + /// The image. + public ImageOperations(Image image) + { + this.image = image; + } + + /// + public IImageOperations ApplyProcessor(IImageProcessor processor, Rectangle rectangle) + { + // TODO : make this queue, and allow special processors managage the cloing operation for 'generate' + // to allow things like resize to not need to retain an extra copy of image data in memory, and to + // prevent an pixel copy operation + this.image.ApplyProcessor(processor, rectangle); + return this; + } + + /// + public IImageOperations ApplyProcessor(IImageProcessor processor) + { + return this.ApplyProcessor(processor, this.image.Bounds); + } + + /// + /// Applies a bluck colelctino of pressorce at once + /// + /// Processors to apply + /// this + public IImageOperations ApplyProcessors(IEnumerable> processors) + { + foreach (var processor in processors) + { + return this.ApplyProcessor(processor); + } + + return this; + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Numerics/ValueSize.cs b/src/ImageSharp/Numerics/ValueSize.cs new file mode 100644 index 0000000000..5d81e2f952 --- /dev/null +++ b/src/ImageSharp/Numerics/ValueSize.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp +{ + using SixLabors.Primitives; + + /// + /// Represents a value in relation to a value on the image + /// + internal struct ValueSize + { + /// + /// Initializes a new instance of the struct. + /// + /// The value. + /// The type. + public ValueSize(float value, ValueSizeType type) + { + if (type != ValueSizeType.Absolute) + { + Guard.MustBeBetweenOrEqualTo(value, 0, 1, nameof(value)); + } + + this.Value = value; + this.Type = type; + } + + /// + /// The different vlaue types + /// + public enum ValueSizeType + { + /// + /// The value is the final return value + /// + Absolute, + + /// + /// The value is a percentage of the Images Width + /// + PercentageOfWidth, + + /// + /// The value is a percentage of the Images height + /// + PercentageOfHeight + } + + /// + /// Gets the value. + /// + public float Value { get; } + + /// + /// Gets the type. + /// + public ValueSizeType Type { get; } + + /// + /// Implicitly converts a float into an absolute value + /// + /// the vlaue to use as the absolute figure. + public static implicit operator ValueSize(float d) + => Absolute(d); + + /// + /// Create a new ValueSize with as a PercentageOfWidth type with value set to percentage. + /// + /// The percentage. + /// a Values size with type PercentageOfWidth + public static ValueSize PercentageOfWidth(float percentage) + { + return new ValueSize(percentage, ValueSizeType.PercentageOfWidth); + } + + /// + /// Create a new ValueSize with as a PercentageOfHeight type with value set to percentage. + /// + /// The percentage. + /// a Values size with type PercentageOfHeight + public static ValueSize PercentageOfHeight(float percentage) + { + return new ValueSize(percentage, ValueSizeType.PercentageOfHeight); + } + + /// + /// Create a new ValueSize with as a Absolute type with value set to value. + /// + /// The value. + /// a Values size with type Absolute( + public static ValueSize Absolute(float value) + { + return new ValueSize(value, ValueSizeType.Absolute); + } + + /// + /// Calculates the specified size. + /// + /// The size. + /// The calucalted value + public float Calculate(Size size) + { + switch (this.Type) + { + case ValueSizeType.PercentageOfWidth: + return this.Value * size.Width; + case ValueSizeType.PercentageOfHeight: + return this.Value * size.Height; + case ValueSizeType.Absolute: + default: + return this.Value; + } + } + + /// + public override string ToString() + { + return $"{this.Value} - {this.Type}"; + } + } +} diff --git a/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs b/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs index e37f80c25a..a4ee73af48 100644 --- a/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs +++ b/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs @@ -24,10 +24,11 @@ public static partial class ImageExtensions /// The image this method extends. /// The threshold to apply binarization of the image. Must be between 0 and 1. /// The . - public static Image BinaryThreshold(this Image source, float threshold) + public static IImageOperations BinaryThreshold(this IImageOperations source, float threshold) where TPixel : struct, IPixel { - return BinaryThreshold(source, threshold, source.Bounds); + source.ApplyProcessor(new BinaryThresholdProcessor(threshold)); + return source; } /// @@ -40,7 +41,7 @@ public static Image BinaryThreshold(this Image source, f /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image BinaryThreshold(this Image source, float threshold, Rectangle rectangle) + public static IImageOperations BinaryThreshold(this IImageOperations source, float threshold, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new BinaryThresholdProcessor(threshold), rectangle); diff --git a/src/ImageSharp/Processing/Binarization/Dither.cs b/src/ImageSharp/Processing/Binarization/Dither.cs index efaf63b06c..614eabca79 100644 --- a/src/ImageSharp/Processing/Binarization/Dither.cs +++ b/src/ImageSharp/Processing/Binarization/Dither.cs @@ -25,10 +25,11 @@ public static partial class ImageExtensions /// The ordered ditherer. /// The component index to test the threshold against. Must range from 0 to 3. /// The . - public static Image Dither(this Image source, IOrderedDither dither, int index = 0) + public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, int index = 0) where TPixel : struct, IPixel { - return Dither(source, dither, source.Bounds, index); + source.ApplyProcessor(new OrderedDitherProcessor(dither, index)); + return source; } /// @@ -42,7 +43,7 @@ public static Image Dither(this Image source, IOrderedDi /// /// The component index to test the threshold against. Must range from 0 to 3. /// The . - public static Image Dither(this Image source, IOrderedDither dither, Rectangle rectangle, int index = 0) + public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, Rectangle rectangle, int index = 0) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, index), rectangle); @@ -57,10 +58,11 @@ public static Image Dither(this Image source, IOrderedDi /// The diffusion algorithm to apply. /// The threshold to apply binarization of the image. Must be between 0 and 1. /// The . - public static Image Dither(this Image source, IErrorDiffuser diffuser, float threshold) + public static IImageOperations Dither(this IImageOperations source, IErrorDiffuser diffuser, float threshold) where TPixel : struct, IPixel { - return Dither(source, diffuser, threshold, source.Bounds); + source.ApplyProcessor(new ErrorDiffusionDitherProcessor(diffuser, threshold)); + return source; } /// @@ -74,7 +76,7 @@ public static Image Dither(this Image source, IErrorDiff /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Dither(this Image source, IErrorDiffuser diffuser, float threshold, Rectangle rectangle) + public static IImageOperations Dither(this IImageOperations source, IErrorDiffuser diffuser, float threshold, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new ErrorDiffusionDitherProcessor(diffuser, threshold), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs b/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs index 6a4e3807ba..5710991dc3 100644 --- a/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs +++ b/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs @@ -24,10 +24,11 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image BlackWhite(this Image source) + public static IImageOperations BlackWhite(this IImageOperations source) where TPixel : struct, IPixel { - return BlackWhite(source, source.Bounds); + source.ApplyProcessor(new BlackWhiteProcessor()); + return source; } /// @@ -39,7 +40,7 @@ public static Image BlackWhite(this Image source) /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image BlackWhite(this Image source, Rectangle rectangle) + public static IImageOperations BlackWhite(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new BlackWhiteProcessor(), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs b/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs index 14641afba1..4d83ba9a20 100644 --- a/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs +++ b/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs @@ -25,10 +25,11 @@ public static partial class ImageExtensions /// The image this method extends. /// The type of color blindness simulator to apply. /// The . - public static Image ColorBlindness(this Image source, ColorBlindness colorBlindness) + public static IImageOperations ColorBlindness(this IImageOperations source, ColorBlindness colorBlindness) where TPixel : struct, IPixel { - return ColorBlindness(source, colorBlindness, source.Bounds); + source.ApplyProcessor(GetProcessor(colorBlindness)); + return source; } /// @@ -41,48 +42,35 @@ public static Image ColorBlindness(this Image source, Co /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image ColorBlindness(this Image source, ColorBlindness colorBlindness, Rectangle rectangle) + public static IImageOperations ColorBlindness(this IImageOperations source, ColorBlindness colorBlindness, Rectangle rectangle) where TPixel : struct, IPixel { - IImageProcessor processor; + source.ApplyProcessor(GetProcessor(colorBlindness), rectangle); + return source; + } + private static IImageProcessor GetProcessor(ColorBlindness colorBlindness) + where TPixel : struct, IPixel + { switch (colorBlindness) { case ImageSharp.Processing.ColorBlindness.Achromatomaly: - processor = new AchromatomalyProcessor(); - break; - + return new AchromatomalyProcessor(); case ImageSharp.Processing.ColorBlindness.Achromatopsia: - processor = new AchromatopsiaProcessor(); - break; - + return new AchromatopsiaProcessor(); case ImageSharp.Processing.ColorBlindness.Deuteranomaly: - processor = new DeuteranomalyProcessor(); - break; - + return new DeuteranomalyProcessor(); case ImageSharp.Processing.ColorBlindness.Deuteranopia: - processor = new DeuteranopiaProcessor(); - break; - + return new DeuteranopiaProcessor(); case ImageSharp.Processing.ColorBlindness.Protanomaly: - processor = new ProtanomalyProcessor(); - break; - + return new ProtanomalyProcessor(); case ImageSharp.Processing.ColorBlindness.Protanopia: - processor = new ProtanopiaProcessor(); - break; - + return new ProtanopiaProcessor(); case ImageSharp.Processing.ColorBlindness.Tritanomaly: - processor = new TritanomalyProcessor(); - break; - + return new TritanomalyProcessor(); default: - processor = new TritanopiaProcessor(); - break; + return new TritanopiaProcessor(); } - - source.ApplyProcessor(processor, rectangle); - return source; } } } diff --git a/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs b/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs index 635b6747a6..6cdc3343de 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs @@ -22,7 +22,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image Grayscale(this Image source) + public static IImageOperations Grayscale(this IImageOperations source) where TPixel : struct, IPixel { return Grayscale(source, GrayscaleMode.Bt709); @@ -35,10 +35,15 @@ public static Image Grayscale(this Image source) /// The image this method extends. /// The formula to apply to perform the operation. /// The . - public static Image Grayscale(this Image source, GrayscaleMode mode) + public static IImageOperations Grayscale(this IImageOperations source, GrayscaleMode mode) where TPixel : struct, IPixel { - return Grayscale(source, mode, source.Bounds); + IImageProcessor processor = mode == GrayscaleMode.Bt709 + ? (IImageProcessor)new GrayscaleBt709Processor() + : new GrayscaleBt601Processor(); + + source.ApplyProcessor(processor); + return source; } /// @@ -50,13 +55,10 @@ public static Image Grayscale(this Image source, Graysca /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Grayscale(this Image source, Rectangle rectangle) + public static IImageOperations Grayscale(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel { - IImageProcessor processor = new GrayscaleBt709Processor(); - - source.ApplyProcessor(processor, rectangle); - return source; + return Grayscale(source, GrayscaleMode.Bt709, rectangle); } /// @@ -69,7 +71,7 @@ public static Image Grayscale(this Image source, Rectang /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Grayscale(this Image source, GrayscaleMode mode, Rectangle rectangle) + public static IImageOperations Grayscale(this IImageOperations source, GrayscaleMode mode, Rectangle rectangle) where TPixel : struct, IPixel { IImageProcessor processor = mode == GrayscaleMode.Bt709 diff --git a/src/ImageSharp/Processing/ColorMatrix/Hue.cs b/src/ImageSharp/Processing/ColorMatrix/Hue.cs index d218b3a104..86a5336219 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Hue.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Hue.cs @@ -25,10 +25,11 @@ public static partial class ImageExtensions /// The image this method extends. /// The angle in degrees to adjust the image. /// The . - public static Image Hue(this Image source, float degrees) + public static IImageOperations Hue(this IImageOperations source, float degrees) where TPixel : struct, IPixel { - return Hue(source, degrees, source.Bounds); + source.ApplyProcessor(new HueProcessor(degrees)); + return source; } /// @@ -41,7 +42,7 @@ public static Image Hue(this Image source, float degrees /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Hue(this Image source, float degrees, Rectangle rectangle) + public static IImageOperations Hue(this IImageOperations source, float degrees, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new HueProcessor(degrees), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs b/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs index 09eb131907..2f331d6478 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs @@ -24,10 +24,11 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image Kodachrome(this Image source) + public static IImageOperations Kodachrome(this IImageOperations source) where TPixel : struct, IPixel { - return Kodachrome(source, source.Bounds); + source.ApplyProcessor(new KodachromeProcessor()); + return source; } /// @@ -39,7 +40,7 @@ public static Image Kodachrome(this Image source) /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Kodachrome(this Image source, Rectangle rectangle) + public static IImageOperations Kodachrome(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new KodachromeProcessor(), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs b/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs index bca4577e48..e2c8f3674c 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs @@ -24,10 +24,10 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image Lomograph(this Image source) + public static IImageOperations Lomograph(this IImageOperations source) where TPixel : struct, IPixel { - return Lomograph(source, source.Bounds, GraphicsOptions.Default); + return Lomograph(source, GraphicsOptions.Default); } /// @@ -39,7 +39,7 @@ public static Image Lomograph(this Image source) /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Lomograph(this Image source, Rectangle rectangle) + public static IImageOperations Lomograph(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel { return Lomograph(source, rectangle, GraphicsOptions.Default); @@ -52,10 +52,11 @@ public static Image Lomograph(this Image source, Rectang /// The image this method extends. /// The options effecting pixel blending. /// The . - public static Image Lomograph(this Image source, GraphicsOptions options) + public static IImageOperations Lomograph(this IImageOperations source, GraphicsOptions options) where TPixel : struct, IPixel { - return Lomograph(source, source.Bounds, options); + source.ApplyProcessor(new LomographProcessor(options)); + return source; } /// @@ -68,7 +69,7 @@ public static Image Lomograph(this Image source, Graphic /// /// The options effecting pixel blending. /// The . - public static Image Lomograph(this Image source, Rectangle rectangle, GraphicsOptions options) + public static IImageOperations Lomograph(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new LomographProcessor(options), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs b/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs index b2d8515d6c..bfbf6477b9 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image Polaroid(this Image source) + public static IImageOperations Polaroid(this IImageOperations source) where TPixel : struct, IPixel { return Polaroid(source, GraphicsOptions.Default); @@ -39,7 +39,7 @@ public static Image Polaroid(this Image source) /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Polaroid(this Image source, Rectangle rectangle) + public static IImageOperations Polaroid(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel { return Polaroid(source, rectangle, GraphicsOptions.Default); @@ -52,10 +52,11 @@ public static Image Polaroid(this Image source, Rectangl /// The image this method extends. /// The options effecting pixel blending. /// The . - public static Image Polaroid(this Image source, GraphicsOptions options) + public static IImageOperations Polaroid(this IImageOperations source, GraphicsOptions options) where TPixel : struct, IPixel { - return Polaroid(source, source.Bounds, options); + source.ApplyProcessor(new PolaroidProcessor(options)); + return source; } /// @@ -68,7 +69,7 @@ public static Image Polaroid(this Image source, Graphics /// /// The options effecting pixel blending. /// The . - public static Image Polaroid(this Image source, Rectangle rectangle, GraphicsOptions options) + public static IImageOperations Polaroid(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new PolaroidProcessor(options), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Saturation.cs b/src/ImageSharp/Processing/ColorMatrix/Saturation.cs index 88f3b15296..5a26505272 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Saturation.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Saturation.cs @@ -25,10 +25,11 @@ public static partial class ImageExtensions /// The image this method extends. /// The new saturation of the image. Must be between -100 and 100. /// The . - public static Image Saturation(this Image source, int amount) + public static IImageOperations Saturation(this IImageOperations source, int amount) where TPixel : struct, IPixel { - return Saturation(source, amount, source.Bounds); + source.ApplyProcessor(new SaturationProcessor(amount)); + return source; } /// @@ -41,7 +42,7 @@ public static Image Saturation(this Image source, int am /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Saturation(this Image source, int amount, Rectangle rectangle) + public static IImageOperations Saturation(this IImageOperations source, int amount, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new SaturationProcessor(amount), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Sepia.cs b/src/ImageSharp/Processing/ColorMatrix/Sepia.cs index 000c0ffba8..f4dbb26c1a 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Sepia.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Sepia.cs @@ -24,11 +24,9 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image Sepia(this Image source) + public static IImageOperations Sepia(this IImageOperations source) where TPixel : struct, IPixel - { - return Sepia(source, source.Bounds); - } + => source.ApplyProcessor(new SepiaProcessor()); /// /// Applies sepia toning to the image. @@ -39,11 +37,8 @@ public static Image Sepia(this Image source) /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Sepia(this Image source, Rectangle rectangle) + public static IImageOperations Sepia(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel - { - source.ApplyProcessor(new SepiaProcessor(), rectangle); - return source; - } + => source.ApplyProcessor(new SepiaProcessor(), rectangle); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Convolution/BoxBlur.cs b/src/ImageSharp/Processing/Convolution/BoxBlur.cs index ad5e477dc9..f000a6aa4e 100644 --- a/src/ImageSharp/Processing/Convolution/BoxBlur.cs +++ b/src/ImageSharp/Processing/Convolution/BoxBlur.cs @@ -24,11 +24,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The 'radius' value representing the size of the area to sample. /// The . - public static Image BoxBlur(this Image source, int radius = 7) + public static IImageOperations BoxBlur(this IImageOperations source, int radius = 7) where TPixel : struct, IPixel - { - return BoxBlur(source, radius, source.Bounds); - } + => source.ApplyProcessor(new BoxBlurProcessor(radius)); /// /// Applies a box blur to the image. @@ -40,11 +38,8 @@ public static Image BoxBlur(this Image source, int radiu /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image BoxBlur(this Image source, int radius, Rectangle rectangle) + public static IImageOperations BoxBlur(this IImageOperations source, int radius, Rectangle rectangle) where TPixel : struct, IPixel - { - source.ApplyProcessor(new BoxBlurProcessor(radius), rectangle); - return source; - } + => source.ApplyProcessor(new BoxBlurProcessor(radius), rectangle); } } diff --git a/src/ImageSharp/Processing/Convolution/DetectEdges.cs b/src/ImageSharp/Processing/Convolution/DetectEdges.cs index 1cc8b693ff..14bcf20598 100644 --- a/src/ImageSharp/Processing/Convolution/DetectEdges.cs +++ b/src/ImageSharp/Processing/Convolution/DetectEdges.cs @@ -25,10 +25,10 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image DetectEdges(this Image source) + public static IImageOperations DetectEdges(this IImageOperations source) where TPixel : struct, IPixel { - return DetectEdges(source, source.Bounds, new SobelProcessor { Grayscale = true }); + return DetectEdges(source, new SobelProcessor { Grayscale = true }); } /// @@ -41,7 +41,7 @@ public static Image DetectEdges(this Image source) /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image DetectEdges(this Image source, Rectangle rectangle) + public static IImageOperations DetectEdges(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel { return DetectEdges(source, rectangle, new SobelProcessor { Grayscale = true }); @@ -55,11 +55,9 @@ public static Image DetectEdges(this Image source, Recta /// The filter for detecting edges. /// Whether to convert the image to Grayscale first. Defaults to true. /// The . - public static Image DetectEdges(this Image source, EdgeDetection filter, bool grayscale = true) + public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter, bool grayscale = true) where TPixel : struct, IPixel - { - return DetectEdges(source, filter, source.Bounds, grayscale); - } + => DetectEdges(source, GetProcessor(filter, grayscale)); /// /// Detects any edges within the image. @@ -72,7 +70,41 @@ public static Image DetectEdges(this Image source, EdgeD /// /// Whether to convert the image to Grayscale first. Defaults to true. /// The . - public static Image DetectEdges(this Image source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true) + public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true) + where TPixel : struct, IPixel + => DetectEdges(source, rectangle, GetProcessor(filter, grayscale)); + + /// + /// Detects any edges within the image. + /// + /// The pixel format. + /// The image this method extends. + /// The filter for detecting edges. + /// The . + public static IImageOperations DetectEdges(this IImageOperations source, IEdgeDetectorProcessor filter) + where TPixel : struct, IPixel + { + return source.ApplyProcessor(filter); + } + + /// + /// Detects any edges within the image. + /// + /// The pixel format. + /// The image this method extends. + /// + /// The structure that specifies the portion of the image object to alter. + /// + /// The filter for detecting edges. + /// The . + public static IImageOperations DetectEdges(this IImageOperations source, Rectangle rectangle, IEdgeDetectorProcessor filter) + where TPixel : struct, IPixel + { + source.ApplyProcessor(filter, rectangle); + return source; + } + + private static IEdgeDetectorProcessor GetProcessor(EdgeDetection filter, bool grayscale) where TPixel : struct, IPixel { IEdgeDetectorProcessor processor; @@ -120,37 +152,7 @@ public static Image DetectEdges(this Image source, EdgeD break; } - return DetectEdges(source, rectangle, processor); - } - - /// - /// Detects any edges within the image. - /// - /// The pixel format. - /// The image this method extends. - /// The filter for detecting edges. - /// The . - public static Image DetectEdges(this Image source, IEdgeDetectorProcessor filter) - where TPixel : struct, IPixel - { - return DetectEdges(source, source.Bounds, filter); - } - - /// - /// Detects any edges within the image. - /// - /// The pixel format. - /// The image this method extends. - /// - /// The structure that specifies the portion of the image object to alter. - /// - /// The filter for detecting edges. - /// The . - public static Image DetectEdges(this Image source, Rectangle rectangle, IEdgeDetectorProcessor filter) - where TPixel : struct, IPixel - { - source.ApplyProcessor(filter, rectangle); - return source; + return processor; } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs index f9658fcb5d..7d551ceb8d 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs @@ -25,11 +25,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The 'sigma' value representing the weight of the blur. /// The . - public static Image GaussianBlur(this Image source, float sigma = 3f) + public static IImageOperations GaussianBlur(this IImageOperations source, float sigma = 3f) where TPixel : struct, IPixel - { - return GaussianBlur(source, sigma, source.Bounds); - } + => source.ApplyProcessor(new GaussianBlurProcessor(sigma)); /// /// Applies a Gaussian blur to the image. @@ -41,11 +39,8 @@ public static Image GaussianBlur(this Image source, floa /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image GaussianBlur(this Image source, float sigma, Rectangle rectangle) + public static IImageOperations GaussianBlur(this IImageOperations source, float sigma, Rectangle rectangle) where TPixel : struct, IPixel - { - source.ApplyProcessor(new GaussianBlurProcessor(sigma), rectangle); - return source; - } + => source.ApplyProcessor(new GaussianBlurProcessor(sigma), rectangle); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs index bb616cc67e..58c5ad12ac 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs @@ -25,11 +25,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The 'sigma' value representing the weight of the blur. /// The . - public static Image GaussianSharpen(this Image source, float sigma = 3f) + public static IImageOperations GaussianSharpen(this IImageOperations source, float sigma = 3f) where TPixel : struct, IPixel - { - return GaussianSharpen(source, sigma, source.Bounds); - } + => source.ApplyProcessor(new GaussianSharpenProcessor(sigma)); /// /// Applies a Gaussian sharpening filter to the image. @@ -41,11 +39,8 @@ public static Image GaussianSharpen(this Image source, f /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image GaussianSharpen(this Image source, float sigma, Rectangle rectangle) + public static IImageOperations GaussianSharpen(this IImageOperations source, float sigma, Rectangle rectangle) where TPixel : struct, IPixel - { - source.ApplyProcessor(new GaussianSharpenProcessor(sigma), rectangle); - return source; - } + => source.ApplyProcessor(new GaussianSharpenProcessor(sigma), rectangle); } } diff --git a/src/ImageSharp/Processing/DelegateImageProcessor.cs b/src/ImageSharp/Processing/DelegateImageProcessor.cs new file mode 100644 index 0000000000..e1d1060c67 --- /dev/null +++ b/src/ImageSharp/Processing/DelegateImageProcessor.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Processing +{ + using System; + using System.Threading.Tasks; + + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + + /// + /// Allows the application of processors to images. + /// + /// The pixel format. + internal class DelegateImageProcessor : ImageProcessor + where TPixel : struct, IPixel + { + private readonly Action> action; + + /// + /// Initializes a new instance of the class. + /// + /// The action. + public DelegateImageProcessor(Action> action) + { + this.action = action; + } + + /// + protected override void BeforeImageApply(Image source, Rectangle sourceRectangle) + { + this.action?.Invoke((Image)source); + } + + /// + protected override void OnApply(ImageBase source, Rectangle sourceRectangle) + { + // no op, we did all we wanted to do inside BeforeImageApply + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Effects/Alpha.cs b/src/ImageSharp/Processing/Effects/Alpha.cs index a0d218651a..4978caf86c 100644 --- a/src/ImageSharp/Processing/Effects/Alpha.cs +++ b/src/ImageSharp/Processing/Effects/Alpha.cs @@ -24,11 +24,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The new opacity of the image. Must be between 0 and 1. /// The . - public static Image Alpha(this Image source, float percent) + public static IImageOperations Alpha(this IImageOperations source, float percent) where TPixel : struct, IPixel - { - return Alpha(source, percent, source.Bounds); - } + => source.ApplyProcessor(new AlphaProcessor(percent)); /// /// Alters the alpha component of the image. @@ -40,11 +38,8 @@ public static Image Alpha(this Image source, float perce /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Alpha(this Image source, float percent, Rectangle rectangle) + public static IImageOperations Alpha(this IImageOperations source, float percent, Rectangle rectangle) where TPixel : struct, IPixel - { - source.ApplyProcessor(new AlphaProcessor(percent), rectangle); - return source; - } + => source.ApplyProcessor(new AlphaProcessor(percent), rectangle); } } diff --git a/src/ImageSharp/Processing/Effects/BackgroundColor.cs b/src/ImageSharp/Processing/Effects/BackgroundColor.cs index a1e04c8a3d..276bfa2a72 100644 --- a/src/ImageSharp/Processing/Effects/BackgroundColor.cs +++ b/src/ImageSharp/Processing/Effects/BackgroundColor.cs @@ -25,11 +25,9 @@ public static partial class ImageExtensions /// The color to set as the background. /// The options effecting pixel blending. /// The . - public static Image BackgroundColor(this Image source, TPixel color, GraphicsOptions options) + public static IImageOperations BackgroundColor(this IImageOperations source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel - { - return BackgroundColor(source, color, source.Bounds, options); - } + => source.ApplyProcessor(new BackgroundColorProcessor(color, options)); /// /// Replaces the background color of image with the given one. @@ -42,12 +40,9 @@ public static Image BackgroundColor(this Image source, T /// /// The options effecting pixel blending. /// The . - public static Image BackgroundColor(this Image source, TPixel color, Rectangle rectangle, GraphicsOptions options) + public static IImageOperations BackgroundColor(this IImageOperations source, TPixel color, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel - { - source.ApplyProcessor(new BackgroundColorProcessor(color, options), rectangle); - return source; - } + => source.ApplyProcessor(new BackgroundColorProcessor(color, options), rectangle); /// /// Replaces the background color of image with the given one. @@ -56,7 +51,7 @@ public static Image BackgroundColor(this Image source, T /// The image this method extends. /// The color to set as the background. /// The . - public static Image BackgroundColor(this Image source, TPixel color) + public static IImageOperations BackgroundColor(this IImageOperations source, TPixel color) where TPixel : struct, IPixel { return BackgroundColor(source, color, GraphicsOptions.Default); @@ -72,7 +67,7 @@ public static Image BackgroundColor(this Image source, T /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image BackgroundColor(this Image source, TPixel color, Rectangle rectangle) + public static IImageOperations BackgroundColor(this IImageOperations source, TPixel color, Rectangle rectangle) where TPixel : struct, IPixel { return BackgroundColor(source, color, rectangle, GraphicsOptions.Default); diff --git a/src/ImageSharp/Processing/Effects/Brightness.cs b/src/ImageSharp/Processing/Effects/Brightness.cs index 165f897b80..9bc27e75d7 100644 --- a/src/ImageSharp/Processing/Effects/Brightness.cs +++ b/src/ImageSharp/Processing/Effects/Brightness.cs @@ -24,11 +24,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The new brightness of the image. Must be between -100 and 100. /// The . - public static Image Brightness(this Image source, int amount) + public static IImageOperations Brightness(this IImageOperations source, int amount) where TPixel : struct, IPixel - { - return Brightness(source, amount, source.Bounds); - } + => source.ApplyProcessor(new BrightnessProcessor(amount)); /// /// Alters the brightness component of the image. @@ -40,11 +38,8 @@ public static Image Brightness(this Image source, int am /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Brightness(this Image source, int amount, Rectangle rectangle) + public static IImageOperations Brightness(this IImageOperations source, int amount, Rectangle rectangle) where TPixel : struct, IPixel - { - source.ApplyProcessor(new BrightnessProcessor(amount), rectangle); - return source; - } + => source.ApplyProcessor(new BrightnessProcessor(amount), rectangle); } } diff --git a/src/ImageSharp/Processing/Effects/Contrast.cs b/src/ImageSharp/Processing/Effects/Contrast.cs index 0a55fd067b..52eb0d5eca 100644 --- a/src/ImageSharp/Processing/Effects/Contrast.cs +++ b/src/ImageSharp/Processing/Effects/Contrast.cs @@ -24,11 +24,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The new contrast of the image. Must be between -100 and 100. /// The . - public static Image Contrast(this Image source, int amount) + public static IImageOperations Contrast(this IImageOperations source, int amount) where TPixel : struct, IPixel - { - return Contrast(source, amount, source.Bounds); - } + => source.ApplyProcessor(new ContrastProcessor(amount)); /// /// Alters the contrast component of the image. @@ -40,11 +38,8 @@ public static Image Contrast(this Image source, int amou /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Contrast(this Image source, int amount, Rectangle rectangle) + public static IImageOperations Contrast(this IImageOperations source, int amount, Rectangle rectangle) where TPixel : struct, IPixel - { - source.ApplyProcessor(new ContrastProcessor(amount), rectangle); - return source; - } + => source.ApplyProcessor(new ContrastProcessor(amount), rectangle); } } diff --git a/src/ImageSharp/Processing/Effects/Invert.cs b/src/ImageSharp/Processing/Effects/Invert.cs index d9a0695566..4f8c6a8864 100644 --- a/src/ImageSharp/Processing/Effects/Invert.cs +++ b/src/ImageSharp/Processing/Effects/Invert.cs @@ -23,11 +23,9 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image Invert(this Image source) + public static IImageOperations Invert(this IImageOperations source) where TPixel : struct, IPixel - { - return Invert(source, source.Bounds); - } + => source.ApplyProcessor(new InvertProcessor()); /// /// Inverts the colors of the image. @@ -38,11 +36,8 @@ public static Image Invert(this Image source) /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Invert(this Image source, Rectangle rectangle) + public static IImageOperations Invert(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel - { - source.ApplyProcessor(new InvertProcessor(), rectangle); - return source; - } + => source.ApplyProcessor(new InvertProcessor(), rectangle); } } diff --git a/src/ImageSharp/Processing/Effects/OilPainting.cs b/src/ImageSharp/Processing/Effects/OilPainting.cs index 3b300e9197..23d5528856 100644 --- a/src/ImageSharp/Processing/Effects/OilPainting.cs +++ b/src/ImageSharp/Processing/Effects/OilPainting.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image OilPaint(this Image source) + public static IImageOperations OilPaint(this IImageOperations source) where TPixel : struct, IPixel { return OilPaint(source, 10, 15); @@ -40,7 +40,7 @@ public static Image OilPaint(this Image source) /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image OilPaint(this Image source, Rectangle rectangle) + public static IImageOperations OilPaint(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel { return OilPaint(source, 10, 15, rectangle); @@ -54,11 +54,9 @@ public static Image OilPaint(this Image source, Rectangl /// The number of intensity levels. Higher values result in a broader range of color intensities forming part of the result image. /// The number of neighboring pixels used in calculating each individual pixel value. /// The . - public static Image OilPaint(this Image source, int levels, int brushSize) - where TPixel : struct, IPixel - { - return OilPaint(source, levels, brushSize, source.Bounds); - } + public static IImageOperations OilPaint(this IImageOperations source, int levels, int brushSize) + where TPixel : struct, IPixel + => source.ApplyProcessor(new OilPaintingProcessor(levels, brushSize)); /// /// Alters the colors of the image recreating an oil painting effect. @@ -71,18 +69,8 @@ public static Image OilPaint(this Image source, int leve /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image OilPaint(this Image source, int levels, int brushSize, Rectangle rectangle) + public static IImageOperations OilPaint(this IImageOperations source, int levels, int brushSize, Rectangle rectangle) where TPixel : struct, IPixel - { - Guard.MustBeGreaterThan(levels, 0, nameof(levels)); - - if (brushSize <= 0 || brushSize > source.Height || brushSize > source.Width) - { - throw new ArgumentOutOfRangeException(nameof(brushSize)); - } - - source.ApplyProcessor(new OilPaintingProcessor(levels, brushSize), rectangle); - return source; - } + => source.ApplyProcessor(new OilPaintingProcessor(levels, brushSize), rectangle); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Effects/Pixelate.cs b/src/ImageSharp/Processing/Effects/Pixelate.cs index 07fdd50a35..cd0551ad39 100644 --- a/src/ImageSharp/Processing/Effects/Pixelate.cs +++ b/src/ImageSharp/Processing/Effects/Pixelate.cs @@ -24,11 +24,9 @@ public static partial class ImageExtensions /// The image this method extends. /// The size of the pixels. /// The . - public static Image Pixelate(this Image source, int size = 4) + public static IImageOperations Pixelate(this IImageOperations source, int size = 4) where TPixel : struct, IPixel - { - return Pixelate(source, size, source.Bounds); - } + => source.ApplyProcessor(new PixelateProcessor(size)); /// /// Pixelates an image with the given pixel size. @@ -40,16 +38,8 @@ public static Image Pixelate(this Image source, int size /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Pixelate(this Image source, int size, Rectangle rectangle) + public static IImageOperations Pixelate(this IImageOperations source, int size, Rectangle rectangle) where TPixel : struct, IPixel - { - if (size <= 0 || size > source.Height || size > source.Width) - { - throw new ArgumentOutOfRangeException(nameof(size)); - } - - source.ApplyProcessor(new PixelateProcessor(size), rectangle); - return source; - } + => source.ApplyProcessor(new PixelateProcessor(size), rectangle); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/ImageProcessor.cs b/src/ImageSharp/Processing/ImageProcessor.cs index dd2a93bc52..bf88d5ff7b 100644 --- a/src/ImageSharp/Processing/ImageProcessor.cs +++ b/src/ImageSharp/Processing/ImageProcessor.cs @@ -25,7 +25,7 @@ internal abstract class ImageProcessor : IImageProcessor public virtual bool Compand { get; set; } = false; /// - public void Apply(ImageBase source, Rectangle sourceRectangle) + public void Apply(Image source, Rectangle sourceRectangle) { if (this.ParallelOptions == null) { @@ -34,10 +34,50 @@ public void Apply(ImageBase source, Rectangle sourceRectangle) try { - this.BeforeApply(source, sourceRectangle); + this.BeforeImageApply(source, sourceRectangle); + this.BeforeApply(source, sourceRectangle); this.OnApply(source, sourceRectangle); + this.AfterApply(source, sourceRectangle); + + foreach (ImageFrame sourceFrame in source.Frames) + { + this.BeforeApply(source, sourceRectangle); + + this.OnApply(source, sourceRectangle); + this.AfterApply(source, sourceRectangle); + } + + this.AfterImageApply(source, sourceRectangle); + } +#if DEBUG + catch (Exception) + { + throw; +#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); +#endif + } + } + + /// + /// Applies the processor to just a single ImageBase + /// + /// the source image + /// the target + public void Apply(ImageBase source, Rectangle sourceRectangle) + { + if (this.ParallelOptions == null) + { + this.ParallelOptions = source.Configuration.ParallelOptions; + } + try + { + this.BeforeApply(source, sourceRectangle); + this.OnApply(source, sourceRectangle); this.AfterApply(source, sourceRectangle); } #if DEBUG @@ -52,6 +92,17 @@ public void Apply(ImageBase source, Rectangle sourceRectangle) } } + /// + /// This method is called before the process is applied to prepare the processor. + /// + /// The source image. Cannot be null. + /// + /// The structure that specifies the portion of the image object to draw. + /// + protected virtual void BeforeImageApply(Image source, Rectangle sourceRectangle) + { + } + /// /// This method is called before the process is applied to prepare the processor. /// @@ -83,5 +134,16 @@ protected virtual void BeforeApply(ImageBase source, Rectangle sourceRec protected virtual void AfterApply(ImageBase source, Rectangle sourceRectangle) { } + + /// + /// This method is called after the process is applied to prepare the processor. + /// + /// The source image. Cannot be null. + /// + /// The structure that specifies the portion of the image object to draw. + /// + protected virtual void AfterImageApply(Image source, Rectangle sourceRectangle) + { + } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Overlays/Glow.cs b/src/ImageSharp/Processing/Overlays/Glow.cs index 84f6bf10ae..4c58a27d45 100644 --- a/src/ImageSharp/Processing/Overlays/Glow.cs +++ b/src/ImageSharp/Processing/Overlays/Glow.cs @@ -21,7 +21,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image Glow(this Image source) + public static IImageOperations Glow(this IImageOperations source) where TPixel : struct, IPixel { return Glow(source, GraphicsOptions.Default); @@ -34,7 +34,7 @@ public static Image Glow(this Image source) /// The image this method extends. /// The color to set as the glow. /// The . - public static Image Glow(this Image source, TPixel color) + public static IImageOperations Glow(this IImageOperations source, TPixel color) where TPixel : struct, IPixel { return Glow(source, color, GraphicsOptions.Default); @@ -47,7 +47,7 @@ public static Image Glow(this Image source, TPixel color /// The image this method extends. /// The the radius. /// The . - public static Image Glow(this Image source, float radius) + public static IImageOperations Glow(this IImageOperations source, float radius) where TPixel : struct, IPixel { return Glow(source, radius, GraphicsOptions.Default); @@ -62,11 +62,9 @@ public static Image Glow(this Image source, float radius /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Glow(this Image source, Rectangle rectangle) + public static IImageOperations Glow(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel - { - return Glow(source, rectangle, GraphicsOptions.Default); - } + => source.Glow(rectangle, GraphicsOptions.Default); /// /// Applies a radial glow effect to an image. @@ -79,11 +77,9 @@ public static Image Glow(this Image source, Rectangle re /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Glow(this Image source, TPixel color, float radius, Rectangle rectangle) + public static IImageOperations Glow(this IImageOperations source, TPixel color, float radius, Rectangle rectangle) where TPixel : struct, IPixel - { - return Glow(source, color, radius, rectangle, GraphicsOptions.Default); - } + => source.Glow(color, ValueSize.Absolute(radius), rectangle, GraphicsOptions.Default); /// /// Applies a radial glow effect to an image. @@ -92,11 +88,9 @@ public static Image Glow(this Image source, TPixel color /// The image this method extends. /// The options effecting things like blending. /// The . - public static Image Glow(this Image source, GraphicsOptions options) + public static IImageOperations Glow(this IImageOperations source, GraphicsOptions options) where TPixel : struct, IPixel - { - return Glow(source, NamedColors.Black, source.Bounds.Width * .5F, source.Bounds, options); - } + => source.Glow(NamedColors.Black, ValueSize.PercentageOfWidth(0.5f), options); /// /// Applies a radial glow effect to an image. @@ -106,11 +100,9 @@ public static Image Glow(this Image source, GraphicsOpti /// The color to set as the glow. /// The options effecting things like blending. /// The . - public static Image Glow(this Image source, TPixel color, GraphicsOptions options) + public static IImageOperations Glow(this IImageOperations source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel - { - return Glow(source, color, source.Bounds.Width * .5F, source.Bounds, options); - } + => source.Glow(color, ValueSize.PercentageOfWidth(0.5f), options); /// /// Applies a radial glow effect to an image. @@ -120,11 +112,9 @@ public static Image Glow(this Image source, TPixel color /// The the radius. /// The options effecting things like blending. /// The . - public static Image Glow(this Image source, float radius, GraphicsOptions options) + public static IImageOperations Glow(this IImageOperations source, float radius, GraphicsOptions options) where TPixel : struct, IPixel - { - return Glow(source, NamedColors.Black, radius, source.Bounds, options); - } + => source.Glow(NamedColors.Black, ValueSize.Absolute(radius), options); /// /// Applies a radial glow effect to an image. @@ -136,11 +126,9 @@ public static Image Glow(this Image source, float radius /// /// The options effecting things like blending. /// The . - public static Image Glow(this Image source, Rectangle rectangle, GraphicsOptions options) + public static IImageOperations Glow(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel - { - return Glow(source, NamedColors.Black, 0, rectangle, options); - } + => source.Glow(NamedColors.Black, ValueSize.PercentageOfWidth(0.5f), rectangle, options); /// /// Applies a radial glow effect to an image. @@ -154,12 +142,37 @@ public static Image Glow(this Image source, Rectangle re /// /// The options effecting things like blending. /// The . - public static Image Glow(this Image source, TPixel color, float radius, Rectangle rectangle, GraphicsOptions options) + public static IImageOperations Glow(this IImageOperations source, TPixel color, float radius, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel - { - var processor = new GlowProcessor(color, options) { Radius = radius, }; - source.ApplyProcessor(processor, rectangle); - return source; - } + => source.Glow(color, ValueSize.Absolute(radius), rectangle, options); + + /// + /// Applies a radial glow effect to an image. + /// + /// The pixel format. + /// The image this method extends. + /// The color to set as the glow. + /// The the radius. + /// + /// The structure that specifies the portion of the image object to alter. + /// + /// The options effecting things like blending. + /// The . + private static IImageOperations Glow(this IImageOperations source, TPixel color, ValueSize radius, Rectangle rectangle, GraphicsOptions options) + where TPixel : struct, IPixel + => source.ApplyProcessor(new GlowProcessor(color, radius, options), rectangle); + + /// + /// Applies a radial glow effect to an image. + /// + /// The pixel format. + /// The image this method extends. + /// The color to set as the glow. + /// The the radius. + /// The options effecting things like blending. + /// The . + private static IImageOperations Glow(this IImageOperations source, TPixel color, ValueSize radius, GraphicsOptions options) + where TPixel : struct, IPixel + => source.ApplyProcessor(new GlowProcessor(color, radius, options)); } } diff --git a/src/ImageSharp/Processing/Overlays/Vignette.cs b/src/ImageSharp/Processing/Overlays/Vignette.cs index 75c4611a1e..78060570c7 100644 --- a/src/ImageSharp/Processing/Overlays/Vignette.cs +++ b/src/ImageSharp/Processing/Overlays/Vignette.cs @@ -21,7 +21,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static Image Vignette(this Image source) + public static IImageOperations Vignette(this IImageOperations source) where TPixel : struct, IPixel { return Vignette(source, GraphicsOptions.Default); @@ -34,7 +34,7 @@ public static Image Vignette(this Image source) /// The image this method extends. /// The color to set as the vignette. /// The . - public static Image Vignette(this Image source, TPixel color) + public static IImageOperations Vignette(this IImageOperations source, TPixel color) where TPixel : struct, IPixel { return Vignette(source, color, GraphicsOptions.Default); @@ -48,7 +48,7 @@ public static Image Vignette(this Image source, TPixel c /// The the x-radius. /// The the y-radius. /// The . - public static Image Vignette(this Image source, float radiusX, float radiusY) + public static IImageOperations Vignette(this IImageOperations source, float radiusX, float radiusY) where TPixel : struct, IPixel { return Vignette(source, radiusX, radiusY, GraphicsOptions.Default); @@ -63,7 +63,7 @@ public static Image Vignette(this Image source, float ra /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Vignette(this Image source, Rectangle rectangle) + public static IImageOperations Vignette(this IImageOperations source, Rectangle rectangle) where TPixel : struct, IPixel { return Vignette(source, rectangle, GraphicsOptions.Default); @@ -81,11 +81,9 @@ public static Image Vignette(this Image source, Rectangl /// The structure that specifies the portion of the image object to alter. /// /// The . - public static Image Vignette(this Image source, TPixel color, float radiusX, float radiusY, Rectangle rectangle) + public static IImageOperations Vignette(this IImageOperations source, TPixel color, float radiusX, float radiusY, Rectangle rectangle) where TPixel : struct, IPixel - { - return Vignette(source, color, radiusX, radiusY, rectangle, GraphicsOptions.Default); - } + => source.Vignette(color, radiusX, radiusY, rectangle, GraphicsOptions.Default); /// /// Applies a radial vignette effect to an image. @@ -94,11 +92,9 @@ public static Image Vignette(this Image source, TPixel c /// The image this method extends. /// The options effecting pixel blending. /// The . - public static Image Vignette(this Image source, GraphicsOptions options) + public static IImageOperations Vignette(this IImageOperations source, GraphicsOptions options) where TPixel : struct, IPixel - { - return Vignette(source, NamedColors.Black, source.Bounds.Width * .5F, source.Bounds.Height * .5F, source.Bounds, options); - } + => source.Vignette(NamedColors.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options); /// /// Applies a radial vignette effect to an image. @@ -108,11 +104,9 @@ public static Image Vignette(this Image source, Graphics /// The color to set as the vignette. /// The options effecting pixel blending. /// The . - public static Image Vignette(this Image source, TPixel color, GraphicsOptions options) + public static IImageOperations Vignette(this IImageOperations source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel - { - return Vignette(source, color, source.Bounds.Width * .5F, source.Bounds.Height * .5F, source.Bounds, options); - } + => source.Vignette(color, 0, 0, options); /// /// Applies a radial vignette effect to an image. @@ -123,11 +117,9 @@ public static Image Vignette(this Image source, TPixel c /// The the y-radius. /// The options effecting pixel blending. /// The . - public static Image Vignette(this Image source, float radiusX, float radiusY, GraphicsOptions options) + public static IImageOperations Vignette(this IImageOperations source, float radiusX, float radiusY, GraphicsOptions options) where TPixel : struct, IPixel - { - return Vignette(source, NamedColors.Black, radiusX, radiusY, source.Bounds, options); - } + => source.Vignette(NamedColors.Black, radiusX, radiusY, options); /// /// Applies a radial vignette effect to an image. @@ -139,11 +131,9 @@ public static Image Vignette(this Image source, float ra /// /// The options effecting pixel blending. /// The . - public static Image Vignette(this Image source, Rectangle rectangle, GraphicsOptions options) + public static IImageOperations Vignette(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel - { - return Vignette(source, NamedColors.Black, 0, 0, rectangle, options); - } + => source.Vignette(NamedColors.Black, 0, 0, rectangle, options); /// /// Applies a radial vignette effect to an image. @@ -158,12 +148,16 @@ public static Image Vignette(this Image source, Rectangl /// /// The options effecting pixel blending. /// The . - public static Image Vignette(this Image source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options) + public static IImageOperations Vignette(this IImageOperations source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel - { - var processor = new VignetteProcessor(color, options) { RadiusX = radiusX, RadiusY = radiusY }; - source.ApplyProcessor(processor, rectangle); - return source; - } + => source.Vignette(color, radiusX, radiusY, rectangle, options); + + private static IImageOperations Vignette(this IImageOperations source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options) + where TPixel : struct, IPixel + => source.ApplyProcessor(new VignetteProcessor(color, radiusX, radiusY, options), rectangle); + + private static IImageOperations Vignette(this IImageOperations source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options) + where TPixel : struct, IPixel + => source.ApplyProcessor(new VignetteProcessor(color, radiusX, radiusY, options)); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs index 9e54574df9..5c1bd20b16 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs @@ -53,7 +53,7 @@ public PolaroidProcessor(GraphicsOptions options) protected override void AfterApply(ImageBase source, Rectangle sourceRectangle) { new VignetteProcessor(veryDarkOrange, this.options).Apply(source, sourceRectangle); - new GlowProcessor(lightOrange, this.options) { Radius = source.Width / 4F }.Apply(source, sourceRectangle); + new GlowProcessor(lightOrange, source.Width / 4F, this.options).Apply(source, sourceRectangle); } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs index f484c8eec8..383917c45f 100644 --- a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs @@ -51,6 +51,11 @@ public OilPaintingProcessor(int levels, int brushSize) /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) { + if (this.BrushSize <= 0 || this.BrushSize > source.Height || this.BrushSize > source.Width) + { + throw new ArgumentOutOfRangeException(nameof(this.BrushSize)); + } + int startY = sourceRectangle.Y; int endY = sourceRectangle.Bottom; int startX = sourceRectangle.X; diff --git a/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs index ff83117c5f..a44e85ef31 100644 --- a/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs @@ -29,23 +29,28 @@ internal class PixelateProcessor : ImageProcessor public PixelateProcessor(int size) { Guard.MustBeGreaterThan(size, 0, nameof(size)); - this.Value = size; + this.Size = size; } /// /// Gets or the pixel size. /// - public int Value { get; } + public int Size { get; } /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) { + if (this.Size <= 0 || this.Size > source.Height || this.Size > source.Width) + { + throw new ArgumentOutOfRangeException(nameof(this.Size)); + } + int startY = sourceRectangle.Y; int endY = sourceRectangle.Bottom; int startX = sourceRectangle.X; int endX = sourceRectangle.Right; - int size = this.Value; - int offset = this.Value / 2; + int size = this.Size; + int offset = this.Size / 2; // Align start/end positions. int minX = Math.Max(0, startX); diff --git a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs index 8a13eabca8..5a816da14d 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs @@ -27,11 +27,13 @@ internal class GlowProcessor : ImageProcessor /// Initializes a new instance of the class. /// /// The color or the glow. + /// The radius of the glow. /// The options effecting blending and composition. - public GlowProcessor(TPixel color, GraphicsOptions options) + public GlowProcessor(TPixel color, ValueSize radius, GraphicsOptions options) { this.options = options; this.GlowColor = color; + this.Radius = radius; this.blender = PixelOperations.Instance.GetPixelBlender(this.options.BlenderMode); } @@ -43,7 +45,7 @@ public GlowProcessor(TPixel color, GraphicsOptions options) /// /// Gets or sets the the radius. /// - public float Radius { get; set; } + public ValueSize Radius { get; set; } /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) @@ -54,7 +56,10 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan int endX = sourceRectangle.Right; TPixel glowColor = this.GlowColor; Vector2 centre = Rectangle.Center(sourceRectangle); - float maxDistance = this.Radius > 0 ? MathF.Min(this.Radius, sourceRectangle.Width * .5F) : sourceRectangle.Width * .5F; + + var finalRadius = this.Radius.Calculate(source.Bounds.Size); + + float maxDistance = finalRadius > 0 ? MathF.Min(finalRadius, sourceRectangle.Width * .5F) : sourceRectangle.Width * .5F; // Align start/end positions. int minX = Math.Max(0, startX); diff --git a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs index 8cb58739b0..6a46692d23 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs @@ -27,11 +27,26 @@ internal class VignetteProcessor : ImageProcessor /// Initializes a new instance of the class. /// /// The color of the vignette. + /// The x-radius. + /// The y-radius. /// The options effecting blending and composition. - public VignetteProcessor(TPixel color, GraphicsOptions options) + public VignetteProcessor(TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options) { this.VignetteColor = color; + this.RadiusX = radiusX; + this.RadiusY = radiusY; + this.options = options; + this.blender = PixelOperations.Instance.GetPixelBlender(this.options.BlenderMode); + } + /// + /// Initializes a new instance of the class. + /// + /// The color of the vignette. + /// The options effecting blending and composition. + public VignetteProcessor(TPixel color, GraphicsOptions options) + { + this.VignetteColor = color; this.options = options; this.blender = PixelOperations.Instance.GetPixelBlender(this.options.BlenderMode); } @@ -44,12 +59,12 @@ public VignetteProcessor(TPixel color, GraphicsOptions options) /// /// Gets or sets the the x-radius. /// - public float RadiusX { get; set; } + public ValueSize RadiusX { get; set; } /// /// Gets or sets the the y-radius. /// - public float RadiusY { get; set; } + public ValueSize RadiusY { get; set; } /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) @@ -60,8 +75,11 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan int endX = sourceRectangle.Right; TPixel vignetteColor = this.VignetteColor; Vector2 centre = Rectangle.Center(sourceRectangle); - float rX = this.RadiusX > 0 ? MathF.Min(this.RadiusX, sourceRectangle.Width * .5F) : sourceRectangle.Width * .5F; - float rY = this.RadiusY > 0 ? MathF.Min(this.RadiusY, sourceRectangle.Height * .5F) : sourceRectangle.Height * .5F; + + var finalradiusX = this.RadiusX.Calculate(source.Bounds.Size); + var finalradiusY = this.RadiusY.Calculate(source.Bounds.Size); + float rX = finalradiusX > 0 ? MathF.Min(finalradiusX, sourceRectangle.Width * .5F) : sourceRectangle.Width * .5F; + float rY = finalradiusY > 0 ? MathF.Min(finalradiusY, sourceRectangle.Height * .5F) : sourceRectangle.Height * .5F; float maxDistance = MathF.Sqrt((rX * rX) + (rY * rY)); // Align start/end positions. diff --git a/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs new file mode 100644 index 0000000000..f18eb80926 --- /dev/null +++ b/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Processing.Processors +{ + using System; + using System.Threading.Tasks; + + using ImageSharp.Memory; + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + + /// + /// Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. + /// + /// The pixel format. + internal class AutoRotateProcessor : ImageProcessor + where TPixel : struct, IPixel + { + /// + /// Initializes a new instance of the class. + /// + public AutoRotateProcessor() + { + } + + /// + protected override void OnApply(ImageBase sourceBase, Rectangle sourceRectangle) + { + // can only apply to the origional image + var source = sourceBase as Image; + if (source != null) + { + Orientation orientation = GetExifOrientation(source); + + switch (orientation) + { + case Orientation.TopRight: + new FlipProcessor(FlipType.Horizontal).Apply(source, sourceRectangle); + break; + + case Orientation.BottomRight: + new RotateProcessor() { Angle = (int)RotateType.Rotate180, Expand = false }.Apply(source, sourceRectangle); + break; + + case Orientation.BottomLeft: + new FlipProcessor(FlipType.Vertical).Apply(source, sourceRectangle); + break; + + case Orientation.LeftTop: + new RotateProcessor() { Angle = (int)RotateType.Rotate90, Expand = false }.Apply(source, sourceRectangle); + new FlipProcessor(FlipType.Horizontal).Apply(source, sourceRectangle); + break; + + case Orientation.RightTop: + new RotateProcessor() { Angle = (int)RotateType.Rotate90, Expand = false }.Apply(source, sourceRectangle); + break; + + case Orientation.RightBottom: + new FlipProcessor(FlipType.Vertical).Apply(source, sourceRectangle); + new RotateProcessor() { Angle = (int)RotateType.Rotate270, Expand = false }.Apply(source, sourceRectangle); + break; + + case Orientation.LeftBottom: + new RotateProcessor() { Angle = (int)RotateType.Rotate270, Expand = false }.Apply(source, sourceRectangle); + break; + + case Orientation.Unknown: + case Orientation.TopLeft: + default: + break; + } + } + } + + /// + /// Returns the current EXIF orientation + /// + /// The image to auto rotate. + /// The + private static Orientation GetExifOrientation(Image source) + { + if (source.MetaData.ExifProfile == null) + { + return Orientation.Unknown; + } + + ExifValue value = source.MetaData.ExifProfile.GetValue(ExifTag.Orientation); + if (value == null) + { + return Orientation.Unknown; + } + + var orientation = (Orientation)value.Value; + + source.MetaData.ExifProfile.SetValue(ExifTag.Orientation, (ushort)Orientation.TopLeft); + + return orientation; + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs index 0186a8fa8e..0f1e166fdc 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs @@ -46,19 +46,19 @@ protected ResamplingWeightedProcessor(IResampler sampler, int width, int height, public IResampler Sampler { get; } /// - /// Gets the width. + /// Gets or sets the width. /// - public int Width { get; } + public int Width { get; protected set; } /// - /// Gets the height. + /// Gets or sets the height. /// - public int Height { get; } + public int Height { get; protected set; } /// - /// Gets the resize rectangle. + /// Gets or sets the resize rectangle. /// - public Rectangle ResizeRectangle { get; } + public Rectangle ResizeRectangle { get; protected set; } /// /// Gets or sets the horizontal weights. diff --git a/src/ImageSharp/Processing/Transforms/AutoOrient.cs b/src/ImageSharp/Processing/Transforms/AutoOrient.cs index 07e5d5bc9a..fb7bfb4ac7 100644 --- a/src/ImageSharp/Processing/Transforms/AutoOrient.cs +++ b/src/ImageSharp/Processing/Transforms/AutoOrient.cs @@ -20,68 +20,8 @@ public static partial class ImageExtensions /// The pixel format. /// The image to auto rotate. /// The - public static Image AutoOrient(this Image source) + public static IImageOperations AutoOrient(this IImageOperations source) where TPixel : struct, IPixel - { - Orientation orientation = GetExifOrientation(source); - - switch (orientation) - { - case Orientation.TopRight: - return source.Flip(FlipType.Horizontal); - - case Orientation.BottomRight: - return source.Rotate(RotateType.Rotate180); - - case Orientation.BottomLeft: - return source.Flip(FlipType.Vertical); - - case Orientation.LeftTop: - return source.Rotate(RotateType.Rotate90) - .Flip(FlipType.Horizontal); - - case Orientation.RightTop: - return source.Rotate(RotateType.Rotate90); - - case Orientation.RightBottom: - return source.Flip(FlipType.Vertical) - .Rotate(RotateType.Rotate270); - - case Orientation.LeftBottom: - return source.Rotate(RotateType.Rotate270); - - case Orientation.Unknown: - case Orientation.TopLeft: - default: - return source; - } - } - - /// - /// Returns the current EXIF orientation - /// - /// The pixel format. - /// The image to auto rotate. - /// The - private static Orientation GetExifOrientation(Image source) - where TPixel : struct, IPixel - { - if (source.MetaData.ExifProfile == null) - { - return Orientation.Unknown; - } - - ExifValue value = source.MetaData.ExifProfile.GetValue(ExifTag.Orientation); - if (value == null) - { - return Orientation.Unknown; - } - - var orientation = (Orientation)value.Value; - - source.MetaData.ExifProfile.SetValue(ExifTag.Orientation, (ushort)Orientation.TopLeft); - - return orientation; - } + => source.ApplyProcessor(new Processing.Processors.AutoRotateProcessor()); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Crop.cs b/src/ImageSharp/Processing/Transforms/Crop.cs index 94e9ba1f49..c518ac5ac1 100644 --- a/src/ImageSharp/Processing/Transforms/Crop.cs +++ b/src/ImageSharp/Processing/Transforms/Crop.cs @@ -25,11 +25,9 @@ public static partial class ImageExtensions /// The target image width. /// The target image height. /// The - public static Image Crop(this Image source, int width, int height) + public static IImageOperations Crop(this IImageOperations source, int width, int height) where TPixel : struct, IPixel - { - return Crop(source, new Rectangle(0, 0, width, height)); - } + => Crop(source, new Rectangle(0, 0, width, height)); /// /// Crops an image to the given rectangle. @@ -40,13 +38,8 @@ public static Image Crop(this Image source, int width, i /// The structure that specifies the portion of the image object to retain. /// /// The - public static Image Crop(this Image source, Rectangle cropRectangle) + public static IImageOperations Crop(this IImageOperations source, Rectangle cropRectangle) where TPixel : struct, IPixel - { - CropProcessor processor = new CropProcessor(cropRectangle); - - source.ApplyProcessor(processor, source.Bounds); - return source; - } + => 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 index 2f4a8e3833..00f4043215 100644 --- a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs +++ b/src/ImageSharp/Processing/Transforms/EntropyCrop.cs @@ -23,13 +23,8 @@ public static partial class ImageExtensions /// The image to crop. /// The threshold for entropic density. /// The - public static Image EntropyCrop(this Image source, float threshold = .5f) + public static IImageOperations EntropyCrop(this IImageOperations source, float threshold = .5f) where TPixel : struct, IPixel - { - EntropyCropProcessor processor = new EntropyCropProcessor(threshold); - - source.ApplyProcessor(processor, source.Bounds); - return source; - } + => 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/Flip.cs index 1c8baebf13..6cde1257c9 100644 --- a/src/ImageSharp/Processing/Transforms/Flip.cs +++ b/src/ImageSharp/Processing/Transforms/Flip.cs @@ -24,13 +24,8 @@ public static partial class ImageExtensions /// The image to rotate, flip, or both. /// The to perform the flip. /// The - public static Image Flip(this Image source, FlipType flipType) + public static IImageOperations Flip(this IImageOperations source, FlipType flipType) where TPixel : struct, IPixel - { - FlipProcessor processor = new FlipProcessor(flipType); - - source.ApplyProcessor(processor, source.Bounds); - return source; - } + => source.ApplyProcessor(new FlipProcessor(flipType)); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Transforms/Pad.cs b/src/ImageSharp/Processing/Transforms/Pad.cs index 8138fd7654..fb064f5ce5 100644 --- a/src/ImageSharp/Processing/Transforms/Pad.cs +++ b/src/ImageSharp/Processing/Transforms/Pad.cs @@ -26,7 +26,7 @@ public static partial class ImageExtensions /// The new width. /// The new height. /// The . - public static Image Pad(this Image source, int width, int height) + public static IImageOperations Pad(this IImageOperations source, int width, int height) where TPixel : struct, IPixel { ResizeOptions options = new ResizeOptions diff --git a/src/ImageSharp/Processing/Transforms/Resize.cs b/src/ImageSharp/Processing/Transforms/Resize.cs index e00faf10ea..6ccea5f42d 100644 --- a/src/ImageSharp/Processing/Transforms/Resize.cs +++ b/src/ImageSharp/Processing/Transforms/Resize.cs @@ -24,23 +24,28 @@ public static partial class ImageExtensions /// The resize options. /// The /// Passing zero for one of height or width within the resize options will automatically preserve the aspect ratio of the original image - public static Image Resize(this Image source, ResizeOptions options) + public static IImageOperations Resize(this IImageOperations source, ResizeOptions options) where TPixel : struct, IPixel { - // Ensure size is populated across both dimensions. - if (options.Size.Width == 0 && options.Size.Height > 0) + return source.Run(img => { - options.Size = new Size((int)MathF.Round(source.Width * options.Size.Height / (float)source.Height), options.Size.Height); - } + // cheat and bound through a run, inside here we should just be mutating, this reallt needs moving over to a processor - if (options.Size.Height == 0 && options.Size.Width > 0) - { - options.Size = new Size(options.Size.Width, (int)MathF.Round(source.Height * options.Size.Width / (float)source.Width)); - } + // Ensure size is populated across both dimensions. + if (options.Size.Width == 0 && options.Size.Height > 0) + { + options.Size = new Size((int)MathF.Round(img.Width * options.Size.Height / (float)img.Height), options.Size.Height); + } + + if (options.Size.Height == 0 && options.Size.Width > 0) + { + options.Size = new Size(options.Size.Width, (int)MathF.Round(img.Height * options.Size.Width / (float)img.Width)); + } - Rectangle targetRectangle = ResizeHelper.CalculateTargetLocationAndBounds(source, options); + Rectangle targetRectangle = ResizeHelper.CalculateTargetLocationAndBounds(img, options); - return Resize(source, options.Size.Width, options.Size.Height, options.Sampler, source.Bounds, targetRectangle, options.Compand); + img.Mutate(x => Resize(x, options.Size.Width, options.Size.Height, options.Sampler, targetRectangle, options.Compand)); + }); } /// @@ -51,7 +56,7 @@ public static Image Resize(this Image source, ResizeOpti /// The target image size. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static Image Resize(this Image source, Size size) + public static IImageOperations Resize(this IImageOperations source, Size size) where TPixel : struct, IPixel { return Resize(source, size.Width, size.Height, new BicubicResampler(), false); @@ -66,7 +71,7 @@ public static Image Resize(this Image source, Size size) /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static Image Resize(this Image source, Size size, bool compand) + public static IImageOperations Resize(this IImageOperations source, Size size, bool compand) where TPixel : struct, IPixel { return Resize(source, size.Width, size.Height, new BicubicResampler(), compand); @@ -81,7 +86,7 @@ public static Image Resize(this Image source, Size size, /// The target image height. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static Image Resize(this Image source, int width, int height) + public static IImageOperations Resize(this IImageOperations source, int width, int height) where TPixel : struct, IPixel { return Resize(source, width, height, new BicubicResampler(), false); @@ -97,7 +102,7 @@ public static Image Resize(this Image source, int width, /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static Image Resize(this Image source, int width, int height, bool compand) + public static IImageOperations Resize(this IImageOperations source, int width, int height, bool compand) where TPixel : struct, IPixel { return Resize(source, width, height, new BicubicResampler(), compand); @@ -113,7 +118,7 @@ public static Image Resize(this Image source, int width, /// The to perform the resampling. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static Image Resize(this Image source, int width, int height, IResampler sampler) + public static IImageOperations Resize(this IImageOperations source, int width, int height, IResampler sampler) where TPixel : struct, IPixel { return Resize(source, width, height, sampler, false); @@ -130,10 +135,10 @@ public static Image Resize(this Image source, int width, /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static Image Resize(this Image source, int width, int height, IResampler sampler, bool compand) + public static IImageOperations Resize(this IImageOperations source, int width, int height, IResampler sampler, bool compand) where TPixel : struct, IPixel { - return Resize(source, width, height, sampler, source.Bounds, new Rectangle(0, 0, width, height), compand); + return Resize(source, width, height, sampler, new Rectangle(0, 0, width, height), compand); } /// @@ -154,28 +159,69 @@ public static Image Resize(this Image source, int width, /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static Image Resize(this Image source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand) + public static IImageOperations Resize(this IImageOperations source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel { - if (width == 0 && height > 0) - { - width = (int)MathF.Round(source.Width * height / (float)source.Height); - targetRectangle.Width = width; - } + return source.Run(img => + { + // todo : stop cheeting here and move this stuff into the processors itself + if (width == 0 && height > 0) + { + width = (int)MathF.Round(img.Width * height / (float)img.Height); + targetRectangle.Width = width; + } + + if (height == 0 && width > 0) + { + height = (int)MathF.Round(img.Height * width / (float)img.Width); + targetRectangle.Height = height; + } + + Guard.MustBeGreaterThan(width, 0, nameof(width)); + Guard.MustBeGreaterThan(height, 0, nameof(height)); + + img.Mutate(x => x.ApplyProcessor(new ResizeProcessor(sampler, width, height, targetRectangle) { Compand = compand }, sourceRectangle)); + }); + } - if (height == 0 && width > 0) + /// + /// Resizes an image to the given width and height with the given sampler and + /// source rectangle. + /// + /// The pixel format. + /// The image to resize. + /// The target image width. + /// The target image height. + /// The to perform the resampling. + /// + /// The structure that specifies the portion of the target image object to draw to. + /// + /// Whether to compress and expand the image color-space to gamma correct the image during processing. + /// The + /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image + public static IImageOperations Resize(this IImageOperations source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand) + where TPixel : struct, IPixel + { + return source.Run(img => { - height = (int)MathF.Round(source.Height * width / (float)source.Width); - targetRectangle.Height = height; - } - - Guard.MustBeGreaterThan(width, 0, nameof(width)); - Guard.MustBeGreaterThan(height, 0, nameof(height)); - - var processor = new ResizeProcessor(sampler, width, height, targetRectangle) { Compand = compand }; - - source.ApplyProcessor(processor, sourceRectangle); - return source; + // todo : stop cheeting here and move this stuff into the processors itself + if (width == 0 && height > 0) + { + width = (int)MathF.Round(img.Width * height / (float)img.Height); + targetRectangle.Width = width; + } + + if (height == 0 && width > 0) + { + height = (int)MathF.Round(img.Height * width / (float)img.Width); + targetRectangle.Height = height; + } + + Guard.MustBeGreaterThan(width, 0, nameof(width)); + Guard.MustBeGreaterThan(height, 0, nameof(height)); + + img.Mutate(x => x.ApplyProcessor(new ResizeProcessor(sampler, width, height, targetRectangle) { Compand = compand })); + }); } } } diff --git a/src/ImageSharp/Processing/Transforms/Rotate.cs b/src/ImageSharp/Processing/Transforms/Rotate.cs index af7c06a27e..92349dba37 100644 --- a/src/ImageSharp/Processing/Transforms/Rotate.cs +++ b/src/ImageSharp/Processing/Transforms/Rotate.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image to rotate. /// The angle in degrees to perform the rotation. /// The - public static Image Rotate(this Image source, float degrees) + public static IImageOperations Rotate(this IImageOperations source, float degrees) where TPixel : struct, IPixel { return Rotate(source, degrees, true); @@ -37,11 +37,9 @@ public static Image Rotate(this Image source, float degr /// The image to rotate. /// The to perform the rotation. /// The - public static Image Rotate(this Image source, RotateType rotateType) + public static IImageOperations Rotate(this IImageOperations source, RotateType rotateType) where TPixel : struct, IPixel - { - return Rotate(source, (float)rotateType, false); - } + => Rotate(source, (float)rotateType, false); /// /// Rotates an image by the given angle in degrees. @@ -51,13 +49,8 @@ public static Image Rotate(this Image source, RotateType /// The angle in degrees to perform the rotation. /// Whether to expand the image to fit the rotated result. /// The - public static Image Rotate(this Image source, float degrees, bool expand) + public static IImageOperations Rotate(this IImageOperations source, float degrees, bool expand) where TPixel : struct, IPixel - { - RotateProcessor processor = new RotateProcessor { Angle = degrees, Expand = expand }; - - source.ApplyProcessor(processor, source.Bounds); - return source; - } + => source.ApplyProcessor(new RotateProcessor { Angle = degrees, Expand = expand }); } } diff --git a/src/ImageSharp/Processing/Transforms/RotateFlip.cs b/src/ImageSharp/Processing/Transforms/RotateFlip.cs index 805deb8d16..fda11d8338 100644 --- a/src/ImageSharp/Processing/Transforms/RotateFlip.cs +++ b/src/ImageSharp/Processing/Transforms/RotateFlip.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The to perform the rotation. /// The to perform the flip. /// The - public static Image RotateFlip(this Image source, RotateType rotateType, FlipType flipType) + public static IImageOperations RotateFlip(this IImageOperations source, RotateType rotateType, FlipType flipType) where TPixel : struct, IPixel { return source.Rotate(rotateType).Flip(flipType); diff --git a/src/ImageSharp/Processing/Transforms/Skew.cs b/src/ImageSharp/Processing/Transforms/Skew.cs index d42d79225b..f38606eda1 100644 --- a/src/ImageSharp/Processing/Transforms/Skew.cs +++ b/src/ImageSharp/Processing/Transforms/Skew.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The angle in degrees to perform the rotation along the x-axis. /// The angle in degrees to perform the rotation along the y-axis. /// The - public static Image Skew(this Image source, float degreesX, float degreesY) + public static IImageOperations Skew(this IImageOperations source, float degreesX, float degreesY) where TPixel : struct, IPixel { return Skew(source, degreesX, degreesY, true); @@ -39,13 +39,8 @@ public static Image Skew(this Image source, float degree /// The angle in degrees to perform the rotation along the y-axis. /// Whether to expand the image to fit the skewed result. /// The - public static Image Skew(this Image source, float degreesX, float degreesY, bool expand) + public static IImageOperations Skew(this IImageOperations source, float degreesX, float degreesY, bool expand) where TPixel : struct, IPixel - { - SkewProcessor processor = new SkewProcessor { AngleX = degreesX, AngleY = degreesY, Expand = expand }; - - source.ApplyProcessor(processor, source.Bounds); - return source; - } + => source.ApplyProcessor(new SkewProcessor { AngleX = degreesX, AngleY = degreesY, Expand = expand }); } } diff --git a/src/ImageSharp/Quantizers/Quantize.cs b/src/ImageSharp/Quantizers/Quantize.cs index a235092787..2b5130f8c1 100644 --- a/src/ImageSharp/Quantizers/Quantize.cs +++ b/src/ImageSharp/Quantizers/Quantize.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The quantization mode to apply to perform the operation. /// The maximum number of colors to return. Defaults to 256. /// The . - public static Image Quantize(this Image source, Quantization mode = Quantization.Octree, int maxColors = 256) + public static IImageOperations Quantize(this IImageOperations source, Quantization mode = Quantization.Octree, int maxColors = 256) where TPixel : struct, IPixel { IQuantizer quantizer; @@ -54,31 +54,34 @@ public static Image Quantize(this Image source, Quantiza /// The quantizer to apply to perform the operation. /// The maximum number of colors to return. /// The . - public static Image Quantize(this Image source, IQuantizer quantizer, int maxColors) + public static IImageOperations Quantize(this IImageOperations source, IQuantizer quantizer, int maxColors) where TPixel : struct, IPixel { - QuantizedImage quantized = quantizer.Quantize(source, maxColors); - int palleteCount = quantized.Palette.Length - 1; - - using (PixelAccessor pixels = new PixelAccessor(quantized.Width, quantized.Height)) + return source.Run(img => { - Parallel.For( - 0, - pixels.Height, - source.Configuration.ParallelOptions, - y => - { - for (int x = 0; x < pixels.Width; x++) + // TODO : move helper logic into the processor + QuantizedImage quantized = quantizer.Quantize(img, maxColors); + int palleteCount = quantized.Palette.Length - 1; + + using (PixelAccessor pixels = new PixelAccessor(quantized.Width, quantized.Height)) + { + Parallel.For( + 0, + pixels.Height, + img.Configuration.ParallelOptions, + y => { - int i = x + (y * pixels.Width); - TPixel color = quantized.Palette[Math.Min(palleteCount, quantized.Pixels[i])]; - pixels[x, y] = color; - } - }); + for (int x = 0; x < pixels.Width; x++) + { + int i = x + (y * pixels.Width); + TPixel color = quantized.Palette[Math.Min(palleteCount, quantized.Pixels[i])]; + pixels[x, y] = color; + } + }); - source.SwapPixelsBuffers(pixels); - return source; - } + img.SwapPixelsBuffers(pixels); + } + }); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs index 66104944ea..0a5750fe93 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs @@ -47,7 +47,7 @@ public void DrawLinesCore() { using (Image image = new Image(800, 800)) { - image.DrawBeziers( + image.Mutate(x => x.DrawBeziers( Rgba32.HotPink, 10, new SixLabors.Primitives.PointF[] { @@ -55,7 +55,7 @@ public void DrawLinesCore() new Vector2(30, 10), new Vector2(240, 30), new Vector2(300, 500) - }); + })); using (MemoryStream ms = new MemoryStream()) { diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs index a6af5a9769..3a3b5f30db 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs @@ -45,14 +45,14 @@ public void DrawLinesCore() { using (Image image = new Image(800, 800)) { - image.DrawLines( + image.Mutate(x => x.DrawLines( Rgba32.HotPink, 10, new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(550, 50), new Vector2(200, 400) - }); + })); using (MemoryStream ms = new MemoryStream()) { diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs index 3abd3b889d..b9a9605898 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs @@ -47,14 +47,14 @@ public void DrawPolygonCore() { using (Image image = new Image(800, 800)) { - image.DrawPolygon( + image.Mutate(x => x.DrawPolygon( Rgba32.HotPink, 10, new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(550, 50), new Vector2(200, 400) - }); + })); using (MemoryStream ms = new MemoryStream()) { diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs b/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs index b7d1b96b74..b0981b94d5 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs @@ -55,13 +55,13 @@ public void DrawSolidPolygonCore() { using (Image image = new Image(800, 800)) { - image.FillPolygon( + image.Mutate(x => x.FillPolygon( Rgba32.HotPink, new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(550, 50), new Vector2(200, 400) - }); + })); using (MemoryStream ms = new MemoryStream()) { @@ -75,9 +75,9 @@ public void DrawSolidPolygonCoreCahced() { using (Image image = new Image(800, 800)) { - image.Fill( + image.Mutate(x => x.Fill( Rgba32.HotPink, - this.shape); + this.shape)); using (MemoryStream ms = new MemoryStream()) { diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs b/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs index 0738812a1c..6219a97f68 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs @@ -39,7 +39,7 @@ public CoreSize FillRactangleCore() { using (Image image = new Image(800, 800)) { - image.Fill(Rgba32.HotPink, new CoreRectangle(10, 10, 190, 140)); + image.Mutate(x => x.Fill(Rgba32.HotPink, new CoreRectangle(10, 10, 190, 140))); return new CoreSize(image.Width, image.Height); } @@ -50,13 +50,13 @@ public CoreSize FillPolygonCore() { using (Image image = new Image(800, 800)) { - image.FillPolygon( + image.Mutate(x => x.FillPolygon( Rgba32.HotPink, new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(200, 10), new Vector2(200, 150), - new Vector2(10, 150) }); + new Vector2(10, 150) })); return new CoreSize(image.Width, image.Height); } diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs b/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs index aa97efe00b..fec6332d25 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs @@ -40,7 +40,7 @@ public void DrawPatternPolygon3Core() { using (Image image = new Image(800, 800)) { - image.Fill(CoreBrushes.BackwardDiagonal(Rgba32.HotPink)); + image.Mutate(x => x.Fill(CoreBrushes.BackwardDiagonal(Rgba32.HotPink))); using (MemoryStream ms = new MemoryStream()) { diff --git a/tests/ImageSharp.Benchmarks/Samplers/Crop.cs b/tests/ImageSharp.Benchmarks/Samplers/Crop.cs index cb13378a13..ee8fdcf250 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Crop.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Crop.cs @@ -41,7 +41,7 @@ public CoreSize CropResizeCore() { using (Image image = new Image(800, 800)) { - image.Crop(100, 100); + image.Mutate(x => x.Crop(100, 100)); return new CoreSize(image.Width, image.Height); } } diff --git a/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs b/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs index 1f69030a00..380a0abb03 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs @@ -38,17 +38,17 @@ public void Cleanup() [Benchmark(Description = "ImageSharp DetectEdges")] public void ImageProcessorCoreDetectEdges() { - this.image.DetectEdges(EdgeDetection.Kayyali); - this.image.DetectEdges(EdgeDetection.Kayyali); - this.image.DetectEdges(EdgeDetection.Kirsch); - this.image.DetectEdges(EdgeDetection.Lapacian3X3); - this.image.DetectEdges(EdgeDetection.Lapacian5X5); - this.image.DetectEdges(EdgeDetection.LaplacianOfGaussian); - this.image.DetectEdges(EdgeDetection.Prewitt); - this.image.DetectEdges(EdgeDetection.RobertsCross); - this.image.DetectEdges(EdgeDetection.Robinson); - this.image.DetectEdges(EdgeDetection.Scharr); - this.image.DetectEdges(EdgeDetection.Sobel); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Kayyali)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Kayyali)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Kirsch)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Lapacian3X3)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Lapacian5X5)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.LaplacianOfGaussian)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Prewitt)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.RobertsCross)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Robinson)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Scharr)); + this.image.Mutate(x => x.DetectEdges(EdgeDetection.Sobel)); } } } diff --git a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs index 2aa8df96ca..53cdb1b93e 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs @@ -26,7 +26,7 @@ public class Glow : BenchmarkBase [GlobalSetup] public void Setup() { - this.bulk = new GlowProcessor(NamedColors.Beige, GraphicsOptions.Default) { Radius = 800 * .5f, }; + this.bulk = new GlowProcessor(NamedColors.Beige, 800 * .5f, GraphicsOptions.Default); this.parallel = new GlowProcessorParallel(NamedColors.Beige) { Radius = 800 * .5f, }; } diff --git a/tests/ImageSharp.Benchmarks/Samplers/Resize.cs b/tests/ImageSharp.Benchmarks/Samplers/Resize.cs index 3873400698..db22167704 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Resize.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Resize.cs @@ -41,7 +41,7 @@ public CoreSize ResizeCore() { using (Image image = new Image(2000, 2000)) { - image.Resize(400, 400); + image.Mutate(x => x.Resize(400, 400)); return new CoreSize(image.Width, image.Height); } } diff --git a/tests/ImageSharp.Tests/Drawing/BeziersTests.cs b/tests/ImageSharp.Tests/Drawing/BeziersTests.cs index 7ddc2de5a4..1b3aeacb15 100644 --- a/tests/ImageSharp.Tests/Drawing/BeziersTests.cs +++ b/tests/ImageSharp.Tests/Drawing/BeziersTests.cs @@ -24,15 +24,15 @@ public void ImageShouldBeOverlayedByBezierLine() string path = this.CreateOutputDirectory("Drawing", "BezierLine"); using (Image image = new Image(500, 500)) { - image.BackgroundColor(Rgba32.Blue) + image.Mutate(x => x.BackgroundColor(Rgba32.Blue) .DrawBeziers(Rgba32.HotPink, 5, new SixLabors.Primitives.PointF[] { new Vector2(10, 400), new Vector2(30, 10), new Vector2(240, 30), new Vector2(300, 400) - }) - .Save($"{path}/Simple.png"); + })); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -63,7 +63,7 @@ public void ImageShouldBeOverlayedBezierLineWithOpacity() using (Image image = new Image(500, 500)) { - image.BackgroundColor(Rgba32.Blue) + image.Mutate(x => x.BackgroundColor(Rgba32.Blue) .DrawBeziers(color, 10, new SixLabors.Primitives.PointF[]{ @@ -71,8 +71,8 @@ public void ImageShouldBeOverlayedBezierLineWithOpacity() new Vector2(30, 10), new Vector2(240, 30), new Vector2(300, 400) - }) - .Save($"{path}/Opacity.png"); + })); + image.Save($"{path}/Opacity.png"); //shift background color towards forground color by the opacity amount Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); diff --git a/tests/ImageSharp.Tests/Drawing/BlendedShapes.cs b/tests/ImageSharp.Tests/Drawing/BlendedShapes.cs index 40a1cb3d3c..e1ff00ca23 100644 --- a/tests/ImageSharp.Tests/Drawing/BlendedShapes.cs +++ b/tests/ImageSharp.Tests/Drawing/BlendedShapes.cs @@ -27,11 +27,12 @@ public void DrawBlendedValues(TestImageProvider provider, PixelB { var scaleX = (img.Width / 100); var scaleY = (img.Height / 100); - img.Fill(NamedColors.DarkBlue, new Rectangle(0 * scaleX, 40 * scaleY, 100 * scaleX, 20 * scaleY)); - img.Fill(NamedColors.HotPink, new Rectangle(20 * scaleX, 0 * scaleY, 30 * scaleX, 100 * scaleY), new ImageSharp.GraphicsOptions(true) - { - BlenderMode = mode - }); + img.Mutate(x=>x + .Fill(NamedColors.DarkBlue, new Rectangle(0 * scaleX, 40 * scaleY, 100 * scaleX, 20 * scaleY)) + .Fill(NamedColors.HotPink, new Rectangle(20 * scaleX, 0 * scaleY, 30 * scaleX, 100 * scaleY), new ImageSharp.GraphicsOptions(true) + { + BlenderMode = mode + })); img.DebugSave(provider, new { mode }); } } @@ -45,15 +46,15 @@ public void DrawBlendedValues_transparent(TestImageProvider prov { var scaleX = (img.Width / 100); var scaleY = (img.Height / 100); - img.Fill(NamedColors.DarkBlue, new Rectangle(0* scaleX, 40 * scaleY, 100 * scaleX, 20 * scaleY)); - img.Fill(NamedColors.HotPink, new Rectangle(20 * scaleX, 0 * scaleY, 30 * scaleX, 100 * scaleY), new ImageSharp.GraphicsOptions(true) + img.Mutate(x=>x.Fill(NamedColors.DarkBlue, new Rectangle(0* scaleX, 40 * scaleY, 100 * scaleX, 20 * scaleY))); + img.Mutate(x => x.Fill(NamedColors.HotPink, new Rectangle(20 * scaleX, 0 * scaleY, 30 * scaleX, 100 * scaleY), new ImageSharp.GraphicsOptions(true) { BlenderMode = mode - }); - img.Fill(NamedColors.Transparent, new SixLabors.Shapes.EllipsePolygon(40 * scaleX, 50 * scaleY, 50 * scaleX, 50 * scaleY), new ImageSharp.GraphicsOptions(true) + })); + img.Mutate(x => x.Fill(NamedColors.Transparent, new SixLabors.Shapes.EllipsePolygon(40 * scaleX, 50 * scaleY, 50 * scaleX, 50 * scaleY), new ImageSharp.GraphicsOptions(true) { BlenderMode = mode - }); + })); img.DebugSave(provider, new { mode }); } } @@ -67,20 +68,20 @@ public void DrawBlendedValues_transparent50Percent(TestImageProvider.DarkBlue, new Rectangle(0 * scaleX, 40, 100 * scaleX, 20* scaleY)); - img.Fill(NamedColors.HotPink, new Rectangle(20 * scaleX, 0, 30 * scaleX, 100 * scaleY), new ImageSharp.GraphicsOptions(true) + img.Mutate(x=>x.Fill(NamedColors.DarkBlue, new Rectangle(0 * scaleX, 40, 100 * scaleX, 20* scaleY))); + img.Mutate(x => x.Fill(NamedColors.HotPink, new Rectangle(20 * scaleX, 0, 30 * scaleX, 100 * scaleY), new ImageSharp.GraphicsOptions(true) { BlenderMode = mode - }); + })); var c = NamedColors.Red.ToVector4(); c.W *= 0.5f; TPixel pixel = default(TPixel); pixel.PackFromVector4(c); - img.Fill(pixel, new SixLabors.Shapes.EllipsePolygon(40 * scaleX, 50 * scaleY, 50 * scaleX, 50 * scaleY), new ImageSharp.GraphicsOptions(true) + img.Mutate(x => x.Fill(pixel, new SixLabors.Shapes.EllipsePolygon(40 * scaleX, 50 * scaleY, 50 * scaleX, 50 * scaleY), new ImageSharp.GraphicsOptions(true) { BlenderMode = mode - }); + })); img.DebugSave(provider, new { mode }); } } @@ -96,16 +97,11 @@ public void DrawBlendedValues_doldidEllips(TestImageProvider pro { var scaleX = (img.Width / 100); var scaleY = (img.Height / 100); - img.Fill(NamedColors.DarkBlue, new Rectangle(0 * scaleX, 40* scaleY, 100 * scaleX, 20 * scaleY)); - //img.Fill(NamedColors.HotPink, new Rectangle(20 * scaleX, 0 * scaleY, 30 * scaleX, 100 * scaleY), new ImageSharp.GraphicsOptions(true) - //{ - // BlenderMode = mode - //}); - - img.Fill(NamedColors.Black, new SixLabors.Shapes.EllipsePolygon(40 * scaleX, 50 * scaleY, 50 * scaleX, 50 * scaleY), new ImageSharp.GraphicsOptions(true) + img.Mutate(x => x.Fill(NamedColors.DarkBlue, new Rectangle(0 * scaleX, 40* scaleY, 100 * scaleX, 20 * scaleY))); + img.Mutate(x => x.Fill(NamedColors.Black, new SixLabors.Shapes.EllipsePolygon(40 * scaleX, 50 * scaleY, 50 * scaleX, 50 * scaleY), new ImageSharp.GraphicsOptions(true) { BlenderMode = mode - }); + })); img.DebugSave(provider, new { mode }); } } diff --git a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs index 728ed749a2..29e3d94fb3 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs @@ -40,8 +40,8 @@ public void ImageShouldApplyDrawImage(TestImageProvider provider using (Image image = provider.GetImage()) using (Image blend = Image.Load(TestFile.Create(TestImages.Bmp.Car).Bytes)) { - image.DrawImage(blend, mode, .75f, new Size(image.Width / 2, image.Height / 2), new Point(image.Width / 4, image.Height / 4)) - .DebugSave(provider, new { mode }); + image.Mutate(x => x.DrawImage(blend, mode, .75f, new Size(image.Width / 2, image.Height / 2), new Point(image.Width / 4, image.Height / 4))); + image.DebugSave(provider, new { mode }); } } } diff --git a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs index da5028f04f..c609aa9918 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs @@ -34,10 +34,10 @@ public void ImageShouldBeOverlayedByPath() ShapePath p = new ShapePath(linerSegemnt, bazierSegment); - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Draw(Rgba32.HotPink, 5, p) - .Save($"{path}/Simple.png"); + .Draw(Rgba32.HotPink, 5, p)); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -74,10 +74,10 @@ public void ImageShouldBeOverlayedPathWithOpacity() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Draw(color, 10, p) - .Save($"{path}/Opacity.png"); + .Draw(color, 10, p)); + image.Save($"{path}/Opacity.png"); //shift background color towards forground color by the opacity amount Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); @@ -101,12 +101,12 @@ public void PathExtendingOffEdgeOfImageShouldNotBeCropped() string path = this.CreateOutputDirectory("Drawing", "Path"); using (var image = new Image(256, 256)) { - image.Fill(Rgba32.Black); + image.Mutate(x => x.Fill(Rgba32.Black)); var pen = Pens.Solid(Rgba32.White, 5f); for (int i = 0; i < 300; i += 20) { - image.DrawLines(pen, new SixLabors.Primitives.PointF[] { new Vector2(100, 2), new Vector2(-10, i) }); + image.Mutate(x => x.DrawLines(pen, new SixLabors.Primitives.PointF[] { new Vector2(100, 2), new Vector2(-10, i) })); } image diff --git a/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs b/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs index bbabdf0ea6..5dd7c55211 100644 --- a/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs @@ -21,9 +21,9 @@ private void Test(string name, Rgba32 background, IBrush brush, Rgba32[, string path = this.CreateOutputDirectory("Fill", "PatternBrush"); using (Image image = new Image(20, 20)) { - image + image.Mutate(x => x .Fill(background) - .Fill(brush); + .Fill(brush)); image.Save($"{path}/{name}.png"); @@ -51,7 +51,8 @@ private void Test(string name, Rgba32 background, IBrush brush, Rgba32[, } } } - image.Resize(80, 80).Save($"{path}/{name}x4.png"); + image.Mutate(x => x.Resize(80, 80)); + image.Save($"{path}/{name}x4.png"); } } diff --git a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs index b04a413857..d0e93e7343 100644 --- a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs @@ -71,18 +71,16 @@ public void FillOffCanvas() processor.Apply(img, bounds); } - - [Fact] public void DrawOffCanvas() { using (var img = new Image(10, 10)) { - img.DrawLines(new Pen(Rgba32.Black, 10), new SixLabors.Primitives.PointF[] { + img.Mutate(x => x.DrawLines(new Pen(Rgba32.Black, 10), new SixLabors.Primitives.PointF[] { new Vector2(-10, 5), new Vector2(20, 5), - }); + })); } } } diff --git a/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs b/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs index ce127cfe03..f2f6ad06a4 100644 --- a/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs @@ -24,8 +24,9 @@ public void ImageShouldBeFloodFilledWithColorOnDefaultBackground() string path = this.CreateOutputDirectory("Fill", "SolidBrush"); using (Image image = new Image(500, 500)) { + image.Mutate(x => x + .Fill(Rgba32.HotPink)); image - .Fill(Rgba32.HotPink) .Save($"{path}/DefaultBack.png"); using (PixelAccessor sourcePixels = image.Lock()) @@ -43,10 +44,10 @@ public void ImageShouldBeFloodFilledWithColor() string path = this.CreateOutputDirectory("Fill", "SolidBrush"); using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Fill(Rgba32.HotPink) - .Save($"{path}/Simple.png"); + .Fill(Rgba32.HotPink)); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -65,10 +66,10 @@ public void ImageShouldBeFloodFilledWithColorOpacity() { Rgba32 color = new Rgba32(Rgba32.HotPink.R, Rgba32.HotPink.G, Rgba32.HotPink.B, 150); - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Fill(color) - .Save($"{path}/Opacity.png"); + .Fill(color)); + image.Save($"{path}/Opacity.png"); //shift background color towards forground color by the opacity amount Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); diff --git a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs index e058572fb3..fea7ee8183 100644 --- a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs @@ -34,10 +34,10 @@ public void ImageShouldBeOverlayedByPolygonOutline() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Draw(Rgba32.HotPink, 5, simplePath.Clip(hole1)) - .Save($"{path}/Simple.png"); + .Draw(Rgba32.HotPink, 5, simplePath.Clip(hole1))); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -81,10 +81,10 @@ public void ImageShouldBeOverlayedByPolygonOutlineNoOverlapping() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Draw(Rgba32.HotPink, 5, simplePath.Clip(hole1)) - .Save($"{path}/SimpleVanishHole.png"); + .Draw(Rgba32.HotPink, 5, simplePath.Clip(hole1))); + image.Save($"{path}/SimpleVanishHole.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -129,10 +129,10 @@ public void ImageShouldBeOverlayedByPolygonOutlineOverlapping() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Draw(Rgba32.HotPink, 5, simplePath.Clip(hole1)) - .Save($"{path}/SimpleOverlapping.png"); + .Draw(Rgba32.HotPink, 5, simplePath.Clip(hole1))); + image.Save($"{path}/SimpleOverlapping.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -172,10 +172,10 @@ public void ImageShouldBeOverlayedByPolygonOutlineDashed() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Draw(Pens.Dash(Rgba32.HotPink, 5), simplePath.Clip(hole1)) - .Save($"{path}/Dashed.png"); + .Draw(Pens.Dash(Rgba32.HotPink, 5), simplePath.Clip(hole1))); + image.Save($"{path}/Dashed.png"); } } @@ -197,10 +197,10 @@ public void ImageShouldBeOverlayedPolygonOutlineWithOpacity() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Draw(color, 5, simplePath.Clip(hole1)) - .Save($"{path}/Opacity.png"); + .Draw(color, 5, simplePath.Clip(hole1))); + image.Save($"{path}/Opacity.png"); //shift background color towards forground color by the opacity amount Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); diff --git a/tests/ImageSharp.Tests/Drawing/LineTests.cs b/tests/ImageSharp.Tests/Drawing/LineTests.cs index f47d566967..693bbc28fb 100644 --- a/tests/ImageSharp.Tests/Drawing/LineTests.cs +++ b/tests/ImageSharp.Tests/Drawing/LineTests.cs @@ -23,15 +23,15 @@ public void ImageShouldBeOverlayedByPath() string path = this.CreateOutputDirectory("Drawing", "Lines"); using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .DrawLines(Rgba32.HotPink, 5, new SixLabors.Primitives.PointF[]{ new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) - }) - .Save($"{path}/Simple.png"); + })); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -50,7 +50,7 @@ public void ImageShouldBeOverlayedByPath_NoAntialias() string path = this.CreateOutputDirectory("Drawing", "Lines"); using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .DrawLines(Rgba32.HotPink, 5, new SixLabors.Primitives.PointF[] { @@ -58,8 +58,8 @@ public void ImageShouldBeOverlayedByPath_NoAntialias() new Vector2(200, 150), new Vector2(50, 300) }, - new GraphicsOptions(false)) - .Save($"{path}/Simple_noantialias.png"); + new GraphicsOptions(false))); + image.Save($"{path}/Simple_noantialias.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -78,17 +78,17 @@ public void ImageShouldBeOverlayedByPathDashed() string path = this.CreateOutputDirectory("Drawing", "Lines"); using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .DrawLines(Pens.Dash(Rgba32.HotPink, 5), new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) - }) - .Save($"{path}/Dashed.png"); - } + })); + image.Save($"{path}/Dashed.png"); } + } [Fact] public void ImageShouldBeOverlayedByPathDotted() @@ -96,17 +96,17 @@ public void ImageShouldBeOverlayedByPathDotted() string path = this.CreateOutputDirectory("Drawing", "Lines"); using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .DrawLines(Pens.Dot(Rgba32.HotPink, 5), new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) - }) - .Save($"{path}/Dot.png"); - } + })); + image.Save($"{path}/Dot.png"); } + } [Fact] public void ImageShouldBeOverlayedByPathDashDot() @@ -114,17 +114,17 @@ public void ImageShouldBeOverlayedByPathDashDot() string path = this.CreateOutputDirectory("Drawing", "Lines"); using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .DrawLines(Pens.DashDot(Rgba32.HotPink, 5), new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) - }) - .Save($"{path}/DashDot.png"); - } + })); + image.Save($"{path}/DashDot.png"); } + } [Fact] public void ImageShouldBeOverlayedByPathDashDotDot() @@ -132,15 +132,15 @@ public void ImageShouldBeOverlayedByPathDashDotDot() string path = this.CreateOutputDirectory("Drawing", "Lines"); Image image = new Image(500, 500); - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .DrawLines(Pens.DashDotDot(Rgba32.HotPink, 5), new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) - }) - .Save($"{path}/DashDotDot.png"); - } + })); + image.Save($"{path}/DashDotDot.png"); + } [Fact] public void ImageShouldBeOverlayedPathWithOpacity() @@ -151,27 +151,27 @@ public void ImageShouldBeOverlayedPathWithOpacity() Image image = new Image(500, 500); - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .DrawLines(color, 10, new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) - }) - .Save($"{path}/Opacity.png"); + })); + image.Save($"{path}/Opacity.png"); - //shift background color towards forground color by the opacity amount - Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); + //shift background color towards forground color by the opacity amount + Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); - using (PixelAccessor sourcePixels = image.Lock()) - { - Assert.Equal(mergedColor, sourcePixels[11, 11]); + using (PixelAccessor sourcePixels = image.Lock()) + { + Assert.Equal(mergedColor, sourcePixels[11, 11]); - Assert.Equal(mergedColor, sourcePixels[199, 149]); + Assert.Equal(mergedColor, sourcePixels[199, 149]); - Assert.Equal(Rgba32.Blue, sourcePixels[50, 50]); - } + Assert.Equal(Rgba32.Blue, sourcePixels[50, 50]); } + } [Fact] public void ImageShouldBeOverlayedByPathOutline() @@ -180,27 +180,27 @@ public void ImageShouldBeOverlayedByPathOutline() Image image = new Image(500, 500); - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .DrawLines(Rgba32.HotPink, 10, new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(200, 10), new Vector2(200, 150), new Vector2(10, 150) - }) - .Save($"{path}/Rectangle.png"); + })); + image.Save($"{path}/Rectangle.png"); - using (PixelAccessor sourcePixels = image.Lock()) - { - Assert.Equal(Rgba32.HotPink, sourcePixels[11, 11]); + using (PixelAccessor sourcePixels = image.Lock()) + { + Assert.Equal(Rgba32.HotPink, sourcePixels[11, 11]); - Assert.Equal(Rgba32.HotPink, sourcePixels[198, 10]); + Assert.Equal(Rgba32.HotPink, sourcePixels[198, 10]); - Assert.Equal(Rgba32.Blue, sourcePixels[10, 50]); + Assert.Equal(Rgba32.Blue, sourcePixels[10, 50]); - Assert.Equal(Rgba32.Blue, sourcePixels[50, 50]); - } + Assert.Equal(Rgba32.Blue, sourcePixels[50, 50]); } - } + } +} diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs index 3a2b66c3c2..b80173bcf8 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs @@ -37,7 +37,7 @@ public void Dispose() [Fact] public void CorrectlySetsBrushAndPath() { - img.Fill(brush, path); + img.Mutate(x => x.Fill(brush, path)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -56,7 +56,7 @@ public void CorrectlySetsBrushAndPath() [Fact] public void CorrectlySetsBrushPathOptions() { - img.Fill(brush, path, noneDefault); + img.Mutate(x => x.Fill(brush, path, noneDefault)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -73,7 +73,7 @@ public void CorrectlySetsBrushPathOptions() [Fact] public void CorrectlySetsColorAndPath() { - img.Fill(color, path); + img.Mutate(x => x.Fill(color, path)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -91,7 +91,7 @@ public void CorrectlySetsColorAndPath() [Fact] public void CorrectlySetsColorPathAndOptions() { - img.Fill(color, path, noneDefault); + img.Mutate(x => x.Fill(color, path, noneDefault)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs index 24efa976e8..8fe18713d8 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs @@ -47,7 +47,7 @@ public void Dispose() [Fact] public void CorrectlySetsBrushAndPath() { - img.Fill(brush, pathCollection); + img.Mutate(x => x.Fill(brush, pathCollection)); Assert.Equal(2, img.ProcessorApplications.Count); for (var i = 0; i < 2; i++) @@ -69,7 +69,7 @@ public void CorrectlySetsBrushAndPath() [Fact] public void CorrectlySetsBrushPathOptions() { - img.Fill(brush, pathCollection, noneDefault); + img.Mutate(x => x.Fill(brush, pathCollection, noneDefault)); Assert.Equal(2, img.ProcessorApplications.Count); for (var i = 0; i < 2; i++) @@ -89,7 +89,7 @@ public void CorrectlySetsBrushPathOptions() [Fact] public void CorrectlySetsColorAndPath() { - img.Fill(color, pathCollection); + img.Mutate(x => x.Fill(color, pathCollection)); Assert.Equal(2, img.ProcessorApplications.Count); for (var i = 0; i < 2; i++) @@ -110,7 +110,7 @@ public void CorrectlySetsColorAndPath() [Fact] public void CorrectlySetsColorPathAndOptions() { - img.Fill(color, pathCollection, noneDefault); + img.Mutate(x => x.Fill(color, pathCollection, noneDefault)); Assert.Equal(2, img.ProcessorApplications.Count); for (var i = 0; i < 2; i++) diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs index b46d3d0d9c..2fd9a89b3c 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs @@ -37,7 +37,7 @@ public void Dispose() [Fact] public void CorrectlySetsBrushAndPath() { - img.FillPolygon(brush, path); + img.Mutate(x => x.FillPolygon(brush, path)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -54,7 +54,7 @@ public void CorrectlySetsBrushAndPath() [Fact] public void CorrectlySetsBrushPathAndOptions() { - img.FillPolygon(brush, path, noneDefault); + img.Mutate(x => x.FillPolygon(brush, path, noneDefault)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -71,7 +71,7 @@ public void CorrectlySetsBrushPathAndOptions() [Fact] public void CorrectlySetsColorAndPath() { - img.FillPolygon(color, path); + img.Mutate(x => x.FillPolygon(color, path)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -89,7 +89,7 @@ public void CorrectlySetsColorAndPath() [Fact] public void CorrectlySetsColorPathAndOptions() { - img.FillPolygon(color, path, noneDefault); + img.Mutate(x => x.FillPolygon(color, path, noneDefault)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs index 7e6a3deee5..56c7d51093 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs @@ -32,7 +32,7 @@ public void Dispose() [Fact] public void CorrectlySetsBrushAndRectangle() { - img.Fill(brush, rectangle); + img.Mutate(x => x.Fill(brush, rectangle)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -52,7 +52,7 @@ public void CorrectlySetsBrushAndRectangle() [Fact] public void CorrectlySetsBrushRectangleAndOptions() { - img.Fill(brush, rectangle, noneDefault); + img.Mutate(x => x.Fill(brush, rectangle, noneDefault)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -72,7 +72,7 @@ public void CorrectlySetsBrushRectangleAndOptions() [Fact] public void CorrectlySetsColorAndRectangle() { - img.Fill(color, rectangle); + img.Mutate(x => x.Fill(color, rectangle)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); @@ -93,7 +93,7 @@ public void CorrectlySetsColorAndRectangle() [Fact] public void CorrectlySetsColorRectangleAndOptions() { - img.Fill(color, rectangle, noneDefault); + img.Mutate(x => x.Fill(color, rectangle, noneDefault)); Assert.NotEmpty(img.ProcessorApplications); FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); diff --git a/tests/ImageSharp.Tests/Drawing/PolygonTests.cs b/tests/ImageSharp.Tests/Drawing/PolygonTests.cs index 501b10e4af..827cde5a85 100644 --- a/tests/ImageSharp.Tests/Drawing/PolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/PolygonTests.cs @@ -25,15 +25,15 @@ public void ImageShouldBeOverlayedByPolygonOutline() using (Image image = new Image(500, 500)) { - image - .BackgroundColor(Rgba32.Blue) - .DrawPolygon(Rgba32.HotPink, 5, - new SixLabors.Primitives.PointF[] { + image.Mutate(x => x + .BackgroundColor(Rgba32.Blue) + .DrawPolygon(Rgba32.HotPink, 5, + new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(200, 150), new Vector2(50, 300) - }) - .Save($"{path}/Simple.png"); + })); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -62,10 +62,10 @@ public void ImageShouldBeOverlayedPolygonOutlineWithOpacity() using (Image image = new Image(500, 500)) { - image - .BackgroundColor(Rgba32.Blue) - .DrawPolygon(color, 10, simplePath) - .Save($"{path}/Opacity.png"); + image.Mutate(x => x + .BackgroundColor(Rgba32.Blue) + .DrawPolygon(color, 10, simplePath)); + image.Save($"{path}/Opacity.png"); //shift background color towards forground color by the opacity amount Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); @@ -90,10 +90,10 @@ public void ImageShouldBeOverlayedByRectangleOutline() using (Image image = new Image(500, 500)) { - image - .BackgroundColor(Rgba32.Blue) - .Draw(Rgba32.HotPink, 10, new Rectangle(10, 10, 190, 140)) - .Save($"{path}/Rectangle.png"); + image.Mutate(x => x + .BackgroundColor(Rgba32.Blue) + .Draw(Rgba32.HotPink, 10, new Rectangle(10, 10, 190, 140))); + image.Save($"{path}/Rectangle.png"); using (PixelAccessor sourcePixels = image.Lock()) { diff --git a/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs b/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs index 9c62e860a8..53b7d950f4 100644 --- a/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs +++ b/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs @@ -27,8 +27,8 @@ public void ImageShouldRecolorYellowToHotPink() { using (Image image = file.CreateImage()) { - image.Fill(brush) - .Save($"{path}/{file.FileName}"); + image.Mutate(x => x.Fill(brush)); + image.Save($"{path}/{file.FileName}"); } } } @@ -45,8 +45,8 @@ public void ImageShouldRecolorYellowToHotPinkInARectangle() using (Image image = file.CreateImage()) { int imageHeight = image.Height; - image.Fill(brush, new Rectangle(0, imageHeight / 2 - imageHeight / 4, image.Width, imageHeight / 2)) - .Save($"{path}/Shaped_{file.FileName}"); + image.Mutate(x => x.Fill(brush, new Rectangle(0, imageHeight / 2 - imageHeight / 4, image.Width, imageHeight / 2))); + image.Save($"{path}/Shaped_{file.FileName}"); } } } diff --git a/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs b/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs index ba904cb3f2..aa9ffb1877 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs @@ -28,10 +28,10 @@ public void ImageShouldBeOverlayedByFilledPolygon() }; using (Image image = new Image(500, 500)) { - image - .BackgroundColor(Rgba32.Blue) - .Fill(Rgba32.HotPink, new Polygon(new CubicBezierLineSegment(simplePath))) - .Save($"{path}/Simple.png"); + image.Mutate(x => x + .BackgroundColor(Rgba32.Blue) + .Fill(Rgba32.HotPink, new Polygon(new CubicBezierLineSegment(simplePath)))); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -60,10 +60,10 @@ public void ImageShouldBeOverlayedByFilledPolygonOpacity() using (Image image = new Image(500, 500)) { - image - .BackgroundColor(Rgba32.Blue) - .Fill(color, new Polygon(new CubicBezierLineSegment(simplePath))) - .Save($"{path}/Opacity.png"); + image.Mutate(x => x + .BackgroundColor(Rgba32.Blue) + .Fill(color, new Polygon(new CubicBezierLineSegment(simplePath)))); + image.Save($"{path}/Opacity.png"); //shift background color towards forground color by the opacity amount Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); diff --git a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs index c3af3d5c28..70369a6a8c 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs @@ -34,10 +34,10 @@ public void ImageShouldBeOverlayedByPolygonOutline() // var clipped = new Rectangle(10, 10, 100, 100).Clip(new Rectangle(20, 0, 20, 20)); using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Fill(Rgba32.HotPink, clipped) - .Save($"{path}/Simple.png"); + .Fill(Rgba32.HotPink, clipped)); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -66,10 +66,10 @@ public void ImageShouldBeOverlayedPolygonOutlineWithOverlap() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Fill(Rgba32.HotPink, simplePath.Clip(hole1)) - .Save($"{path}/SimpleOverlapping.png"); + .Fill(Rgba32.HotPink, simplePath.Clip(hole1))); + image.Save($"{path}/SimpleOverlapping.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -98,10 +98,10 @@ public void ImageShouldBeOverlayedPolygonOutlineWithOpacity() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Fill(color, simplePath.Clip(hole1)) - .Save($"{path}/Opacity.png"); + .Fill(color, simplePath.Clip(hole1))); + image.Save($"{path}/Opacity.png"); //shift background color towards forground color by the opacity amount Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); diff --git a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs index 793bcfc9f0..469669acf2 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs @@ -31,9 +31,9 @@ public void ImageShouldBeOverlayedByFilledPolygon() using (Image image = new Image(500, 500)) { - image - .FillPolygon(Rgba32.HotPink, simplePath, new GraphicsOptions(true)) - .Save($"{path}/Simple.png"); + image.Mutate(x => x + .FillPolygon(Rgba32.HotPink, simplePath, new GraphicsOptions(true))); + image.Save($"{path}/Simple.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -54,9 +54,9 @@ public void ImageShouldBeOverlayedByFilledPolygonWithPattern() using (Image image = new Image(500, 500)) { - image - .FillPolygon(Brushes.Horizontal(Rgba32.HotPink), simplePath, new GraphicsOptions(true)) - .Save($"{path}/Pattern.png"); + image.Mutate(x => x + .FillPolygon(Brushes.Horizontal(Rgba32.HotPink), simplePath, new GraphicsOptions(true))); + image.Save($"{path}/Pattern.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -77,10 +77,10 @@ public void ImageShouldBeOverlayedByFilledPolygonNoAntialias() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .FillPolygon(Rgba32.HotPink, simplePath, new GraphicsOptions(false)) - .Save($"{path}/Simple_NoAntialias.png"); + .FillPolygon(Rgba32.HotPink, simplePath, new GraphicsOptions(false))); + image.Save($"{path}/Simple_NoAntialias.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -110,10 +110,10 @@ public void ImageShouldBeOverlayedByFilledPolygonImage() { ImageBrush brush = new ImageBrush(brushImage); - image - .BackgroundColor(Rgba32.Blue) - .FillPolygon(brush, simplePath) - .Save($"{path}/Image.png"); + image.Mutate(x => x + .BackgroundColor(Rgba32.Blue) + .FillPolygon(brush, simplePath)); + image.Save($"{path}/Image.png"); } } @@ -130,10 +130,10 @@ public void ImageShouldBeOverlayedByFilledPolygonOpacity() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .FillPolygon(color, simplePath) - .Save($"{path}/Opacity.png"); + .FillPolygon(color, simplePath)); + image.Save($"{path}/Opacity.png"); //shift background color towards forground color by the opacity amount Rgba32 mergedColor = new Rgba32(Vector4.Lerp(Rgba32.Blue.ToVector4(), Rgba32.HotPink.ToVector4(), 150f / 255f)); @@ -152,10 +152,10 @@ public void ImageShouldBeOverlayedByFilledRectangle() using (Image image = new Image(500, 500)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Fill(Rgba32.HotPink, new SixLabors.Shapes.RectangularePolygon(10, 10, 190, 140)) - .Save($"{path}/Rectangle.png"); + .Fill(Rgba32.HotPink, new SixLabors.Shapes.RectangularePolygon(10, 10, 190, 140))); + image.Save($"{path}/Rectangle.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -179,10 +179,10 @@ public void ImageShouldBeOverlayedByFilledTriangle() using (Image image = new Image(100, 100)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Fill(Rgba32.HotPink, new RegularPolygon(50, 50, 3, 30)) - .Save($"{path}/Triangle.png"); + .Fill(Rgba32.HotPink, new RegularPolygon(50, 50, 3, 30))); + image.Save($"{path}/Triangle.png"); using (PixelAccessor sourcePixels = image.Lock()) { @@ -202,10 +202,10 @@ public void ImageShouldBeOverlayedByFilledSeptagon() config.ParallelOptions.MaxDegreeOfParallelism = 1; using (Image image = new Image(config, 100, 100)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) - .Fill(Rgba32.HotPink, new RegularPolygon(50, 50, 7, 30, -(float)Math.PI)) - .Save($"{path}/Septagon.png"); + .Fill(Rgba32.HotPink, new RegularPolygon(50, 50, 7, 30, -(float)Math.PI))); + image.Save($"{path}/Septagon.png"); } } @@ -218,11 +218,11 @@ public void ImageShouldBeOverlayedByFilledEllipse() config.ParallelOptions.MaxDegreeOfParallelism = 1; using (Image image = new Image(config, 100, 100)) { - image + image.Mutate(x => x .BackgroundColor(Rgba32.Blue) .Fill(Rgba32.HotPink, new EllipsePolygon(50, 50, 30, 50) - .Rotate((float)(Math.PI / 3))) - .Save($"{path}/ellipse.png"); + .Rotate((float)(Math.PI / 3)))); + image.Save($"{path}/ellipse.png"); } } @@ -235,7 +235,7 @@ public void ImageShouldBeOverlayedBySquareWithCornerClipped() config.ParallelOptions.MaxDegreeOfParallelism = 1; using (Image image = new Image(config, 200, 200)) { - image + image.Mutate(x => x .Fill(Rgba32.Blue) .FillPolygon(Rgba32.HotPink, new SixLabors.Primitives.PointF[] { @@ -245,8 +245,8 @@ public void ImageShouldBeOverlayedBySquareWithCornerClipped() new Vector2( 120, 64 ), new Vector2( 120, 120 ), new Vector2( 8, 120 ) - }) - .Save($"{path}/clipped-corner.png"); + })); + image.Save($"{path}/clipped-corner.png"); } } } diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs index 05a1f1e363..067ea122d8 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs @@ -51,13 +51,13 @@ public void Dispose() [Fact] public void FillsForEachACharachterWhenBrushSetAndNotPen() { - this.img.DrawText( + this.img.Mutate(x => x.DrawText( "123", this.Font, Brushes.Solid(Rgba32.Red), null, path, - new TextGraphicsOptions(true)); + new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -67,7 +67,7 @@ public void FillsForEachACharachterWhenBrushSetAndNotPen() [Fact] public void FillsForEachACharachterWhenBrushSetAndNotPenDefaultOptions() { - this.img.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), null, path); + this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), null, path)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -77,7 +77,7 @@ public void FillsForEachACharachterWhenBrushSetAndNotPenDefaultOptions() [Fact] public void FillsForEachACharachterWhenBrushSet() { - this.img.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), path, new TextGraphicsOptions(true)); + this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), path, new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -87,7 +87,7 @@ public void FillsForEachACharachterWhenBrushSet() [Fact] public void FillsForEachACharachterWhenBrushSetDefaultOptions() { - this.img.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), path); + this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), path)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -97,7 +97,7 @@ public void FillsForEachACharachterWhenBrushSetDefaultOptions() [Fact] public void FillsForEachACharachterWhenColorSet() { - this.img.DrawText("123", this.Font, Rgba32.Red, path, new TextGraphicsOptions(true)); + this.img.Mutate(x => x.DrawText("123", this.Font, Rgba32.Red, path, new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); @@ -111,7 +111,7 @@ public void FillsForEachACharachterWhenColorSet() [Fact] public void FillsForEachACharachterWhenColorSetDefaultOptions() { - this.img.DrawText("123", this.Font, Rgba32.Red, path); + this.img.Mutate(x => x.DrawText("123", this.Font, Rgba32.Red, path)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); @@ -126,13 +126,13 @@ public void FillsForEachACharachterWhenColorSetDefaultOptions() [Fact] public void DrawForEachACharachterWhenPenSetAndNotBrush() { - this.img.DrawText( + this.img.Mutate(x => x.DrawText( "123", this.Font, null, Pens.Dash(Rgba32.Red, 1), path, - new TextGraphicsOptions(true)); + new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -142,7 +142,7 @@ public void DrawForEachACharachterWhenPenSetAndNotBrush() [Fact] public void DrawForEachACharachterWhenPenSetAndNotBrushDefaultOptions() { - this.img.DrawText("123", this.Font, null, Pens.Dash(Rgba32.Red, 1), path); + this.img.Mutate(x => x.DrawText("123", this.Font, null, Pens.Dash(Rgba32.Red, 1), path)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -152,7 +152,7 @@ public void DrawForEachACharachterWhenPenSetAndNotBrushDefaultOptions() [Fact] public void DrawForEachACharachterWhenPenSet() { - this.img.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), path, new TextGraphicsOptions(true)); + this.img.Mutate(x => x.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), path, new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -162,7 +162,7 @@ public void DrawForEachACharachterWhenPenSet() [Fact] public void DrawForEachACharachterWhenPenSetDefaultOptions() { - this.img.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), path); + this.img.Mutate(x => x.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), path)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -172,13 +172,13 @@ public void DrawForEachACharachterWhenPenSetDefaultOptions() [Fact] public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSet() { - this.img.DrawText( + this.img.Mutate(x => x.DrawText( "123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path, - new TextGraphicsOptions(true)); + new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(6, this.img.ProcessorApplications.Count); @@ -187,7 +187,7 @@ public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSet() [Fact] public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSetDefaultOptions() { - this.img.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path); + this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(6, this.img.ProcessorApplications.Count); @@ -196,13 +196,13 @@ public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSetDefaultOpt [Fact] public void BrushAppliesBeforPen() { - this.img.DrawText( + this.img.Mutate(x => x.DrawText( "1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path, - new TextGraphicsOptions(true)); + new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(2, this.img.ProcessorApplications.Count); @@ -213,39 +213,12 @@ public void BrushAppliesBeforPen() [Fact] public void BrushAppliesBeforPenDefaultOptions() { - this.img.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path); + this.img.Mutate(x => x.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(2, this.img.ProcessorApplications.Count); Assert.IsType>(this.img.ProcessorApplications[0].processor); Assert.IsType>(this.img.ProcessorApplications[1].processor); } - - [Fact] - public void GlyphHeightChangesBasedOnuseImageResolutionFlag() - { - this.img.MetaData.VerticalResolution = 1; - this.img.MetaData.HorizontalResolution = 1; - this.img.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), path, new TextGraphicsOptions(true) { - UseImageResolution = false - }); - - this.img.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), path, new TextGraphicsOptions(true) - { - UseImageResolution = true - }); - - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(2, this.img.ProcessorApplications.Count); - FillRegionProcessor ownResolution = Assert.IsType>(this.img.ProcessorApplications[0].processor); - FillRegionProcessor imgResolution = Assert.IsType>(this.img.ProcessorApplications[1].processor); - - ShapeRegion ownRegion = Assert.IsType(ownResolution.Region); - ShapeRegion imgRegion = Assert.IsType(imgResolution.Region); - - // magic numbers based on the font used at well known resolutions - Assert.Equal(7.44, ownRegion.Shape.Bounds.Height, 2); - Assert.Equal(0.1, imgRegion.Shape.Bounds.Height, 2); - } } } diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs index 1c8c9f1d16..d03af54562 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs @@ -51,13 +51,13 @@ public void Dispose() [Fact] public void FillsForEachACharachterWhenBrushSetAndNotPen() { - this.img.DrawText( + this.img.Mutate(x => x.DrawText( "123", this.Font, Brushes.Solid(Rgba32.Red), null, Vector2.Zero, - new TextGraphicsOptions(true)); + new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -67,7 +67,7 @@ public void FillsForEachACharachterWhenBrushSetAndNotPen() [Fact] public void FillsForEachACharachterWhenBrushSetAndNotPenDefaultOptions() { - this.img.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), null, Vector2.Zero); + this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), null, Vector2.Zero)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -77,7 +77,7 @@ public void FillsForEachACharachterWhenBrushSetAndNotPenDefaultOptions() [Fact] public void FillsForEachACharachterWhenBrushSet() { - this.img.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero, new TextGraphicsOptions(true)); + this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero, new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -87,7 +87,7 @@ public void FillsForEachACharachterWhenBrushSet() [Fact] public void FillsForEachACharachterWhenBrushSetDefaultOptions() { - this.img.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero); + this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -97,7 +97,7 @@ public void FillsForEachACharachterWhenBrushSetDefaultOptions() [Fact] public void FillsForEachACharachterWhenColorSet() { - this.img.DrawText("123", this.Font, Rgba32.Red, Vector2.Zero, new TextGraphicsOptions(true)); + this.img.Mutate(x => x.DrawText("123", this.Font, Rgba32.Red, Vector2.Zero, new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); @@ -111,7 +111,7 @@ public void FillsForEachACharachterWhenColorSet() [Fact] public void FillsForEachACharachterWhenColorSetDefaultOptions() { - this.img.DrawText("123", this.Font, Rgba32.Red, Vector2.Zero); + this.img.Mutate(x => x.DrawText("123", this.Font, Rgba32.Red, Vector2.Zero)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); @@ -126,13 +126,13 @@ public void FillsForEachACharachterWhenColorSetDefaultOptions() [Fact] public void DrawForEachACharachterWhenPenSetAndNotBrush() { - this.img.DrawText( + this.img.Mutate(x => x.DrawText( "123", this.Font, null, Pens.Dash(Rgba32.Red, 1), Vector2.Zero, - new TextGraphicsOptions(true)); + new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -142,7 +142,7 @@ public void DrawForEachACharachterWhenPenSetAndNotBrush() [Fact] public void DrawForEachACharachterWhenPenSetAndNotBrushDefaultOptions() { - this.img.DrawText("123", this.Font, null, Pens.Dash(Rgba32.Red, 1), Vector2.Zero); + this.img.Mutate(x => x.DrawText("123", this.Font, null, Pens.Dash(Rgba32.Red, 1), Vector2.Zero)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -152,7 +152,7 @@ public void DrawForEachACharachterWhenPenSetAndNotBrushDefaultOptions() [Fact] public void DrawForEachACharachterWhenPenSet() { - this.img.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), Vector2.Zero, new TextGraphicsOptions(true)); + this.img.Mutate(x => x.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), Vector2.Zero, new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -162,7 +162,7 @@ public void DrawForEachACharachterWhenPenSet() [Fact] public void DrawForEachACharachterWhenPenSetDefaultOptions() { - this.img.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), Vector2.Zero); + this.img.Mutate(x => x.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), Vector2.Zero)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied @@ -172,13 +172,13 @@ public void DrawForEachACharachterWhenPenSetDefaultOptions() [Fact] public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSet() { - this.img.DrawText( + this.img.Mutate(x => x.DrawText( "123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero, - new TextGraphicsOptions(true)); + new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(6, this.img.ProcessorApplications.Count); @@ -187,7 +187,7 @@ public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSet() [Fact] public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSetDefaultOptions() { - this.img.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero); + this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(6, this.img.ProcessorApplications.Count); @@ -196,13 +196,13 @@ public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSetDefaultOpt [Fact] public void BrushAppliesBeforPen() { - this.img.DrawText( + this.img.Mutate(x => x.DrawText( "1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero, - new TextGraphicsOptions(true)); + new TextGraphicsOptions(true))); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(2, this.img.ProcessorApplications.Count); @@ -213,39 +213,12 @@ public void BrushAppliesBeforPen() [Fact] public void BrushAppliesBeforPenDefaultOptions() { - this.img.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero); + this.img.Mutate(x => x.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero)); Assert.NotEmpty(this.img.ProcessorApplications); Assert.Equal(2, this.img.ProcessorApplications.Count); Assert.IsType>(this.img.ProcessorApplications[0].processor); Assert.IsType>(this.img.ProcessorApplications[1].processor); } - - [Fact] - public void GlyphHeightChangesBasedOnuseImageResolutionFlag() - { - this.img.MetaData.VerticalResolution = 1; - this.img.MetaData.HorizontalResolution = 1; - this.img.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero, new TextGraphicsOptions(true) { - UseImageResolution = false - }); - - this.img.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero, new TextGraphicsOptions(true) - { - UseImageResolution = true - }); - - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(2, this.img.ProcessorApplications.Count); - FillRegionProcessor ownResolution = Assert.IsType>(this.img.ProcessorApplications[0].processor); - FillRegionProcessor imgResolution = Assert.IsType>(this.img.ProcessorApplications[1].processor); - - ShapeRegion ownRegion = Assert.IsType(ownResolution.Region); - ShapeRegion imgRegion = Assert.IsType(imgResolution.Region); - - // magic numbers based on the font used at well known resolutions - Assert.Equal(7.44, ownRegion.Shape.Bounds.Height, 2); - Assert.Equal(0.1, imgRegion.Shape.Bounds.Height, 2); - } } } diff --git a/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs b/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs index ce2a5becf9..af401264dc 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs @@ -34,8 +34,8 @@ public void DrawAB() //draws 2 overlapping triangle glyphs twice 1 set on each line using (Image img = new Image(100, 200)) { - img.Fill(Rgba32.DarkBlue) - .DrawText("AB\nAB", new Font(this.Font, 50), Rgba32.Red, new Vector2(0, 0)); + img.Mutate(x => x.Fill(Rgba32.DarkBlue) + .DrawText("AB\nAB", new Font(this.Font, 50), Rgba32.Red, new Vector2(0, 0))); img.Save($"{this.CreateOutputDirectory("Drawing", "Text")}/AB.png"); } } diff --git a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs index 4ef8fe0612..1f669ba240 100644 --- a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs +++ b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs @@ -50,7 +50,7 @@ public void DecodeThenEncodeImageFromStreamShouldSucceed() { using (Image image = file.CreateImage()) { - image.Save($"{path}/{file.FileName}"); + image.Save($"{path}/{file.FileName}"); } } } @@ -68,8 +68,8 @@ public void QuantizeImageShouldPreserveMaximumColorPrecision() { using (FileStream output = File.OpenWrite($"{path}/Octree-{file.FileName}")) { - image.Quantize(Quantization.Octree) - .Save(output, mimeType); + image.Mutate(x => x.Quantize(Quantization.Octree)); + image.Save(output, mimeType); } } @@ -78,8 +78,8 @@ public void QuantizeImageShouldPreserveMaximumColorPrecision() { using (FileStream output = File.OpenWrite($"{path}/Wu-{file.FileName}")) { - image.Quantize(Quantization.Wu) - .Save(output, mimeType); + image.Mutate(x => x.Quantize(Quantization.Wu)); + image.Save(output, mimeType); } } @@ -87,8 +87,8 @@ public void QuantizeImageShouldPreserveMaximumColorPrecision() { using (FileStream output = File.OpenWrite($"{path}/Palette-{file.FileName}")) { - image.Quantize(Quantization.Palette) - .Save(output, mimeType); + image.Mutate(x => x.Quantize(Quantization.Palette)); + image.Save(output, mimeType); } } } diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs index 86faeee232..49802a8d23 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs @@ -36,8 +36,9 @@ public JpegEncoderTests(ITestOutputHelper output) public void LoadResizeSave(TestImageProvider provider, int quality, JpegSubsample subsample) where TPixel : struct, IPixel { - using (Image image = provider.GetImage().Resize(new ResizeOptions { Size = new Size(150, 100), Mode = ResizeMode.Max })) + using (Image image = provider.GetImage(x=>x.Resize(new ResizeOptions { Size = new Size(150, 100), Mode = ResizeMode.Max }))) { + image.MetaData.ExifProfile = null; // Reduce the size of the file JpegEncoder options = new JpegEncoder { Subsample = subsample, Quality = quality }; diff --git a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs index bac340a71c..43ca2a1b6d 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs @@ -113,7 +113,7 @@ public void Resize(TestImageProvider provider) using (MemoryStream ms = new MemoryStream()) { // image.Save(provider.Utility.GetTestOutputFileName("png")); - image.Resize(100, 100); + image.Mutate(x=>x.Resize(100, 100)); // image.Save(provider.Utility.GetTestOutputFileName("png", "resize")); image.Save(ms, new PngEncoder()); diff --git a/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs b/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs index b59023340b..4ffc33580a 100644 --- a/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs +++ b/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs @@ -82,7 +82,7 @@ public void CopyToThenCopyFromWithOffset(TestImageProvider provi { using (Image srcImage = provider.GetImage()) { - srcImage.Fill(NamedColors.Red, new Rectangle(4, 4, 8, 8)); + srcImage.Mutate(x => x.Fill(NamedColors.Red, new Rectangle(4, 4, 8, 8))); using (PixelAccessor srcPixels = srcImage.Lock()) { using (PixelArea area = new PixelArea(8, 8, order)) @@ -100,8 +100,9 @@ public void CopyToThenCopyFromWithOffset(TestImageProvider provi provider.Utility.SourceFileOrDescription = order.ToString(); provider.Utility.SaveTestOutputFile(destImage, "bmp"); - using (Image expectedImage = new Image(8, 8).Fill(NamedColors.Red)) + using (Image expectedImage = new Image(8, 8)) { + expectedImage.Mutate(x => x.Fill(NamedColors.Red)); Assert.True(destImage.IsEquivalentTo(expectedImage)); } } diff --git a/tests/ImageSharp.Tests/ImageComparer.cs b/tests/ImageSharp.Tests/ImageComparer.cs index 6cd80e9e83..46d4351ded 100644 --- a/tests/ImageSharp.Tests/ImageComparer.cs +++ b/tests/ImageSharp.Tests/ImageComparer.cs @@ -47,8 +47,8 @@ public static void EnsureProcessorChangesAreConstrained(Image< where TPixelB : struct, IPixel { // Draw identical shapes over the bounded and compare to ensure changes are constrained. - expected.Fill(NamedColors.HotPink, bounds); - actual.Fill(NamedColors.HotPink, bounds); + expected.Mutate(x => x.Fill(NamedColors.HotPink, bounds)); + actual.Mutate(x => x.Fill(NamedColors.HotPink, bounds)); CheckSimilarity(expected, actual, imageTheshold, segmentThreshold, scalingFactor); } @@ -138,7 +138,7 @@ private static Fast2DArray GetGrayScaleValues(this Image where TPixelA : struct, IPixel { byte[] buffer = new byte[3]; - using (Image img = new Image(source).Resize(scalingFactor, scalingFactor).Grayscale()) + using (Image img = source.Generate(x => x.Resize(scalingFactor, scalingFactor).Grayscale())) { using (PixelAccessor pixels = img.Lock()) { diff --git a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs index 642df598a3..a8140aac71 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyBinaryThresholdFilter(TestImageProvider image = provider.GetImage()) { - image.BinaryThreshold(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.BinaryThreshold(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -41,8 +41,8 @@ public void ImageShouldApplyBinaryThresholdInBox(TestImageProvider x.BinaryThreshold(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs index a06397c864..25b34bfe4e 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs @@ -38,8 +38,8 @@ public void ImageShouldApplyDitherFilter(TestImageProvider provi { using (Image image = provider.GetImage()) { - image.Dither(ditherer) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Dither(ditherer)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -53,8 +53,8 @@ public void ImageShouldApplyDitherFilterInBox(TestImageProvider { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.Dither(ditherer, bounds) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Dither(ditherer, bounds)); + image.DebugSave(provider, name, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } @@ -67,8 +67,8 @@ public void ImageShouldApplyDiffusionFilter(TestImageProvider pr { using (Image image = provider.GetImage()) { - image.Dither(diffuser, .5F) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Dither(diffuser, .5F)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -82,8 +82,8 @@ public void ImageShouldApplyDiffusionFilterInBox(TestImageProvider x.Dither(diffuser, .5F, bounds)); + image.DebugSave(provider, name, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs index 4dc70fb0f5..90c02be197 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs @@ -18,8 +18,8 @@ public void ImageShouldApplyBlackWhiteFilter(TestImageProvider p { using (Image image = provider.GetImage()) { - image.BlackWhite() - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.BlackWhite()); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -33,8 +33,8 @@ public void ImageShouldApplyBlackWhiteFilterInBox(TestImageProvider x.BlackWhite(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs index bc1c8ad226..9006e3e33d 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs @@ -32,8 +32,8 @@ public void ImageShouldApplyColorBlindnessFilter(TestImageProvider image = provider.GetImage()) { - image.ColorBlindness(colorBlindness) - .DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp); + image.Mutate(x => x.ColorBlindness(colorBlindness)); + image.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp); } } @@ -47,8 +47,8 @@ public void ImageShouldApplyColorBlindnessFilterInBox(TestImageProvider< { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.ColorBlindness(colorBlindness, bounds) - .DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp); + image.Mutate(x => x.ColorBlindness(colorBlindness, bounds)); + image.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs index 9bf55a6d25..6dd0e82488 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs @@ -29,7 +29,7 @@ public void ImageShouldApplyGrayscaleFilterAll(TestImageProvider { using (Image image = provider.GetImage()) { - image.Grayscale(value); + image.Mutate(x => x.Grayscale(value)); byte[] data = new byte[3]; for (int i = 0; i < image.Pixels.Length; i++) { @@ -51,8 +51,8 @@ public void ImageShouldApplyGrayscaleFilterInBox(TestImageProvider(source)) { var bounds = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); - image.Grayscale(value, bounds) - .DebugSave(provider, value.ToString()); + image.Mutate(x => x.Grayscale(value, bounds)); + image.DebugSave(provider, value.ToString()); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs index ba1cf2b8f7..1fe56a8be9 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyHueFilter(TestImageProvider provider { using (Image image = provider.GetImage()) { - image.Hue(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.Hue(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -40,8 +40,8 @@ public void ImageShouldApplyHueFilterInBox(TestImageProvider pro { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.Hue(value, bounds) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.Hue(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs index 971cdb6d81..779ca0f6b2 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs @@ -18,8 +18,8 @@ public void ImageShouldApplyKodachromeFilter(TestImageProvider p { using (Image image = provider.GetImage()) { - image.Kodachrome() - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Kodachrome()); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -33,8 +33,8 @@ public void ImageShouldApplyKodachromeFilterInBox(TestImageProvider x.Kodachrome(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs index 5b41cdb3b7..ebfacb7203 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs @@ -20,8 +20,8 @@ public void ImageShouldApplyLomographFilter(TestImageProvider pr { using (Image image = provider.GetImage()) { - image.Lomograph() - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Lomograph()); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -35,8 +35,8 @@ public void ImageShouldApplyLomographFilterInBox(TestImageProvider x.Lomograph(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs index 48f7a6c0a8..54836cedfa 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs @@ -18,8 +18,8 @@ public void ImageShouldApplyPolaroidFilter(TestImageProvider pro { using (Image image = provider.GetImage()) { - image.Polaroid() - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Polaroid()); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -33,8 +33,8 @@ public void ImageShouldApplyPolaroidFilterInBox(TestImageProvider x.Polaroid(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs index a4a4f3bb51..73c3f98b53 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplySaturationFilter(TestImageProvider p { using (Image image = provider.GetImage()) { - image.Saturation(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.Saturation(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -40,8 +40,8 @@ public void ImageShouldApplySaturationFilterInBox(TestImageProvider x.Saturation(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs index af554e30d8..ae7865c11a 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs @@ -18,8 +18,8 @@ public void ImageShouldApplySepiaFilter(TestImageProvider provid { using (Image image = provider.GetImage()) { - image.Sepia() - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Sepia()); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -33,8 +33,8 @@ public void ImageShouldApplySepiaFilterInBox(TestImageProvider p { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.Sepia(bounds) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Sepia(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs index ef049a539a..58a2665d0d 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyBoxBlurFilter(TestImageProvider prov { using (Image image = provider.GetImage()) { - image.BoxBlur(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.BoxBlur(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -40,8 +40,8 @@ public void ImageShouldApplyBoxBlurFilterInBox(TestImageProvider { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.BoxBlur(value, bounds) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.BoxBlur(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs index d5817ab14f..9f3a2d79a6 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs @@ -34,8 +34,8 @@ public void ImageShouldApplyDetectEdgesFilter(TestImageProvider { using (Image image = provider.GetImage()) { - image.DetectEdges(detector) - .DebugSave(provider, detector.ToString(), Extensions.Bmp); + image.Mutate(x => x.DetectEdges(detector)); + image.DebugSave(provider, detector.ToString(), Extensions.Bmp); } } @@ -49,8 +49,8 @@ public void ImageShouldApplyDetectEdgesFilterInBox(TestImageProvider x.DetectEdges(detector, bounds)); + image.DebugSave(provider, detector.ToString(), Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs index fa4e4b0b6b..763e806af9 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyGaussianBlurFilter(TestImageProvider { using (Image image = provider.GetImage()) { - image.GaussianBlur(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.GaussianBlur(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -40,8 +40,8 @@ public void ImageShouldApplyGaussianBlurFilterInBox(TestImageProvider x.GaussianBlur(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs index d15042ee69..6313bc72aa 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyGaussianSharpenFilter(TestImageProvider image = provider.GetImage()) { - image.GaussianSharpen(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.GaussianSharpen(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -40,8 +40,8 @@ public void ImageShouldApplyGaussianSharpenFilterInBox(TestImageProvider { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.GaussianSharpen(value, bounds) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.GaussianSharpen(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs b/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs index 34a24e70be..e01e67e181 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyAlphaFilter(TestImageProvider provid { using (Image image = provider.GetImage()) { - image.Alpha(value) - .DebugSave(provider, value, Extensions.Png); + image.Mutate(x => x.Alpha(value)); + image.DebugSave(provider, value, Extensions.Png); } } @@ -40,8 +40,8 @@ public void ImageShouldApplyAlphaFilterInBox(TestImageProvider p { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.Alpha(value, bounds) - .DebugSave(provider, value, Extensions.Png); + image.Mutate(x => x.Alpha(value, bounds)); + image.DebugSave(provider, value, Extensions.Png); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs index 63efbf3e73..55f11b8b54 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs @@ -18,8 +18,8 @@ public void ImageShouldApplyBackgroundColorFilter(TestImageProvider image = provider.GetImage()) { - image.BackgroundColor(NamedColors.HotPink) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.BackgroundColor(NamedColors.HotPink)); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -33,8 +33,8 @@ public void ImageShouldApplyBackgroundColorFilterInBox(TestImageProvider { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.BackgroundColor(NamedColors.HotPink, bounds) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.BackgroundColor(NamedColors.HotPink, bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs index c3b37705a9..081fdf319c 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyBrightnessFilter(TestImageProvider p { using (Image image = provider.GetImage()) { - image.Brightness(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.Brightness(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -40,8 +40,8 @@ public void ImageShouldApplyBrightnessFilterInBox(TestImageProvider x.Brightness(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); ; } diff --git a/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs index 892eb93622..2c2ef1403a 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyContrastFilter(TestImageProvider pro { using (Image image = provider.GetImage()) { - image.Contrast(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.Contrast(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -40,8 +40,8 @@ public void ImageShouldApplyContrastFilterInBox(TestImageProvider x.Contrast(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs index 3d8b3d1a1f..7d79517bc9 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs @@ -18,8 +18,8 @@ public void ImageShouldApplyInvertFilter(TestImageProvider provi { using (Image image = provider.GetImage()) { - image.Invert() - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Invert()); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -33,8 +33,8 @@ public void ImageShouldApplyInvertFilterInBox(TestImageProvider { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.Invert(bounds) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Invert(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs index 3d0e8f1177..002d57d847 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyOilPaintFilter(TestImageProvider pro { using (Image image = provider.GetImage()) { - image.OilPaint(levels, brushSize) - .DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp); + image.Mutate(x => x.OilPaint(levels, brushSize)); + image.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp); } } @@ -40,8 +40,8 @@ public void ImageShouldApplyOilPaintFilterInBox(TestImageProvider x.OilPaint(levels, brushSize, bounds)); + image.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds, 0.001F); } diff --git a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs index 253f1f4598..3a6e273d00 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs @@ -25,8 +25,8 @@ public void ImageShouldApplyPixelateFilter(TestImageProvider pro { using (Image image = provider.GetImage()) { - image.Pixelate(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.Pixelate(value)); + image.DebugSave(provider, value, Extensions.Bmp); // Test the neigbouring pixels for (int y = 0; y < image.Height; y += value) @@ -56,8 +56,8 @@ public void ImageShouldApplyPixelateFilterInBox(TestImageProvider x.Pixelate(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); for (int y = 0; y < image.Height; y++) { diff --git a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs index d0633dca59..20e521c8d9 100644 --- a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs +++ b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs @@ -18,8 +18,8 @@ public void ImageShouldApplyGlowFilter(TestImageProvider provide { using (Image image = provider.GetImage()) { - image.Glow() - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Glow()); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -30,8 +30,8 @@ public void ImageShouldApplyGlowFilterColor(TestImageProvider pr { using (Image image = provider.GetImage()) { - image.Glow(NamedColors.Orange) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Glow(NamedColors.Orange)); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -42,8 +42,8 @@ public void ImageShouldApplyGlowFilterRadius(TestImageProvider p { using (Image image = provider.GetImage()) { - image.Glow(image.Width / 4F) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Glow(image.Width / 4F)); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -57,8 +57,8 @@ public void ImageShouldApplyGlowFilterInBox(TestImageProvider pr { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - image.Glow(bounds) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Glow(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs index 56fcf0ee0d..74c5296fa3 100644 --- a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs @@ -18,8 +18,8 @@ public void ImageShouldApplyVignetteFilter(TestImageProvider pro { using (Image image = provider.GetImage()) { - image.Vignette() - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Vignette()); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -30,8 +30,8 @@ public void ImageShouldApplyVignetteFilterColor(TestImageProvider image = provider.GetImage()) { - image.Vignette(NamedColors.Orange) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Vignette(NamedColors.Orange)); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -42,8 +42,8 @@ public void ImageShouldApplyVignetteFilterRadius(TestImageProvider image = provider.GetImage()) { - image.Vignette(image.Width / 4F, image.Height / 4F) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Vignette(image.Width / 4F, image.Height / 4F)); + image.DebugSave(provider, null, Extensions.Bmp); } } @@ -57,8 +57,8 @@ public void ImageShouldApplyVignetteFilterInBox(TestImageProvider x.Vignette(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs index 7bc0c8bb52..6c1d32b337 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs @@ -38,10 +38,11 @@ public void ImageShouldAutoRotate(TestImageProvider provider, Ro image.MetaData.ExifProfile = new ExifProfile(); image.MetaData.ExifProfile.SetValue(ExifTag.Orientation, orientation); - image.RotateFlip(rotateType, flipType) - .DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "1_before"), Extensions.Bmp) - .AutoOrient() - .DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "2_after"), Extensions.Bmp); + image.Mutate(x => x.RotateFlip(rotateType, flipType)); + image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "1_before"), Extensions.Bmp); + + image.Mutate(x => x.AutoOrient()); + image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "2_after"), Extensions.Bmp); } } } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs index ca20abf790..b95c9d82ae 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs @@ -18,8 +18,8 @@ public void ImageShouldCrop(TestImageProvider provider) { using (Image image = provider.GetImage()) { - image.Crop(image.Width / 2, image.Height / 2) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Crop(image.Width / 2, image.Height / 2)); + image.DebugSave(provider, null, Extensions.Bmp); } } } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs index 24febd5b2f..1c97c70ad0 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs @@ -25,8 +25,8 @@ public void ImageShouldEntropyCrop(TestImageProvider provider, f { using (Image image = provider.GetImage()) { - image.EntropyCrop(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.EntropyCrop(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs index 45ab1e5f8b..8e048ae04e 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs @@ -29,8 +29,8 @@ public void ImageShouldFlip(TestImageProvider provider, FlipType { using (Image image = provider.GetImage()) { - image.Flip(flipType) - .DebugSave(provider, flipType, Extensions.Bmp); + image.Mutate(x => x.Flip(flipType)); + image.DebugSave(provider, flipType, Extensions.Bmp); } } } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs index 7caa1e7c0e..7471330bea 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs @@ -18,8 +18,8 @@ public void ImageShouldPad(TestImageProvider provider) { using (Image image = provider.GetImage()) { - image.Pad(image.Width + 50, image.Height + 50) - .DebugSave(provider, null, Extensions.Bmp); + image.Mutate(x => x.Pad(image.Width + 50, image.Height + 50)); + image.DebugSave(provider, null, Extensions.Bmp); // Check pixels are empty for (int y = 0; y < 25; y++) diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ResizeProfilingBenchmarks.cs b/tests/ImageSharp.Tests/Processing/Transforms/ResizeProfilingBenchmarks.cs index a300672e85..7b83f0a8e2 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ResizeProfilingBenchmarks.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/ResizeProfilingBenchmarks.cs @@ -34,7 +34,7 @@ public void ResizeBicubic(int width, int height) { using (var image = new Image(width, height)) { - image.Resize(width / 4, height / 4); + image.Mutate(x => x.Resize(width / 4, height / 4)); } }); } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs index fb195254e3..0092ae9da6 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs @@ -39,8 +39,8 @@ public void ImageShouldResize(TestImageProvider provider, string { using (Image image = provider.GetImage()) { - image.Resize(image.Width / 2, image.Height / 2, sampler, true) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2, sampler, true)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -54,8 +54,8 @@ public void ImageShouldResizeFromSourceRectangle(TestImageProvider x.Resize(image.Width, image.Height, sampler, sourceRectangle, destRectangle, false)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -66,8 +66,8 @@ public void ImageShouldResizeWidthAndKeepAspect(TestImageProvider image = provider.GetImage()) { - image.Resize(image.Width / 3, 0, sampler, false) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(image.Width / 3, 0, sampler, false)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -78,8 +78,8 @@ public void ImageShouldResizeHeightAndKeepAspect(TestImageProvider image = provider.GetImage()) { - image.Resize(0, image.Height / 3, sampler, false) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(0, image.Height / 3, sampler, false)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -96,8 +96,8 @@ public void ImageShouldResizeWithCropWidthMode(TestImageProvider Size = new Size(image.Width / 2, image.Height) }; - image.Resize(options) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -114,8 +114,8 @@ public void ImageShouldResizeWithCropHeightMode(TestImageProvider x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -133,8 +133,8 @@ public void ImageShouldResizeWithPadMode(TestImageProvider provi Mode = ResizeMode.Pad }; - image.Resize(options) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -152,8 +152,8 @@ public void ImageShouldResizeWithBoxPadMode(TestImageProvider pr Mode = ResizeMode.BoxPad }; - image.Resize(options) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -171,8 +171,8 @@ public void ImageShouldResizeWithMaxMode(TestImageProvider provi Mode = ResizeMode.Max }; - image.Resize(options) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -190,8 +190,8 @@ public void ImageShouldResizeWithMinMode(TestImageProvider provi Mode = ResizeMode.Min }; - image.Resize(options) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); } } @@ -209,8 +209,8 @@ public void ImageShouldResizeWithStretchMode(TestImageProvider p Mode = ResizeMode.Stretch }; - image.Resize(options) - .DebugSave(provider, name, Extensions.Bmp); + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); } } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs index f85ef6f13a..432b2549bb 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs @@ -31,8 +31,8 @@ public void ImageShouldRotateFlip(TestImageProvider provider, Ro { using (Image image = provider.GetImage()) { - image.RotateFlip(rotateType, flipType) - .DebugSave(provider, string.Join("_", rotateType, flipType), Extensions.Bmp); + image.Mutate(x => x.RotateFlip(rotateType, flipType)); + image.DebugSave(provider, string.Join("_", rotateType, flipType), Extensions.Bmp); } } } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs index 1f18564290..2db86390de 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs @@ -35,8 +35,8 @@ public void ImageShouldRotate(TestImageProvider provider, float { using (Image image = provider.GetImage()) { - image.Rotate(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.Rotate(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } @@ -47,8 +47,8 @@ public void ImageShouldRotateEnum(TestImageProvider provider, Ro { using (Image image = provider.GetImage()) { - image.Rotate(value) - .DebugSave(provider, value, Extensions.Bmp); + image.Mutate(x => x.Rotate(value)); + image.DebugSave(provider, value, Extensions.Bmp); } } } diff --git a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs index f2c2d7cbd2..63924c535f 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs @@ -25,8 +25,8 @@ public void ImageShouldSkew(TestImageProvider provider, float x, { using (Image image = provider.GetImage()) { - image.Skew(x, y) - .DebugSave(provider, string.Join("_", x, y), Extensions.Bmp); + image.Mutate(i => i.Skew(x, y)); + image.DebugSave(provider, string.Join("_", x, y), Extensions.Bmp); } } } diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs index 0caded4201..08e3e1054d 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs @@ -55,7 +55,8 @@ public override Image GetImage() TPixel color = default(TPixel); color.PackFromRgba32(new Rgba32(this.r, this.g, this.b, this.a)); - return image.Fill(color); + image.Mutate(x => x.Fill(color)); + return image; } public override void Serialize(IXunitSerializationInfo info) diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs index 03a685d34f..e939d78bba 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs @@ -82,6 +82,16 @@ public static TestImageProvider Solid( /// public abstract Image GetImage(); + /// + /// Returns an instance to the test case with the necessary traits. + /// + public Image GetImage(Action> operationsToApply) + { + var img = GetImage(); + img.Mutate(operationsToApply); + return img; + } + public virtual void Deserialize(IXunitSerializationInfo info) { PixelTypes pixelType = info.GetValue("PixelType"); diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs index 437c295b9c..88ab987ed8 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs @@ -67,8 +67,7 @@ public void IsEquivalentTo_WhenFalse(TestImageProvider provider, where TPixel : struct, IPixel { Image a = provider.GetImage(); - Image b = provider.GetImage(); - b = b.OilPaint(3, 2); + Image b = provider.GetImage(x=>x.OilPaint(3, 2)); Assert.False(a.IsEquivalentTo(b, compareAlpha)); } From 456e139813f21be2d9b75b7e7ad81c50758e09da Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Tue, 4 Jul 2017 18:47:32 +0100 Subject: [PATCH 02/33] fix demo --- samples/AvatarWithRoundedCorner/Program.cs | 52 +++++++++++++--------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index 45fe1e3c86..0ceb7566ef 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -8,57 +8,69 @@ namespace AvatarWithRoundedCorner using SixLabors.Primitives; using SixLabors.Shapes; - class Program + static class Program { static void Main(string[] args) { System.IO.Directory.CreateDirectory("output"); + using (var img = Image.Load("fb.jpg")) + { + // as generate returns a new IImage make sure we dispose of it + using (Image dest = img.Generate(x => x.ConvertToAvatar(new Size(200, 200), 20))) + { + dest.Save("output/fb.png"); + } + + using (Image destRound = img.Generate(x => x.ConvertToAvatar(new Size(200, 200), 100))) + { + destRound.Save("output/fb-round.png"); + } - GenerateAvatar("fb.jpg", "output/fb.png", new Size(200, 200), 20); - GenerateAvatar("fb.jpg", "output/fb-round.png", new Size(200, 200), 100); - GenerateAvatar("fb.jpg", "output/fb-rounder.png", new Size(200, 200), 150); + using (Image destRound = img.Generate(x => x.ConvertToAvatar(new Size(200, 200), 150))) + { + destRound.Save("output/fb-rounder.png"); + } + + // the original `img` object has not been altered at all. + } } - private static void GenerateAvatar(string source, string destination, Size size, float cornerRadius) + // lets create our custom image mutating pipeline + private static IImageOperations ConvertToAvatar(this IImageOperations operations, Size size, float cornerRadius) { - using (var image = Image.Load(source)) + return operations.Resize(new ImageSharp.Processing.ResizeOptions { - image.Mutate(x => x - .Resize(new ImageSharp.Processing.ResizeOptions - { - Size = size, - Mode = ImageSharp.Processing.ResizeMode.Crop - }) - .Run(i=>ApplyRoundedCourners(i, cornerRadius))); - - image.Save(destination); - } + Size = size, + Mode = ImageSharp.Processing.ResizeMode.Crop + }).Run(i => ApplyRoundedCourners(i, cornerRadius)); } + // the combination of `IImageOperations.Run()` + this could be replaced with an `IImageProcessor` public static void ApplyRoundedCourners(Image img, float cornerRadius) { var corners = BuildCorners(img.Width, img.Height, cornerRadius); - // now we have our corners time to draw them + + // mutating in here as we already have a cloned original img.Mutate(x => x.Fill(Rgba32.Transparent, corners, new GraphicsOptions(true) { BlenderMode = ImageSharp.PixelFormats.PixelBlenderMode.Src // enforces that any part of this shape that has color is punched out of the background })); } - public static IPathCollection BuildCorners(int imageWidth, int imageHeight, float cornerRadius) + public static IPathCollection BuildCorners(int imageWidth, int imageHeight, float cornerRadius) { // first create a square var rect = new SixLabors.Shapes.RectangularePolygon(-0.5f, -0.5f, cornerRadius, cornerRadius); // then cut out of the square a circle so we are left with a corner - var cornerToptLeft = rect.Clip(new SixLabors.Shapes.EllipsePolygon(cornerRadius-0.5f, cornerRadius - 0.5f, cornerRadius)); + var cornerToptLeft = rect.Clip(new SixLabors.Shapes.EllipsePolygon(cornerRadius - 0.5f, cornerRadius - 0.5f, cornerRadius)); // corner is now a corner shape positions top left //lets make 3 more positioned correctly, we cando that by translating the orgional artound the center of the image var center = new Vector2(imageWidth / 2, imageHeight / 2); var angle = Math.PI / 2f; - float rightPos = imageWidth - cornerToptLeft.Bounds.Width +1; + float rightPos = imageWidth - cornerToptLeft.Bounds.Width + 1; float bottomPos = imageHeight - cornerToptLeft.Bounds.Height + 1; // move it across the widthof the image - the width of the shape From 88e30a01340c2dd2c4cd3f2fa32e2a7b14a56b07 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Tue, 4 Jul 2017 19:05:01 +0100 Subject: [PATCH 03/33] fix apply processors to frames --- src/ImageSharp/Processing/ImageProcessor.cs | 6 +++--- .../Formats/Gif/GifDecoderTests.cs | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/ImageSharp/Processing/ImageProcessor.cs b/src/ImageSharp/Processing/ImageProcessor.cs index bf88d5ff7b..a4ed4eb988 100644 --- a/src/ImageSharp/Processing/ImageProcessor.cs +++ b/src/ImageSharp/Processing/ImageProcessor.cs @@ -42,10 +42,10 @@ public void Apply(Image source, Rectangle sourceRectangle) foreach (ImageFrame sourceFrame in source.Frames) { - this.BeforeApply(source, sourceRectangle); + this.BeforeApply(sourceFrame, sourceRectangle); - this.OnApply(source, sourceRectangle); - this.AfterApply(source, sourceRectangle); + this.OnApply(sourceFrame, sourceRectangle); + this.AfterApply(sourceFrame, sourceRectangle); } this.AfterImageApply(source, sourceRectangle); diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs index 06bfd8990d..f74c7a5a71 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs @@ -11,6 +11,7 @@ namespace ImageSharp.Tests using ImageSharp.Formats; using ImageSharp.PixelFormats; + using SixLabors.Primitives; public class GifDecoderTests { @@ -29,7 +30,20 @@ public void DecodeAndReSave(TestImageProvider imageProvider) imageProvider.Utility.SaveTestOutputFile(image, "gif"); } } - + [Theory] + [WithFileCollection(nameof(TestFiles), PixelTypes)] + public void DecodeResizeAndSave(TestImageProvider imageProvider) + where TPixel : struct, IPixel + { + using (Image image = imageProvider.GetImage()) + { + image.Mutate(x => x.Resize(new Size(image.Width / 2, image.Height / 2))); + + imageProvider.Utility.SaveTestOutputFile(image, "bmp"); + imageProvider.Utility.SaveTestOutputFile(image, "gif"); + } + } + [Fact] public void Decode_IgnoreMetadataIsFalse_CommentsAreRead() { From a61fcc95d9e37a63903aa2def3e59e475edae39d Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Wed, 5 Jul 2017 07:39:19 +0100 Subject: [PATCH 04/33] Rename Generate -> Clone --- samples/AvatarWithRoundedCorner/Program.cs | 6 +++--- .../Processors/DrawImageProcessor.cs | 2 +- src/ImageSharp/ApplyProcessors.cs | 10 +++++----- src/ImageSharp/Image/Image{TPixel}.cs | 9 +++++++++ tests/ImageSharp.Tests/ImageComparer.cs | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index 0ceb7566ef..d519fc1edb 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -16,17 +16,17 @@ static void Main(string[] args) using (var img = Image.Load("fb.jpg")) { // as generate returns a new IImage make sure we dispose of it - using (Image dest = img.Generate(x => x.ConvertToAvatar(new Size(200, 200), 20))) + using (Image dest = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 20))) { dest.Save("output/fb.png"); } - using (Image destRound = img.Generate(x => x.ConvertToAvatar(new Size(200, 200), 100))) + using (Image destRound = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 100))) { destRound.Save("output/fb-round.png"); } - using (Image destRound = img.Generate(x => x.ConvertToAvatar(new Size(200, 200), 150))) + using (Image destRound = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 150))) { destRound.Save("output/fb-rounder.png"); } diff --git a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs index 07a3ae8c29..7154396dd9 100644 --- a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs @@ -70,7 +70,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan { if (targetImage.Bounds.Size != this.Size) { - targetImage = disposableImage = this.Image.Generate(x => x.Resize(this.Size.Width, this.Size.Height)); + targetImage = disposableImage = this.Image.Clone(x => x.Resize(this.Size.Width, this.Size.Height)); } // Align start/end positions. diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index 2a9c3ccbef..a092b789b1 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -49,13 +49,13 @@ public static void Mutate(this Image source, params IImageProces } /// - /// Mutates the image by applying the operations to it. + /// Clones the current image mutating the clone by applying the operations to it. /// /// The pixel format. /// The image to rotate, flip, or both. /// The operations to perform on the source. /// Anew Image which has teh data from the but with the applied. - public static Image Generate(this Image source, Action> operations) + public static Image Clone(this Image source, Action> operations) where TPixel : struct, IPixel { Guard.NotNull(operations, nameof(operations)); @@ -68,13 +68,13 @@ public static Image Generate(this Image source, Action - /// Mutates the image by applying the operations to it. + /// Clones the current image mutating the clone by applying the operations to it. /// /// The pixel format. /// The image to rotate, flip, or both. /// The operations to perform on the source. /// Anew Image which has teh data from the but with the applied. - public static Image Generate(this Image source, params IImageProcessor[] operations) + public static Image Clone(this Image source, params IImageProcessor[] operations) where TPixel : struct, IPixel { Guard.NotNull(operations, nameof(operations)); @@ -87,7 +87,7 @@ public static Image Generate(this Image source, params I } /// - /// Mutates the image by applying the operations to it. + /// Queues up a simple operation that provides access to the mutatable image. /// /// The pixel format. /// The image to rotate, flip, or both. diff --git a/src/ImageSharp/Image/Image{TPixel}.cs b/src/ImageSharp/Image/Image{TPixel}.cs index 13b8655211..0dcb369059 100644 --- a/src/ImageSharp/Image/Image{TPixel}.cs +++ b/src/ImageSharp/Image/Image{TPixel}.cs @@ -250,6 +250,15 @@ public Image Save(string filePath, IImageEncoder encoder) } #endif + /// + /// Clones the current image + /// + /// Returns a new image with all the same metadata as the original. + public Image Clone() + { + return new Image(this); + } + /// public override string ToString() { diff --git a/tests/ImageSharp.Tests/ImageComparer.cs b/tests/ImageSharp.Tests/ImageComparer.cs index 46d4351ded..ea6d2e8052 100644 --- a/tests/ImageSharp.Tests/ImageComparer.cs +++ b/tests/ImageSharp.Tests/ImageComparer.cs @@ -138,7 +138,7 @@ private static Fast2DArray GetGrayScaleValues(this Image where TPixelA : struct, IPixel { byte[] buffer = new byte[3]; - using (Image img = source.Generate(x => x.Resize(scalingFactor, scalingFactor).Grayscale())) + using (Image img = source.Clone(x => x.Resize(scalingFactor, scalingFactor).Grayscale())) { using (PixelAccessor pixels = img.Lock()) { From 001e3ca0153444539a5eae36812c8d89dd8b2a04 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Mon, 10 Jul 2017 23:28:32 +0100 Subject: [PATCH 05/33] Fix stack overflow --- src/ImageSharp/Processing/Overlays/Vignette.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ImageSharp/Processing/Overlays/Vignette.cs b/src/ImageSharp/Processing/Overlays/Vignette.cs index 78060570c7..535b758493 100644 --- a/src/ImageSharp/Processing/Overlays/Vignette.cs +++ b/src/ImageSharp/Processing/Overlays/Vignette.cs @@ -94,7 +94,7 @@ public static IImageOperations Vignette(this IImageOperationsThe . public static IImageOperations Vignette(this IImageOperations source, GraphicsOptions options) where TPixel : struct, IPixel - => source.Vignette(NamedColors.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options); + => source.VignetteInternal(NamedColors.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options); /// /// Applies a radial vignette effect to an image. @@ -106,7 +106,7 @@ public static IImageOperations Vignette(this IImageOperationsThe . public static IImageOperations Vignette(this IImageOperations source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel - => source.Vignette(color, 0, 0, options); + => source.VignetteInternal(color, 0, 0, options); /// /// Applies a radial vignette effect to an image. @@ -119,7 +119,7 @@ public static IImageOperations Vignette(this IImageOperationsThe . public static IImageOperations Vignette(this IImageOperations source, float radiusX, float radiusY, GraphicsOptions options) where TPixel : struct, IPixel - => source.Vignette(NamedColors.Black, radiusX, radiusY, options); + => source.VignetteInternal(NamedColors.Black, radiusX, radiusY, options); /// /// Applies a radial vignette effect to an image. @@ -150,13 +150,13 @@ public static IImageOperations Vignette(this IImageOperationsThe . public static IImageOperations Vignette(this IImageOperations source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel - => source.Vignette(color, radiusX, radiusY, rectangle, options); + => source.VignetteInternal(color, radiusX, radiusY, rectangle, options); - private static IImageOperations Vignette(this IImageOperations source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options) + private static IImageOperations VignetteInternal(this IImageOperations source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new VignetteProcessor(color, radiusX, radiusY, options), rectangle); - private static IImageOperations Vignette(this IImageOperations source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options) + private static IImageOperations VignetteInternal(this IImageOperations source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new VignetteProcessor(color, radiusX, radiusY, options)); } From 961e202f10bcef1f5a16116ac5fc223efaff1310 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Tue, 11 Jul 2017 18:44:16 +0100 Subject: [PATCH 06/33] initail image operations tests --- src/ImageSharp/ApplyProcessors.cs | 26 +++- src/ImageSharp/Configuration.cs | 7 +- src/ImageSharp/IImageOperationsProvider.cs | 38 ++++++ src/ImageSharp/IImageOperations{TPixel}.cs | 2 +- .../Processing/DelegateImageProcessor.cs | 5 + src/Shared/AssemblyInfo.Common.cs | 4 +- .../BaseImageOperationsExtensionTest.cs | 25 ++++ .../FakeImageOperationsProvider.cs | 77 +++++++++++ tests/ImageSharp.Tests/ImageOperationTests.cs | 120 ++++++++++++++++++ 9 files changed, 297 insertions(+), 7 deletions(-) create mode 100644 src/ImageSharp/IImageOperationsProvider.cs create mode 100644 tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs create mode 100644 tests/ImageSharp.Tests/FakeImageOperationsProvider.cs create mode 100644 tests/ImageSharp.Tests/ImageOperationTests.cs diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index a092b789b1..d625b1c241 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -28,7 +28,7 @@ public static void Mutate(this Image source, Action(source); + IImageOperations operationsRunner = source.Configuration.ImageOperationsProvider.CreateMutator(source); operations(operationsRunner); } @@ -44,7 +44,7 @@ public static void Mutate(this Image source, params IImageProces Guard.NotNull(operations, nameof(operations)); // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing - var operationsRunner = new ImageOperations(source); + IImageOperations operationsRunner = source.Configuration.ImageOperationsProvider.CreateMutator(source); operationsRunner.ApplyProcessors(operations); } @@ -62,7 +62,7 @@ public static Image Clone(this Image source, Action(source); // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing - var operationsRunner = new ImageOperations(generated); + IImageOperations operationsRunner = source.Configuration.ImageOperationsProvider.CreateMutator(generated); operations(operationsRunner); return generated; } @@ -81,7 +81,7 @@ public static Image Clone(this Image source, params IIma var generated = new Image(source); // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing - var operationsRunner = new ImageOperations(generated); + IImageOperations operationsRunner = source.Configuration.ImageOperationsProvider.CreateMutator(generated); operationsRunner.ApplyProcessors(operations); return generated; } @@ -96,5 +96,23 @@ public static Image Clone(this Image source, params IIma public static IImageOperations Run(this IImageOperations source, Action> operation) where TPixel : struct, IPixel => source.ApplyProcessor(new DelegateImageProcessor(operation)); + + /// + /// Queues up a simple operation that provides access to the mutatable image. + /// + /// The pixel format. + /// The image to rotate, flip, or both. + /// The operations to perform on the source. + /// returns the current optinoatins class to allow chaining of oprations. + internal static IImageOperations ApplyProcessors(this IImageOperations source, params IImageProcessor[] operations) + where TPixel : struct, IPixel + { + foreach (IImageProcessor op in operations) + { + source = source.ApplyProcessor(op); + } + + return source; + } } } diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index 226d451325..8340196338 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -103,11 +103,16 @@ public Configuration(params IConfigurationModule[] configurationModules) #if !NETSTANDARD1_1 /// - /// Gets or sets the fielsystem helper for accessing the local file system. + /// Gets or sets the filesystem helper for accessing the local file system. /// internal IFileSystem FileSystem { get; set; } = new LocalFileSystem(); #endif + /// + /// Gets or sets the image operations providers. + /// + internal IImageOperationsProvider ImageOperationsProvider { get; set; } = new DefaultImageOperationsProvider(); + /// /// Registers a new format provider. /// diff --git a/src/ImageSharp/IImageOperationsProvider.cs b/src/ImageSharp/IImageOperationsProvider.cs new file mode 100644 index 0000000000..475c632657 --- /dev/null +++ b/src/ImageSharp/IImageOperationsProvider.cs @@ -0,0 +1,38 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp +{ + using System; + using ImageSharp.PixelFormats; + + /// + /// Represents an interface that will create IImageOperations + /// + internal interface IImageOperationsProvider + { + /// + /// Called during Mutate operations to generate the imageoperations provider. + /// + /// The pixel format + /// The source image. + /// A new IImageOPeration + IImageOperations CreateMutator(Image source) + where TPixel : struct, IPixel; + } + + /// + /// The default implmentation of IImageOperationsProvider + /// + internal class DefaultImageOperationsProvider : IImageOperationsProvider + { + /// + public IImageOperations CreateMutator(Image source) + where TPixel : struct, IPixel + { + return new ImageOperations(source); + } + } +} diff --git a/src/ImageSharp/IImageOperations{TPixel}.cs b/src/ImageSharp/IImageOperations{TPixel}.cs index a176c0e28a..349cef7f34 100644 --- a/src/ImageSharp/IImageOperations{TPixel}.cs +++ b/src/ImageSharp/IImageOperations{TPixel}.cs @@ -12,7 +12,7 @@ namespace ImageSharp using SixLabors.Primitives; /// - /// The static collection of all the default image formats + /// An interface to queue up image operations. /// /// The pixel format public interface IImageOperations diff --git a/src/ImageSharp/Processing/DelegateImageProcessor.cs b/src/ImageSharp/Processing/DelegateImageProcessor.cs index e1d1060c67..5fbb84114d 100644 --- a/src/ImageSharp/Processing/DelegateImageProcessor.cs +++ b/src/ImageSharp/Processing/DelegateImageProcessor.cs @@ -29,6 +29,11 @@ public DelegateImageProcessor(Action> action) this.action = action; } + /// + /// Gets the action that will be applied to the image. + /// + internal Action> Action => this.action; + /// protected override void BeforeImageApply(Image source, Rectangle sourceRectangle) { diff --git a/src/Shared/AssemblyInfo.Common.cs b/src/Shared/AssemblyInfo.Common.cs index 252ef3eae0..c2aa13de25 100644 --- a/src/Shared/AssemblyInfo.Common.cs +++ b/src/Shared/AssemblyInfo.Common.cs @@ -37,4 +37,6 @@ [assembly: InternalsVisibleTo("ImageSharp.Drawing")] [assembly: InternalsVisibleTo("ImageSharp.Benchmarks")] [assembly: InternalsVisibleTo("ImageSharp.Tests")] -[assembly: InternalsVisibleTo("ImageSharp.Sandbox46")] \ No newline at end of file +[assembly: InternalsVisibleTo("ImageSharp.Sandbox46")] + +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] \ No newline at end of file diff --git a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs new file mode 100644 index 0000000000..d6bea7108a --- /dev/null +++ b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using ImageSharp.Processing; +using Xunit; + +namespace ImageSharp.Tests +{ + public abstract class BaseImageOperationsExtensionTest + { + protected readonly FakeImageOperationsProvider.FakeImageOperations operations; + + public BaseImageOperationsExtensionTest() + { + this.operations = new FakeImageOperationsProvider.FakeImageOperations(null); + } + + public T Verify(int index = 0) + { + var operation = this.operations.applied[index]; + + return Assert.IsType(operation.Processor); + } + } +} diff --git a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs new file mode 100644 index 0000000000..b9a1d80a20 --- /dev/null +++ b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs @@ -0,0 +1,77 @@ +namespace ImageSharp.Tests +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using SixLabors.Primitives; + + public class FakeImageOperationsProvider : IImageOperationsProvider + { + private List ImageOperators = new List(); + + public bool HasCreated(Image source) + where TPixel : struct, IPixel + { + return Created(source).Any(); + } + public IEnumerable> Created(Image source) where TPixel : struct, IPixel + { + return this.ImageOperators.OfType>() + .Where(x => x.source == source); + } + + public IEnumerable.AppliedOpperation> AppliedOperations(Image source) where TPixel : struct, IPixel + { + return Created(source) + .SelectMany(x => x.applied); + } + + public IImageOperations CreateMutator(Image source) where TPixel : struct, IPixel + { + var op = new FakeImageOperations(source); + this.ImageOperators.Add(op); + return op; + } + + + public class FakeImageOperations : IImageOperations + where TPixel : struct, IPixel + { + public Image source; + + public List applied = new List(); + + public FakeImageOperations(Image source) + { + this.source = source; + } + + public IImageOperations ApplyProcessor(IImageProcessor processor, Rectangle rectangle) + { + applied.Add(new AppliedOpperation + { + Processor = processor, + Rectangle = rectangle + }); + return this; + } + + public IImageOperations ApplyProcessor(IImageProcessor processor) + { + applied.Add(new AppliedOpperation + { + Processor = processor + }); + return this; + } + public struct AppliedOpperation + { + public Rectangle? Rectangle { get; set; } + public IImageProcessor Processor { get; set; } + } + } + } +} diff --git a/tests/ImageSharp.Tests/ImageOperationTests.cs b/tests/ImageSharp.Tests/ImageOperationTests.cs new file mode 100644 index 0000000000..61bb18e767 --- /dev/null +++ b/tests/ImageSharp.Tests/ImageOperationTests.cs @@ -0,0 +1,120 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + + using ImageSharp.Formats; + using ImageSharp.IO; + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using Moq; + using SixLabors.Primitives; + using Xunit; + + /// + /// Tests the configuration class. + /// + public class ImageOperationTests : IDisposable + { + private readonly Image image; + private readonly FakeImageOperationsProvider provider; + private readonly IImageProcessor processor; + + public Configuration Configuration { get; private set; } + + public ImageOperationTests() + { + this.provider = new FakeImageOperationsProvider(); + this.processor = new Mock>().Object; + this.image = new Image(new Configuration() + { + ImageOperationsProvider = this.provider + }, 1, 1); + } + + [Fact] + public void MutateCallsImageOperationsProvider_Func_OriginalImage() + { + this.image.Mutate(x => x.ApplyProcessor(this.processor)); + + Assert.True(this.provider.HasCreated(this.image)); + Assert.Contains(this.processor, this.provider.AppliedOperations(this.image).Select(x=>x.Processor)); + } + + [Fact] + public void MutateCallsImageOperationsProvider_ListOfProcessors_OriginalImage() + { + this.image.Mutate(this.processor); + + Assert.True(this.provider.HasCreated(this.image)); + Assert.Contains(this.processor, this.provider.AppliedOperations(this.image).Select(x => x.Processor)); + } + + [Fact] + public void CloneCallsImageOperationsProvider_Func_WithDuplicateImage() + { + var returned = this.image.Clone(x => x.ApplyProcessor(this.processor)); + + Assert.True(this.provider.HasCreated(returned)); + Assert.Contains(this.processor, this.provider.AppliedOperations(returned).Select(x => x.Processor)); + } + + [Fact] + public void CloneCallsImageOperationsProvider_ListOfProcessors_WithDuplicateImage() + { + var returned = this.image.Clone(this.processor); + + Assert.True(this.provider.HasCreated(returned)); + Assert.Contains(this.processor, this.provider.AppliedOperations(returned).Select(x => x.Processor)); + } + + [Fact] + public void CloneCallsImageOperationsProvider_Func_NotOnOrigional() + { + var returned = this.image.Clone(x => x.ApplyProcessor(this.processor)); + Assert.False(this.provider.HasCreated(this.image)); + Assert.DoesNotContain(this.processor, this.provider.AppliedOperations(this.image).Select(x => x.Processor)); + } + + [Fact] + public void CloneCallsImageOperationsProvider_ListOfProcessors_NotOnOrigional() + { + var returned = this.image.Clone(this.processor); + Assert.False(this.provider.HasCreated(this.image)); + Assert.DoesNotContain(this.processor, this.provider.AppliedOperations(this.image).Select(x => x.Processor)); + } + + [Fact] + public void ApplyProcessors_ListOfProcessors_AppliesALlProcessorsToOperation() + { + var operations = new FakeImageOperationsProvider.FakeImageOperations(null); + operations.ApplyProcessors(this.processor); + Assert.Contains(this.processor, operations.applied.Select(x => x.Processor)); + } + + public void Dispose() + { + this.image.Dispose(); + } + } + + public class RunImageOperation : BaseImageOperationsExtensionTest + { + [Fact] + public void Run_CreatedDelegateProcessor() + { + Action> action = (i) => { }; + this.operations.Run(action); + + DelegateImageProcessor processor = this.Verify>(); + Assert.Equal(action, processor.Action); + } + } +} \ No newline at end of file From c3f7f8395ebf68de40a8e821a8cf660ec7abec32 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Tue, 11 Jul 2017 19:01:01 +0100 Subject: [PATCH 07/33] move methods --- src/ImageSharp/ApplyProcessors.cs | 11 ------- src/ImageSharp/Processing/Delegate.cs | 30 +++++++++++++++++++ .../DelegateProcessor.cs} | 8 ++--- .../{ => Processors}/ImageProcessor.cs | 0 4 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 src/ImageSharp/Processing/Delegate.cs rename src/ImageSharp/Processing/{DelegateImageProcessor.cs => Processors/DelegateProcessor.cs} (82%) rename src/ImageSharp/Processing/{ => Processors}/ImageProcessor.cs (100%) diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index a092b789b1..9287c83670 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -85,16 +85,5 @@ public static Image Clone(this Image source, params IIma operationsRunner.ApplyProcessors(operations); return generated; } - - /// - /// Queues up a simple operation that provides access to the mutatable image. - /// - /// The pixel format. - /// The image to rotate, flip, or both. - /// The operations to perform on the source. - /// returns the current optinoatins class to allow chaining of oprations. - public static IImageOperations Run(this IImageOperations source, Action> operation) - where TPixel : struct, IPixel - => source.ApplyProcessor(new DelegateImageProcessor(operation)); } } diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs new file mode 100644 index 0000000000..52ec736f5d --- /dev/null +++ b/src/ImageSharp/Processing/Delegate.cs @@ -0,0 +1,30 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp +{ + using System; + + using ImageSharp.PixelFormats; + + using ImageSharp.Processing; + + /// + /// Extension methods for the type. + /// + public static partial class ImageExtensions + { + /// + /// Queues up a simple operation that provides access to the mutatable image. + /// + /// The pixel format. + /// The image to rotate, flip, or both. + /// The operations to perform on the source. + /// returns the current optinoatins class to allow chaining of oprations. + public static IImageOperations Run(this IImageOperations source, Action> operation) + where TPixel : struct, IPixel + => source.ApplyProcessor(new DelegateProcessor(operation)); + } +} diff --git a/src/ImageSharp/Processing/DelegateImageProcessor.cs b/src/ImageSharp/Processing/Processors/DelegateProcessor.cs similarity index 82% rename from src/ImageSharp/Processing/DelegateImageProcessor.cs rename to src/ImageSharp/Processing/Processors/DelegateProcessor.cs index e1d1060c67..f0d6917777 100644 --- a/src/ImageSharp/Processing/DelegateImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/DelegateProcessor.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // @@ -15,16 +15,16 @@ namespace ImageSharp.Processing /// Allows the application of processors to images. /// /// The pixel format. - internal class DelegateImageProcessor : ImageProcessor + internal class DelegateProcessor : ImageProcessor where TPixel : struct, IPixel { private readonly Action> action; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The action. - public DelegateImageProcessor(Action> action) + public DelegateProcessor(Action> action) { this.action = action; } diff --git a/src/ImageSharp/Processing/ImageProcessor.cs b/src/ImageSharp/Processing/Processors/ImageProcessor.cs similarity index 100% rename from src/ImageSharp/Processing/ImageProcessor.cs rename to src/ImageSharp/Processing/Processors/ImageProcessor.cs From f7cbb279955090eacecccec6a08a8f026b605140 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Tue, 11 Jul 2017 22:13:24 +0100 Subject: [PATCH 08/33] test extensions methods --- src/ImageSharp/ApplyProcessors.cs | 15 +- src/ImageSharp/Numerics/ValueSize.cs | 9 +- .../Processing/Binarization/Dither.cs | 36 ++- .../Processing/Convolution/BoxBlur.cs | 13 +- .../Processing/Convolution/DetectEdges.cs | 14 +- .../Processing/Convolution/GaussianBlur.cs | 12 +- .../Processing/Convolution/GaussianSharpen.cs | 13 +- src/ImageSharp/Processing/Delegate.cs | 1 + src/ImageSharp/Processing/Effects/Pixelate.cs | 13 +- .../Processing/Overlays/Vignette.cs | 4 +- .../ColorMatrix/SaturationProcessor.cs | 6 + .../Convolution/BoxBlurProcessor.cs | 6 + .../Convolution/GaussianBlurProcessor.cs | 5 + .../Convolution/GaussianSharpenProcessor.cs | 5 + .../Effects/BackgroundColorProcessor.cs | 5 + .../Processors/Overlays/GlowProcessor.cs | 5 + .../Processors/Overlays/VignetteProcessor.cs | 5 + .../Transforms/EntropyCropProcessor.cs | 6 +- .../BaseImageOperationsExtensionTest.cs | 16 + .../Drawing/Paths/FillPath.cs | 37 +-- .../Drawing/Paths/FillPathCollection.cs | 32 +- .../Drawing/Paths/FillPolygon.cs | 33 +-- .../Drawing/Paths/FillRectangle.cs | 40 +-- .../Drawing/Paths/ProcessorWatchingImage.cs | 40 --- .../Drawing/Text/DrawText.Path.cs | 137 +++++---- .../ImageSharp.Tests/Drawing/Text/DrawText.cs | 138 +++++---- tests/ImageSharp.Tests/ImageOperationTests.cs | 13 - .../Binarization/BinaryThresholdTest.cs | 43 +-- .../Processing/Binarization/DitherTest.cs | 112 ++++--- .../Processing/ColorMatrix/BlackWhiteTest.cs | 34 +-- .../ColorMatrix/ColorBlindnessTest.cs | 57 ++-- .../Processing/ColorMatrix/GrayscaleTest.cs | 60 ++-- .../Processing/ColorMatrix/HueTest.cs | 41 +-- .../Processing/ColorMatrix/KodachromeTest.cs | 34 +-- .../Processing/ColorMatrix/LomographTest.cs | 34 +-- .../Processing/ColorMatrix/PolaroidTest.cs | 34 +-- .../Processing/ColorMatrix/SaturationTest.cs | 42 +-- .../Processing/ColorMatrix/SepiaTest.cs | 34 +-- .../Processing/Convolution/BoxBlurTest.cs | 48 ++- .../Processing/Convolution/DetectEdgesTest.cs | 79 ++--- .../Convolution/GaussianBlurTest.cs | 48 ++- .../Convolution/GaussianSharpenTest.cs | 48 ++- .../Processing/DelegateTest.cs | 25 ++ .../Processing/Effects/AlphaTest.cs | 41 +-- .../Processing/Effects/BackgroundColorTest.cs | 56 ++-- .../Processing/Effects/BrightnessTest.cs | 41 +-- .../Processing/Effects/ContrastTest.cs | 41 +-- .../Processing/Effects/InvertTest.cs | 34 +-- .../Processing/Effects/OilPaintTest.cs | 64 ++-- .../Processing/Effects/PixelateTest.cs | 80 ++--- .../Processing/Overlays/GlowTest.cs | 76 +++-- .../Processing/Overlays/VignetteTest.cs | 81 +++--- .../Binarization/BinaryThresholdTest.cs | 51 ++++ .../Processors/Binarization/DitherTest.cs | 92 ++++++ .../Processors/ColorMatrix/BlackWhiteTest.cs | 43 +++ .../ColorMatrix/ColorBlindnessTest.cs | 57 ++++ .../Processors/ColorMatrix/GrayscaleTest.cs | 61 ++++ .../Processors/ColorMatrix/HueTest.cs | 50 ++++ .../Processors/ColorMatrix/KodachromeTest.cs | 43 +++ .../Processors/ColorMatrix/LomographTest.cs | 45 +++ .../Processors/ColorMatrix/PolaroidTest.cs | 43 +++ .../Processors/ColorMatrix/SaturationTest.cs | 50 ++++ .../Processors/ColorMatrix/SepiaTest.cs | 43 +++ .../Processors/Convolution/BoxBlurTest.cs | 50 ++++ .../Processors/Convolution/DetectEdgesTest.cs | 59 ++++ .../Convolution/GaussianBlurTest.cs | 50 ++++ .../Convolution/GaussianSharpenTest.cs | 50 ++++ .../Processors/Effects/AlphaTest.cs | 50 ++++ .../Processors/Effects/BackgroundColorTest.cs | 43 +++ .../Processors/Effects/BrightnessTest.cs | 50 ++++ .../Processors/Effects/ContrastTest.cs | 50 ++++ .../Processors/Effects/InvertTest.cs | 43 +++ .../Processors/Effects/OilPaintTest.cs | 50 ++++ .../Processors/Effects/PixelateTest.cs | 84 ++++++ .../Processors/Overlays/GlowTest.cs | 67 +++++ .../Processors/Overlays/VignetteTest.cs | 67 +++++ .../Processors/Transforms/AutoOrientTests.cs | 84 ++++++ .../Processors/Transforms/CropTest.cs | 26 ++ .../Processors/Transforms/EntropyCropTest.cs | 33 +++ .../Processors/Transforms/FlipTests.cs | 37 +++ .../Processors/Transforms/PadTest.cs | 35 +++ .../Transforms/ResizeProfilingBenchmarks.cs | 2 +- .../Processors/Transforms/ResizeTests.cs | 273 ++++++++++++++++++ .../Processors/Transforms/RotateFlipTests.cs | 39 +++ .../Processors/Transforms/RotateTests.cs | 55 ++++ .../Processors/Transforms/SkewTest.cs | 33 +++ .../Processing/Transforms/AutoOrientTests.cs | 73 +---- .../Processing/Transforms/CropTest.cs | 33 ++- .../Processing/Transforms/EntropyCropTest.cs | 26 +- .../Processing/Transforms/FlipTests.cs | 32 +- .../Processing/Transforms/PadTest.cs | 24 +- .../Processing/Transforms/ResizeTests.cs | 262 +---------------- .../Processing/Transforms/RotateFlipTests.cs | 44 +-- .../Processing/Transforms/RotateTests.cs | 64 ++-- .../Processing/Transforms/SkewTest.cs | 35 ++- tests/ImageSharp.Tests/TestFile.cs | 10 +- .../TestUtilities/TestType.cs | 28 ++ 97 files changed, 2941 insertions(+), 1544 deletions(-) delete mode 100644 tests/ImageSharp.Tests/Drawing/Paths/ProcessorWatchingImage.cs create mode 100644 tests/ImageSharp.Tests/Processing/DelegateTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs rename tests/ImageSharp.Tests/Processing/{ => Processors}/Transforms/ResizeProfilingBenchmarks.cs (97%) create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs create mode 100644 tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs create mode 100644 tests/ImageSharp.Tests/TestUtilities/TestType.cs diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index 0e81957019..fd91349f57 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -87,14 +87,21 @@ public static Image Clone(this Image source, params IIma } /// - /// Queues up a simple operation that provides access to the mutatable image. + /// Applies all the ImageProcessors agains the operation /// /// The pixel format. /// The image to rotate, flip, or both. - /// The operations to perform on the source. + /// The operations to perform on the source. /// returns the current optinoatins class to allow chaining of oprations. - public static IImageOperations Run(this IImageOperations source, Action> operation) + public static IImageOperations ApplyProcessors(this IImageOperations source, params IImageProcessor[] operations) where TPixel : struct, IPixel - => source.ApplyProcessor(new DelegateImageProcessor(operation)); + { + foreach (var p in operations) + { + source = source.ApplyProcessor(p); + } + + return source; + } } } diff --git a/src/ImageSharp/Numerics/ValueSize.cs b/src/ImageSharp/Numerics/ValueSize.cs index 5d81e2f952..af7454c191 100644 --- a/src/ImageSharp/Numerics/ValueSize.cs +++ b/src/ImageSharp/Numerics/ValueSize.cs @@ -5,12 +5,13 @@ namespace ImageSharp { + using System; using SixLabors.Primitives; /// /// Represents a value in relation to a value on the image /// - internal struct ValueSize + internal struct ValueSize : IEquatable { /// /// Initializes a new instance of the struct. @@ -120,5 +121,11 @@ public override string ToString() { return $"{this.Value} - {this.Type}"; } + + /// + public bool Equals(ValueSize other) + { + return this.Type == other.Type && this.Value == other.Value; + } } } diff --git a/src/ImageSharp/Processing/Binarization/Dither.cs b/src/ImageSharp/Processing/Binarization/Dither.cs index 614eabca79..ce5e8c205c 100644 --- a/src/ImageSharp/Processing/Binarization/Dither.cs +++ b/src/ImageSharp/Processing/Binarization/Dither.cs @@ -25,7 +25,21 @@ public static partial class ImageExtensions /// The ordered ditherer. /// The component index to test the threshold against. Must range from 0 to 3. /// The . - public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, int index = 0) + public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither) + where TPixel : struct, IPixel + { + source.ApplyProcessor(new OrderedDitherProcessor(dither, 0)); + return source; + } + /// + /// Dithers the image reducing it to two colors using ordered dithering. + /// + /// The pixel format. + /// The image this method extends. + /// The ordered ditherer. + /// The component index to test the threshold against. Must range from 0 to 3. + /// The . + public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, int index) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, index)); @@ -43,7 +57,25 @@ public static IImageOperations Dither(this IImageOperations /// The component index to test the threshold against. Must range from 0 to 3. /// The . - public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, Rectangle rectangle, int index = 0) + public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, Rectangle rectangle) + where TPixel : struct, IPixel + { + source.ApplyProcessor(new OrderedDitherProcessor(dither, 0), rectangle); + return source; + } + + /// + /// Dithers the image reducing it to two colors using ordered dithering. + /// + /// The pixel format. + /// The image this method extends. + /// The ordered ditherer. + /// + /// The structure that specifies the portion of the image object to alter. + /// + /// The component index to test the threshold against. Must range from 0 to 3. + /// The . + public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, Rectangle rectangle, int index) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, index), rectangle); diff --git a/src/ImageSharp/Processing/Convolution/BoxBlur.cs b/src/ImageSharp/Processing/Convolution/BoxBlur.cs index f000a6aa4e..1a89ac1a0e 100644 --- a/src/ImageSharp/Processing/Convolution/BoxBlur.cs +++ b/src/ImageSharp/Processing/Convolution/BoxBlur.cs @@ -24,7 +24,18 @@ public static partial class ImageExtensions /// The image this method extends. /// The 'radius' value representing the size of the area to sample. /// The . - public static IImageOperations BoxBlur(this IImageOperations source, int radius = 7) + public static IImageOperations BoxBlur(this IImageOperations source) + where TPixel : struct, IPixel + => source.ApplyProcessor(new BoxBlurProcessor(7)); + + /// + /// Applies a box blur to the image. + /// + /// The pixel format. + /// The image this method extends. + /// The 'radius' value representing the size of the area to sample. + /// The . + public static IImageOperations BoxBlur(this IImageOperations source, int radius) where TPixel : struct, IPixel => source.ApplyProcessor(new BoxBlurProcessor(radius)); diff --git a/src/ImageSharp/Processing/Convolution/DetectEdges.cs b/src/ImageSharp/Processing/Convolution/DetectEdges.cs index 14bcf20598..b4382f902b 100644 --- a/src/ImageSharp/Processing/Convolution/DetectEdges.cs +++ b/src/ImageSharp/Processing/Convolution/DetectEdges.cs @@ -55,7 +55,19 @@ public static IImageOperations DetectEdges(this IImageOperations /// The filter for detecting edges. /// Whether to convert the image to Grayscale first. Defaults to true. /// The . - public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter, bool grayscale = true) + public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter) + where TPixel : struct, IPixel + => DetectEdges(source, GetProcessor(filter, true)); + + /// + /// Detects any edges within the image. + /// + /// The pixel format. + /// The image this method extends. + /// The filter for detecting edges. + /// Whether to convert the image to Grayscale first. Defaults to true. + /// The . + public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter, bool grayscale) where TPixel : struct, IPixel => DetectEdges(source, GetProcessor(filter, grayscale)); diff --git a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs index 7d551ceb8d..91f5635050 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs @@ -25,7 +25,17 @@ public static partial class ImageExtensions /// The image this method extends. /// The 'sigma' value representing the weight of the blur. /// The . - public static IImageOperations GaussianBlur(this IImageOperations source, float sigma = 3f) + public static IImageOperations GaussianBlur(this IImageOperations source) + where TPixel : struct, IPixel + => source.ApplyProcessor(new GaussianBlurProcessor(3f)); + /// + /// Applies a Gaussian blur to the image. + /// + /// The pixel format. + /// The image this method extends. + /// The 'sigma' value representing the weight of the blur. + /// The . + public static IImageOperations GaussianBlur(this IImageOperations source, float sigma) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianBlurProcessor(sigma)); diff --git a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs index 58c5ad12ac..1fd003d128 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs @@ -25,7 +25,18 @@ public static partial class ImageExtensions /// The image this method extends. /// The 'sigma' value representing the weight of the blur. /// The . - public static IImageOperations GaussianSharpen(this IImageOperations source, float sigma = 3f) + public static IImageOperations GaussianSharpen(this IImageOperations source) + where TPixel : struct, IPixel + => source.ApplyProcessor(new GaussianSharpenProcessor(3f)); + + /// + /// Applies a Gaussian sharpening filter to the image. + /// + /// The pixel format. + /// The image this method extends. + /// The 'sigma' value representing the weight of the blur. + /// The . + public static IImageOperations GaussianSharpen(this IImageOperations source, float sigma) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianSharpenProcessor(sigma)); diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs index 52ec736f5d..a6efb711bf 100644 --- a/src/ImageSharp/Processing/Delegate.cs +++ b/src/ImageSharp/Processing/Delegate.cs @@ -26,5 +26,6 @@ public static partial class ImageExtensions public static IImageOperations Run(this IImageOperations source, Action> operation) where TPixel : struct, IPixel => source.ApplyProcessor(new DelegateProcessor(operation)); + } } diff --git a/src/ImageSharp/Processing/Effects/Pixelate.cs b/src/ImageSharp/Processing/Effects/Pixelate.cs index cd0551ad39..8447f5ba17 100644 --- a/src/ImageSharp/Processing/Effects/Pixelate.cs +++ b/src/ImageSharp/Processing/Effects/Pixelate.cs @@ -24,7 +24,18 @@ public static partial class ImageExtensions /// The image this method extends. /// The size of the pixels. /// The . - public static IImageOperations Pixelate(this IImageOperations source, int size = 4) + public static IImageOperations Pixelate(this IImageOperations source) + where TPixel : struct, IPixel + => source.ApplyProcessor(new PixelateProcessor(4)); + + /// + /// Pixelates an image with the given pixel size. + /// + /// The pixel format. + /// The image this method extends. + /// The size of the pixels. + /// The . + public static IImageOperations Pixelate(this IImageOperations source, int size) where TPixel : struct, IPixel => source.ApplyProcessor(new PixelateProcessor(size)); diff --git a/src/ImageSharp/Processing/Overlays/Vignette.cs b/src/ImageSharp/Processing/Overlays/Vignette.cs index 535b758493..175d3ea3a2 100644 --- a/src/ImageSharp/Processing/Overlays/Vignette.cs +++ b/src/ImageSharp/Processing/Overlays/Vignette.cs @@ -106,7 +106,7 @@ public static IImageOperations Vignette(this IImageOperationsThe . public static IImageOperations Vignette(this IImageOperations source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel - => source.VignetteInternal(color, 0, 0, options); + => source.VignetteInternal(color, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options); /// /// Applies a radial vignette effect to an image. @@ -133,7 +133,7 @@ public static IImageOperations Vignette(this IImageOperationsThe . public static IImageOperations Vignette(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel - => source.Vignette(NamedColors.Black, 0, 0, rectangle, options); + => source.VignetteInternal(NamedColors.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), rectangle, options); /// /// Applies a radial vignette effect to an image. diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs index 3adfb83114..ffc8eb6b19 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs @@ -26,6 +26,7 @@ internal class SaturationProcessor : ColorMatrixProcessor /// public SaturationProcessor(int saturation) { + this.Amount = saturation; Guard.MustBeBetweenOrEqualTo(saturation, -100, 100, nameof(saturation)); float saturationFactor = saturation / 100F; @@ -58,6 +59,11 @@ public SaturationProcessor(int saturation) this.Matrix = matrix4X4; } + /// + /// Gets the amount to apply. + /// + public int Amount { get; } + /// public override Matrix4x4 Matrix { get; } } diff --git a/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs index 0a2162fb05..93a9254802 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs @@ -31,11 +31,17 @@ internal class BoxBlurProcessor : ImageProcessor /// public BoxBlurProcessor(int radius = 7) { + this.Radius = radius; this.kernelSize = (radius * 2) + 1; this.KernelX = this.CreateBoxKernel(true); this.KernelY = this.CreateBoxKernel(false); } + /// + /// Gets the Radius + /// + public int Radius { get; } + /// /// Gets the horizontal gradient operator. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs index ef6ddaa6a7..dcafd0d91e 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs @@ -72,6 +72,11 @@ public GaussianBlurProcessor(float sigma, int radius) this.KernelY = this.CreateGaussianKernel(false); } + /// + /// Gets the sigma + /// + public float Sigma => this.sigma; + /// /// Gets the horizontal gradient operator. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs index 594dda8cab..84a7f9b09c 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs @@ -74,6 +74,11 @@ public GaussianSharpenProcessor(float sigma, int radius) this.KernelY = this.CreateGaussianKernel(false); } + /// + /// Gets the sigma + /// + public float Sigma => this.sigma; + /// /// Gets the horizontal gradient operator. /// diff --git a/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs index 96fcf4d630..96a2b704f7 100644 --- a/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs @@ -32,6 +32,11 @@ public BackgroundColorProcessor(TPixel color, GraphicsOptions options) this.options = options; } + /// + /// Gets the Graphics options to alter how processor is applied. + /// + public GraphicsOptions GraphicsOptions => this.options; + /// /// Gets the background color value. /// diff --git a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs index 5a816da14d..5da6a96dcf 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs @@ -37,6 +37,11 @@ public GlowProcessor(TPixel color, ValueSize radius, GraphicsOptions options) this.blender = PixelOperations.Instance.GetPixelBlender(this.options.BlenderMode); } + /// + /// Gets the Graphics options to alter how processor is applied. + /// + public GraphicsOptions GraphicsOptions => this.options; + /// /// Gets or sets the glow color to apply. /// diff --git a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs index 6a46692d23..07c45f4f03 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs @@ -51,6 +51,11 @@ public VignetteProcessor(TPixel color, GraphicsOptions options) this.blender = PixelOperations.Instance.GetPixelBlender(this.options.BlenderMode); } + /// + /// Gets the Graphics options to alter how processor is applied. + /// + public GraphicsOptions GraphicsOptions => this.options; + /// /// Gets or sets the vignette color to apply. /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs index 16f74f218b..a52065ea9b 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs @@ -28,13 +28,13 @@ internal class EntropyCropProcessor : ImageProcessor public EntropyCropProcessor(float threshold) { Guard.MustBeBetweenOrEqualTo(threshold, 0, 1, nameof(threshold)); - this.Value = threshold; + this.Threshold = threshold; } /// /// Gets the threshold value. /// - public float Value { get; } + public float Threshold { get; } /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) @@ -45,7 +45,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan new SobelProcessor().Apply(temp, sourceRectangle); // Apply threshold binarization filter. - new BinaryThresholdProcessor(this.Value).Apply(temp, sourceRectangle); + new BinaryThresholdProcessor(this.Threshold).Apply(temp, sourceRectangle); // Search for the first white pixels Rectangle rectangle = ImageMaths.GetFilteredBoundingRectangle(temp, 0); diff --git a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs index d6bea7108a..398db976e5 100644 --- a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs +++ b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using ImageSharp.Processing; +using SixLabors.Primitives; using Xunit; namespace ImageSharp.Tests @@ -9,16 +10,31 @@ namespace ImageSharp.Tests public abstract class BaseImageOperationsExtensionTest { protected readonly FakeImageOperationsProvider.FakeImageOperations operations; + protected readonly Rectangle rect; + protected readonly GraphicsOptions options; public BaseImageOperationsExtensionTest() { + this.options = new GraphicsOptions(false) { }; + this.rect = new Rectangle(91, 123, 324, 56); // make this random? this.operations = new FakeImageOperationsProvider.FakeImageOperations(null); } public T Verify(int index = 0) { + Assert.InRange(index, 0, this.operations.applied.Count - 1); + + var operation = this.operations.applied[index]; + + return Assert.IsType(operation.Processor); + } + public T Verify(Rectangle rect, int index = 0) + { + Assert.InRange(index, 0, this.operations.applied.Count - 1); + var operation = this.operations.applied[index]; + Assert.Equal(rect, operation.Rectangle); return Assert.IsType(operation.Processor); } } diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs index b80173bcf8..c1e22e49c6 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs @@ -11,7 +11,7 @@ namespace ImageSharp.Tests.Drawing.Paths using ImageSharp.Drawing.Processors; using ImageSharp.PixelFormats; - public class FillPath : IDisposable + public class FillPath : BaseImageOperationsExtensionTest { GraphicsOptions noneDefault = new GraphicsOptions(); Rgba32 color = Rgba32.HotPink; @@ -22,25 +22,12 @@ public class FillPath : IDisposable new Vector2(20,10), new Vector2(30,10), })); - private ProcessorWatchingImage img; - - public FillPath() - { - this.img = new ProcessorWatchingImage(10, 10); - } - - public void Dispose() - { - img.Dispose(); - } [Fact] public void CorrectlySetsBrushAndPath() { - img.Mutate(x => x.Fill(brush, path)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + this.operations.Fill(brush, path); + var processor = this.Verify>(); Assert.Equal(GraphicsOptions.Default, processor.Options); @@ -56,10 +43,8 @@ public void CorrectlySetsBrushAndPath() [Fact] public void CorrectlySetsBrushPathOptions() { - img.Mutate(x => x.Fill(brush, path, noneDefault)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + this.operations.Fill(brush, path, noneDefault); + var processor = this.Verify>(); Assert.Equal(noneDefault, processor.Options); @@ -73,10 +58,8 @@ public void CorrectlySetsBrushPathOptions() [Fact] public void CorrectlySetsColorAndPath() { - img.Mutate(x => x.Fill(color, path)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + this.operations.Fill(color, path); + var processor = this.Verify>(); Assert.Equal(GraphicsOptions.Default, processor.Options); @@ -91,10 +74,8 @@ public void CorrectlySetsColorAndPath() [Fact] public void CorrectlySetsColorPathAndOptions() { - img.Mutate(x => x.Fill(color, path, noneDefault)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + this.operations.Fill(color, path, noneDefault); + var processor = this.Verify>(); Assert.Equal(noneDefault, processor.Options); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs index 8fe18713d8..11ead13c18 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs @@ -11,7 +11,7 @@ namespace ImageSharp.Tests.Drawing.Paths using ImageSharp.Drawing.Processors; using ImageSharp.PixelFormats; - public class FillPathCollection : IDisposable + public class FillPathCollection : BaseImageOperationsExtensionTest { GraphicsOptions noneDefault = new GraphicsOptions(); Rgba32 color = Rgba32.HotPink; @@ -30,29 +30,20 @@ public class FillPathCollection : IDisposable })); IPathCollection pathCollection; - - private ProcessorWatchingImage img; - + public FillPathCollection() { this.pathCollection = new PathCollection(path1, path2); - this.img = new ProcessorWatchingImage(10, 10); - } - - public void Dispose() - { - img.Dispose(); } [Fact] public void CorrectlySetsBrushAndPath() { - img.Mutate(x => x.Fill(brush, pathCollection)); + this.operations.Fill(brush, pathCollection); - Assert.Equal(2, img.ProcessorApplications.Count); for (var i = 0; i < 2; i++) { - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[i].processor); + FillRegionProcessor processor = this.Verify>(i); Assert.Equal(GraphicsOptions.Default, processor.Options); @@ -69,12 +60,11 @@ public void CorrectlySetsBrushAndPath() [Fact] public void CorrectlySetsBrushPathOptions() { - img.Mutate(x => x.Fill(brush, pathCollection, noneDefault)); + this.operations.Fill(brush, pathCollection, noneDefault); - Assert.Equal(2, img.ProcessorApplications.Count); for (var i = 0; i < 2; i++) { - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[i].processor); + FillRegionProcessor processor = this.Verify>(i); Assert.Equal(noneDefault, processor.Options); @@ -89,12 +79,11 @@ public void CorrectlySetsBrushPathOptions() [Fact] public void CorrectlySetsColorAndPath() { - img.Mutate(x => x.Fill(color, pathCollection)); + this.operations.Fill(color, pathCollection); - Assert.Equal(2, img.ProcessorApplications.Count); for (var i = 0; i < 2; i++) { - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[i].processor); + FillRegionProcessor processor = this.Verify>(i); Assert.Equal(GraphicsOptions.Default, processor.Options); @@ -110,12 +99,11 @@ public void CorrectlySetsColorAndPath() [Fact] public void CorrectlySetsColorPathAndOptions() { - img.Mutate(x => x.Fill(color, pathCollection, noneDefault)); + this.operations.Fill(color, pathCollection, noneDefault); - Assert.Equal(2, img.ProcessorApplications.Count); for (var i = 0; i < 2; i++) { - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[i].processor); + FillRegionProcessor processor = this.Verify>(i); Assert.Equal(noneDefault, processor.Options); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs index 2fd9a89b3c..d833bf47be 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs @@ -11,7 +11,7 @@ namespace ImageSharp.Tests.Drawing.Paths using ImageSharp.Drawing.Processors; using ImageSharp.PixelFormats; - public class FillPolygon : IDisposable + public class FillPolygon : BaseImageOperationsExtensionTest { GraphicsOptions noneDefault = new GraphicsOptions(); Rgba32 color = Rgba32.HotPink; @@ -22,25 +22,14 @@ public class FillPolygon : IDisposable new Vector2(20,10), new Vector2(30,10), }; - private ProcessorWatchingImage img; - public FillPolygon() - { - this.img = new Paths.ProcessorWatchingImage(10, 10); - } - - public void Dispose() - { - img.Dispose(); - } [Fact] public void CorrectlySetsBrushAndPath() { - img.Mutate(x => x.FillPolygon(brush, path)); + this.operations.FillPolygon(brush, path); - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + FillRegionProcessor processor = this.Verify>(); Assert.Equal(GraphicsOptions.Default, processor.Options); @@ -54,10 +43,8 @@ public void CorrectlySetsBrushAndPath() [Fact] public void CorrectlySetsBrushPathAndOptions() { - img.Mutate(x => x.FillPolygon(brush, path, noneDefault)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + this.operations.FillPolygon(brush, path, noneDefault); + FillRegionProcessor processor = this.Verify>(); Assert.Equal(noneDefault, processor.Options); @@ -71,10 +58,9 @@ public void CorrectlySetsBrushPathAndOptions() [Fact] public void CorrectlySetsColorAndPath() { - img.Mutate(x => x.FillPolygon(color, path)); + this.operations.FillPolygon(color, path); + FillRegionProcessor processor = this.Verify>(); - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); Assert.Equal(GraphicsOptions.Default, processor.Options); @@ -89,10 +75,9 @@ public void CorrectlySetsColorAndPath() [Fact] public void CorrectlySetsColorPathAndOptions() { - img.Mutate(x => x.FillPolygon(color, path, noneDefault)); + this.operations.FillPolygon(color, path, noneDefault); + FillRegionProcessor processor = this.Verify>(); - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); Assert.Equal(noneDefault, processor.Options); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs index 56c7d51093..687c63068d 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs @@ -10,32 +10,18 @@ namespace ImageSharp.Tests.Drawing.Paths using ImageSharp.Drawing.Processors; using ImageSharp.PixelFormats; - public class FillRectangle : IDisposable + public class FillRectangle : BaseImageOperationsExtensionTest { GraphicsOptions noneDefault = new GraphicsOptions(); Rgba32 color = Rgba32.HotPink; SolidBrush brush = Brushes.Solid(Rgba32.HotPink); SixLabors.Primitives.Rectangle rectangle = new SixLabors.Primitives.Rectangle(10, 10, 77, 76); - private ProcessorWatchingImage img; - - public FillRectangle() - { - this.img = new Paths.ProcessorWatchingImage(10, 10); - } - - public void Dispose() - { - img.Dispose(); - } - [Fact] public void CorrectlySetsBrushAndRectangle() { - img.Mutate(x => x.Fill(brush, rectangle)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + this.operations.Fill(brush, rectangle); + FillRegionProcessor processor = this.Verify>(); Assert.Equal(GraphicsOptions.Default, processor.Options); @@ -52,10 +38,8 @@ public void CorrectlySetsBrushAndRectangle() [Fact] public void CorrectlySetsBrushRectangleAndOptions() { - img.Mutate(x => x.Fill(brush, rectangle, noneDefault)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + this.operations.Fill(brush, rectangle, noneDefault); + FillRegionProcessor processor = this.Verify>(); Assert.Equal(noneDefault, processor.Options); @@ -72,11 +56,9 @@ public void CorrectlySetsBrushRectangleAndOptions() [Fact] public void CorrectlySetsColorAndRectangle() { - img.Mutate(x => x.Fill(color, rectangle)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); - + this.operations.Fill(color, rectangle); + FillRegionProcessor processor = this.Verify>(); + Assert.Equal(GraphicsOptions.Default, processor.Options); ShapeRegion region = Assert.IsType(processor.Region); @@ -93,10 +75,8 @@ public void CorrectlySetsColorAndRectangle() [Fact] public void CorrectlySetsColorRectangleAndOptions() { - img.Mutate(x => x.Fill(color, rectangle, noneDefault)); - - Assert.NotEmpty(img.ProcessorApplications); - FillRegionProcessor processor = Assert.IsType>(img.ProcessorApplications[0].processor); + this.operations.Fill(color, rectangle, noneDefault); + FillRegionProcessor processor = this.Verify>(); Assert.Equal(noneDefault, processor.Options); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/ProcessorWatchingImage.cs b/tests/ImageSharp.Tests/Drawing/Paths/ProcessorWatchingImage.cs deleted file mode 100644 index 1670b33520..0000000000 --- a/tests/ImageSharp.Tests/Drawing/Paths/ProcessorWatchingImage.cs +++ /dev/null @@ -1,40 +0,0 @@ - -namespace ImageSharp.Tests.Drawing.Paths -{ - using System; - using System.IO; - using ImageSharp; - using ImageSharp.Processing; - using System.Collections.Generic; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - - /// - /// Watches but does not actually run the processors against the image. - /// - /// - public class ProcessorWatchingImage : Image - { - public List ProcessorApplications { get; } = new List(); - - public ProcessorWatchingImage(int width, int height) - : base(Configuration.CreateDefaultInstance(), width, height) - { - } - - public override void ApplyProcessor(IImageProcessor processor, Rectangle rectangle) - { - this.ProcessorApplications.Add(new ProcessorDetails - { - processor = processor, - rectangle = rectangle - }); - } - - public struct ProcessorDetails - { - public IImageProcessor processor; - public Rectangle rectangle; - } - } -} diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs index 067ea122d8..705c99d08e 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs @@ -20,7 +20,7 @@ namespace ImageSharp.Tests.Drawing.Text using Xunit; - public class DrawText_Path : IDisposable + public class DrawText_Path : BaseImageOperationsExtensionTest { Rgba32 color = Rgba32.HotPink; @@ -30,8 +30,6 @@ public class DrawText_Path : IDisposable new LinearLineSegment( new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(20, 10), new Vector2(20, 10), new Vector2(30, 10), })); - private ProcessorWatchingImage img; - private readonly FontCollection FontCollection; private readonly Font Font; @@ -40,69 +38,62 @@ public DrawText_Path() { this.FontCollection = new FontCollection(); this.Font = this.FontCollection.Install(TestFontUtilities.GetPath("SixLaborsSampleAB.woff")).CreateFont(12); - this.img = new ProcessorWatchingImage(10, 10); - } - - public void Dispose() - { - this.img.Dispose(); } [Fact] public void FillsForEachACharachterWhenBrushSetAndNotPen() { - this.img.Mutate(x => x.DrawText( + this.operations.DrawText( "123", this.Font, Brushes.Solid(Rgba32.Red), null, path, - new TextGraphicsOptions(true))); + new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void FillsForEachACharachterWhenBrushSetAndNotPenDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), null, path)); + this.operations.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), null, path); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void FillsForEachACharachterWhenBrushSet() { - this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), path, new TextGraphicsOptions(true))); + this.operations.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), path, new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void FillsForEachACharachterWhenBrushSetDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), path)); + this.operations.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), path); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void FillsForEachACharachterWhenColorSet() { - this.img.Mutate(x => x.DrawText("123", this.Font, Rgba32.Red, path, new TextGraphicsOptions(true))); + this.operations.DrawText("123", this.Font, Rgba32.Red, path, new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); - FillRegionProcessor processor = - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); SolidBrush brush = Assert.IsType>(processor.Brush); Assert.Equal(Rgba32.Red, brush.Color); @@ -111,13 +102,11 @@ public void FillsForEachACharachterWhenColorSet() [Fact] public void FillsForEachACharachterWhenColorSetDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Rgba32.Red, path)); + this.operations.DrawText("123", this.Font, Rgba32.Red, path); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); - Assert.IsType>(this.img.ProcessorApplications[0].processor); - FillRegionProcessor processor = - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); SolidBrush brush = Assert.IsType>(processor.Brush); Assert.Equal(Rgba32.Red, brush.Color); @@ -126,99 +115,103 @@ public void FillsForEachACharachterWhenColorSetDefaultOptions() [Fact] public void DrawForEachACharachterWhenPenSetAndNotBrush() { - this.img.Mutate(x => x.DrawText( + this.operations.DrawText( "123", this.Font, null, Pens.Dash(Rgba32.Red, 1), path, - new TextGraphicsOptions(true))); + new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void DrawForEachACharachterWhenPenSetAndNotBrushDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, null, Pens.Dash(Rgba32.Red, 1), path)); + this.operations.DrawText("123", this.Font, null, Pens.Dash(Rgba32.Red, 1), path); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void DrawForEachACharachterWhenPenSet() { - this.img.Mutate(x => x.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), path, new TextGraphicsOptions(true))); + this.operations.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), path, new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void DrawForEachACharachterWhenPenSetDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), path)); + this.operations.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), path); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSet() { - this.img.Mutate(x => x.DrawText( + this.operations.DrawText( "123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path, - new TextGraphicsOptions(true))); + new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(6, this.img.ProcessorApplications.Count); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); + this.Verify>(3); + this.Verify>(4); + this.Verify>(5); } [Fact] public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSetDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path)); + this.operations.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(6, this.img.ProcessorApplications.Count); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); + this.Verify>(3); + this.Verify>(4); + this.Verify>(5); } [Fact] public void BrushAppliesBeforPen() { - this.img.Mutate(x => x.DrawText( + this.operations.DrawText( "1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path, - new TextGraphicsOptions(true))); + new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(2, this.img.ProcessorApplications.Count); - Assert.IsType>(this.img.ProcessorApplications[0].processor); - Assert.IsType>(this.img.ProcessorApplications[1].processor); + var processor = this.Verify>(0); + this.Verify>(1); } [Fact] public void BrushAppliesBeforPenDefaultOptions() { - this.img.Mutate(x => x.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path)); + this.operations.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), path); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(2, this.img.ProcessorApplications.Count); - Assert.IsType>(this.img.ProcessorApplications[0].processor); - Assert.IsType>(this.img.ProcessorApplications[1].processor); + var processor = this.Verify>(0); + this.Verify>(1); } } } diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs index d03af54562..0adf0141c5 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs @@ -20,7 +20,7 @@ namespace ImageSharp.Tests.Drawing.Text using Xunit; - public class DrawText : IDisposable + public class DrawText : BaseImageOperationsExtensionTest { Rgba32 color = Rgba32.HotPink; @@ -30,8 +30,6 @@ public class DrawText : IDisposable new LinearLineSegment( new SixLabors.Primitives.PointF[] { new Vector2(10, 10), new Vector2(20, 10), new Vector2(20, 10), new Vector2(30, 10), })); - private ProcessorWatchingImage img; - private readonly FontCollection FontCollection; private readonly Font Font; @@ -40,69 +38,62 @@ public DrawText() { this.FontCollection = new FontCollection(); this.Font = this.FontCollection.Install(TestFontUtilities.GetPath("SixLaborsSampleAB.woff")).CreateFont(12); - this.img = new ProcessorWatchingImage(10, 10); - } - - public void Dispose() - { - this.img.Dispose(); } [Fact] public void FillsForEachACharachterWhenBrushSetAndNotPen() { - this.img.Mutate(x => x.DrawText( + this.operations.DrawText( "123", this.Font, Brushes.Solid(Rgba32.Red), null, Vector2.Zero, - new TextGraphicsOptions(true))); + new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void FillsForEachACharachterWhenBrushSetAndNotPenDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), null, Vector2.Zero)); + this.operations.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), null, Vector2.Zero); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void FillsForEachACharachterWhenBrushSet() { - this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero, new TextGraphicsOptions(true))); + this.operations.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero, new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void FillsForEachACharachterWhenBrushSetDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero)); + this.operations.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Vector2.Zero); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void FillsForEachACharachterWhenColorSet() { - this.img.Mutate(x => x.DrawText("123", this.Font, Rgba32.Red, Vector2.Zero, new TextGraphicsOptions(true))); + this.operations.DrawText("123", this.Font, Rgba32.Red, Vector2.Zero, new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); - FillRegionProcessor processor = - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); SolidBrush brush = Assert.IsType>(processor.Brush); Assert.Equal(Rgba32.Red, brush.Color); @@ -111,13 +102,11 @@ public void FillsForEachACharachterWhenColorSet() [Fact] public void FillsForEachACharachterWhenColorSetDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Rgba32.Red, Vector2.Zero)); + this.operations.DrawText("123", this.Font, Rgba32.Red, Vector2.Zero); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); - Assert.IsType>(this.img.ProcessorApplications[0].processor); - FillRegionProcessor processor = - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); SolidBrush brush = Assert.IsType>(processor.Brush); Assert.Equal(Rgba32.Red, brush.Color); @@ -126,99 +115,104 @@ public void FillsForEachACharachterWhenColorSetDefaultOptions() [Fact] public void DrawForEachACharachterWhenPenSetAndNotBrush() { - this.img.Mutate(x => x.DrawText( + this.operations.DrawText( "123", this.Font, null, Pens.Dash(Rgba32.Red, 1), Vector2.Zero, - new TextGraphicsOptions(true))); + new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void DrawForEachACharachterWhenPenSetAndNotBrushDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, null, Pens.Dash(Rgba32.Red, 1), Vector2.Zero)); + this.operations.DrawText("123", this.Font, null, Pens.Dash(Rgba32.Red, 1), Vector2.Zero); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void DrawForEachACharachterWhenPenSet() { - this.img.Mutate(x => x.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), Vector2.Zero, new TextGraphicsOptions(true))); + this.operations.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), Vector2.Zero, new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void DrawForEachACharachterWhenPenSetDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), Vector2.Zero)); + this.operations.DrawText("123", this.Font, Pens.Dash(Rgba32.Red, 1), Vector2.Zero); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(3, this.img.ProcessorApplications.Count); // 3 fills where applied - Assert.IsType>(this.img.ProcessorApplications[0].processor); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); } [Fact] public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSet() { - this.img.Mutate(x => x.DrawText( + this.operations.DrawText( "123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero, - new TextGraphicsOptions(true))); + new TextGraphicsOptions(true)); + + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(6, this.img.ProcessorApplications.Count); + this.Verify>(3); + this.Verify>(4); + this.Verify>(5); } [Fact] public void DrawForEachACharachterWhenPenSetAndFillFroEachWhenBrushSetDefaultOptions() { - this.img.Mutate(x => x.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero)); + this.operations.DrawText("123", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(6, this.img.ProcessorApplications.Count); + var processor = this.Verify>(0); + this.Verify>(1); + this.Verify>(2); + this.Verify>(3); + this.Verify>(4); + this.Verify>(5); } [Fact] public void BrushAppliesBeforPen() { - this.img.Mutate(x => x.DrawText( + this.operations.DrawText( "1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero, - new TextGraphicsOptions(true))); + new TextGraphicsOptions(true)); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(2, this.img.ProcessorApplications.Count); - Assert.IsType>(this.img.ProcessorApplications[0].processor); - Assert.IsType>(this.img.ProcessorApplications[1].processor); + var processor = this.Verify>(0); + this.Verify>(1); } [Fact] public void BrushAppliesBeforPenDefaultOptions() { - this.img.Mutate(x => x.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero)); + this.operations.DrawText("1", this.Font, Brushes.Solid(Rgba32.Red), Pens.Dash(Rgba32.Red, 1), Vector2.Zero); - Assert.NotEmpty(this.img.ProcessorApplications); - Assert.Equal(2, this.img.ProcessorApplications.Count); - Assert.IsType>(this.img.ProcessorApplications[0].processor); - Assert.IsType>(this.img.ProcessorApplications[1].processor); + var processor = this.Verify>(0); + this.Verify>(1); } } } diff --git a/tests/ImageSharp.Tests/ImageOperationTests.cs b/tests/ImageSharp.Tests/ImageOperationTests.cs index 61bb18e767..a84b0fcb0c 100644 --- a/tests/ImageSharp.Tests/ImageOperationTests.cs +++ b/tests/ImageSharp.Tests/ImageOperationTests.cs @@ -104,17 +104,4 @@ public void Dispose() this.image.Dispose(); } } - - public class RunImageOperation : BaseImageOperationsExtensionTest - { - [Fact] - public void Run_CreatedDelegateProcessor() - { - Action> action = (i) => { }; - this.operations.Run(action); - - DelegateImageProcessor processor = this.Verify>(); - Assert.Equal(action, processor.Action); - } - } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs index a8140aac71..b61df20354 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs @@ -6,46 +6,27 @@ namespace ImageSharp.Tests.Processing.Binarization { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class BinaryThresholdTest : FileTestBase + public class BinaryThresholdTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData BinaryThresholdValues - = new TheoryData - { - .25F, - .75F - }; - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(BinaryThresholdValues), DefaultPixelType)] - public void ImageShouldApplyBinaryThresholdFilter(TestImageProvider provider, float value) - where TPixel : struct, IPixel + [Fact] + public void BinaryThreshold_CorrectProcessor() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.BinaryThreshold(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + this.operations.BinaryThreshold(.23f); + var p = this.Verify>(); + Assert.Equal(.23f, p.Threshold); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(BinaryThresholdValues), DefaultPixelType)] - public void ImageShouldApplyBinaryThresholdInBox(TestImageProvider provider, float value) - where TPixel : struct, IPixel + [Fact] + public void BinaryThreshold_rect_CorrectProcessor() { - - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.BinaryThreshold(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.BinaryThreshold(.93f, this.rect); + var p = this.Verify>(this.rect); + Assert.Equal(.93f, p.Threshold); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs index 25b34bfe4e..bf67826b67 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs @@ -8,85 +8,73 @@ namespace ImageSharp.Tests.Processing.Binarization using ImageSharp.Dithering; using ImageSharp.Dithering.Ordered; using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; + using Moq; using SixLabors.Primitives; using Xunit; - public class DitherTest : FileTestBase + public class DitherTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData Ditherers = new TheoryData - { - { "Ordered", new Ordered() }, - { "Bayer", new Bayer() } - }; + private readonly IOrderedDither orderedDither; + private readonly IErrorDiffuser errorDiffuser; - public static readonly TheoryData ErrorDiffusers = new TheoryData + public DitherTest() { - { "Atkinson", new Atkinson() }, - { "Burks", new Burks() }, - { "FloydSteinberg", new FloydSteinberg() }, - { "JarvisJudiceNinke", new JarvisJudiceNinke() }, - { "Sierra2", new Sierra2() }, - { "Sierra3", new Sierra3() }, - { "SierraLite", new SierraLite() }, - { "Stucki", new Stucki() }, - }; - - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(Ditherers), DefaultPixelType)] - public void ImageShouldApplyDitherFilter(TestImageProvider provider, string name, IOrderedDither ditherer) - where TPixel : struct, IPixel + this.orderedDither = new Mock().Object; + this.errorDiffuser = new Mock().Object; + } + [Fact] + public void Dither_CorrectProcessor() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Dither(ditherer)); - image.DebugSave(provider, name, Extensions.Bmp); - } + this.operations.Dither(orderedDither); + var p = this.Verify>(); + Assert.Equal(this.orderedDither, p.Dither); + Assert.Equal(0, p.Index); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(Ditherers), DefaultPixelType)] - public void ImageShouldApplyDitherFilterInBox(TestImageProvider provider, string name, IOrderedDither ditherer) - where TPixel : struct, IPixel + [Fact] + public void Dither_rect_CorrectProcessor() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Dither(ditherer, bounds)); - image.DebugSave(provider, name, Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.Dither(orderedDither, this.rect); + var p = this.Verify>(this.rect); + Assert.Equal(this.orderedDither, p.Dither); + Assert.Equal(0, p.Index); } - - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(ErrorDiffusers), DefaultPixelType)] - public void ImageShouldApplyDiffusionFilter(TestImageProvider provider, string name, IErrorDiffuser diffuser) - where TPixel : struct, IPixel + [Fact] + public void Dither_index_CorrectProcessor() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Dither(diffuser, .5F)); - image.DebugSave(provider, name, Extensions.Bmp); - } + this.operations.Dither(orderedDither, 2); + var p = this.Verify>(); + Assert.Equal(this.orderedDither, p.Dither); + Assert.Equal(2, p.Index); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(ErrorDiffusers), DefaultPixelType)] - public void ImageShouldApplyDiffusionFilterInBox(TestImageProvider provider, string name, IErrorDiffuser diffuser) - where TPixel : struct, IPixel + [Fact] + public void Dither_index_rect_CorrectProcessor() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + this.operations.Dither(orderedDither, this.rect, 2); + var p = this.Verify>(this.rect); + Assert.Equal(this.orderedDither, p.Dither); + Assert.Equal(2, p.Index); + } - image.Mutate(x => x.Dither(diffuser, .5F, bounds)); - image.DebugSave(provider, name, Extensions.Bmp); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + [Fact] + public void Dither_ErrorDifuser_CorrectProcessor() + { + this.operations.Dither(errorDiffuser, 4); + var p = this.Verify>(); + Assert.Equal(this.errorDiffuser, p.Diffuser); + Assert.Equal(4, p.Threshold); + } + + [Fact] + public void Dither_ErrorDifuser_rect_CorrectProcessor() + { + this.operations.Dither(this.errorDiffuser, 3, this.rect); + var p = this.Verify>(this.rect); + Assert.Equal(this.errorDiffuser, p.Diffuser); + Assert.Equal(3, p.Threshold); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs index 90c02be197..0608ee511d 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs @@ -6,38 +6,24 @@ namespace ImageSharp.Tests.Processing.ColorMatrix { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class BlackWhiteTest : FileTestBase + public class BlackWhiteTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyBlackWhiteFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void BlackWhite_CorrectProcessor() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.BlackWhite()); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.BlackWhite(); + var p = this.Verify>(); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyBlackWhiteFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void BlackWhite_rect_CorrectProcessor() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.BlackWhite(bounds)); - image.DebugSave(provider, null, Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.BlackWhite( this.rect); + var p = this.Verify>(this.rect); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs index 9006e3e33d..5f0fe06e45 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs @@ -5,53 +5,42 @@ namespace ImageSharp.Tests.Processing.ColorMatrix { + using System.Collections.Generic; using ImageSharp.PixelFormats; using ImageSharp.Processing; + using ImageSharp.Processing.Processors; + using ImageSharp.Tests.TestUtilities; using SixLabors.Primitives; using Xunit; - public class ColorBlindnessTest : FileTestBase + public class ColorBlindnessTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData ColorBlindnessFilters - = new TheoryData - { - ColorBlindness.Achromatomaly, - ColorBlindness.Achromatopsia, - ColorBlindness.Deuteranomaly, - ColorBlindness.Deuteranopia, - ColorBlindness.Protanomaly, - ColorBlindness.Protanopia, - ColorBlindness.Tritanomaly, - ColorBlindness.Tritanopia + public static IEnumerable TheoryData = new[] { + new object[]{ new TestType>(), ColorBlindness.Achromatomaly }, + new object[]{ new TestType>(), ColorBlindness.Achromatopsia }, + new object[]{ new TestType>(), ColorBlindness.Deuteranomaly }, + new object[]{ new TestType>(), ColorBlindness.Deuteranopia }, + new object[]{ new TestType>(), ColorBlindness.Protanomaly }, + new object[]{ new TestType>(), ColorBlindness.Protanopia }, + new object[]{ new TestType>(), ColorBlindness.Tritanomaly }, + new object[]{ new TestType>(), ColorBlindness.Tritanopia } }; [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(ColorBlindnessFilters), DefaultPixelType)] - public void ImageShouldApplyColorBlindnessFilter(TestImageProvider provider, ColorBlindness colorBlindness) - where TPixel : struct, IPixel + [MemberData(nameof(TheoryData))] + public void ColorBlindness_CorrectProcessor(TestType testType, ColorBlindness colorBlindness) + where T : IImageProcessor { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.ColorBlindness(colorBlindness)); - image.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp); - } + this.operations.ColorBlindness(colorBlindness); + var p = this.Verify(); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(ColorBlindnessFilters), DefaultPixelType)] - public void ImageShouldApplyColorBlindnessFilterInBox(TestImageProvider provider, ColorBlindness colorBlindness) - where TPixel : struct, IPixel + [MemberData(nameof(TheoryData))] + public void ColorBlindness_rect_CorrectProcessor(TestType testType, ColorBlindness colorBlindness) + where T : IImageProcessor { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.ColorBlindness(colorBlindness, bounds)); - image.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.ColorBlindness(colorBlindness, this.rect); + var p = this.Verify(this.rect); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs index 6dd0e82488..a4722261e6 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs @@ -5,57 +5,45 @@ namespace ImageSharp.Tests.Processing.ColorMatrix { + using System.Collections; + using System.Collections.Generic; using ImageSharp.PixelFormats; using ImageSharp.Processing; + using ImageSharp.Processing.Processors; + using ImageSharp.Tests.TestUtilities; using SixLabors.Primitives; using Xunit; - public class GrayscaleTest : FileTestBase + public class GrayscaleTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData GrayscaleModeTypes - = new TheoryData - { - GrayscaleMode.Bt601, - GrayscaleMode.Bt709 - }; + public static IEnumerable ModeTheoryData = new[] { + new object[]{ new TestType>(), GrayscaleMode.Bt709 } + }; - /// - /// Use test patterns over loaded images to save decode time. - /// [Theory] - [WithTestPatternImages(nameof(GrayscaleModeTypes), 50, 50, DefaultPixelType)] - public void ImageShouldApplyGrayscaleFilterAll(TestImageProvider provider, GrayscaleMode value) - where TPixel : struct, IPixel + [MemberData(nameof(ModeTheoryData))] + public void Grayscale_mode_CorrectProcessor(TestType testType, GrayscaleMode mode) + where T : IImageProcessor { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Grayscale(value)); - byte[] data = new byte[3]; - for (int i = 0; i < image.Pixels.Length; i++) - { - image.Pixels[i].ToXyzBytes(data, 0); - Assert.Equal(data[0], data[1]); - Assert.Equal(data[1], data[2]); - } + this.operations.Grayscale(mode); + var p = this.Verify(); - image.DebugSave(provider, value.ToString()); - } } [Theory] - [WithTestPatternImages(nameof(GrayscaleModeTypes), 50, 50, DefaultPixelType)] - public void ImageShouldApplyGrayscaleFilterInBox(TestImageProvider provider, GrayscaleMode value) - where TPixel : struct, IPixel + [MemberData(nameof(ModeTheoryData))] + public void Grayscale_mode_rect_CorrectProcessor(TestType testType, GrayscaleMode mode) + where T : IImageProcessor { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); - image.Mutate(x => x.Grayscale(value, bounds)); - image.DebugSave(provider, value.ToString()); + this.operations.Grayscale(mode, this.rect); + this.Verify(this.rect); + } - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + [Fact] + public void Grayscale_rect_CorrectProcessor() + { + this.operations.Grayscale(this.rect); + this.Verify>(this.rect); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs index 1fe56a8be9..4132990855 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs @@ -6,45 +6,28 @@ namespace ImageSharp.Tests.Processing.ColorMatrix { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class HueTest : FileTestBase + public class HueTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData HueValues - = new TheoryData + [Fact] + public void Hue_amount_HueProcessorDefaultsSet() { - 180, - -180 - }; + this.operations.Hue(34f); + var processor = this.Verify>(); - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(HueValues), DefaultPixelType)] - public void ImageShouldApplyHueFilter(TestImageProvider provider, int value) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Hue(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + Assert.Equal(34f, processor.Angle); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(HueValues), DefaultPixelType)] - public void ImageShouldApplyHueFilterInBox(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void Hue_amount_rect_HueProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Hue(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); + this.operations.Hue(5f, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(5f, processor.Angle); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs index 779ca0f6b2..dcffd4b4f6 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs @@ -6,38 +6,24 @@ namespace ImageSharp.Tests.Processing.ColorMatrix { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class KodachromeTest : FileTestBase + public class KodachromeTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyKodachromeFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Kodachrome_amount_KodachromeProcessorDefaultsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Kodachrome()); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Kodachrome(); + var processor = this.Verify>(); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyKodachromeFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Kodachrome_amount_rect_KodachromeProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Kodachrome(bounds)); - image.DebugSave(provider, null, Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.Kodachrome(this.rect); + var processor = this.Verify>(this.rect); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs index ebfacb7203..5b468bfdea 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs @@ -8,38 +8,24 @@ namespace ImageSharp.Tests using System.IO; using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class LomographTest : FileTestBase + public class LomographTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyLomographFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Lomograph_amount_LomographProcessorDefaultsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Lomograph()); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Lomograph(); + var processor = this.Verify>(); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyLomographFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Lomograph_amount_rect_LomographProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Lomograph(bounds)); - image.DebugSave(provider, null, Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.Lomograph(this.rect); + var processor = this.Verify>(this.rect); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs index 54836cedfa..245bc47c5f 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs @@ -6,38 +6,24 @@ namespace ImageSharp.Tests.Processing.ColorMatrix { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class PolaroidTest : FileTestBase + public class PolaroidTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyPolaroidFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Polaroid_amount_PolaroidProcessorDefaultsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Polaroid()); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Polaroid(); + var processor = this.Verify>(); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyPolaroidFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Polaroid_amount_rect_PolaroidProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Polaroid(bounds)); - image.DebugSave(provider, null, Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.Polaroid(this.rect); + var processor = this.Verify>(this.rect); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs index 73c3f98b53..58df89db6f 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs @@ -6,45 +6,29 @@ namespace ImageSharp.Tests.Processing.ColorMatrix { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class SaturationTest : FileTestBase + public class SaturationTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData SaturationValues - = new TheoryData - { - 50 , - -50 , - }; - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(SaturationValues), DefaultPixelType)] - public void ImageShouldApplySaturationFilter(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void Saturation_amount_SaturationProcessorDefaultsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Saturation(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + this.operations.Saturation(34); + var processor = this.Verify>(); + + Assert.Equal(34, processor.Amount); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(SaturationValues), DefaultPixelType)] - public void ImageShouldApplySaturationFilterInBox(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void Saturation_amount_rect_SaturationProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Saturation(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); + this.operations.Saturation(5, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(5, processor.Amount); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs index ae7865c11a..3fa1f081aa 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs @@ -6,38 +6,24 @@ namespace ImageSharp.Tests.Processing.ColorMatrix { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class SepiaTest : FileTestBase + public class SepiaTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplySepiaFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Sepia_amount_SepiaProcessorDefaultsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Sepia()); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Sepia(); + var processor = this.Verify>(); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplySepiaFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Sepia_amount_rect_SepiaProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Sepia(bounds)); - image.DebugSave(provider, null, Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.Sepia(this.rect); + var processor = this.Verify>(this.rect); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs index 58a2665d0d..e4c185114d 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs @@ -6,45 +6,37 @@ namespace ImageSharp.Tests.Processing.Convolution { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class BoxBlurTest : FileTestBase + public class BoxBlurTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData BoxBlurValues - = new TheoryData + [Fact] + public void BoxBlur_BoxBlurProcessorDefaultsSet() { - 3, - 5 - }; + this.operations.BoxBlur(); + var processor = this.Verify>(); - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(BoxBlurValues), DefaultPixelType)] - public void ImageShouldApplyBoxBlurFilter(TestImageProvider provider, int value) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.BoxBlur(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + Assert.Equal(7, processor.Radius); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(BoxBlurValues), DefaultPixelType)] - public void ImageShouldApplyBoxBlurFilterInBox(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void BoxBlur_amount_BoxBlurProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + this.operations.BoxBlur(34); + var processor = this.Verify>(); + + Assert.Equal(34, processor.Radius); + } - image.Mutate(x => x.BoxBlur(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); + [Fact] + public void BoxBlur_amount_rect_BoxBlurProcessorDefaultsSet() + { + this.operations.BoxBlur(5, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(5, processor.Radius); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs index 9f3a2d79a6..0377953a65 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs @@ -5,55 +5,68 @@ namespace ImageSharp.Tests.Processing.Convolution { + using System.Collections.Generic; using ImageSharp.PixelFormats; using ImageSharp.Processing; + using ImageSharp.Processing.Processors; + using ImageSharp.Tests.TestUtilities; using SixLabors.Primitives; using Xunit; - public class DetectEdgesTest : FileTestBase + public class DetectEdgesTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData DetectEdgesFilters - = new TheoryData + + [Fact] + public void DetectEdges_SobelProcessorDefaultsSet() + { + this.operations.DetectEdges(); + var processor = this.Verify>(); + + Assert.True(processor.Grayscale); + } + + [Fact] + public void DetectEdges_Rect_SobelProcessorDefaultsSet() { - EdgeDetection.Kayyali, - EdgeDetection.Kirsch, - EdgeDetection.Lapacian3X3, - EdgeDetection.Lapacian5X5, - EdgeDetection.LaplacianOfGaussian, - EdgeDetection.Prewitt, - EdgeDetection.RobertsCross, - EdgeDetection.Robinson, - EdgeDetection.Scharr, - EdgeDetection.Sobel + this.operations.DetectEdges(this.rect); + var processor = this.Verify>(this.rect); + + Assert.True(processor.Grayscale); + } + public static IEnumerable EdgeDetectionTheoryData => new[] { + new object[]{ new TestType>(), EdgeDetection.Kayyali }, + new object[]{ new TestType>(), EdgeDetection.Kirsch }, + new object[]{ new TestType>(), EdgeDetection.Lapacian3X3 }, + new object[]{ new TestType>(), EdgeDetection.Lapacian5X5 }, + new object[]{ new TestType>(), EdgeDetection.LaplacianOfGaussian }, + new object[]{ new TestType>(), EdgeDetection.Prewitt }, + new object[]{ new TestType>(), EdgeDetection.RobertsCross }, + new object[]{ new TestType>(), EdgeDetection.Robinson }, + new object[]{ new TestType>(), EdgeDetection.Scharr }, + new object[]{ new TestType>(), EdgeDetection.Sobel }, }; [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(DetectEdgesFilters), DefaultPixelType)] - public void ImageShouldApplyDetectEdgesFilter(TestImageProvider provider, EdgeDetection detector) - where TPixel : struct, IPixel + [MemberData(nameof(EdgeDetectionTheoryData))] + public void DetectEdges_filter_SobelProcessorDefaultsSet(TestType type, EdgeDetection filter) + where TProcessor : IEdgeDetectorProcessor { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.DetectEdges(detector)); - image.DebugSave(provider, detector.ToString(), Extensions.Bmp); - } + this.operations.DetectEdges(filter); + var processor = this.Verify(); + + Assert.True(processor.Grayscale); } [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(DetectEdgesFilters), DefaultPixelType)] - public void ImageShouldApplyDetectEdgesFilterInBox(TestImageProvider provider, EdgeDetection detector) - where TPixel : struct, IPixel + [MemberData(nameof(EdgeDetectionTheoryData))] + public void DetectEdges_filter_grayscale_SobelProcessorDefaultsSet(TestType type, EdgeDetection filter) + where TProcessor : IEdgeDetectorProcessor { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.DetectEdges(detector, bounds)); - image.DebugSave(provider, detector.ToString(), Extensions.Bmp); + var grey = (int)filter % 2 == 0; + this.operations.DetectEdges(filter, grey); + var processor = this.Verify(); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(grey, processor.Grayscale); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs index 763e806af9..8b2e4c6340 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs @@ -6,45 +6,37 @@ namespace ImageSharp.Tests.Processing.Convolution { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class GaussianBlurTest : FileTestBase + public class GaussianBlurTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData GaussianBlurValues - = new TheoryData + [Fact] + public void GaussianBlur_GaussianBlurProcessorDefaultsSet() { - 3, - 5 - }; + this.operations.GaussianBlur(); + var processor = this.Verify>(); - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(GaussianBlurValues), DefaultPixelType)] - public void ImageShouldApplyGaussianBlurFilter(TestImageProvider provider, int value) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.GaussianBlur(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + Assert.Equal(3f, processor.Sigma); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(GaussianBlurValues), DefaultPixelType)] - public void ImageShouldApplyGaussianBlurFilterInBox(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void GaussianBlur_amount_GaussianBlurProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + this.operations.GaussianBlur(0.2f); + var processor = this.Verify>(); + + Assert.Equal(.2f, processor.Sigma); + } - image.Mutate(x => x.GaussianBlur(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); + [Fact] + public void GaussianBlur_amount_rect_GaussianBlurProcessorDefaultsSet() + { + this.operations.GaussianBlur(0.6f, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(.6f, processor.Sigma); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs index 6313bc72aa..e381ad7e92 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs @@ -6,45 +6,37 @@ namespace ImageSharp.Tests.Processing.Convolution { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class GaussianSharpenTest : FileTestBase + public class GaussianSharpenTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData GaussianSharpenValues - = new TheoryData + [Fact] + public void GaussianSharpen_GaussianSharpenProcessorDefaultsSet() { - 3, - 5 - }; + this.operations.GaussianSharpen(); + var processor = this.Verify>(); - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(GaussianSharpenValues), DefaultPixelType)] - public void ImageShouldApplyGaussianSharpenFilter(TestImageProvider provider, int value) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.GaussianSharpen(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + Assert.Equal(3f, processor.Sigma); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(GaussianSharpenValues), DefaultPixelType)] - public void ImageShouldApplyGaussianSharpenFilterInBox(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void GaussianSharpen_amount_GaussianSharpenProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + this.operations.GaussianSharpen(0.2f); + var processor = this.Verify>(); + + Assert.Equal(.2f, processor.Sigma); + } - image.Mutate(x => x.GaussianSharpen(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); + [Fact] + public void GaussianSharpen_amount_rect_GaussianSharpenProcessorDefaultsSet() + { + this.operations.GaussianSharpen(0.6f, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(.6f, processor.Sigma); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/DelegateTest.cs b/tests/ImageSharp.Tests/Processing/DelegateTest.cs new file mode 100644 index 0000000000..73011bee1f --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/DelegateTest.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing +{ + using System; + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using Xunit; + + public class DelegateTest : BaseImageOperationsExtensionTest + { + [Fact] + public void Run_CreatedDelegateProcessor() + { + Action> action = (i) => { }; + this.operations.Run(action); + + DelegateProcessor processor = this.Verify>(); + Assert.Equal(action, processor.Action); + } + } +} diff --git a/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs b/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs index e01e67e181..960ab4509c 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs @@ -6,45 +6,28 @@ namespace ImageSharp.Tests.Processing.Effects { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class AlphaTest : FileTestBase + public class AlphaTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData AlphaValues - = new TheoryData + [Fact] + public void Alpha_amount_AlphaProcessorDefaultsSet() { - 20/100F, - 80/100F - }; + this.operations.Alpha(0.2f); + var processor = this.Verify>(); - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(AlphaValues), DefaultPixelType)] - public void ImageShouldApplyAlphaFilter(TestImageProvider provider, float value) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Alpha(value)); - image.DebugSave(provider, value, Extensions.Png); - } + Assert.Equal(.2f, processor.Value); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(AlphaValues), DefaultPixelType)] - public void ImageShouldApplyAlphaFilterInBox(TestImageProvider provider, float value) - where TPixel : struct, IPixel + [Fact] + public void Alpha_amount_rect_AlphaProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Alpha(value, bounds)); - image.DebugSave(provider, value, Extensions.Png); + this.operations.Alpha(0.6f, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(.6f, processor.Value); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs index 55f11b8b54..8de7b675ab 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs @@ -6,38 +6,50 @@ namespace ImageSharp.Tests.Processing.Effects { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class BackgroundColorTest : FileTestBase + public class BackgroundColorTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyBackgroundColorFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void BackgroundColor_amount_BackgroundColorProcessorDefaultsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.BackgroundColor(NamedColors.HotPink)); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.BackgroundColor(Rgba32.BlanchedAlmond); + var processor = this.Verify>(); + + Assert.Equal(GraphicsOptions.Default, processor.GraphicsOptions); + Assert.Equal(Rgba32.BlanchedAlmond, processor.Value); + } + + [Fact] + public void BackgroundColor_amount_rect_BackgroundColorProcessorDefaultsSet() + { + this.operations.BackgroundColor(Rgba32.BlanchedAlmond, this.rect); + var processor = this.Verify>(this.rect); + + Assert.Equal(GraphicsOptions.Default, processor.GraphicsOptions); + Assert.Equal(Rgba32.BlanchedAlmond, processor.Value); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyBackgroundColorFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void BackgroundColor_amount_options_BackgroundColorProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + this.operations.BackgroundColor(Rgba32.BlanchedAlmond, this.options); + var processor = this.Verify>(); + + Assert.Equal(this.options, processor.GraphicsOptions); + Assert.Equal(Rgba32.BlanchedAlmond, processor.Value); + } - image.Mutate(x => x.BackgroundColor(NamedColors.HotPink, bounds)); - image.DebugSave(provider, null, Extensions.Bmp); + [Fact] + public void BackgroundColor_amount_rect_options_BackgroundColorProcessorDefaultsSet() + { + this.operations.BackgroundColor(Rgba32.BlanchedAlmond, this.rect, this.options); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(this.options, processor.GraphicsOptions); + Assert.Equal(Rgba32.BlanchedAlmond, processor.Value); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs index 081fdf319c..e9a9a49b6a 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs @@ -6,45 +6,28 @@ namespace ImageSharp.Tests.Processing.Effects { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class BrightnessTest : FileTestBase + public class BrightnessTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData BrightnessValues - = new TheoryData + [Fact] + public void Brightness_amount_BrightnessProcessorDefaultsSet() { - 50, - -50 - }; + this.operations.Brightness(23); + var processor = this.Verify>(); - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(BrightnessValues), DefaultPixelType)] - public void ImageShouldApplyBrightnessFilter(TestImageProvider provider, int value) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Brightness(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + Assert.Equal(23, processor.Value); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(BrightnessValues), DefaultPixelType)] - public void ImageShouldApplyBrightnessFilterInBox(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void Brightness_amount_rect_BrightnessProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Brightness(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); + this.operations.Brightness(23, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); ; - } + Assert.Equal(23, processor.Value); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs index 2c2ef1403a..392c407f3a 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs @@ -6,45 +6,28 @@ namespace ImageSharp.Tests.Processing.Effects { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class ContrastTest : FileTestBase + public class ContrastTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData ContrastValues - = new TheoryData + [Fact] + public void Contrast_amount_ContrastProcessorDefaultsSet() { - 50, - -50 - }; + this.operations.Contrast(23); + var processor = this.Verify>(); - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(ContrastValues), DefaultPixelType)] - public void ImageShouldApplyContrastFilter(TestImageProvider provider, int value) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Contrast(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + Assert.Equal(23, processor.Value); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(ContrastValues), DefaultPixelType)] - public void ImageShouldApplyContrastFilterInBox(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void Contrast_amount_rect_ContrastProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Contrast(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); + this.operations.Contrast(23, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(23, processor.Value); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs index 7d79517bc9..794cb65b8e 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs @@ -6,38 +6,24 @@ namespace ImageSharp.Tests.Processing.Effects { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class InvertTest : FileTestBase + public class InvertTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyInvertFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Invert_InvertProcessorDefaultsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Invert()); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Invert(); + var processor = this.Verify>(); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyInvertFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Pixelate_rect_PixelateProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Invert(bounds)); - image.DebugSave(provider, null, Extensions.Bmp); - - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + this.operations.Invert(this.rect); + var processor = this.Verify>(this.rect); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs index 002d57d847..b96887c76b 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs @@ -3,48 +3,52 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Tests +namespace ImageSharp.Tests.Processing.Effects { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class OilPaintTest : FileTestBase + public class OilPaintTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData OilPaintValues - = new TheoryData - { - { 15, 10 }, - { 6, 5 } - }; - - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(OilPaintValues), DefaultPixelType)] - public void ImageShouldApplyOilPaintFilter(TestImageProvider provider, int levels, int brushSize) - where TPixel : struct, IPixel + [Fact] + public void OilPaint_OilPaintingProcessorDefaultsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.OilPaint(levels, brushSize)); - image.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp); - } + this.operations.OilPaint(); + var processor = this.Verify>(); + + Assert.Equal(10, processor.Levels); + Assert.Equal(15, processor.BrushSize); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(OilPaintValues), DefaultPixelType)] - public void ImageShouldApplyOilPaintFilterInBox(TestImageProvider provider, int levels, int brushSize) - where TPixel : struct, IPixel + [Fact] + public void OilPaint_rect_OilPaintingProcessorDefaultsSet() + { + this.operations.OilPaint(this.rect); + var processor = this.Verify>(this.rect); + + Assert.Equal(10, processor.Levels); + Assert.Equal(15, processor.BrushSize); + } + [Fact] + public void OilPaint_Levels_Brsuh_OilPaintingProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + this.operations.OilPaint(34, 65); + var processor = this.Verify>(); - image.Mutate(x => x.OilPaint(levels, brushSize, bounds)); - image.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp); + Assert.Equal(34, processor.Levels); + Assert.Equal(65, processor.BrushSize); + } + + [Fact] + public void OilPaint_Levels_Brsuh_rect_OilPaintingProcessorDefaultsSet() + { + this.operations.OilPaint(54, 43, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds, 0.001F); - } + Assert.Equal(54, processor.Levels); + Assert.Equal(43, processor.BrushSize); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs index 3a6e273d00..bcd35af163 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs @@ -6,79 +6,37 @@ namespace ImageSharp.Tests.Processing.Effects { using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class PixelateTest : FileTestBase + public class PixelateTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData PixelateValues - = new TheoryData + [Fact] + public void Pixelate_PixelateProcessorDefaultsSet() { - 4 , - 8 - }; + this.operations.Pixelate(); + var processor = this.Verify>(); - [Theory] - [WithTestPatternImages(nameof(PixelateValues), 320, 240, PixelTypes.Rgba32)] - public void ImageShouldApplyPixelateFilter(TestImageProvider provider, int value) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Pixelate(value)); - image.DebugSave(provider, value, Extensions.Bmp); - - // Test the neigbouring pixels - for (int y = 0; y < image.Height; y += value) - { - for (int x = 0; x < image.Width; x += value) - { - TPixel source = image[x, y]; - for (int pixY = y; pixY < y + value && pixY < image.Height; pixY++) - { - for (int pixX = x; pixX < x + value && pixX < image.Width; pixX++) - { - Assert.Equal(source, image[pixX, pixY]); - } - } - } - } - } + Assert.Equal(4, processor.Size); } - [Theory] - [WithTestPatternImages(nameof(PixelateValues), 320, 240, PixelTypes.Rgba32)] - public void ImageShouldApplyPixelateFilterInBox(TestImageProvider provider, int value) - where TPixel : struct, IPixel + [Fact] + public void Pixelate_Size_PixelateProcessorDefaultsSet() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Pixelate(value, bounds)); - image.DebugSave(provider, value, Extensions.Bmp); + this.operations.Pixelate(12); + var processor = this.Verify>(); - for (int y = 0; y < image.Height; y++) - { - for (int x = 0; x < image.Width; x++) - { - int tx = x; - int ty = y; - TPixel sourceColor = source[tx, ty]; - if (bounds.Contains(tx, ty)) - { - int sourceX = tx - ((tx - bounds.Left) % value) + (value / 2); - int sourceY = ty - ((ty - bounds.Top) % value) + (value / 2); + Assert.Equal(12, processor.Size); + } - sourceColor = image[sourceX, sourceY]; - } - Assert.Equal(sourceColor, image[tx, ty]); - } - } + [Fact] + public void Pixelate_Size_rect_PixelateProcessorDefaultsSet() + { + this.operations.Pixelate(23, this.rect); + var processor = this.Verify>(this.rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(23, processor.Size); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs index 20e521c8d9..223129877f 100644 --- a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs +++ b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs @@ -5,63 +5,57 @@ namespace ImageSharp.Tests.Processing.Overlays { + using System; using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; using SixLabors.Primitives; using Xunit; - public class GlowTest : FileTestBase + public class GlowTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyGlowFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Glow_GlowProcessorWithDefaultValues() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Glow()); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Glow(); + var p = this.Verify>(); + + Assert.Equal(GraphicsOptions.Default, p.GraphicsOptions); + Assert.Equal(Rgba32.Black, p.GlowColor); + Assert.Equal(ValueSize.PercentageOfWidth(.5f), p.Radius); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyGlowFilterColor(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Glow_Color_GlowProcessorWithDefaultValues() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Glow(NamedColors.Orange)); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Glow(Rgba32.Aquamarine); + var p = this.Verify>(); + + Assert.Equal(GraphicsOptions.Default, p.GraphicsOptions); + Assert.Equal(Rgba32.Aquamarine, p.GlowColor); + Assert.Equal(ValueSize.PercentageOfWidth(.5f), p.Radius); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyGlowFilterRadius(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Glow_Radux_GlowProcessorWithDefaultValues() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Glow(image.Width / 4F)); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Glow(3.5f); + var p = this.Verify>(); + + Assert.Equal(GraphicsOptions.Default, p.GraphicsOptions); + Assert.Equal(Rgba32.Black, p.GlowColor); + Assert.Equal(ValueSize.Absolute(3.5f), p.Radius); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyGlowFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Glow_Rect_GlowProcessorWithDefaultValues() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Glow(bounds)); - image.DebugSave(provider, null, Extensions.Bmp); + var rect = new Rectangle(12, 123, 43, 65); + this.operations.Glow(rect); + var p = this.Verify>(rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(GraphicsOptions.Default, p.GraphicsOptions); + Assert.Equal(Rgba32.Black, p.GlowColor); + Assert.Equal(ValueSize.PercentageOfWidth(.5f), p.Radius); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs index 74c5296fa3..f93ca186f1 100644 --- a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs @@ -5,63 +5,62 @@ namespace ImageSharp.Tests.Processing.Overlays { + using System; using ImageSharp.PixelFormats; + using ImageSharp.Processing.Processors; + using ImageSharp.Tests.TestUtilities; using SixLabors.Primitives; using Xunit; - public class VignetteTest : FileTestBase + public class VignetteTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyVignetteFilter(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Vignette_VignetteProcessorWithDefaultValues() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Vignette()); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Vignette(); + var p = this.Verify>(); + + Assert.Equal(GraphicsOptions.Default, p.GraphicsOptions); + Assert.Equal(Rgba32.Black, p.VignetteColor); + Assert.Equal(ValueSize.PercentageOfWidth(.5f), p.RadiusX); + Assert.Equal(ValueSize.PercentageOfHeight(.5f), p.RadiusY); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyVignetteFilterColor(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Vignette_Color_VignetteProcessorWithDefaultValues() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Vignette(NamedColors.Orange)); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Vignette(Rgba32.Aquamarine); + var p = this.Verify>(); + + Assert.Equal(GraphicsOptions.Default, p.GraphicsOptions); + Assert.Equal(Rgba32.Aquamarine, p.VignetteColor); + Assert.Equal(ValueSize.PercentageOfWidth(.5f), p.RadiusX); + Assert.Equal(ValueSize.PercentageOfHeight(.5f), p.RadiusY); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyVignetteFilterRadius(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Vignette_Radux_VignetteProcessorWithDefaultValues() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Vignette(image.Width / 4F, image.Height / 4F)); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Vignette(3.5f, 12123f); + var p = this.Verify>(); + + Assert.Equal(GraphicsOptions.Default, p.GraphicsOptions); + Assert.Equal(Rgba32.Black, p.VignetteColor); + Assert.Equal(ValueSize.Absolute(3.5f), p.RadiusX); + Assert.Equal(ValueSize.Absolute(12123f), p.RadiusY); } - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldApplyVignetteFilterInBox(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact] + public void Vignette_Rect_VignetteProcessorWithDefaultValues() { - using (Image source = provider.GetImage()) - using (var image = new Image(source)) - { - var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Vignette(bounds)); - image.DebugSave(provider, null, Extensions.Bmp); + var rect = new Rectangle(12, 123, 43, 65); + this.operations.Vignette(rect); + var p = this.Verify>(rect); - ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); - } + Assert.Equal(GraphicsOptions.Default, p.GraphicsOptions); + Assert.Equal(Rgba32.Black, p.VignetteColor); + Assert.Equal(ValueSize.PercentageOfWidth(.5f), p.RadiusX); + Assert.Equal(ValueSize.PercentageOfHeight(.5f), p.RadiusY); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs new file mode 100644 index 0000000000..3e8c99e359 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Binarization +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class BinaryThresholdTest : FileTestBase + { + public static readonly TheoryData BinaryThresholdValues + = new TheoryData + { + .25F, + .75F + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(BinaryThresholdValues), DefaultPixelType)] + public void ImageShouldApplyBinaryThresholdFilter(TestImageProvider provider, float value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.BinaryThreshold(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(BinaryThresholdValues), DefaultPixelType)] + public void ImageShouldApplyBinaryThresholdInBox(TestImageProvider provider, float value) + where TPixel : struct, IPixel + { + + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.BinaryThreshold(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs new file mode 100644 index 0000000000..0a4ccaeb1d --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs @@ -0,0 +1,92 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Binarization +{ + using ImageSharp.Dithering; + using ImageSharp.Dithering.Ordered; + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class DitherTest : FileTestBase + { + public static readonly TheoryData Ditherers = new TheoryData + { + { "Ordered", new Ordered() }, + { "Bayer", new Bayer() } + }; + + public static readonly TheoryData ErrorDiffusers = new TheoryData + { + { "Atkinson", new Atkinson() }, + { "Burks", new Burks() }, + { "FloydSteinberg", new FloydSteinberg() }, + { "JarvisJudiceNinke", new JarvisJudiceNinke() }, + { "Sierra2", new Sierra2() }, + { "Sierra3", new Sierra3() }, + { "SierraLite", new SierraLite() }, + { "Stucki", new Stucki() }, + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(Ditherers), DefaultPixelType)] + public void ImageShouldApplyDitherFilter(TestImageProvider provider, string name, IOrderedDither ditherer) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Dither(ditherer)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(Ditherers), DefaultPixelType)] + public void ImageShouldApplyDitherFilterInBox(TestImageProvider provider, string name, IOrderedDither ditherer) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Dither(ditherer, bounds)); + image.DebugSave(provider, name, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(ErrorDiffusers), DefaultPixelType)] + public void ImageShouldApplyDiffusionFilter(TestImageProvider provider, string name, IErrorDiffuser diffuser) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Dither(diffuser, .5F)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(ErrorDiffusers), DefaultPixelType)] + public void ImageShouldApplyDiffusionFilterInBox(TestImageProvider provider, string name, IErrorDiffuser diffuser) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Dither(diffuser, .5F, bounds)); + image.DebugSave(provider, name, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs new file mode 100644 index 0000000000..5b4953d600 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs @@ -0,0 +1,43 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class BlackWhiteTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyBlackWhiteFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.BlackWhite()); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyBlackWhiteFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.BlackWhite(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs new file mode 100644 index 0000000000..6d2df4c9b3 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs @@ -0,0 +1,57 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using SixLabors.Primitives; + using Xunit; + + public class ColorBlindnessTest : FileTestBase + { + public static readonly TheoryData ColorBlindnessFilters + = new TheoryData + { + ColorBlindness.Achromatomaly, + ColorBlindness.Achromatopsia, + ColorBlindness.Deuteranomaly, + ColorBlindness.Deuteranopia, + ColorBlindness.Protanomaly, + ColorBlindness.Protanopia, + ColorBlindness.Tritanomaly, + ColorBlindness.Tritanopia + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(ColorBlindnessFilters), DefaultPixelType)] + public void ImageShouldApplyColorBlindnessFilter(TestImageProvider provider, ColorBlindness colorBlindness) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.ColorBlindness(colorBlindness)); + image.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(ColorBlindnessFilters), DefaultPixelType)] + public void ImageShouldApplyColorBlindnessFilterInBox(TestImageProvider provider, ColorBlindness colorBlindness) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.ColorBlindness(colorBlindness, bounds)); + image.DebugSave(provider, colorBlindness.ToString(), Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs new file mode 100644 index 0000000000..3fba626c28 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using SixLabors.Primitives; + using Xunit; + + public class GrayscaleTest : FileTestBase + { + public static readonly TheoryData GrayscaleModeTypes + = new TheoryData + { + GrayscaleMode.Bt601, + GrayscaleMode.Bt709 + }; + + /// + /// Use test patterns over loaded images to save decode time. + /// + [Theory] + [WithTestPatternImages(nameof(GrayscaleModeTypes), 50, 50, DefaultPixelType)] + public void ImageShouldApplyGrayscaleFilterAll(TestImageProvider provider, GrayscaleMode value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Grayscale(value)); + byte[] data = new byte[3]; + for (int i = 0; i < image.Pixels.Length; i++) + { + image.Pixels[i].ToXyzBytes(data, 0); + Assert.Equal(data[0], data[1]); + Assert.Equal(data[1], data[2]); + } + + image.DebugSave(provider, value.ToString()); + } + } + + [Theory] + [WithTestPatternImages(nameof(GrayscaleModeTypes), 50, 50, DefaultPixelType)] + public void ImageShouldApplyGrayscaleFilterInBox(TestImageProvider provider, GrayscaleMode value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); + image.Mutate(x => x.Grayscale(value, bounds)); + image.DebugSave(provider, value.ToString()); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs new file mode 100644 index 0000000000..1019e2def6 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class HueTest : FileTestBase + { + public static readonly TheoryData HueValues + = new TheoryData + { + 180, + -180 + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(HueValues), DefaultPixelType)] + public void ImageShouldApplyHueFilter(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Hue(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(HueValues), DefaultPixelType)] + public void ImageShouldApplyHueFilterInBox(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Hue(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs new file mode 100644 index 0000000000..9e7c2c02f9 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs @@ -0,0 +1,43 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class KodachromeTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyKodachromeFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Kodachrome()); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyKodachromeFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Kodachrome(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs new file mode 100644 index 0000000000..d44f7005fd --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using System.IO; + + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class LomographTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyLomographFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Lomograph()); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyLomographFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Lomograph(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs new file mode 100644 index 0000000000..29ae45be49 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs @@ -0,0 +1,43 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class PolaroidTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyPolaroidFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Polaroid()); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyPolaroidFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Polaroid(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs new file mode 100644 index 0000000000..df0af2bb68 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class SaturationTest : FileTestBase + { + public static readonly TheoryData SaturationValues + = new TheoryData + { + 50 , + -50 , + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(SaturationValues), DefaultPixelType)] + public void ImageShouldApplySaturationFilter(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Saturation(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(SaturationValues), DefaultPixelType)] + public void ImageShouldApplySaturationFilterInBox(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Saturation(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs new file mode 100644 index 0000000000..82bd4b26e0 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs @@ -0,0 +1,43 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.ColorMatrix +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class SepiaTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplySepiaFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Sepia()); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplySepiaFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Sepia(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs new file mode 100644 index 0000000000..71b5ee69b4 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Convolution +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class BoxBlurTest : FileTestBase + { + public static readonly TheoryData BoxBlurValues + = new TheoryData + { + 3, + 5 + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(BoxBlurValues), DefaultPixelType)] + public void ImageShouldApplyBoxBlurFilter(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.BoxBlur(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(BoxBlurValues), DefaultPixelType)] + public void ImageShouldApplyBoxBlurFilterInBox(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.BoxBlur(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs new file mode 100644 index 0000000000..7a5dbc1fca --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Convolution +{ + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using SixLabors.Primitives; + using Xunit; + + public class DetectEdgesTest : FileTestBase + { + public static readonly TheoryData DetectEdgesFilters + = new TheoryData + { + EdgeDetection.Kayyali, + EdgeDetection.Kirsch, + EdgeDetection.Lapacian3X3, + EdgeDetection.Lapacian5X5, + EdgeDetection.LaplacianOfGaussian, + EdgeDetection.Prewitt, + EdgeDetection.RobertsCross, + EdgeDetection.Robinson, + EdgeDetection.Scharr, + EdgeDetection.Sobel + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(DetectEdgesFilters), DefaultPixelType)] + public void ImageShouldApplyDetectEdgesFilter(TestImageProvider provider, EdgeDetection detector) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.DetectEdges(detector)); + image.DebugSave(provider, detector.ToString(), Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(DetectEdgesFilters), DefaultPixelType)] + public void ImageShouldApplyDetectEdgesFilterInBox(TestImageProvider provider, EdgeDetection detector) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.DetectEdges(detector, bounds)); + image.DebugSave(provider, detector.ToString(), Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs new file mode 100644 index 0000000000..5bb372e544 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Convolution +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class GaussianBlurTest : FileTestBase + { + public static readonly TheoryData GaussianBlurValues + = new TheoryData + { + 3, + 5 + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(GaussianBlurValues), DefaultPixelType)] + public void ImageShouldApplyGaussianBlurFilter(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.GaussianBlur(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(GaussianBlurValues), DefaultPixelType)] + public void ImageShouldApplyGaussianBlurFilterInBox(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.GaussianBlur(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs new file mode 100644 index 0000000000..71eae5b093 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Convolution +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class GaussianSharpenTest : FileTestBase + { + public static readonly TheoryData GaussianSharpenValues + = new TheoryData + { + 3, + 5 + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(GaussianSharpenValues), DefaultPixelType)] + public void ImageShouldApplyGaussianSharpenFilter(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.GaussianSharpen(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(GaussianSharpenValues), DefaultPixelType)] + public void ImageShouldApplyGaussianSharpenFilterInBox(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.GaussianSharpen(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs new file mode 100644 index 0000000000..c29267b106 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Effects +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class AlphaTest : FileTestBase + { + public static readonly TheoryData AlphaValues + = new TheoryData + { + 20/100F, + 80/100F + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(AlphaValues), DefaultPixelType)] + public void ImageShouldApplyAlphaFilter(TestImageProvider provider, float value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Alpha(value)); + image.DebugSave(provider, value, Extensions.Png); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(AlphaValues), DefaultPixelType)] + public void ImageShouldApplyAlphaFilterInBox(TestImageProvider provider, float value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Alpha(value, bounds)); + image.DebugSave(provider, value, Extensions.Png); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs new file mode 100644 index 0000000000..2e2768115d --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs @@ -0,0 +1,43 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Effects +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class BackgroundColorTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyBackgroundColorFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.BackgroundColor(NamedColors.HotPink)); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyBackgroundColorFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.BackgroundColor(NamedColors.HotPink, bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs new file mode 100644 index 0000000000..abd9951ab0 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Effects +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class BrightnessTest : FileTestBase + { + public static readonly TheoryData BrightnessValues + = new TheoryData + { + 50, + -50 + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(BrightnessValues), DefaultPixelType)] + public void ImageShouldApplyBrightnessFilter(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Brightness(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(BrightnessValues), DefaultPixelType)] + public void ImageShouldApplyBrightnessFilterInBox(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Brightness(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); ; + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs new file mode 100644 index 0000000000..c9d322a976 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Effects +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class ContrastTest : FileTestBase + { + public static readonly TheoryData ContrastValues + = new TheoryData + { + 50, + -50 + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(ContrastValues), DefaultPixelType)] + public void ImageShouldApplyContrastFilter(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Contrast(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(ContrastValues), DefaultPixelType)] + public void ImageShouldApplyContrastFilterInBox(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Contrast(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs new file mode 100644 index 0000000000..839b1bb993 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs @@ -0,0 +1,43 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Effects +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class InvertTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyInvertFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Invert()); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyInvertFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Invert(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs new file mode 100644 index 0000000000..17598c6486 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs @@ -0,0 +1,50 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Effects +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class OilPaintTest : FileTestBase + { + public static readonly TheoryData OilPaintValues + = new TheoryData + { + { 15, 10 }, + { 6, 5 } + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(OilPaintValues), DefaultPixelType)] + public void ImageShouldApplyOilPaintFilter(TestImageProvider provider, int levels, int brushSize) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.OilPaint(levels, brushSize)); + image.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(OilPaintValues), DefaultPixelType)] + public void ImageShouldApplyOilPaintFilterInBox(TestImageProvider provider, int levels, int brushSize) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.OilPaint(levels, brushSize, bounds)); + image.DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds, 0.001F); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs new file mode 100644 index 0000000000..e24b359e38 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Effects +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class PixelateTest : FileTestBase + { + public static readonly TheoryData PixelateValues + = new TheoryData + { + 4 , + 8 + }; + + [Theory] + [WithTestPatternImages(nameof(PixelateValues), 320, 240, PixelTypes.Rgba32)] + public void ImageShouldApplyPixelateFilter(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Pixelate(value)); + image.DebugSave(provider, value, Extensions.Bmp); + + // Test the neigbouring pixels + for (int y = 0; y < image.Height; y += value) + { + for (int x = 0; x < image.Width; x += value) + { + TPixel source = image[x, y]; + for (int pixY = y; pixY < y + value && pixY < image.Height; pixY++) + { + for (int pixX = x; pixX < x + value && pixX < image.Width; pixX++) + { + Assert.Equal(source, image[pixX, pixY]); + } + } + } + } + } + } + + [Theory] + [WithTestPatternImages(nameof(PixelateValues), 320, 240, PixelTypes.Rgba32)] + public void ImageShouldApplyPixelateFilterInBox(TestImageProvider provider, int value) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Pixelate(value, bounds)); + image.DebugSave(provider, value, Extensions.Bmp); + + for (int y = 0; y < image.Height; y++) + { + for (int x = 0; x < image.Width; x++) + { + int tx = x; + int ty = y; + TPixel sourceColor = source[tx, ty]; + if (bounds.Contains(tx, ty)) + { + int sourceX = tx - ((tx - bounds.Left) % value) + (value / 2); + int sourceY = ty - ((ty - bounds.Top) % value) + (value / 2); + + sourceColor = image[sourceX, sourceY]; + } + Assert.Equal(sourceColor, image[tx, ty]); + } + } + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs new file mode 100644 index 0000000000..cab607973d --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Overlays +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class GlowTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyGlowFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Glow()); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyGlowFilterColor(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Glow(NamedColors.Orange)); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyGlowFilterRadius(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Glow(image.Width / 4F)); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyGlowFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Glow(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs new file mode 100644 index 0000000000..6f856c6867 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Overlays +{ + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + using Xunit; + + public class VignetteTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyVignetteFilter(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Vignette()); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyVignetteFilterColor(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Vignette(NamedColors.Orange)); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyVignetteFilterRadius(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Vignette(image.Width / 4F, image.Height / 4F)); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldApplyVignetteFilterInBox(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image source = provider.GetImage()) + using (var image = new Image(source)) + { + var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Vignette(bounds)); + image.DebugSave(provider, null, Extensions.Bmp); + + ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs new file mode 100644 index 0000000000..7ab49bc417 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using System; + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + + using Xunit; + + public class AutoOrientTests : FileTestBase + { + public static readonly string[] FlipFiles = { TestImages.Bmp.F }; + + public static readonly TheoryData OrientationValues + = new TheoryData + { + { RotateType.None, FlipType.None, 0 }, + { RotateType.None, FlipType.None, 1 }, + { RotateType.None, FlipType.Horizontal, 2 }, + { RotateType.Rotate180, FlipType.None, 3 }, + { RotateType.Rotate180, FlipType.Horizontal, 4 }, + { RotateType.Rotate90, FlipType.Horizontal, 5 }, + { RotateType.Rotate270, FlipType.None, 6 }, + { RotateType.Rotate90, FlipType.Vertical, 7 }, + { RotateType.Rotate90, FlipType.None, 8 }, + }; + + public static readonly TheoryData InvalidOrientationValues + = new TheoryData + { + { ExifDataType.Byte, new byte[] { 1 } }, + { ExifDataType.SignedByte, new byte[] { 2 } }, + { ExifDataType.SignedShort, BitConverter.GetBytes((short) 3) }, + { ExifDataType.Long, BitConverter.GetBytes((uint) 4) }, + { ExifDataType.SignedLong, BitConverter.GetBytes((int) 5) } + }; + + [Theory] + [WithFileCollection(nameof(FlipFiles), nameof(OrientationValues), DefaultPixelType)] + public void ImageShouldAutoRotate(TestImageProvider provider, RotateType rotateType, FlipType flipType, ushort orientation) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.MetaData.ExifProfile = new ExifProfile(); + image.MetaData.ExifProfile.SetValue(ExifTag.Orientation, orientation); + + image.Mutate(x => x.RotateFlip(rotateType, flipType)); + image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "1_before"), Extensions.Bmp); + + image.Mutate(x => x.AutoOrient()); + image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "2_after"), Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(FlipFiles), nameof(InvalidOrientationValues), DefaultPixelType)] + public void ImageShouldAutoRotateInvalidValues(TestImageProvider provider, ExifDataType dataType, byte[] orientation) + where TPixel : struct, IPixel + { + var profile = new ExifProfile(); + profile.SetValue(ExifTag.JPEGTables, orientation); + + byte[] bytes = profile.ToByteArray(); + // Change the tag into ExifTag.Orientation + bytes[16] = 18; + bytes[17] = 1; + // Change the data type + bytes[18] = (byte)dataType; + // Change the number of components + bytes[20] = 1; + + using (Image image = provider.GetImage()) + { + image.MetaData.ExifProfile = new ExifProfile(bytes); + image.Mutate(x=>x.AutoOrient()); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs new file mode 100644 index 0000000000..951fdee5ec --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using ImageSharp.PixelFormats; + + using Xunit; + + public class CropTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldCrop(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Crop(image.Width / 2, image.Height / 2)); + image.DebugSave(provider, null, Extensions.Bmp); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs new file mode 100644 index 0000000000..910925e8f3 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs @@ -0,0 +1,33 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using ImageSharp.PixelFormats; + + using Xunit; + + public class EntropyCropTest : FileTestBase + { + public static readonly TheoryData EntropyCropValues + = new TheoryData + { + .25F, + .75F + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(EntropyCropValues), DefaultPixelType)] + public void ImageShouldEntropyCrop(TestImageProvider provider, float value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.EntropyCrop(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs new file mode 100644 index 0000000000..1ffccb80a4 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + + using Xunit; + + public class FlipTests : FileTestBase + { + public static readonly string[] FlipFiles = { TestImages.Bmp.F }; + + public static readonly TheoryData FlipValues + = new TheoryData + { + { FlipType.None }, + { FlipType.Vertical }, + { FlipType.Horizontal }, + }; + + [Theory] + [WithFileCollection(nameof(FlipFiles), nameof(FlipValues), DefaultPixelType)] + public void ImageShouldFlip(TestImageProvider provider, FlipType flipType) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Flip(flipType)); + image.DebugSave(provider, flipType, Extensions.Bmp); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs new file mode 100644 index 0000000000..9a09645385 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using ImageSharp.PixelFormats; + + using Xunit; + + public class PadTest : FileTestBase + { + [Theory] + [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] + public void ImageShouldPad(TestImageProvider provider) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Pad(image.Width + 50, image.Height + 50)); + image.DebugSave(provider, null, Extensions.Bmp); + + // Check pixels are empty + for (int y = 0; y < 25; y++) + { + for (int x = 0; x < 25; x++) + { + Assert.Equal(default(TPixel), image[x, y]); + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ResizeProfilingBenchmarks.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs similarity index 97% rename from tests/ImageSharp.Tests/Processing/Transforms/ResizeProfilingBenchmarks.cs rename to tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs index 7b83f0a8e2..4e6fd024e7 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ResizeProfilingBenchmarks.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Tests.Processing.Transforms +namespace ImageSharp.Tests.Processing.Processors.Transforms { using System; using System.IO; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs new file mode 100644 index 0000000000..813767edcb --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -0,0 +1,273 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using SixLabors.Primitives; + using Xunit; + + public class ResizeTests : FileTestBase + { + public static readonly string[] ResizeFiles = { TestImages.Jpeg.Baseline.Calliphora }; + + public static readonly TheoryData ReSamplers = + new TheoryData + { + { "Bicubic", new BicubicResampler() }, + { "Triangle", new TriangleResampler() }, + { "NearestNeighbor", new NearestNeighborResampler() }, + { "Box", new BoxResampler() }, + { "Lanczos3", new Lanczos3Resampler() }, + { "Lanczos5", new Lanczos5Resampler() }, + { "MitchellNetravali", new MitchellNetravaliResampler() }, + { "Lanczos8", new Lanczos8Resampler() }, + { "Hermite", new HermiteResampler() }, + { "Spline", new SplineResampler() }, + { "Robidoux", new RobidouxResampler() }, + { "RobidouxSharp", new RobidouxSharpResampler() }, + { "Welch", new WelchResampler() } + }; + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResize(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2, sampler, true)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeFromSourceRectangle(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + var sourceRectangle = new Rectangle(image.Width / 8, image.Height / 8, image.Width / 4, image.Height / 4); + var destRectangle = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); + + image.Mutate(x => x.Resize(image.Width, image.Height, sampler, sourceRectangle, destRectangle, false)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeWidthAndKeepAspect(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Resize(image.Width / 3, 0, sampler, false)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeHeightAndKeepAspect(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Resize(0, image.Height / 3, sampler, false)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeWithCropWidthMode(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + var options = new ResizeOptions + { + Sampler = sampler, + Size = new Size(image.Width / 2, image.Height) + }; + + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeWithCropHeightMode(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + var options = new ResizeOptions + { + Sampler = sampler, + Size = new Size(image.Width, image.Height / 2) + }; + + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeWithPadMode(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + var options = new ResizeOptions + { + Sampler = sampler, + Size = new Size(image.Width + 200, image.Height), + Mode = ResizeMode.Pad + }; + + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeWithBoxPadMode(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + var options = new ResizeOptions + { + Sampler = sampler, + Size = new Size(image.Width + 200, image.Height + 200), + Mode = ResizeMode.BoxPad + }; + + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeWithMaxMode(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + var options = new ResizeOptions + { + Sampler = sampler, + Size = new Size(300, 300), + Mode = ResizeMode.Max + }; + + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeWithMinMode(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + var options = new ResizeOptions + { + Sampler = sampler, + Size = new Size((int)MathF.Round(image.Width * .75F), (int)MathF.Round(image.Height * .95F)), + Mode = ResizeMode.Min + }; + + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] + public void ImageShouldResizeWithStretchMode(TestImageProvider provider, string name, IResampler sampler) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + var options = new ResizeOptions + { + Sampler = sampler, + Size = new Size(image.Width / 2, image.Height), + Mode = ResizeMode.Stretch + }; + + image.Mutate(x => x.Resize(options)); + image.DebugSave(provider, name, Extensions.Bmp); + } + } + + [Theory] + [InlineData(-2, 0)] + [InlineData(-1, 0)] + [InlineData(0, 1)] + [InlineData(1, 0)] + [InlineData(2, 0)] + public static void BicubicWindowOscillatesCorrectly(float x, float expected) + { + var sampler = new BicubicResampler(); + float result = sampler.GetValue(x); + + Assert.Equal(result, expected); + } + + [Theory] + [InlineData(-2, 0)] + [InlineData(-1, 0)] + [InlineData(0, 1)] + [InlineData(1, 0)] + [InlineData(2, 0)] + public static void TriangleWindowOscillatesCorrectly(float x, float expected) + { + var sampler = new TriangleResampler(); + float result = sampler.GetValue(x); + + Assert.Equal(result, expected); + } + + [Theory] + [InlineData(-2, 0)] + [InlineData(-1, 0)] + [InlineData(0, 1)] + [InlineData(1, 0)] + [InlineData(2, 0)] + public static void Lanczos3WindowOscillatesCorrectly(float x, float expected) + { + var sampler = new Lanczos3Resampler(); + float result = sampler.GetValue(x); + + Assert.Equal(result, expected); + } + + [Theory] + [InlineData(-4, 0)] + [InlineData(-2, 0)] + [InlineData(0, 1)] + [InlineData(2, 0)] + [InlineData(4, 0)] + public static void Lanczos5WindowOscillatesCorrectly(float x, float expected) + { + var sampler = new Lanczos5Resampler(); + float result = sampler.GetValue(x); + + Assert.Equal(result, expected); + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs new file mode 100644 index 0000000000..b0cafd114e --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs @@ -0,0 +1,39 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + + using Xunit; + + public class RotateFlipTests : FileTestBase + { + public static readonly string[] FlipFiles = { TestImages.Bmp.F }; + + public static readonly TheoryData RotateFlipValues + = new TheoryData + { + { RotateType.None, FlipType.Vertical }, + { RotateType.None, FlipType.Horizontal }, + { RotateType.Rotate90, FlipType.None }, + { RotateType.Rotate180, FlipType.None }, + { RotateType.Rotate270, FlipType.None }, + }; + + [Theory] + [WithFileCollection(nameof(FlipFiles), nameof(RotateFlipValues), DefaultPixelType)] + public void ImageShouldRotateFlip(TestImageProvider provider, RotateType rotateType, FlipType flipType) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.RotateFlip(rotateType, flipType)); + image.DebugSave(provider, string.Join("_", rotateType, flipType), Extensions.Bmp); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs new file mode 100644 index 0000000000..74afd02404 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + + using Xunit; + + public class RotateTests : FileTestBase + { + public static readonly TheoryData RotateFloatValues + = new TheoryData + { + 170, + -170 + }; + + public static readonly TheoryData RotateEnumValues + = new TheoryData + { + RotateType.None, + RotateType.Rotate90, + RotateType.Rotate180, + RotateType.Rotate270 + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(RotateFloatValues), DefaultPixelType)] + public void ImageShouldRotate(TestImageProvider provider, float value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Rotate(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(RotateEnumValues), DefaultPixelType)] + public void ImageShouldRotateEnum(TestImageProvider provider, RotateType value) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(x => x.Rotate(value)); + image.DebugSave(provider, value, Extensions.Bmp); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs new file mode 100644 index 0000000000..64f4d4905e --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs @@ -0,0 +1,33 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Processors.Transforms +{ + using ImageSharp.PixelFormats; + + using Xunit; + + public class SkewTest : FileTestBase + { + public static readonly TheoryData SkewValues + = new TheoryData + { + { 20, 10 }, + { -20, -10 } + }; + + [Theory] + [WithFileCollection(nameof(DefaultFiles), nameof(SkewValues), DefaultPixelType)] + public void ImageShouldSkew(TestImageProvider provider, float x, float y) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Mutate(i => i.Skew(x, y)); + image.DebugSave(provider, string.Join("_", x, y), Extensions.Bmp); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs index 3799054beb..c26c957a0a 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs @@ -8,77 +8,16 @@ namespace ImageSharp.Tests.Processing.Transforms using System; using ImageSharp.PixelFormats; using ImageSharp.Processing; - + using ImageSharp.Processing.Processors; using Xunit; - public class AutoOrientTests : FileTestBase + public class AutoOrientTests : BaseImageOperationsExtensionTest { - public static readonly string[] FlipFiles = { TestImages.Bmp.F }; - - public static readonly TheoryData OrientationValues - = new TheoryData - { - { RotateType.None, FlipType.None, 0 }, - { RotateType.None, FlipType.None, 1 }, - { RotateType.None, FlipType.Horizontal, 2 }, - { RotateType.Rotate180, FlipType.None, 3 }, - { RotateType.Rotate180, FlipType.Horizontal, 4 }, - { RotateType.Rotate90, FlipType.Horizontal, 5 }, - { RotateType.Rotate270, FlipType.None, 6 }, - { RotateType.Rotate90, FlipType.Vertical, 7 }, - { RotateType.Rotate90, FlipType.None, 8 }, - }; - - public static readonly TheoryData InvalidOrientationValues - = new TheoryData + [Fact] + public void AutoOrient_AutoRotateProcessor() { - { ExifDataType.Byte, new byte[] { 1 } }, - { ExifDataType.SignedByte, new byte[] { 2 } }, - { ExifDataType.SignedShort, BitConverter.GetBytes((short) 3) }, - { ExifDataType.Long, BitConverter.GetBytes((uint) 4) }, - { ExifDataType.SignedLong, BitConverter.GetBytes((int) 5) } - }; - - [Theory] - [WithFileCollection(nameof(FlipFiles), nameof(OrientationValues), DefaultPixelType)] - public void ImageShouldAutoRotate(TestImageProvider provider, RotateType rotateType, FlipType flipType, ushort orientation) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.MetaData.ExifProfile = new ExifProfile(); - image.MetaData.ExifProfile.SetValue(ExifTag.Orientation, orientation); - - image.Mutate(x => x.RotateFlip(rotateType, flipType)); - image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "1_before"), Extensions.Bmp); - - image.Mutate(x => x.AutoOrient()); - image.DebugSave(provider, string.Join("_", rotateType, flipType, orientation, "2_after"), Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(FlipFiles), nameof(InvalidOrientationValues), DefaultPixelType)] - public void ImageShouldAutoRotateInvalidValues(TestImageProvider provider, ExifDataType dataType, byte[] orientation) - where TPixel : struct, IPixel - { - var profile = new ExifProfile(); - profile.SetValue(ExifTag.JPEGTables, orientation); - - byte[] bytes = profile.ToByteArray(); - // Change the tag into ExifTag.Orientation - bytes[16] = 18; - bytes[17] = 1; - // Change the data type - bytes[18] = (byte)dataType; - // Change the number of components - bytes[20] = 1; - - using (Image image = provider.GetImage()) - { - image.MetaData.ExifProfile = new ExifProfile(bytes); - image.Mutate(x=>x.AutoOrient()); - } + this.operations.AutoOrient(); + this.Verify>(); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs index b95c9d82ae..33f3ffb935 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs @@ -5,22 +5,35 @@ namespace ImageSharp.Tests.Processing.Transforms { + using System; using ImageSharp.PixelFormats; - + using ImageSharp.Processing.Processors; + using SixLabors.Primitives; using Xunit; - public class CropTest : FileTestBase + public class CropTest : BaseImageOperationsExtensionTest { [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldCrop(TestImageProvider provider) - where TPixel : struct, IPixel + [InlineData(10, 10)] + [InlineData(12, 123)] + public void Crop_Width_height_CropProcessorWithRectangleSet(int width, int height) { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Crop(image.Width / 2, image.Height / 2)); - image.DebugSave(provider, null, Extensions.Bmp); - } + this.operations.Crop(width, height); + var processor = this.Verify>(); + + Assert.Equal(new Rectangle(0, 0, width, height), processor.CropRectangle); + } + + [Theory] + [InlineData(10, 10, 2, 6)] + [InlineData(12, 123, 6, 2)] + public void Crop_Rectangle_CropProcessorWithRectangleSet(int x, int y, int width, int height) + { + var rect = new Rectangle(x, y, width, height); + this.operations.Crop(rect); + var processor = this.Verify>(); + + Assert.Equal(rect, 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 1c97c70ad0..11a7dc2505 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs @@ -5,29 +5,23 @@ namespace ImageSharp.Tests.Processing.Transforms { + using System; using ImageSharp.PixelFormats; - + using ImageSharp.Processing.Processors; using Xunit; - public class EntropyCropTest : FileTestBase + public class EntropyCropTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData EntropyCropValues - = new TheoryData - { - .25F, - .75F - }; [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(EntropyCropValues), DefaultPixelType)] - public void ImageShouldEntropyCrop(TestImageProvider provider, float value) - where TPixel : struct, IPixel + [InlineData(0.5f)] + [InlineData(.2f)] + public void EntropyCrop_threasholdFloat_EntropyCropProcessorWithThreshold(float threashold) { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.EntropyCrop(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + this.operations.EntropyCrop(threashold); + var processor = this.Verify>(); + + Assert.Equal(threashold, 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 8e048ae04e..5234baed72 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs @@ -5,33 +5,25 @@ namespace ImageSharp.Tests.Processing.Transforms { + using System; using ImageSharp.PixelFormats; using ImageSharp.Processing; - + using ImageSharp.Processing.Processors; using Xunit; - public class FlipTests : FileTestBase + public class FlipTests : BaseImageOperationsExtensionTest { - public static readonly string[] FlipFiles = { TestImages.Bmp.F }; - - public static readonly TheoryData FlipValues - = new TheoryData - { - { FlipType.None }, - { FlipType.Vertical }, - { FlipType.Horizontal }, - }; [Theory] - [WithFileCollection(nameof(FlipFiles), nameof(FlipValues), DefaultPixelType)] - public void ImageShouldFlip(TestImageProvider provider, FlipType flipType) - where TPixel : struct, IPixel + [InlineData(FlipType.None)] + [InlineData(FlipType.Horizontal)] + [InlineData(FlipType.Vertical)] + public void Flip_degreesFloat_RotateProcessorWithAnglesSetAndExpandTrue(FlipType flip) { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Flip(flipType)); - image.DebugSave(provider, flipType, Extensions.Bmp); - } + this.operations.Flip(flip); + var flipProcessor = this.Verify>(); + + Assert.Equal(flip, flipProcessor.FlipType); } } -} \ No newline at end of file +} diff --git a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs index 7471330bea..8b8d51f9fa 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs @@ -5,31 +5,17 @@ namespace ImageSharp.Tests.Processing.Transforms { + using System; using ImageSharp.PixelFormats; using Xunit; - public class PadTest : FileTestBase + public class PadTest : BaseImageOperationsExtensionTest { - [Theory] - [WithFileCollection(nameof(DefaultFiles), DefaultPixelType)] - public void ImageShouldPad(TestImageProvider provider) - where TPixel : struct, IPixel + [Fact(Skip = "Skip this is a helper around resize, skip until resize can be refactord")] + public void Pad_width_height_ResizeProcessorWithCorrectOPtionsSet() { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Pad(image.Width + 50, image.Height + 50)); - image.DebugSave(provider, null, Extensions.Bmp); - - // Check pixels are empty - for (int y = 0; y < 25; y++) - { - for (int x = 0; x < 25; x++) - { - Assert.Equal(default(TPixel), image[x, y]); - } - } - } + throw new NotImplementedException("Write test here"); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs index 0092ae9da6..ae35740a94 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs @@ -5,269 +5,19 @@ namespace ImageSharp.Tests.Processing.Transforms { + using System; using ImageSharp.PixelFormats; using ImageSharp.Processing; using SixLabors.Primitives; using Xunit; - public class ResizeTests : FileTestBase + public class ResizeTests : BaseImageOperationsExtensionTest { - public static readonly string[] ResizeFiles = { TestImages.Jpeg.Baseline.Calliphora }; - - public static readonly TheoryData ReSamplers = - new TheoryData - { - { "Bicubic", new BicubicResampler() }, - { "Triangle", new TriangleResampler() }, - { "NearestNeighbor", new NearestNeighborResampler() }, - { "Box", new BoxResampler() }, - { "Lanczos3", new Lanczos3Resampler() }, - { "Lanczos5", new Lanczos5Resampler() }, - { "MitchellNetravali", new MitchellNetravaliResampler() }, - { "Lanczos8", new Lanczos8Resampler() }, - { "Hermite", new HermiteResampler() }, - { "Spline", new SplineResampler() }, - { "Robidoux", new RobidouxResampler() }, - { "RobidouxSharp", new RobidouxSharpResampler() }, - { "Welch", new WelchResampler() } - }; - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResize(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Resize(image.Width / 2, image.Height / 2, sampler, true)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeFromSourceRectangle(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - var sourceRectangle = new Rectangle(image.Width / 8, image.Height / 8, image.Width / 4, image.Height / 4); - var destRectangle = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); - - image.Mutate(x => x.Resize(image.Width, image.Height, sampler, sourceRectangle, destRectangle, false)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeWidthAndKeepAspect(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Resize(image.Width / 3, 0, sampler, false)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeHeightAndKeepAspect(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Resize(0, image.Height / 3, sampler, false)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeWithCropWidthMode(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - var options = new ResizeOptions - { - Sampler = sampler, - Size = new Size(image.Width / 2, image.Height) - }; - - image.Mutate(x => x.Resize(options)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeWithCropHeightMode(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - var options = new ResizeOptions - { - Sampler = sampler, - Size = new Size(image.Width, image.Height / 2) - }; - - image.Mutate(x => x.Resize(options)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeWithPadMode(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - var options = new ResizeOptions - { - Sampler = sampler, - Size = new Size(image.Width + 200, image.Height), - Mode = ResizeMode.Pad - }; - - image.Mutate(x => x.Resize(options)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeWithBoxPadMode(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - var options = new ResizeOptions - { - Sampler = sampler, - Size = new Size(image.Width + 200, image.Height + 200), - Mode = ResizeMode.BoxPad - }; - - image.Mutate(x => x.Resize(options)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeWithMaxMode(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - var options = new ResizeOptions - { - Sampler = sampler, - Size = new Size(300, 300), - Mode = ResizeMode.Max - }; - - image.Mutate(x => x.Resize(options)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeWithMinMode(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - var options = new ResizeOptions - { - Sampler = sampler, - Size = new Size((int)MathF.Round(image.Width * .75F), (int)MathF.Round(image.Height * .95F)), - Mode = ResizeMode.Min - }; - - image.Mutate(x => x.Resize(options)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [WithFileCollection(nameof(ResizeFiles), nameof(ReSamplers), DefaultPixelType)] - public void ImageShouldResizeWithStretchMode(TestImageProvider provider, string name, IResampler sampler) - where TPixel : struct, IPixel - { - using (Image image = provider.GetImage()) - { - var options = new ResizeOptions - { - Sampler = sampler, - Size = new Size(image.Width / 2, image.Height), - Mode = ResizeMode.Stretch - }; - - image.Mutate(x => x.Resize(options)); - image.DebugSave(provider, name, Extensions.Bmp); - } - } - - [Theory] - [InlineData(-2, 0)] - [InlineData(-1, 0)] - [InlineData(0, 1)] - [InlineData(1, 0)] - [InlineData(2, 0)] - public static void BicubicWindowOscillatesCorrectly(float x, float expected) - { - var sampler = new BicubicResampler(); - float result = sampler.GetValue(x); - - Assert.Equal(result, expected); - } - - [Theory] - [InlineData(-2, 0)] - [InlineData(-1, 0)] - [InlineData(0, 1)] - [InlineData(1, 0)] - [InlineData(2, 0)] - public static void TriangleWindowOscillatesCorrectly(float x, float expected) - { - var sampler = new TriangleResampler(); - float result = sampler.GetValue(x); - - Assert.Equal(result, expected); - } - - [Theory] - [InlineData(-2, 0)] - [InlineData(-1, 0)] - [InlineData(0, 1)] - [InlineData(1, 0)] - [InlineData(2, 0)] - public static void Lanczos3WindowOscillatesCorrectly(float x, float expected) + [Fact(Skip = "Skip resize tests as they need refactoring to be simpler and just pass data into the resize processor.")] + public void TestMissing() { - var sampler = new Lanczos3Resampler(); - float result = sampler.GetValue(x); - - Assert.Equal(result, expected); - } - - [Theory] - [InlineData(-4, 0)] - [InlineData(-2, 0)] - [InlineData(0, 1)] - [InlineData(2, 0)] - [InlineData(4, 0)] - public static void Lanczos5WindowOscillatesCorrectly(float x, float expected) - { - var sampler = new Lanczos5Resampler(); - float result = sampler.GetValue(x); - - Assert.Equal(result, expected); + // + throw new NotImplementedException("Write test here"); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs index 432b2549bb..91505afa04 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs @@ -5,35 +5,37 @@ namespace ImageSharp.Tests.Processing.Transforms { + using System; using ImageSharp.PixelFormats; using ImageSharp.Processing; - + using ImageSharp.Processing.Processors; using Xunit; - public class RotateFlipTests : FileTestBase + public class RotateFlipTests : BaseImageOperationsExtensionTest { - public static readonly string[] FlipFiles = { TestImages.Bmp.F }; - - public static readonly TheoryData RotateFlipValues - = new TheoryData - { - { RotateType.None, FlipType.Vertical }, - { RotateType.None, FlipType.Horizontal }, - { RotateType.Rotate90, FlipType.None }, - { RotateType.Rotate180, FlipType.None }, - { RotateType.Rotate270, FlipType.None }, - }; [Theory] - [WithFileCollection(nameof(FlipFiles), nameof(RotateFlipValues), DefaultPixelType)] - public void ImageShouldRotateFlip(TestImageProvider provider, RotateType rotateType, FlipType flipType) - where TPixel : struct, IPixel + [InlineData(RotateType.None, FlipType.None, 0)] + [InlineData(RotateType.Rotate90, FlipType.None, 90)] + [InlineData(RotateType.Rotate180, FlipType.None, 180)] + [InlineData(RotateType.Rotate270, FlipType.None, 270)] + [InlineData(RotateType.None, FlipType.Horizontal, 0)] + [InlineData(RotateType.Rotate90, FlipType.Horizontal, 90)] + [InlineData(RotateType.Rotate180, FlipType.Horizontal, 180)] + [InlineData(RotateType.Rotate270, FlipType.Horizontal, 270)] + [InlineData(RotateType.None, FlipType.Vertical, 0)] + [InlineData(RotateType.Rotate90, FlipType.Vertical, 90)] + [InlineData(RotateType.Rotate180, FlipType.Vertical, 180)] + [InlineData(RotateType.Rotate270, FlipType.Vertical, 270)] + public void Rotate_degreesFloat_RotateProcessorWithAnglesSetAndExpandTrue(RotateType angle, FlipType flip, float expectedAngle) { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.RotateFlip(rotateType, flipType)); - image.DebugSave(provider, string.Join("_", rotateType, flipType), Extensions.Bmp); - } + this.operations.RotateFlip(angle, flip); + var rotateProcessor = this.Verify>(0); + var flipProcessor = this.Verify>(1); + + Assert.Equal(expectedAngle, rotateProcessor.Angle); + Assert.False(rotateProcessor.Expand); + Assert.Equal(flip, flipProcessor.FlipType); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs index 2db86390de..da2a34d0e2 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs @@ -7,49 +7,51 @@ namespace ImageSharp.Tests.Processing.Transforms { using ImageSharp.PixelFormats; using ImageSharp.Processing; - + using ImageSharp.Processing.Processors; using Xunit; - public class RotateTests : FileTestBase + public class RotateTests : BaseImageOperationsExtensionTest { - public static readonly TheoryData RotateFloatValues - = new TheoryData - { - 170, - -170 - }; - public static readonly TheoryData RotateEnumValues - = new TheoryData + [Theory] + [InlineData(85.6f)] + [InlineData(21)] + public void Rotate_degreesFloat_RotateProcessorWithAnglesSetAndExpandTrue(float angle) { - RotateType.None, - RotateType.Rotate90, - RotateType.Rotate180, - RotateType.Rotate270 - }; + this.operations.Rotate(angle); + var processor = this.Verify>(); + + Assert.Equal(angle, processor.Angle); + Assert.True(processor.Expand); + } + [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(RotateFloatValues), DefaultPixelType)] - public void ImageShouldRotate(TestImageProvider provider, float value) - where TPixel : struct, IPixel + [InlineData(RotateType.None, 0)] + [InlineData(RotateType.Rotate90, 90)] + [InlineData(RotateType.Rotate180, 180)] + [InlineData(RotateType.Rotate270, 270)] + public void Rotate_RotateType_RotateProcessorWithAnglesConvertedFromEnumAndExpandTrue(RotateType angle, float expectedangle) { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Rotate(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + this.operations.Rotate(angle); // is this api needed ??? + var processor = this.Verify>(); + + Assert.Equal(expectedangle, processor.Angle); + Assert.False(processor.Expand); } + [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(RotateEnumValues), DefaultPixelType)] - public void ImageShouldRotateEnum(TestImageProvider provider, RotateType value) - where TPixel : struct, IPixel + [InlineData(85.6f, false)] + [InlineData(21, true)] + [InlineData(21, false)] + public void Rotate_degreesFloat_expand_RotateProcessorWithAnglesSetAndExpandSet(float angle, bool expand) { - using (Image image = provider.GetImage()) - { - image.Mutate(x => x.Rotate(value)); - image.DebugSave(provider, value, Extensions.Bmp); - } + this.operations.Rotate(angle, expand); + var processor = this.Verify>(); + + Assert.Equal(angle, processor.Angle); + Assert.Equal(expand, processor.Expand); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs index 63924c535f..6e7b2d8e8a 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs @@ -6,28 +6,31 @@ namespace ImageSharp.Tests.Processing.Transforms { using ImageSharp.PixelFormats; - + using ImageSharp.Processing.Processors; using Xunit; - public class SkewTest : FileTestBase + public class SkewTest : BaseImageOperationsExtensionTest { - public static readonly TheoryData SkewValues - = new TheoryData + [Fact] + public void Skew_x_y_CreateSkewProcessorWithAnglesSetAndExpandTrue() { - { 20, 10 }, - { -20, -10 } - }; + this.operations.Skew(10, 20); + var processor = this.Verify>(); + + Assert.Equal(10, processor.AngleX); + Assert.Equal(20, processor.AngleY); + Assert.True(processor.Expand); + } - [Theory] - [WithFileCollection(nameof(DefaultFiles), nameof(SkewValues), DefaultPixelType)] - public void ImageShouldSkew(TestImageProvider provider, float x, float y) - where TPixel : struct, IPixel + [Fact] + public void Skew_x_y_expand_CreateSkewProcessorWithAnglesSetAndExpandTrue() { - using (Image image = provider.GetImage()) - { - image.Mutate(i => i.Skew(x, y)); - image.DebugSave(provider, string.Join("_", x, y), Extensions.Bmp); - } + this.operations.Skew(10, 20, false); + var processor = this.Verify>(); + + Assert.Equal(10, processor.AngleX); + Assert.Equal(20, processor.AngleY); + Assert.False(processor.Expand); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/TestFile.cs b/tests/ImageSharp.Tests/TestFile.cs index c0f9deebb3..f634eb3f4e 100644 --- a/tests/ImageSharp.Tests/TestFile.cs +++ b/tests/ImageSharp.Tests/TestFile.cs @@ -29,10 +29,13 @@ public class TestFile /// private static readonly string FormatsDirectory = GetFormatsDirectory(); + private Image _image; + private byte[] _bytes; + /// /// The image. /// - private readonly Image image; + private Image image => this._image ?? (this._image = Image.Load(this.Bytes)); /// /// The file. @@ -46,15 +49,12 @@ public class TestFile private TestFile(string file) { this.file = file; - - this.Bytes = File.ReadAllBytes(file); - this.image = Image.Load(this.Bytes); } /// /// Gets the bytes. /// - public byte[] Bytes { get; } + public byte[] Bytes => this._bytes ?? (this._bytes = File.ReadAllBytes(this.file)); /// /// The file name. diff --git a/tests/ImageSharp.Tests/TestUtilities/TestType.cs b/tests/ImageSharp.Tests/TestUtilities/TestType.cs new file mode 100644 index 0000000000..adba1f971f --- /dev/null +++ b/tests/ImageSharp.Tests/TestUtilities/TestType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Text; +using ImageSharp.PixelFormats; +using Xunit.Abstractions; + +namespace ImageSharp.Tests.TestUtilities +{ + public class TestType : IXunitSerializable + { + public TestType() + { + } + + public void Deserialize(IXunitSerializationInfo info) + { + } + + public void Serialize(IXunitSerializationInfo info) + { + } + + public override string ToString() + { + return $"Type<{typeof(T).Name}>"; + } + } +} From 04b6ad824c657abe8a59babc3466f30516894a81 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Tue, 11 Jul 2017 22:18:23 +0100 Subject: [PATCH 09/33] fix warnings --- samples/AvatarWithRoundedCorner/Program.cs | 1 - src/ImageSharp/Processing/Binarization/Dither.cs | 3 +-- src/ImageSharp/Processing/Convolution/BoxBlur.cs | 1 - src/ImageSharp/Processing/Convolution/DetectEdges.cs | 1 - src/ImageSharp/Processing/Convolution/GaussianBlur.cs | 2 +- src/ImageSharp/Processing/Convolution/GaussianSharpen.cs | 1 - src/ImageSharp/Processing/Delegate.cs | 1 - src/ImageSharp/Processing/Effects/Pixelate.cs | 1 - .../General/PixelConversion_ConvertFromRgba32.cs | 2 +- .../General/PixelConversion_ConvertFromVector4.cs | 2 +- .../General/PixelConversion_ConvertToRgba32.cs | 2 +- 11 files changed, 5 insertions(+), 12 deletions(-) diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index d519fc1edb..0cd484737d 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -68,7 +68,6 @@ public static IPathCollection BuildCorners(int imageWidth, int imageHeight, floa // corner is now a corner shape positions top left //lets make 3 more positioned correctly, we cando that by translating the orgional artound the center of the image var center = new Vector2(imageWidth / 2, imageHeight / 2); - var angle = Math.PI / 2f; float rightPos = imageWidth - cornerToptLeft.Bounds.Width + 1; float bottomPos = imageHeight - cornerToptLeft.Bounds.Height + 1; diff --git a/src/ImageSharp/Processing/Binarization/Dither.cs b/src/ImageSharp/Processing/Binarization/Dither.cs index ce5e8c205c..fc5193c33f 100644 --- a/src/ImageSharp/Processing/Binarization/Dither.cs +++ b/src/ImageSharp/Processing/Binarization/Dither.cs @@ -23,7 +23,6 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The ordered ditherer. - /// The component index to test the threshold against. Must range from 0 to 3. /// The . public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither) where TPixel : struct, IPixel @@ -31,6 +30,7 @@ public static IImageOperations Dither(this IImageOperations(dither, 0)); return source; } + /// /// Dithers the image reducing it to two colors using ordered dithering. /// @@ -55,7 +55,6 @@ public static IImageOperations Dither(this IImageOperations /// The structure that specifies the portion of the image object to alter. /// - /// The component index to test the threshold against. Must range from 0 to 3. /// The . public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, Rectangle rectangle) where TPixel : struct, IPixel diff --git a/src/ImageSharp/Processing/Convolution/BoxBlur.cs b/src/ImageSharp/Processing/Convolution/BoxBlur.cs index 1a89ac1a0e..cc0931215c 100644 --- a/src/ImageSharp/Processing/Convolution/BoxBlur.cs +++ b/src/ImageSharp/Processing/Convolution/BoxBlur.cs @@ -22,7 +22,6 @@ public static partial class ImageExtensions /// /// The pixel format. /// The image this method extends. - /// The 'radius' value representing the size of the area to sample. /// The . public static IImageOperations BoxBlur(this IImageOperations source) where TPixel : struct, IPixel diff --git a/src/ImageSharp/Processing/Convolution/DetectEdges.cs b/src/ImageSharp/Processing/Convolution/DetectEdges.cs index b4382f902b..18006752f9 100644 --- a/src/ImageSharp/Processing/Convolution/DetectEdges.cs +++ b/src/ImageSharp/Processing/Convolution/DetectEdges.cs @@ -53,7 +53,6 @@ public static IImageOperations DetectEdges(this IImageOperations /// The pixel format. /// The image this method extends. /// The filter for detecting edges. - /// Whether to convert the image to Grayscale first. Defaults to true. /// The . public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter) where TPixel : struct, IPixel diff --git a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs index 91f5635050..953a576fc6 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs @@ -23,11 +23,11 @@ public static partial class ImageExtensions /// /// The pixel format. /// The image this method extends. - /// The 'sigma' value representing the weight of the blur. /// The . public static IImageOperations GaussianBlur(this IImageOperations source) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianBlurProcessor(3f)); + /// /// Applies a Gaussian blur to the image. /// diff --git a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs index 1fd003d128..1d0cce2229 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs @@ -23,7 +23,6 @@ public static partial class ImageExtensions /// /// The pixel format. /// The image this method extends. - /// The 'sigma' value representing the weight of the blur. /// The . public static IImageOperations GaussianSharpen(this IImageOperations source) where TPixel : struct, IPixel diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs index a6efb711bf..52ec736f5d 100644 --- a/src/ImageSharp/Processing/Delegate.cs +++ b/src/ImageSharp/Processing/Delegate.cs @@ -26,6 +26,5 @@ public static partial class ImageExtensions public static IImageOperations Run(this IImageOperations source, Action> operation) where TPixel : struct, IPixel => source.ApplyProcessor(new DelegateProcessor(operation)); - } } diff --git a/src/ImageSharp/Processing/Effects/Pixelate.cs b/src/ImageSharp/Processing/Effects/Pixelate.cs index 8447f5ba17..b9403b765c 100644 --- a/src/ImageSharp/Processing/Effects/Pixelate.cs +++ b/src/ImageSharp/Processing/Effects/Pixelate.cs @@ -22,7 +22,6 @@ public static partial class ImageExtensions /// /// The pixel format. /// The image this method extends. - /// The size of the pixels. /// The . public static IImageOperations Pixelate(this IImageOperations source) where TPixel : struct, IPixel diff --git a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromRgba32.cs b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromRgba32.cs index e096fd828c..0f025c9a40 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromRgba32.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromRgba32.cs @@ -142,7 +142,7 @@ public void RunFromBytesConversion() [Params(32)] public int Count { get; set; } - [Setup] + [GlobalSetup] public void Setup() { this.compatibleMemLayoutRunner = new ConversionRunner(this.Count); diff --git a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromVector4.cs b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromVector4.cs index 721ac121a3..357ac307e4 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromVector4.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromVector4.cs @@ -108,7 +108,7 @@ public void RunByValConversion() [Params(32)] public int Count { get; set; } - [Setup] + [GlobalSetup] public void Setup() { this.nonVectorRunner = new ConversionRunner(this.Count); diff --git a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertToRgba32.cs b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertToRgba32.cs index 0c9a8af3fd..88f607789f 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertToRgba32.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertToRgba32.cs @@ -111,7 +111,7 @@ public void RunCopyToConversion() [Params(128)] public int Count { get; set; } - [Setup] + [GlobalSetup] public void Setup() { this.compatibleMemoryLayoutRunner = new ConversionRunner(this.Count); From c12f99354df137bb59920e7d3169c53b679b08bc Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Tue, 11 Jul 2017 22:25:54 +0100 Subject: [PATCH 10/33] fix sandbox test --- tests/ImageSharp.Sandbox46/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ImageSharp.Sandbox46/Program.cs b/tests/ImageSharp.Sandbox46/Program.cs index 6f93df16e5..b536af71fa 100644 --- a/tests/ImageSharp.Sandbox46/Program.cs +++ b/tests/ImageSharp.Sandbox46/Program.cs @@ -11,6 +11,7 @@ namespace ImageSharp.Sandbox46 using ImageSharp.Tests; using ImageSharp.Tests.Colors; using ImageSharp.Tests.PixelFormats; + using ImageSharp.Tests.Processing.Processors.Transforms; using ImageSharp.Tests.Processing.Transforms; using Xunit.Abstractions; From 62705683f0b604d8f257a41832bfdec08e982490 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Wed, 12 Jul 2017 07:49:08 +0100 Subject: [PATCH 11/33] blank to force rebuild From ab30013d635d924ed874a1c9c7a7c9ca7a418d45 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Fri, 14 Jul 2017 21:42:32 +0100 Subject: [PATCH 12/33] Renameing classes + simplifying Image --- samples/AvatarWithRoundedCorner/Program.cs | 2 +- src/ImageSharp.Drawing/DrawImage.cs | 12 +- src/ImageSharp.Drawing/FillRegion.cs | 18 +- src/ImageSharp.Drawing/Paths/DrawBeziers.cs | 12 +- src/ImageSharp.Drawing/Paths/DrawLines.cs | 12 +- src/ImageSharp.Drawing/Paths/DrawPath.cs | 12 +- .../Paths/DrawPathCollection.cs | 12 +- src/ImageSharp.Drawing/Paths/DrawPolygon.cs | 12 +- src/ImageSharp.Drawing/Paths/DrawRectangle.cs | 12 +- .../Paths/FillPathBuilder.cs | 8 +- .../Paths/FillPathCollection.cs | 8 +- src/ImageSharp.Drawing/Paths/FillPaths.cs | 8 +- src/ImageSharp.Drawing/Paths/FillPolygon.cs | 8 +- src/ImageSharp.Drawing/Paths/FillRectangle.cs | 8 +- .../Processors/DrawImageProcessor.cs | 4 +- src/ImageSharp.Drawing/Text/DrawText.Path.cs | 16 +- src/ImageSharp.Drawing/Text/DrawText.cs | 16 +- src/ImageSharp/ApplyProcessors.cs | 32 +-- src/ImageSharp/Configuration.cs | 2 +- ...DefaultInternalImageProcessorApplicator.cs | 72 +++++++ ...cs => IImageProcessorApplicatorFactory.cs} | 11 +- ...s => IImageProcessorApplicator{TPixel}.cs} | 22 +- src/ImageSharp/Image/IImageBase.cs | 10 - src/ImageSharp/Image/ImageBase{TPixel}.cs | 30 +-- src/ImageSharp/Image/ImageExtensions.cs | 153 +++++++++++++ src/ImageSharp/Image/ImageFrame{TPixel}.cs | 44 ++-- .../Image/ImageProcessingExtensions.cs | 32 --- src/ImageSharp/Image/Image{TPixel}.cs | 204 ++++-------------- src/ImageSharp/ImageOperations.cs | 62 ------ .../PackedPixelConverterHelper.cs | 9 +- .../Binarization/BinaryThreshold.cs | 4 +- .../Processing/Binarization/Dither.cs | 12 +- .../Processing/ColorMatrix/BlackWhite.cs | 4 +- .../Processing/ColorMatrix/ColorBlindness.cs | 4 +- .../Processing/ColorMatrix/Grayscale.cs | 8 +- src/ImageSharp/Processing/ColorMatrix/Hue.cs | 4 +- .../Processing/ColorMatrix/Kodachrome.cs | 4 +- .../Processing/ColorMatrix/Lomograph.cs | 8 +- .../Processing/ColorMatrix/Polaroid.cs | 8 +- .../Processing/ColorMatrix/Saturation.cs | 4 +- .../Processing/ColorMatrix/Sepia.cs | 4 +- .../Processing/Convolution/BoxBlur.cs | 6 +- .../Processing/Convolution/DetectEdges.cs | 14 +- .../Processing/Convolution/GaussianBlur.cs | 6 +- .../Processing/Convolution/GaussianSharpen.cs | 6 +- src/ImageSharp/Processing/Delegate.cs | 2 +- src/ImageSharp/Processing/Effects/Alpha.cs | 4 +- .../Processing/Effects/BackgroundColor.cs | 8 +- .../Processing/Effects/Brightness.cs | 6 +- src/ImageSharp/Processing/Effects/Contrast.cs | 4 +- src/ImageSharp/Processing/Effects/Invert.cs | 4 +- .../Processing/Effects/OilPainting.cs | 8 +- src/ImageSharp/Processing/Effects/Pixelate.cs | 6 +- src/ImageSharp/Processing/Overlays/Glow.cs | 24 +-- .../Processing/Overlays/Vignette.cs | 24 +-- .../Convolution/Convolution2PassProcessor.cs | 2 +- .../EdgeDetectorCompassProcessor.cs | 4 +- .../Processors/Overlays/GlowProcessor.cs | 2 +- .../Processors/Overlays/VignetteProcessor.cs | 4 +- .../Transforms/EntropyCropProcessor.cs | 2 +- .../Processors/Transforms/RotateProcessor.cs | 3 +- .../Processors/Transforms/SkewProcessor.cs | 3 +- .../Processing/Transforms/AutoOrient.cs | 2 +- src/ImageSharp/Processing/Transforms/Crop.cs | 4 +- .../Processing/Transforms/EntropyCrop.cs | 2 +- src/ImageSharp/Processing/Transforms/Flip.cs | 2 +- src/ImageSharp/Processing/Transforms/Pad.cs | 2 +- .../Processing/Transforms/Resize.cs | 18 +- .../Processing/Transforms/Rotate.cs | 6 +- .../Processing/Transforms/RotateFlip.cs | 2 +- src/ImageSharp/Processing/Transforms/Skew.cs | 4 +- src/ImageSharp/Quantizers/Quantize.cs | 4 +- .../Quantizers/Quantizer{TPixel}.cs | 2 +- tests/ImageSharp.Benchmarks/Samplers/Glow.cs | 4 +- .../BaseImageOperationsExtensionTest.cs | 3 +- .../FakeImageOperationsProvider.cs | 30 ++- .../Formats/GeneralFormatTests.cs | 6 +- tests/ImageSharp.Tests/ImageOperationTests.cs | 4 +- .../Binarization/BinaryThresholdTest.cs | 2 +- .../Processors/Binarization/DitherTest.cs | 4 +- .../Processors/ColorMatrix/BlackWhiteTest.cs | 2 +- .../ColorMatrix/ColorBlindnessTest.cs | 2 +- .../Processors/ColorMatrix/GrayscaleTest.cs | 2 +- .../Processors/ColorMatrix/HueTest.cs | 2 +- .../Processors/ColorMatrix/KodachromeTest.cs | 2 +- .../Processors/ColorMatrix/LomographTest.cs | 2 +- .../Processors/ColorMatrix/PolaroidTest.cs | 2 +- .../Processors/ColorMatrix/SaturationTest.cs | 2 +- .../Processors/ColorMatrix/SepiaTest.cs | 2 +- .../Processors/Convolution/BoxBlurTest.cs | 2 +- .../Processors/Convolution/DetectEdgesTest.cs | 2 +- .../Convolution/GaussianBlurTest.cs | 2 +- .../Convolution/GaussianSharpenTest.cs | 2 +- .../Processors/Effects/AlphaTest.cs | 2 +- .../Processors/Effects/BackgroundColorTest.cs | 2 +- .../Processors/Effects/BrightnessTest.cs | 2 +- .../Processors/Effects/ContrastTest.cs | 2 +- .../Processors/Effects/InvertTest.cs | 2 +- .../Processors/Effects/OilPaintTest.cs | 2 +- .../Processors/Effects/PixelateTest.cs | 2 +- .../Processors/Overlays/GlowTest.cs | 2 +- .../Processors/Overlays/VignetteTest.cs | 2 +- tests/ImageSharp.Tests/TestFile.cs | 2 +- .../TestUtilities/Factories/GenericFactory.cs | 2 +- .../TestUtilities/Factories/ImageFactory.cs | 2 +- .../ImageProviders/TestImageProvider.cs | 2 +- .../ImageProviders/TestPatternProvider.cs | 2 +- 107 files changed, 633 insertions(+), 591 deletions(-) create mode 100644 src/ImageSharp/DefaultInternalImageProcessorApplicator.cs rename src/ImageSharp/{IImageOperationsProvider.cs => IImageProcessorApplicatorFactory.cs} (61%) rename src/ImageSharp/{IImageOperations{TPixel}.cs => IImageProcessorApplicator{TPixel}.cs} (54%) create mode 100644 src/ImageSharp/Image/ImageExtensions.cs delete mode 100644 src/ImageSharp/Image/ImageProcessingExtensions.cs delete mode 100644 src/ImageSharp/ImageOperations.cs diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index 0cd484737d..f635ed203e 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -36,7 +36,7 @@ static void Main(string[] args) } // lets create our custom image mutating pipeline - private static IImageOperations ConvertToAvatar(this IImageOperations operations, Size size, float cornerRadius) + private static IImageProcessorApplicator ConvertToAvatar(this IImageProcessorApplicator operations, Size size, float cornerRadius) { return operations.Resize(new ImageSharp.Processing.ResizeOptions { diff --git a/src/ImageSharp.Drawing/DrawImage.cs b/src/ImageSharp.Drawing/DrawImage.cs index bd51e4ac0a..a7b1faa150 100644 --- a/src/ImageSharp.Drawing/DrawImage.cs +++ b/src/ImageSharp.Drawing/DrawImage.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The location to draw the blended image. /// The options. /// The . - public static IImageOperations DrawImage(this IImageOperations source, Image image, Size size, Point location, GraphicsOptions options) + public static IImageProcessorApplicator DrawImage(this IImageProcessorApplicator source, Image image, Size size, Point location, GraphicsOptions options) where TPixel : struct, IPixel { if (size == default(Size)) @@ -49,7 +49,7 @@ public static IImageOperations DrawImage(this IImageOperationsThe image to blend with the currently processing image. /// The opacity of the image image to blend. Must be between 0 and 1. /// The . - public static IImageOperations Blend(this IImageOperations source, Image image, float percent) + public static IImageProcessorApplicator Blend(this IImageProcessorApplicator source, Image image, float percent) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -66,7 +66,7 @@ public static IImageOperations Blend(this IImageOperationsThe blending mode. /// The opacity of the image image to blend. Must be between 0 and 1. /// The . - public static IImageOperations Blend(this IImageOperations source, Image image, PixelBlenderMode blender, float percent) + public static IImageProcessorApplicator Blend(this IImageProcessorApplicator source, Image image, PixelBlenderMode blender, float percent) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -83,7 +83,7 @@ public static IImageOperations Blend(this IImageOperationsThe image to blend with the currently processing image. /// The options, including the blending type and belnding amount. /// The . - public static IImageOperations Blend(this IImageOperations source, Image image, GraphicsOptions options) + public static IImageProcessorApplicator Blend(this IImageProcessorApplicator source, Image image, GraphicsOptions options) where TPixel : struct, IPixel { return DrawImage(source, image, default(Size), default(Point), options); @@ -99,7 +99,7 @@ public static IImageOperations Blend(this IImageOperationsThe size to draw the blended image. /// The location to draw the blended image. /// The . - public static IImageOperations DrawImage(this IImageOperations source, Image image, float percent, Size size, Point location) + public static IImageProcessorApplicator DrawImage(this IImageProcessorApplicator source, Image image, float percent, Size size, Point location) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -118,7 +118,7 @@ public static IImageOperations DrawImage(this IImageOperationsThe size to draw the blended image. /// The location to draw the blended image. /// The . - public static IImageOperations DrawImage(this IImageOperations source, Image image, PixelBlenderMode blender, float percent, Size size, Point location) + public static IImageProcessorApplicator DrawImage(this IImageProcessorApplicator source, Image image, PixelBlenderMode blender, float percent, Size size, Point location) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; diff --git a/src/ImageSharp.Drawing/FillRegion.cs b/src/ImageSharp.Drawing/FillRegion.cs index d8bb78e906..ff86c7240f 100644 --- a/src/ImageSharp.Drawing/FillRegion.cs +++ b/src/ImageSharp.Drawing/FillRegion.cs @@ -23,10 +23,10 @@ public static partial class ImageExtensions /// The details how to fill the region of interest. /// The graphics options. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, GraphicsOptions options) where TPixel : struct, IPixel { - return source.Apply(new FillProcessor(brush, options)); + return source.ApplyProcessor(new FillProcessor(brush, options)); } /// @@ -36,7 +36,7 @@ public static IImageOperations Fill(this IImageOperationsThe image this method extends. /// The details how to fill the region of interest. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush) where TPixel : struct, IPixel { return source.Fill(brush, GraphicsOptions.Default); @@ -49,7 +49,7 @@ public static IImageOperations Fill(this IImageOperationsThe image this method extends. /// The color. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color)); @@ -64,10 +64,10 @@ public static IImageOperations Fill(this IImageOperationsThe region. /// The graphics options. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, Region region, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, Region region, GraphicsOptions options) where TPixel : struct, IPixel { - return source.Apply(new FillRegionProcessor(brush, region, options)); + return source.ApplyProcessor(new FillRegionProcessor(brush, region, options)); } /// @@ -78,7 +78,7 @@ public static IImageOperations Fill(this IImageOperationsThe brush. /// The region. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, Region region) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, Region region) where TPixel : struct, IPixel { return source.Fill(brush, region, GraphicsOptions.Default); @@ -93,7 +93,7 @@ public static IImageOperations Fill(this IImageOperationsThe region. /// The options. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, Region region, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, Region region, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), region, options); @@ -107,7 +107,7 @@ public static IImageOperations Fill(this IImageOperationsThe color. /// The region. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, Region region) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, Region region) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), region); diff --git a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs index d332f1d05a..b83edb7a21 100644 --- a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs +++ b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static IImageOperations DrawBeziers(this IImageOperations source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points)), options); @@ -43,7 +43,7 @@ public static IImageOperations DrawBeziers(this IImageOperations /// The thickness. /// The points. /// The . - public static IImageOperations DrawBeziers(this IImageOperations source, IBrush brush, float thickness, PointF[] points) + public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points))); @@ -58,7 +58,7 @@ public static IImageOperations DrawBeziers(this IImageOperations /// The thickness. /// The points. /// The . - public static IImageOperations DrawBeziers(this IImageOperations source, TPixel color, float thickness, PointF[] points) + public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawBeziers(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static IImageOperations DrawBeziers(this IImageOperations /// The points. /// The options. /// The . - public static IImageOperations DrawBeziers(this IImageOperations source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawBeziers(new SolidBrush(color), thickness, points, options); @@ -89,7 +89,7 @@ public static IImageOperations DrawBeziers(this IImageOperations /// The points. /// The options. /// The . - public static IImageOperations DrawBeziers(this IImageOperations source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new CubicBezierLineSegment(points)), options); @@ -103,7 +103,7 @@ public static IImageOperations DrawBeziers(this IImageOperations /// The pen. /// The points. /// The . - public static IImageOperations DrawBeziers(this IImageOperations source, IPen pen, PointF[] points) + public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new CubicBezierLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/DrawLines.cs b/src/ImageSharp.Drawing/Paths/DrawLines.cs index db1e46af8a..553ec2ca5a 100644 --- a/src/ImageSharp.Drawing/Paths/DrawLines.cs +++ b/src/ImageSharp.Drawing/Paths/DrawLines.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static IImageOperations DrawLines(this IImageOperations source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points)), options); @@ -43,7 +43,7 @@ public static IImageOperations DrawLines(this IImageOperationsThe thickness. /// The points. /// The . - public static IImageOperations DrawLines(this IImageOperations source, IBrush brush, float thickness, PointF[] points) + public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points))); @@ -58,7 +58,7 @@ public static IImageOperations DrawLines(this IImageOperationsThe thickness. /// The points. /// The . - public static IImageOperations DrawLines(this IImageOperations source, TPixel color, float thickness, PointF[] points) + public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawLines(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static IImageOperations DrawLines(this IImageOperationsThe points. /// The options. /// The .> - public static IImageOperations DrawLines(this IImageOperations source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawLines(new SolidBrush(color), thickness, points, options); @@ -89,7 +89,7 @@ public static IImageOperations DrawLines(this IImageOperationsThe points. /// The options. /// The . - public static IImageOperations DrawLines(this IImageOperations source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new LinearLineSegment(points)), options); @@ -103,7 +103,7 @@ public static IImageOperations DrawLines(this IImageOperationsThe pen. /// The points. /// The . - public static IImageOperations DrawLines(this IImageOperations source, IPen pen, PointF[] points) + public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new LinearLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/DrawPath.cs b/src/ImageSharp.Drawing/Paths/DrawPath.cs index 57ce2032a9..68ba89ff11 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPath.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPath.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The path. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, IPen pen, IPath path, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(pen.StrokeFill, new ShapePath(path, pen), options); @@ -39,7 +39,7 @@ public static IImageOperations Draw(this IImageOperationsThe pen. /// The path. /// The . - public static IImageOperations Draw(this IImageOperations source, IPen pen, IPath path) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, IPath path) where TPixel : struct, IPixel { return source.Draw(pen, path, GraphicsOptions.Default); @@ -55,7 +55,7 @@ public static IImageOperations Draw(this IImageOperationsThe shape. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, IPath path, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), path, options); @@ -70,7 +70,7 @@ public static IImageOperations Draw(this IImageOperationsThe thickness. /// The path. /// The . - public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, IPath path) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, IPath path) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), path); @@ -86,7 +86,7 @@ public static IImageOperations Draw(this IImageOperationsThe path. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, IPath path, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, path, options); @@ -101,7 +101,7 @@ public static IImageOperations Draw(this IImageOperationsThe thickness. /// The path. /// The . - public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, IPath path) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, IPath path) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, path); diff --git a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs b/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs index f909e98da6..086ce97230 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The paths. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, IPen pen, IPathCollection paths, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { foreach (IPath path in paths) @@ -44,7 +44,7 @@ public static IImageOperations Draw(this IImageOperationsThe pen. /// The paths. /// The . - public static IImageOperations Draw(this IImageOperations source, IPen pen, IPathCollection paths) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(pen, paths, GraphicsOptions.Default); @@ -60,7 +60,7 @@ public static IImageOperations Draw(this IImageOperationsThe shapes. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, IPathCollection paths, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), paths, options); @@ -75,7 +75,7 @@ public static IImageOperations Draw(this IImageOperationsThe thickness. /// The paths. /// The . - public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, IPathCollection paths) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), paths); @@ -91,7 +91,7 @@ public static IImageOperations Draw(this IImageOperationsThe paths. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, paths, options); @@ -106,7 +106,7 @@ public static IImageOperations Draw(this IImageOperationsThe thickness. /// The paths. /// The . - public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, IPathCollection paths) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, paths); diff --git a/src/ImageSharp.Drawing/Paths/DrawPolygon.cs b/src/ImageSharp.Drawing/Paths/DrawPolygon.cs index b787afcd58..12b687415f 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPolygon.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPolygon.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static IImageOperations DrawPolygon(this IImageOperations source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Polygon(new LinearLineSegment(points)), options); @@ -43,7 +43,7 @@ public static IImageOperations DrawPolygon(this IImageOperations /// The thickness. /// The points. /// The . - public static IImageOperations DrawPolygon(this IImageOperations source, IBrush brush, float thickness, PointF[] points) + public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Polygon(new LinearLineSegment(points))); @@ -58,7 +58,7 @@ public static IImageOperations DrawPolygon(this IImageOperations /// The thickness. /// The points. /// The . - public static IImageOperations DrawPolygon(this IImageOperations source, TPixel color, float thickness, PointF[] points) + public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawPolygon(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static IImageOperations DrawPolygon(this IImageOperations /// The points. /// The options. /// The . - public static IImageOperations DrawPolygon(this IImageOperations source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawPolygon(new SolidBrush(color), thickness, points, options); @@ -88,7 +88,7 @@ public static IImageOperations DrawPolygon(this IImageOperations /// The pen. /// The points. /// The . - public static IImageOperations DrawPolygon(this IImageOperations source, IPen pen, PointF[] points) + public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Polygon(new LinearLineSegment(points)), GraphicsOptions.Default); @@ -103,7 +103,7 @@ public static IImageOperations DrawPolygon(this IImageOperations /// The points. /// The options. /// The . - public static IImageOperations DrawPolygon(this IImageOperations source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Polygon(new LinearLineSegment(points)), options); diff --git a/src/ImageSharp.Drawing/Paths/DrawRectangle.cs b/src/ImageSharp.Drawing/Paths/DrawRectangle.cs index 544ca2fe96..a9832a6280 100644 --- a/src/ImageSharp.Drawing/Paths/DrawRectangle.cs +++ b/src/ImageSharp.Drawing/Paths/DrawRectangle.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The shape. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, IPen pen, RectangleF shape, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height), options); @@ -39,7 +39,7 @@ public static IImageOperations Draw(this IImageOperationsThe pen. /// The shape. /// The . - public static IImageOperations Draw(this IImageOperations source, IPen pen, RectangleF shape) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(pen, shape, GraphicsOptions.Default); @@ -55,7 +55,7 @@ public static IImageOperations Draw(this IImageOperationsThe shape. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, RectangleF shape, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), shape, options); @@ -70,7 +70,7 @@ public static IImageOperations Draw(this IImageOperationsThe thickness. /// The shape. /// The . - public static IImageOperations Draw(this IImageOperations source, IBrush brush, float thickness, RectangleF shape) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), shape); @@ -86,7 +86,7 @@ public static IImageOperations Draw(this IImageOperationsThe shape. /// The options. /// The . - public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, RectangleF shape, GraphicsOptions options) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, shape, options); @@ -101,7 +101,7 @@ public static IImageOperations Draw(this IImageOperationsThe thickness. /// The shape. /// The . - public static IImageOperations Draw(this IImageOperations source, TPixel color, float thickness, RectangleF shape) + public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, shape); diff --git a/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs b/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs index eae34f0342..38d3ad10f6 100644 --- a/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs +++ b/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The shape. /// The graphics options. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, Action path, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, Action path, GraphicsOptions options) where TPixel : struct, IPixel { var pb = new PathBuilder(); @@ -42,7 +42,7 @@ public static IImageOperations Fill(this IImageOperationsThe brush. /// The path. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, Action path) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, Action path) where TPixel : struct, IPixel { return source.Fill(brush, path, GraphicsOptions.Default); @@ -57,7 +57,7 @@ public static IImageOperations Fill(this IImageOperationsThe path. /// The options. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, Action path, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, Action path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path, options); @@ -71,7 +71,7 @@ public static IImageOperations Fill(this IImageOperationsThe color. /// The path. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, Action path) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, Action path) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path); diff --git a/src/ImageSharp.Drawing/Paths/FillPathCollection.cs b/src/ImageSharp.Drawing/Paths/FillPathCollection.cs index 662245dc30..eec3fa7957 100644 --- a/src/ImageSharp.Drawing/Paths/FillPathCollection.cs +++ b/src/ImageSharp.Drawing/Paths/FillPathCollection.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shapes. /// The graphics options. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, IPathCollection paths, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { foreach (IPath s in paths) @@ -43,7 +43,7 @@ public static IImageOperations Fill(this IImageOperationsThe brush. /// The paths. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, IPathCollection paths) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, IPathCollection paths) where TPixel : struct, IPixel { return source.Fill(brush, paths, GraphicsOptions.Default); @@ -58,7 +58,7 @@ public static IImageOperations Fill(this IImageOperationsThe paths. /// The options. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, IPathCollection paths, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), paths, options); @@ -72,7 +72,7 @@ public static IImageOperations Fill(this IImageOperationsThe color. /// The paths. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, IPathCollection paths) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, IPathCollection paths) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), paths); diff --git a/src/ImageSharp.Drawing/Paths/FillPaths.cs b/src/ImageSharp.Drawing/Paths/FillPaths.cs index 07342d47b9..7cd6dbe54c 100644 --- a/src/ImageSharp.Drawing/Paths/FillPaths.cs +++ b/src/ImageSharp.Drawing/Paths/FillPaths.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shape. /// The graphics options. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, IPath path, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new ShapeRegion(path), options); @@ -38,7 +38,7 @@ public static IImageOperations Fill(this IImageOperationsThe brush. /// The path. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, IPath path) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, IPath path) where TPixel : struct, IPixel { return source.Fill(brush, new ShapeRegion(path), GraphicsOptions.Default); @@ -53,7 +53,7 @@ public static IImageOperations Fill(this IImageOperationsThe path. /// The options. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, IPath path, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path, options); @@ -67,7 +67,7 @@ public static IImageOperations Fill(this IImageOperationsThe color. /// The path. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, IPath path) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, IPath path) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path); diff --git a/src/ImageSharp.Drawing/Paths/FillPolygon.cs b/src/ImageSharp.Drawing/Paths/FillPolygon.cs index 7feac5b0a4..6b6cef8ace 100644 --- a/src/ImageSharp.Drawing/Paths/FillPolygon.cs +++ b/src/ImageSharp.Drawing/Paths/FillPolygon.cs @@ -27,7 +27,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static IImageOperations FillPolygon(this IImageOperations source, IBrush brush, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator FillPolygon(this IImageProcessorApplicator source, IBrush brush, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new Polygon(new LinearLineSegment(points)), options); @@ -41,7 +41,7 @@ public static IImageOperations FillPolygon(this IImageOperations /// The brush. /// The points. /// The . - public static IImageOperations FillPolygon(this IImageOperations source, IBrush brush, PointF[] points) + public static IImageProcessorApplicator FillPolygon(this IImageProcessorApplicator source, IBrush brush, PointF[] points) where TPixel : struct, IPixel { return source.Fill(brush, new Polygon(new LinearLineSegment(points))); @@ -56,7 +56,7 @@ public static IImageOperations FillPolygon(this IImageOperations /// The points. /// The options. /// The . - public static IImageOperations FillPolygon(this IImageOperations source, TPixel color, PointF[] points, GraphicsOptions options) + public static IImageProcessorApplicator FillPolygon(this IImageProcessorApplicator source, TPixel color, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), new Polygon(new LinearLineSegment(points)), options); @@ -70,7 +70,7 @@ public static IImageOperations FillPolygon(this IImageOperations /// The color. /// The points. /// The . - public static IImageOperations FillPolygon(this IImageOperations source, TPixel color, PointF[] points) + public static IImageProcessorApplicator FillPolygon(this IImageProcessorApplicator source, TPixel color, PointF[] points) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), new Polygon(new LinearLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/FillRectangle.cs b/src/ImageSharp.Drawing/Paths/FillRectangle.cs index 52512ca1cb..9e475137a3 100644 --- a/src/ImageSharp.Drawing/Paths/FillRectangle.cs +++ b/src/ImageSharp.Drawing/Paths/FillRectangle.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shape. /// The options. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, RectangleF shape, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height), options); @@ -38,7 +38,7 @@ public static IImageOperations Fill(this IImageOperationsThe brush. /// The shape. /// The . - public static IImageOperations Fill(this IImageOperations source, IBrush brush, RectangleF shape) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, RectangleF shape) where TPixel : struct, IPixel { return source.Fill(brush, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height)); @@ -53,7 +53,7 @@ public static IImageOperations Fill(this IImageOperationsThe shape. /// The options. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, RectangleF shape, GraphicsOptions options) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), shape, options); @@ -67,7 +67,7 @@ public static IImageOperations Fill(this IImageOperationsThe color. /// The shape. /// The . - public static IImageOperations Fill(this IImageOperations source, TPixel color, RectangleF shape) + public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, RectangleF shape) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), shape); diff --git a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs index 7154396dd9..c5b92b4084 100644 --- a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs @@ -68,13 +68,13 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan try { - if (targetImage.Bounds.Size != this.Size) + if (targetImage.Size() != this.Size) { targetImage = disposableImage = this.Image.Clone(x => x.Resize(this.Size.Width, this.Size.Height)); } // Align start/end positions. - Rectangle bounds = this.Image.Bounds; + Rectangle bounds = this.Image.Bounds(); int minX = Math.Max(this.Location.X, sourceRectangle.X); int maxX = Math.Min(this.Location.X + bounds.Width, sourceRectangle.Width); maxX = Math.Min(this.Location.X + this.Size.Width, maxX); diff --git a/src/ImageSharp.Drawing/Text/DrawText.Path.cs b/src/ImageSharp.Drawing/Text/DrawText.Path.cs index 459d5de0d8..c109047b2c 100644 --- a/src/ImageSharp.Drawing/Text/DrawText.Path.cs +++ b/src/ImageSharp.Drawing/Text/DrawText.Path.cs @@ -31,7 +31,7 @@ public static partial class ImageExtensions /// /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, TPixel color, IPath path) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, TPixel color, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, color, path, TextGraphicsOptions.Default); @@ -50,7 +50,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, TPixel color, IPath path, TextGraphicsOptions options) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, TPixel color, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, Brushes.Solid(color), null, path, options); @@ -68,7 +68,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPath path) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, path, TextGraphicsOptions.Default); @@ -87,7 +87,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPath path, TextGraphicsOptions options) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, null, path, options); @@ -105,7 +105,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IPen pen, IPath path) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IPen pen, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, pen, path, TextGraphicsOptions.Default); @@ -124,7 +124,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IPen pen, IPath path, TextGraphicsOptions options) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IPen pen, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, null, pen, path, options); @@ -143,7 +143,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPen pen, IPath path) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPen pen, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, pen, path, TextGraphicsOptions.Default); @@ -163,7 +163,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPen pen, IPath path, TextGraphicsOptions options) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPen pen, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { float dpiX = DefaultTextDpi; diff --git a/src/ImageSharp.Drawing/Text/DrawText.cs b/src/ImageSharp.Drawing/Text/DrawText.cs index 989322a739..338d06058b 100644 --- a/src/ImageSharp.Drawing/Text/DrawText.cs +++ b/src/ImageSharp.Drawing/Text/DrawText.cs @@ -34,7 +34,7 @@ public static partial class ImageExtensions /// /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, TPixel color, PointF location) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, TPixel color, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, color, location, TextGraphicsOptions.Default); @@ -53,7 +53,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, TPixel color, PointF location, TextGraphicsOptions options) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, TPixel color, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, Brushes.Solid(color), null, location, options); @@ -71,7 +71,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, PointF location) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, location, TextGraphicsOptions.Default); @@ -90,7 +90,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, PointF location, TextGraphicsOptions options) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, null, location, options); @@ -108,7 +108,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IPen pen, PointF location) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IPen pen, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, pen, location, TextGraphicsOptions.Default); @@ -127,7 +127,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IPen pen, PointF location, TextGraphicsOptions options) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IPen pen, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, null, pen, location, options); @@ -146,7 +146,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPen pen, PointF location) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPen pen, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, pen, location, TextGraphicsOptions.Default); @@ -166,7 +166,7 @@ public static IImageOperations DrawText(this IImageOperations /// The . /// - public static IImageOperations DrawText(this IImageOperations source, string text, Font font, IBrush brush, IPen pen, PointF location, TextGraphicsOptions options) + public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPen pen, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { float dpiX = DefaultTextDpi; diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index fd91349f57..78a5fc079b 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -22,14 +22,15 @@ public static partial class ImageExtensions /// The pixel format. /// The image to rotate, flip, or both. /// The operations to perform on the source. - public static void Mutate(this Image source, Action> operations) + public static void Mutate(this Image source, Action> operations) where TPixel : struct, IPixel { Guard.NotNull(operations, nameof(operations)); + Guard.NotNull(source, nameof(source)); - // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing - IImageOperations operationsRunner = source.Configuration.ImageOperationsProvider.CreateMutator(source); + IInternalImageProcessorApplicator operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, true); operations(operationsRunner); + operationsRunner.Apply(); } /// @@ -42,10 +43,11 @@ public static void Mutate(this Image source, params IImageProces where TPixel : struct, IPixel { Guard.NotNull(operations, nameof(operations)); + Guard.NotNull(source, nameof(source)); - // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing - IImageOperations operationsRunner = source.Configuration.ImageOperationsProvider.CreateMutator(source); + IInternalImageProcessorApplicator operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, true); operationsRunner.ApplyProcessors(operations); + operationsRunner.Apply(); } /// @@ -55,16 +57,15 @@ public static void Mutate(this Image source, params IImageProces /// The image to rotate, flip, or both. /// The operations to perform on the source. /// Anew Image which has teh data from the but with the applied. - public static Image Clone(this Image source, Action> operations) + public static Image Clone(this Image source, Action> operations) where TPixel : struct, IPixel { Guard.NotNull(operations, nameof(operations)); - var generated = new Image(source); + Guard.NotNull(source, nameof(source)); - // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing - IImageOperations operationsRunner = source.Configuration.ImageOperationsProvider.CreateMutator(generated); + IInternalImageProcessorApplicator operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, false); operations(operationsRunner); - return generated; + return operationsRunner.Apply(); } /// @@ -78,12 +79,11 @@ public static Image Clone(this Image source, params IIma where TPixel : struct, IPixel { Guard.NotNull(operations, nameof(operations)); - var generated = new Image(source); + Guard.NotNull(source, nameof(source)); - // TODO: add parameter to Configuration to configure how this is created, create an IImageOperationsFactory that cna be used to switch this out with a fake for testing - IImageOperations operationsRunner = source.Configuration.ImageOperationsProvider.CreateMutator(generated); + IInternalImageProcessorApplicator operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, false); operationsRunner.ApplyProcessors(operations); - return generated; + return operationsRunner.Apply(); } /// @@ -93,10 +93,10 @@ public static Image Clone(this Image source, params IIma /// The image to rotate, flip, or both. /// The operations to perform on the source. /// returns the current optinoatins class to allow chaining of oprations. - public static IImageOperations ApplyProcessors(this IImageOperations source, params IImageProcessor[] operations) + public static IImageProcessorApplicator ApplyProcessors(this IImageProcessorApplicator source, params IImageProcessor[] operations) where TPixel : struct, IPixel { - foreach (var p in operations) + foreach (IImageProcessor p in operations) { source = source.ApplyProcessor(p); } diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index 8340196338..b868194306 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -111,7 +111,7 @@ public Configuration(params IConfigurationModule[] configurationModules) /// /// Gets or sets the image operations providers. /// - internal IImageOperationsProvider ImageOperationsProvider { get; set; } = new DefaultImageOperationsProvider(); + internal IImageProcessorApplicatorFactory ImageOperationsProvider { get; set; } = new DefaultImageOperationsProvider(); /// /// Registers a new format provider. diff --git a/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs b/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs new file mode 100644 index 0000000000..4dda4f070f --- /dev/null +++ b/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp +{ + using System; + using System.Collections.Generic; + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + using SixLabors.Primitives; + + /// + /// The static collection of all the default image formats + /// + /// The pixel format + internal class DefaultInternalImageProcessorApplicator : IInternalImageProcessorApplicator + where TPixel : struct, IPixel + { + private readonly bool mutate; + private readonly Image source; + private Image destination; + + /// + /// Initializes a new instance of the class. + /// + /// The image. + /// The mutate. + public DefaultInternalImageProcessorApplicator(Image source, bool mutate) + { + this.mutate = mutate; + this.source = source; + if (this.mutate) + { + this.destination = source; + } + } + + /// + public Image Apply() + { + if (!this.mutate && this.destination == null) + { + // ensure we have cloned it if we are not mutating as we might have failed to register any Processors + this.destination = this.source.Clone(); + } + + return this.destination; + } + + /// + public IImageProcessorApplicator ApplyProcessor(IImageProcessor processor, Rectangle rectangle) + { + if (!this.mutate && this.destination == null) + { + // TODO check if the processor implements a special interface and if it does then allow it to take + // over and crereate the clone on behalf ImageOperations class. + this.destination = this.source.Clone(); + } + + processor.Apply(this.destination, rectangle); + return this; + } + + /// + public IImageProcessorApplicator ApplyProcessor(IImageProcessor processor) + { + return this.ApplyProcessor(processor, this.source.Bounds()); + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/IImageOperationsProvider.cs b/src/ImageSharp/IImageProcessorApplicatorFactory.cs similarity index 61% rename from src/ImageSharp/IImageOperationsProvider.cs rename to src/ImageSharp/IImageProcessorApplicatorFactory.cs index 475c632657..b79353ef51 100644 --- a/src/ImageSharp/IImageOperationsProvider.cs +++ b/src/ImageSharp/IImageProcessorApplicatorFactory.cs @@ -11,28 +11,29 @@ namespace ImageSharp /// /// Represents an interface that will create IImageOperations /// - internal interface IImageOperationsProvider + internal interface IImageProcessorApplicatorFactory { /// /// Called during Mutate operations to generate the imageoperations provider. /// /// The pixel format /// The source image. + /// A flag to determin with the image operations is allowed to mutate the source image or not. /// A new IImageOPeration - IImageOperations CreateMutator(Image source) + IInternalImageProcessorApplicator CreateImageOperations(Image source, bool mutate) where TPixel : struct, IPixel; } /// /// The default implmentation of IImageOperationsProvider /// - internal class DefaultImageOperationsProvider : IImageOperationsProvider + internal class DefaultImageOperationsProvider : IImageProcessorApplicatorFactory { /// - public IImageOperations CreateMutator(Image source) + public IInternalImageProcessorApplicator CreateImageOperations(Image source, bool mutate) where TPixel : struct, IPixel { - return new ImageOperations(source); + return new DefaultInternalImageProcessorApplicator(source, mutate); } } } diff --git a/src/ImageSharp/IImageOperations{TPixel}.cs b/src/ImageSharp/IImageProcessorApplicator{TPixel}.cs similarity index 54% rename from src/ImageSharp/IImageOperations{TPixel}.cs rename to src/ImageSharp/IImageProcessorApplicator{TPixel}.cs index 349cef7f34..861c5b010c 100644 --- a/src/ImageSharp/IImageOperations{TPixel}.cs +++ b/src/ImageSharp/IImageProcessorApplicator{TPixel}.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // @@ -15,7 +15,7 @@ namespace ImageSharp /// An interface to queue up image operations. /// /// The pixel format - public interface IImageOperations + public interface IImageProcessorApplicator where TPixel : struct, IPixel { /// @@ -24,13 +24,27 @@ public interface IImageOperations /// The processor to apply /// The area to apply it to /// returns the current optinoatins class to allow chaining of oprations. - IImageOperations ApplyProcessor(IImageProcessor processor, Rectangle rectangle); + IImageProcessorApplicator ApplyProcessor(IImageProcessor processor, Rectangle rectangle); /// /// Adds the processor to the current setr of image operations to be applied. /// /// The processor to apply /// returns the current optinoatins class to allow chaining of oprations. - IImageOperations ApplyProcessor(IImageProcessor processor); + IImageProcessorApplicator ApplyProcessor(IImageProcessor processor); + } + + /// + /// An internal interface to queue up image operations and have a method to apply them to and return a result + /// + /// The pixel format + public interface IInternalImageProcessorApplicator : IImageProcessorApplicator + where TPixel : struct, IPixel + { + /// + /// Adds the processors to the current image + /// + /// returns the current image or a new image depending on withere this is alloed to mutate the source image. + Image Apply(); } } \ No newline at end of file diff --git a/src/ImageSharp/Image/IImageBase.cs b/src/ImageSharp/Image/IImageBase.cs index 0e087aa4a3..9e0c10606b 100644 --- a/src/ImageSharp/Image/IImageBase.cs +++ b/src/ImageSharp/Image/IImageBase.cs @@ -12,11 +12,6 @@ namespace ImageSharp /// public interface IImageBase { - /// - /// Gets the representing the bounds of the image. - /// - Rectangle Bounds { get; } - /// /// Gets the width in pixels. /// @@ -27,11 +22,6 @@ public interface IImageBase /// int Height { get; } - /// - /// Gets the pixel ratio made up of the width and height. - /// - double PixelRatio { get; } - /// /// Gets the configuration providing initialization code which allows extending the library. /// diff --git a/src/ImageSharp/Image/ImageBase{TPixel}.cs b/src/ImageSharp/Image/ImageBase{TPixel}.cs index d4a7af9ca4..95d5375185 100644 --- a/src/ImageSharp/Image/ImageBase{TPixel}.cs +++ b/src/ImageSharp/Image/ImageBase{TPixel}.cs @@ -19,7 +19,6 @@ namespace ImageSharp /// images in different pixel formats. /// /// The pixel format. - [DebuggerDisplay("Image: {Width}x{Height}")] public abstract class ImageBase : IImageBase where TPixel : struct, IPixel { @@ -105,12 +104,8 @@ protected ImageBase(ImageBase other) // Rent then copy the pixels. Unsafe.CopyBlock gives us a nice speed boost here. this.RentPixels(); - using (PixelAccessor sourcePixels = other.Lock()) - using (PixelAccessor target = this.Lock()) - { - // Check we can do this without crashing - sourcePixels.CopyTo(target); - } + + other.Pixels.CopyTo(this.Pixels); } /// @@ -122,12 +117,6 @@ protected ImageBase(ImageBase other) /// public int Height { get; private set; } - /// - public double PixelRatio => (double)this.Width / this.Height; - - /// - public Rectangle Bounds => new Rectangle(0, 0, this.Width, this.Height); - /// /// Gets the configuration providing initialization code which allows extending the library. /// @@ -194,6 +183,15 @@ public Span GetRowSpan(int x, int y) return this.Pixels.Slice((y * this.Width) + x, this.Width - x); } + /// + /// Clones the image + /// + /// A new items which is a clone of the original. + public ImageBase Clone() + { + return this.CloneInternal(); + } + /// public void Dispose() { @@ -246,6 +244,12 @@ internal void SwapPixelsBuffers(PixelAccessor pixelSource) this.PixelBuffer = newPixels; } + /// + /// Clones the image + /// + /// A new items which is a clone of the original. + protected abstract ImageBase CloneInternal(); + /// /// Copies the properties from the other . /// diff --git a/src/ImageSharp/Image/ImageExtensions.cs b/src/ImageSharp/Image/ImageExtensions.cs new file mode 100644 index 0000000000..9c2575a86f --- /dev/null +++ b/src/ImageSharp/Image/ImageExtensions.cs @@ -0,0 +1,153 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Text; + using ImageSharp.Formats; + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + + /// + /// Extension methods over Image{TPixel} + /// + public static partial class ImageExtensions + { + /// + /// Gets the bounds of the image. + /// + /// The Pixel format. + /// The source image + /// Returns the bounds of the image + public static Rectangle Bounds(this ImageBase source) + where TPixel : struct, IPixel + => new Rectangle(0, 0, source.Width, source.Height); + + /// + /// Gets the size of the image. + /// + /// The Pixel format. + /// The source image + /// Returns the bounds of the image + public static Size Size(this ImageBase source) + where TPixel : struct, IPixel + => new Size(source.Width, source.Height); + +#if !NETSTANDARD1_1 + /// + /// Saves the image to the given stream using the currently loaded image format. + /// + /// The Pixel format. + /// The source image + /// The file path to save the image to. + /// Thrown if the stream is null. + public static void Save(this Image source, string filePath) + where TPixel : struct, IPixel + { + Guard.NotNullOrEmpty(filePath, nameof(filePath)); + + string ext = Path.GetExtension(filePath).Trim('.'); + IImageFormat format = source.Configuration.FindFormatByFileExtensions(ext); + if (format == null) + { + var stringBuilder = new StringBuilder(); + stringBuilder.AppendLine($"Can't find a format that is associated with the file extention '{ext}'. Registered formats with there extensions include:"); + foreach (IImageFormat fmt in source.Configuration.ImageFormats) + { + stringBuilder.AppendLine($" - {fmt.Name} : {string.Join(", ", fmt.FileExtensions)}"); + } + + throw new NotSupportedException(stringBuilder.ToString()); + } + + IImageEncoder encoder = source.Configuration.FindEncoder(format); + + if (encoder == null) + { + var stringBuilder = new StringBuilder(); + stringBuilder.AppendLine($"Can't find encoder for file extention '{ext}' using image format '{format.Name}'. Registered encoders include:"); + foreach (KeyValuePair enc in source.Configuration.ImageEncoders) + { + stringBuilder.AppendLine($" - {enc.Key} : {enc.Value.GetType().Name}"); + } + + throw new NotSupportedException(stringBuilder.ToString()); + } + + source.Save(filePath, encoder); + } + + /// + /// Saves the image to the given stream using the currently loaded image format. + /// + /// The Pixel format. + /// The source image + /// The file path to save the image to. + /// The encoder to save the image with. + /// Thrown if the encoder is null. + public static void Save(this Image source, string filePath, IImageEncoder encoder) + where TPixel : struct, IPixel + { + Guard.NotNull(encoder, nameof(encoder)); + using (Stream fs = source.Configuration.FileSystem.Create(filePath)) + { + source.Save(fs, encoder); + } + } +#endif + + /// + /// Saves the image to the given stream using the currently loaded image format. + /// + /// The Pixel format. + /// The source image + /// The stream to save the image to. + /// The format to save the image to. + /// Thrown if the stream is null. + public static void Save(this Image source, Stream stream, IImageFormat format) + where TPixel : struct, IPixel + { + Guard.NotNull(format, nameof(format)); + IImageEncoder encoder = source.Configuration.FindEncoder(format); + + if (encoder == null) + { + var stringBuilder = new StringBuilder(); + stringBuilder.AppendLine("Can't find encoder for provided mime type. Available encoded:"); + + foreach (KeyValuePair val in source.Configuration.ImageEncoders) + { + stringBuilder.AppendLine($" - {val.Key.Name} : {val.Value.GetType().Name}"); + } + + throw new NotSupportedException(stringBuilder.ToString()); + } + + source.Save(stream, encoder); + } + + /// + /// Returns a Base64 encoded string from the given image. + /// + /// + /// The Pixel format. + /// The source image + /// The format. + /// The + public static string ToBase64String(this Image source, IImageFormat format) + where TPixel : struct, IPixel + { + using (var stream = new MemoryStream()) + { + source.Save(stream, format); + stream.Flush(); + return $"data:{format.DefaultMimeType};base64,{Convert.ToBase64String(stream.ToArray())}"; + } + } + } +} diff --git a/src/ImageSharp/Image/ImageFrame{TPixel}.cs b/src/ImageSharp/Image/ImageFrame{TPixel}.cs index 04b9902c67..c8cad16482 100644 --- a/src/ImageSharp/Image/ImageFrame{TPixel}.cs +++ b/src/ImageSharp/Image/ImageFrame{TPixel}.cs @@ -14,39 +14,49 @@ namespace ImageSharp /// Represents a single frame in a animation. /// /// The pixel format. - public class ImageFrame : ImageBase, IImageFrame + public sealed class ImageFrame : ImageBase, IImageFrame where TPixel : struct, IPixel { /// /// Initializes a new instance of the class. /// - /// The width of the image in pixels. - /// The height of the image in pixels. /// /// The configuration providing initialization code which allows extending the library. /// - public ImageFrame(int width, int height, Configuration configuration = null) + /// The width of the image in pixels. + /// The height of the image in pixels. + public ImageFrame(Configuration configuration, int width, int height) : base(configuration, width, height) { } + /// + /// Initializes a new instance of the class. + /// + /// The width of the image in pixels. + /// The height of the image in pixels. + public ImageFrame(int width, int height) + : this(null, width, height) + { + } + /// /// Initializes a new instance of the class. /// /// The image to create the frame from. - public ImageFrame(ImageFrame image) + internal ImageFrame(ImageBase image) : base(image) { - this.CopyProperties(image); } /// /// Initializes a new instance of the class. /// /// The image to create the frame from. - public ImageFrame(ImageBase image) + private ImageFrame(ImageFrame image) : base(image) { + this.CopyProperties(image); } /// @@ -63,15 +73,19 @@ public override string ToString() /// /// Returns a copy of the image frame in the given pixel format. /// - /// A function that allows for the correction of vector scaling between unknown color formats. /// The pixel format. /// The - public ImageFrame To(Func scaleFunc = null) + public ImageFrame CloneAs() where TPixel2 : struct, IPixel { - scaleFunc = PackedPixelConverterHelper.ComputeScaleFunction(scaleFunc); + if (typeof(TPixel2) == typeof(TPixel)) + { + return this.Clone() as ImageFrame; + } - ImageFrame target = new ImageFrame(this.Width, this.Height, this.Configuration); + Func scaleFunc = PackedPixelConverterHelper.ComputeScaleFunction(); + + var target = new ImageFrame(this.Configuration, this.Width, this.Height); target.CopyProperties(this); using (PixelAccessor pixels = this.Lock()) @@ -99,11 +113,17 @@ public ImageFrame To(Func scaleFunc = null) /// Clones the current instance. /// /// The - internal virtual ImageFrame Clone() + public new ImageFrame Clone() { return new ImageFrame(this); } + /// + protected override ImageBase CloneInternal() + { + return this.Clone(); + } + /// /// Copies the properties from the other . /// diff --git a/src/ImageSharp/Image/ImageProcessingExtensions.cs b/src/ImageSharp/Image/ImageProcessingExtensions.cs deleted file mode 100644 index 44fcba7cfe..0000000000 --- a/src/ImageSharp/Image/ImageProcessingExtensions.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// Copyright (c) James Jackson-South and contributors. -// Licensed under the Apache License, Version 2.0. -// - -namespace ImageSharp -{ - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - - /// - /// Extension methods for the type. - /// - public static partial class ImageExtensions - { - /// - /// Applies the processor to the image. - /// This method does not resize the target image. - /// - /// The pixel format. - /// The image this method extends. - /// The processor to apply to the image. - /// The . - public static IImageOperations Apply(this IImageOperations source, IImageProcessor processor) - where TPixel : struct, IPixel - { - source.ApplyProcessor(processor); - return source; - } - } -} \ No newline at end of file diff --git a/src/ImageSharp/Image/Image{TPixel}.cs b/src/ImageSharp/Image/Image{TPixel}.cs index 0dcb369059..ae89b777cd 100644 --- a/src/ImageSharp/Image/Image{TPixel}.cs +++ b/src/ImageSharp/Image/Image{TPixel}.cs @@ -22,8 +22,7 @@ namespace ImageSharp /// Encapsulates an image, which consists of the pixel data for a graphics image and its attributes. /// /// The pixel format. - [DebuggerDisplay("Image: {Width}x{Height}")] - public class Image : ImageBase, IImage + public sealed class Image : ImageBase, IImage where TPixel : struct, IPixel { /// @@ -51,20 +50,36 @@ public Image(int width, int height) { } + /// + /// Initializes a new instance of the class + /// with the height and the width of the image. + /// + /// + /// The configuration providing initialization code which allows extending the library. + /// + /// The width of the image in pixels. + /// The height of the image in pixels. + /// The images metadata. + internal Image(Configuration configuration, int width, int height, ImageMetaData metadata) + : base(configuration, width, height) + { + this.MetaData = metadata ?? new ImageMetaData(); + } + /// /// Initializes a new instance of the class /// by making a copy from another image. /// /// The other image, where the clone should be made from. /// is null. - public Image(Image other) + private Image(Image other) : base(other) { foreach (ImageFrame frame in other.Frames) { if (frame != null) { - this.Frames.Add(new ImageFrame(frame)); + this.Frames.Add(frame.Clone()); } } @@ -77,101 +92,22 @@ public Image(Image other) /// /// The other image, where the clone should be made from. /// is null. - public Image(ImageBase other) + private Image(ImageBase other) : base(other) { } - /// - /// Initializes a new instance of the class - /// with the height and the width of the image. - /// - /// - /// The configuration providing initialization code which allows extending the library. - /// - /// The width of the image in pixels. - /// The height of the image in pixels. - /// The images metadata. - internal Image(Configuration configuration, int width, int height, ImageMetaData metadata) - : base(configuration, width, height) - { - this.MetaData = metadata ?? new ImageMetaData(); - } - /// /// Gets the meta data of the image. /// public ImageMetaData MetaData { get; private set; } = new ImageMetaData(); /// - /// Gets the width of the image in inches. It is calculated as the width of the image - /// in pixels multiplied with the density. When the density is equals or less than zero - /// the default value is used. - /// - /// The width of the image in inches. - public double InchWidth => this.Width / this.MetaData.HorizontalResolution; - - /// - /// Gets the height of the image in inches. It is calculated as the height of the image - /// in pixels multiplied with the density. When the density is equals or less than zero - /// the default value is used. - /// - /// The height of the image in inches. - public double InchHeight => this.Height / this.MetaData.VerticalResolution; - - /// - /// Gets a value indicating whether this image is animated. - /// - /// - /// True if this image is animated; otherwise, false. - /// - public bool IsAnimated => this.Frames.Count > 0; - - /// - /// Gets the other frames for the animation. + /// Gets the other frames associated with this image. /// /// The list of frame images. public IList> Frames { get; } = new List>(); - /// - /// Applies the processor to the image. - /// - /// The processor to apply to the image. - /// The structure that specifies the portion of the image object to draw. - public virtual void ApplyProcessor(IImageProcessor processor, Rectangle rectangle) - { - // we want to put this on on here as it gives us a really go place to test/verify processor settings - processor.Apply(this, rectangle); - } - - /// - /// Saves the image to the given stream using the currently loaded image format. - /// - /// The stream to save the image to. - /// The format to save the image to. - /// Thrown if the stream is null. - /// The - public Image Save(Stream stream, IImageFormat format) - { - Guard.NotNull(format, nameof(format)); - IImageEncoder encoder = this.Configuration.FindEncoder(format); - - if (encoder == null) - { - var stringBuilder = new StringBuilder(); - stringBuilder.AppendLine("Can't find encoder for provided mime type. Available encoded:"); - - foreach (KeyValuePair val in this.Configuration.ImageEncoders) - { - stringBuilder.AppendLine($" - {val.Key.Name} : {val.Value.GetType().Name}"); - } - - throw new NotSupportedException(stringBuilder.ToString()); - } - - return this.Save(stream, encoder); - } - /// /// Saves the image to the given stream using the given image encoder. /// @@ -191,70 +127,11 @@ public Image Save(Stream stream, IImageEncoder encoder) return this; } -#if !NETSTANDARD1_1 - /// - /// Saves the image to the given stream using the currently loaded image format. - /// - /// The file path to save the image to. - /// Thrown if the stream is null. - /// The - public Image Save(string filePath) - { - Guard.NotNullOrEmpty(filePath, nameof(filePath)); - - string ext = Path.GetExtension(filePath).Trim('.'); - var format = this.Configuration.FindFormatByFileExtensions(ext); - if (format == null) - { - var stringBuilder = new StringBuilder(); - stringBuilder.AppendLine($"Can't find a format that is associated with the file extention '{ext}'. Registered formats with there extensions include:"); - foreach (IImageFormat fmt in this.Configuration.ImageFormats) - { - stringBuilder.AppendLine($" - {fmt.Name} : {string.Join(", ", fmt.FileExtensions)}"); - } - - throw new NotSupportedException(stringBuilder.ToString()); - } - - IImageEncoder encoder = this.Configuration.FindEncoder(format); - - if (encoder == null) - { - var stringBuilder = new StringBuilder(); - stringBuilder.AppendLine($"Can't find encoder for file extention '{ext}' using image format '{format.Name}'. Registered encoders include:"); - foreach (KeyValuePair enc in this.Configuration.ImageEncoders) - { - stringBuilder.AppendLine($" - {enc.Key} : {enc.Value.GetType().Name}"); - } - - throw new NotSupportedException(stringBuilder.ToString()); - } - - return this.Save(filePath, encoder); - } - - /// - /// Saves the image to the given stream using the currently loaded image format. - /// - /// The file path to save the image to. - /// The encoder to save the image with. - /// Thrown if the encoder is null. - /// The - public Image Save(string filePath, IImageEncoder encoder) - { - Guard.NotNull(encoder, nameof(encoder)); - using (Stream fs = this.Configuration.FileSystem.Create(filePath)) - { - return this.Save(fs, encoder); - } - } -#endif - /// /// Clones the current image /// /// Returns a new image with all the same metadata as the original. - public Image Clone() + public new Image Clone() { return new Image(this); } @@ -265,32 +142,21 @@ public override string ToString() return $"Image<{typeof(TPixel).Name}>: {this.Width}x{this.Height}"; } - /// - /// Returns a Base64 encoded string from the given image. - /// - /// - /// The format. - /// The - public string ToBase64String(IImageFormat format) - { - using (var stream = new MemoryStream()) - { - this.Save(stream, format); - stream.Flush(); - return $"data:{format.DefaultMimeType};base64,{Convert.ToBase64String(stream.ToArray())}"; - } - } - /// /// Returns a copy of the image in the given pixel format. /// - /// A function that allows for the correction of vector scaling between unknown color formats. /// The pixel format. /// The - public Image To(Func scaleFunc = null) + public Image CloneAs() where TPixel2 : struct, IPixel { - scaleFunc = PackedPixelConverterHelper.ComputeScaleFunction(scaleFunc); + if (typeof(TPixel2) == typeof(TPixel)) + { + // short circuit when same pixel types + return this.Clone() as Image; + } + + Func scaleFunc = PackedPixelConverterHelper.ComputeScaleFunction(); var target = new Image(this.Configuration, this.Width, this.Height); target.CopyProperties(this); @@ -315,7 +181,7 @@ public Image To(Func scaleFunc = null) for (int i = 0; i < this.Frames.Count; i++) { - target.Frames.Add(this.Frames[i].To()); + target.Frames.Add(this.Frames[i].CloneAs()); } return target; @@ -325,7 +191,7 @@ public Image To(Func scaleFunc = null) /// Creates a new from this instance /// /// The - internal virtual ImageFrame ToFrame() + internal ImageFrame ToFrame() { return new ImageFrame(this); } @@ -342,6 +208,12 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); } + /// + protected override ImageBase CloneInternal() + { + return this.Clone(); + } + /// /// Copies the properties from the other . /// diff --git a/src/ImageSharp/ImageOperations.cs b/src/ImageSharp/ImageOperations.cs deleted file mode 100644 index dde3153d16..0000000000 --- a/src/ImageSharp/ImageOperations.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// Copyright (c) James Jackson-South and contributors. -// Licensed under the Apache License, Version 2.0. -// - -namespace ImageSharp -{ - using System.Collections.Generic; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; - - /// - /// The static collection of all the default image formats - /// - /// The pixel format - internal class ImageOperations : IImageOperations - where TPixel : struct, IPixel - { - private readonly Image image; - - /// - /// Initializes a new instance of the class. - /// - /// The image. - public ImageOperations(Image image) - { - this.image = image; - } - - /// - public IImageOperations ApplyProcessor(IImageProcessor processor, Rectangle rectangle) - { - // TODO : make this queue, and allow special processors managage the cloing operation for 'generate' - // to allow things like resize to not need to retain an extra copy of image data in memory, and to - // prevent an pixel copy operation - this.image.ApplyProcessor(processor, rectangle); - return this; - } - - /// - public IImageOperations ApplyProcessor(IImageProcessor processor) - { - return this.ApplyProcessor(processor, this.image.Bounds); - } - - /// - /// Applies a bluck colelctino of pressorce at once - /// - /// Processors to apply - /// this - public IImageOperations ApplyProcessors(IEnumerable> processors) - { - foreach (var processor in processors) - { - return this.ApplyProcessor(processor); - } - - return this; - } - } -} \ No newline at end of file diff --git a/src/ImageSharp/PixelFormats/PackedPixelConverterHelper.cs b/src/ImageSharp/PixelFormats/PackedPixelConverterHelper.cs index 29ef5675e7..2a25ffc164 100644 --- a/src/ImageSharp/PixelFormats/PackedPixelConverterHelper.cs +++ b/src/ImageSharp/PixelFormats/PackedPixelConverterHelper.cs @@ -21,18 +21,11 @@ internal static class PackedPixelConverterHelper /// /// Returns the correct scaling function for the given types The compute scale function. /// - /// The scale function. /// The source pixel format. /// The target pixel format. /// The - public static Func ComputeScaleFunction(Func scaleFunc) + public static Func ComputeScaleFunction() { - // Custom type with a custom function. - if (scaleFunc != null) - { - return scaleFunc; - } - Type source = typeof(TPixel); Type target = typeof(TPixel2); diff --git a/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs b/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs index a4ee73af48..796b4f5973 100644 --- a/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs +++ b/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The threshold to apply binarization of the image. Must be between 0 and 1. /// The . - public static IImageOperations BinaryThreshold(this IImageOperations source, float threshold) + public static IImageProcessorApplicator BinaryThreshold(this IImageProcessorApplicator source, float threshold) where TPixel : struct, IPixel { source.ApplyProcessor(new BinaryThresholdProcessor(threshold)); @@ -41,7 +41,7 @@ public static IImageOperations BinaryThreshold(this IImageOperat /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations BinaryThreshold(this IImageOperations source, float threshold, Rectangle rectangle) + public static IImageProcessorApplicator BinaryThreshold(this IImageProcessorApplicator source, float threshold, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new BinaryThresholdProcessor(threshold), rectangle); diff --git a/src/ImageSharp/Processing/Binarization/Dither.cs b/src/ImageSharp/Processing/Binarization/Dither.cs index fc5193c33f..177279cea9 100644 --- a/src/ImageSharp/Processing/Binarization/Dither.cs +++ b/src/ImageSharp/Processing/Binarization/Dither.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The ordered ditherer. /// The . - public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither) + public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IOrderedDither dither) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, 0)); @@ -39,7 +39,7 @@ public static IImageOperations Dither(this IImageOperationsThe ordered ditherer. /// The component index to test the threshold against. Must range from 0 to 3. /// The . - public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, int index) + public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IOrderedDither dither, int index) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, index)); @@ -56,7 +56,7 @@ public static IImageOperations Dither(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, Rectangle rectangle) + public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IOrderedDither dither, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, 0), rectangle); @@ -74,7 +74,7 @@ public static IImageOperations Dither(this IImageOperations /// The component index to test the threshold against. Must range from 0 to 3. /// The . - public static IImageOperations Dither(this IImageOperations source, IOrderedDither dither, Rectangle rectangle, int index) + public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IOrderedDither dither, Rectangle rectangle, int index) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, index), rectangle); @@ -89,7 +89,7 @@ public static IImageOperations Dither(this IImageOperationsThe diffusion algorithm to apply. /// The threshold to apply binarization of the image. Must be between 0 and 1. /// The . - public static IImageOperations Dither(this IImageOperations source, IErrorDiffuser diffuser, float threshold) + public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IErrorDiffuser diffuser, float threshold) where TPixel : struct, IPixel { source.ApplyProcessor(new ErrorDiffusionDitherProcessor(diffuser, threshold)); @@ -107,7 +107,7 @@ public static IImageOperations Dither(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Dither(this IImageOperations source, IErrorDiffuser diffuser, float threshold, Rectangle rectangle) + public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IErrorDiffuser diffuser, float threshold, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new ErrorDiffusionDitherProcessor(diffuser, threshold), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs b/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs index 5710991dc3..3d15d1cbc0 100644 --- a/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs +++ b/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations BlackWhite(this IImageOperations source) + public static IImageProcessorApplicator BlackWhite(this IImageProcessorApplicator source) where TPixel : struct, IPixel { source.ApplyProcessor(new BlackWhiteProcessor()); @@ -40,7 +40,7 @@ public static IImageOperations BlackWhite(this IImageOperations< /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations BlackWhite(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator BlackWhite(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new BlackWhiteProcessor(), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs b/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs index 4d83ba9a20..8a055c33cf 100644 --- a/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs +++ b/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The type of color blindness simulator to apply. /// The . - public static IImageOperations ColorBlindness(this IImageOperations source, ColorBlindness colorBlindness) + public static IImageProcessorApplicator ColorBlindness(this IImageProcessorApplicator source, ColorBlindness colorBlindness) where TPixel : struct, IPixel { source.ApplyProcessor(GetProcessor(colorBlindness)); @@ -42,7 +42,7 @@ public static IImageOperations ColorBlindness(this IImageOperati /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations ColorBlindness(this IImageOperations source, ColorBlindness colorBlindness, Rectangle rectangle) + public static IImageProcessorApplicator ColorBlindness(this IImageProcessorApplicator source, ColorBlindness colorBlindness, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(GetProcessor(colorBlindness), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs b/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs index 6cdc3343de..7b00ae0d85 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs @@ -22,7 +22,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Grayscale(this IImageOperations source) + public static IImageProcessorApplicator Grayscale(this IImageProcessorApplicator source) where TPixel : struct, IPixel { return Grayscale(source, GrayscaleMode.Bt709); @@ -35,7 +35,7 @@ public static IImageOperations Grayscale(this IImageOperationsThe image this method extends. /// The formula to apply to perform the operation. /// The . - public static IImageOperations Grayscale(this IImageOperations source, GrayscaleMode mode) + public static IImageProcessorApplicator Grayscale(this IImageProcessorApplicator source, GrayscaleMode mode) where TPixel : struct, IPixel { IImageProcessor processor = mode == GrayscaleMode.Bt709 @@ -55,7 +55,7 @@ public static IImageOperations Grayscale(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Grayscale(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator Grayscale(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel { return Grayscale(source, GrayscaleMode.Bt709, rectangle); @@ -71,7 +71,7 @@ public static IImageOperations Grayscale(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Grayscale(this IImageOperations source, GrayscaleMode mode, Rectangle rectangle) + public static IImageProcessorApplicator Grayscale(this IImageProcessorApplicator source, GrayscaleMode mode, Rectangle rectangle) where TPixel : struct, IPixel { IImageProcessor processor = mode == GrayscaleMode.Bt709 diff --git a/src/ImageSharp/Processing/ColorMatrix/Hue.cs b/src/ImageSharp/Processing/ColorMatrix/Hue.cs index 86a5336219..cd2adaadb3 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Hue.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Hue.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The angle in degrees to adjust the image. /// The . - public static IImageOperations Hue(this IImageOperations source, float degrees) + public static IImageProcessorApplicator Hue(this IImageProcessorApplicator source, float degrees) where TPixel : struct, IPixel { source.ApplyProcessor(new HueProcessor(degrees)); @@ -42,7 +42,7 @@ public static IImageOperations Hue(this IImageOperations /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Hue(this IImageOperations source, float degrees, Rectangle rectangle) + public static IImageProcessorApplicator Hue(this IImageProcessorApplicator source, float degrees, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new HueProcessor(degrees), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs b/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs index 2f331d6478..b16f241c01 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Kodachrome(this IImageOperations source) + public static IImageProcessorApplicator Kodachrome(this IImageProcessorApplicator source) where TPixel : struct, IPixel { source.ApplyProcessor(new KodachromeProcessor()); @@ -40,7 +40,7 @@ public static IImageOperations Kodachrome(this IImageOperations< /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Kodachrome(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator Kodachrome(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new KodachromeProcessor(), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs b/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs index e2c8f3674c..0a2f80cc42 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Lomograph(this IImageOperations source) + public static IImageProcessorApplicator Lomograph(this IImageProcessorApplicator source) where TPixel : struct, IPixel { return Lomograph(source, GraphicsOptions.Default); @@ -39,7 +39,7 @@ public static IImageOperations Lomograph(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Lomograph(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator Lomograph(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel { return Lomograph(source, rectangle, GraphicsOptions.Default); @@ -52,7 +52,7 @@ public static IImageOperations Lomograph(this IImageOperationsThe image this method extends. /// The options effecting pixel blending. /// The . - public static IImageOperations Lomograph(this IImageOperations source, GraphicsOptions options) + public static IImageProcessorApplicator Lomograph(this IImageProcessorApplicator source, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new LomographProcessor(options)); @@ -69,7 +69,7 @@ public static IImageOperations Lomograph(this IImageOperations /// The options effecting pixel blending. /// The . - public static IImageOperations Lomograph(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessorApplicator Lomograph(this IImageProcessorApplicator source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new LomographProcessor(options), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs b/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs index bfbf6477b9..e579a32511 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Polaroid(this IImageOperations source) + public static IImageProcessorApplicator Polaroid(this IImageProcessorApplicator source) where TPixel : struct, IPixel { return Polaroid(source, GraphicsOptions.Default); @@ -39,7 +39,7 @@ public static IImageOperations Polaroid(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Polaroid(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator Polaroid(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel { return Polaroid(source, rectangle, GraphicsOptions.Default); @@ -52,7 +52,7 @@ public static IImageOperations Polaroid(this IImageOperationsThe image this method extends. /// The options effecting pixel blending. /// The . - public static IImageOperations Polaroid(this IImageOperations source, GraphicsOptions options) + public static IImageProcessorApplicator Polaroid(this IImageProcessorApplicator source, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new PolaroidProcessor(options)); @@ -69,7 +69,7 @@ public static IImageOperations Polaroid(this IImageOperations /// The options effecting pixel blending. /// The . - public static IImageOperations Polaroid(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessorApplicator Polaroid(this IImageProcessorApplicator source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new PolaroidProcessor(options), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Saturation.cs b/src/ImageSharp/Processing/ColorMatrix/Saturation.cs index 5a26505272..768eb97c54 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Saturation.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Saturation.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The new saturation of the image. Must be between -100 and 100. /// The . - public static IImageOperations Saturation(this IImageOperations source, int amount) + public static IImageProcessorApplicator Saturation(this IImageProcessorApplicator source, int amount) where TPixel : struct, IPixel { source.ApplyProcessor(new SaturationProcessor(amount)); @@ -42,7 +42,7 @@ public static IImageOperations Saturation(this IImageOperations< /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Saturation(this IImageOperations source, int amount, Rectangle rectangle) + public static IImageProcessorApplicator Saturation(this IImageProcessorApplicator source, int amount, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new SaturationProcessor(amount), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Sepia.cs b/src/ImageSharp/Processing/ColorMatrix/Sepia.cs index f4dbb26c1a..5cf64a020b 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Sepia.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Sepia.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Sepia(this IImageOperations source) + public static IImageProcessorApplicator Sepia(this IImageProcessorApplicator source) where TPixel : struct, IPixel => source.ApplyProcessor(new SepiaProcessor()); @@ -37,7 +37,7 @@ public static IImageOperations Sepia(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Sepia(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator Sepia(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new SepiaProcessor(), rectangle); } diff --git a/src/ImageSharp/Processing/Convolution/BoxBlur.cs b/src/ImageSharp/Processing/Convolution/BoxBlur.cs index cc0931215c..c25de35718 100644 --- a/src/ImageSharp/Processing/Convolution/BoxBlur.cs +++ b/src/ImageSharp/Processing/Convolution/BoxBlur.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations BoxBlur(this IImageOperations source) + public static IImageProcessorApplicator BoxBlur(this IImageProcessorApplicator source) where TPixel : struct, IPixel => source.ApplyProcessor(new BoxBlurProcessor(7)); @@ -34,7 +34,7 @@ public static IImageOperations BoxBlur(this IImageOperationsThe image this method extends. /// The 'radius' value representing the size of the area to sample. /// The . - public static IImageOperations BoxBlur(this IImageOperations source, int radius) + public static IImageProcessorApplicator BoxBlur(this IImageProcessorApplicator source, int radius) where TPixel : struct, IPixel => source.ApplyProcessor(new BoxBlurProcessor(radius)); @@ -48,7 +48,7 @@ public static IImageOperations BoxBlur(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations BoxBlur(this IImageOperations source, int radius, Rectangle rectangle) + public static IImageProcessorApplicator BoxBlur(this IImageProcessorApplicator source, int radius, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new BoxBlurProcessor(radius), rectangle); } diff --git a/src/ImageSharp/Processing/Convolution/DetectEdges.cs b/src/ImageSharp/Processing/Convolution/DetectEdges.cs index 18006752f9..7ececcfe23 100644 --- a/src/ImageSharp/Processing/Convolution/DetectEdges.cs +++ b/src/ImageSharp/Processing/Convolution/DetectEdges.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations DetectEdges(this IImageOperations source) + public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source) where TPixel : struct, IPixel { return DetectEdges(source, new SobelProcessor { Grayscale = true }); @@ -41,7 +41,7 @@ public static IImageOperations DetectEdges(this IImageOperations /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations DetectEdges(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel { return DetectEdges(source, rectangle, new SobelProcessor { Grayscale = true }); @@ -54,7 +54,7 @@ public static IImageOperations DetectEdges(this IImageOperations /// The image this method extends. /// The filter for detecting edges. /// The . - public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter) + public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, EdgeDetection filter) where TPixel : struct, IPixel => DetectEdges(source, GetProcessor(filter, true)); @@ -66,7 +66,7 @@ public static IImageOperations DetectEdges(this IImageOperations /// The filter for detecting edges. /// Whether to convert the image to Grayscale first. Defaults to true. /// The . - public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter, bool grayscale) + public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, EdgeDetection filter, bool grayscale) where TPixel : struct, IPixel => DetectEdges(source, GetProcessor(filter, grayscale)); @@ -81,7 +81,7 @@ public static IImageOperations DetectEdges(this IImageOperations /// /// Whether to convert the image to Grayscale first. Defaults to true. /// The . - public static IImageOperations DetectEdges(this IImageOperations source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true) + public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true) where TPixel : struct, IPixel => DetectEdges(source, rectangle, GetProcessor(filter, grayscale)); @@ -92,7 +92,7 @@ public static IImageOperations DetectEdges(this IImageOperations /// The image this method extends. /// The filter for detecting edges. /// The . - public static IImageOperations DetectEdges(this IImageOperations source, IEdgeDetectorProcessor filter) + public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, IEdgeDetectorProcessor filter) where TPixel : struct, IPixel { return source.ApplyProcessor(filter); @@ -108,7 +108,7 @@ public static IImageOperations DetectEdges(this IImageOperations /// /// The filter for detecting edges. /// The . - public static IImageOperations DetectEdges(this IImageOperations source, Rectangle rectangle, IEdgeDetectorProcessor filter) + public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, Rectangle rectangle, IEdgeDetectorProcessor filter) where TPixel : struct, IPixel { source.ApplyProcessor(filter, rectangle); diff --git a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs index 953a576fc6..4b1682818a 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations GaussianBlur(this IImageOperations source) + public static IImageProcessorApplicator GaussianBlur(this IImageProcessorApplicator source) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianBlurProcessor(3f)); @@ -35,7 +35,7 @@ public static IImageOperations GaussianBlur(this IImageOperation /// The image this method extends. /// The 'sigma' value representing the weight of the blur. /// The . - public static IImageOperations GaussianBlur(this IImageOperations source, float sigma) + public static IImageProcessorApplicator GaussianBlur(this IImageProcessorApplicator source, float sigma) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianBlurProcessor(sigma)); @@ -49,7 +49,7 @@ public static IImageOperations GaussianBlur(this IImageOperation /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations GaussianBlur(this IImageOperations source, float sigma, Rectangle rectangle) + public static IImageProcessorApplicator GaussianBlur(this IImageProcessorApplicator source, float sigma, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianBlurProcessor(sigma), rectangle); } diff --git a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs index 1d0cce2229..8c8ac6ed2c 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations GaussianSharpen(this IImageOperations source) + public static IImageProcessorApplicator GaussianSharpen(this IImageProcessorApplicator source) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianSharpenProcessor(3f)); @@ -35,7 +35,7 @@ public static IImageOperations GaussianSharpen(this IImageOperat /// The image this method extends. /// The 'sigma' value representing the weight of the blur. /// The . - public static IImageOperations GaussianSharpen(this IImageOperations source, float sigma) + public static IImageProcessorApplicator GaussianSharpen(this IImageProcessorApplicator source, float sigma) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianSharpenProcessor(sigma)); @@ -49,7 +49,7 @@ public static IImageOperations GaussianSharpen(this IImageOperat /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations GaussianSharpen(this IImageOperations source, float sigma, Rectangle rectangle) + public static IImageProcessorApplicator GaussianSharpen(this IImageProcessorApplicator source, float sigma, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianSharpenProcessor(sigma), rectangle); } diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs index 52ec736f5d..a5647d69eb 100644 --- a/src/ImageSharp/Processing/Delegate.cs +++ b/src/ImageSharp/Processing/Delegate.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The image to rotate, flip, or both. /// The operations to perform on the source. /// returns the current optinoatins class to allow chaining of oprations. - public static IImageOperations Run(this IImageOperations source, Action> operation) + public static IImageProcessorApplicator Run(this IImageProcessorApplicator source, Action> operation) where TPixel : struct, IPixel => source.ApplyProcessor(new DelegateProcessor(operation)); } diff --git a/src/ImageSharp/Processing/Effects/Alpha.cs b/src/ImageSharp/Processing/Effects/Alpha.cs index 4978caf86c..b49a697da8 100644 --- a/src/ImageSharp/Processing/Effects/Alpha.cs +++ b/src/ImageSharp/Processing/Effects/Alpha.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The new opacity of the image. Must be between 0 and 1. /// The . - public static IImageOperations Alpha(this IImageOperations source, float percent) + public static IImageProcessorApplicator Alpha(this IImageProcessorApplicator source, float percent) where TPixel : struct, IPixel => source.ApplyProcessor(new AlphaProcessor(percent)); @@ -38,7 +38,7 @@ public static IImageOperations Alpha(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Alpha(this IImageOperations source, float percent, Rectangle rectangle) + public static IImageProcessorApplicator Alpha(this IImageProcessorApplicator source, float percent, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new AlphaProcessor(percent), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/BackgroundColor.cs b/src/ImageSharp/Processing/Effects/BackgroundColor.cs index 276bfa2a72..c4754c8e6f 100644 --- a/src/ImageSharp/Processing/Effects/BackgroundColor.cs +++ b/src/ImageSharp/Processing/Effects/BackgroundColor.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The color to set as the background. /// The options effecting pixel blending. /// The . - public static IImageOperations BackgroundColor(this IImageOperations source, TPixel color, GraphicsOptions options) + public static IImageProcessorApplicator BackgroundColor(this IImageProcessorApplicator source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new BackgroundColorProcessor(color, options)); @@ -40,7 +40,7 @@ public static IImageOperations BackgroundColor(this IImageOperat /// /// The options effecting pixel blending. /// The . - public static IImageOperations BackgroundColor(this IImageOperations source, TPixel color, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessorApplicator BackgroundColor(this IImageProcessorApplicator source, TPixel color, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new BackgroundColorProcessor(color, options), rectangle); @@ -51,7 +51,7 @@ public static IImageOperations BackgroundColor(this IImageOperat /// The image this method extends. /// The color to set as the background. /// The . - public static IImageOperations BackgroundColor(this IImageOperations source, TPixel color) + public static IImageProcessorApplicator BackgroundColor(this IImageProcessorApplicator source, TPixel color) where TPixel : struct, IPixel { return BackgroundColor(source, color, GraphicsOptions.Default); @@ -67,7 +67,7 @@ public static IImageOperations BackgroundColor(this IImageOperat /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations BackgroundColor(this IImageOperations source, TPixel color, Rectangle rectangle) + public static IImageProcessorApplicator BackgroundColor(this IImageProcessorApplicator source, TPixel color, Rectangle rectangle) where TPixel : struct, IPixel { return BackgroundColor(source, color, rectangle, GraphicsOptions.Default); diff --git a/src/ImageSharp/Processing/Effects/Brightness.cs b/src/ImageSharp/Processing/Effects/Brightness.cs index 9bc27e75d7..59a02d4562 100644 --- a/src/ImageSharp/Processing/Effects/Brightness.cs +++ b/src/ImageSharp/Processing/Effects/Brightness.cs @@ -24,8 +24,8 @@ public static partial class ImageExtensions /// The image this method extends. /// The new brightness of the image. Must be between -100 and 100. /// The . - public static IImageOperations Brightness(this IImageOperations source, int amount) - where TPixel : struct, IPixel + public static IImageProcessorApplicator Brightness(this IImageProcessorApplicator source, int amount) + where TPixel : struct, IPixel => source.ApplyProcessor(new BrightnessProcessor(amount)); /// @@ -38,7 +38,7 @@ public static IImageOperations Brightness(this IImageOperations< /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Brightness(this IImageOperations source, int amount, Rectangle rectangle) + public static IImageProcessorApplicator Brightness(this IImageProcessorApplicator source, int amount, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new BrightnessProcessor(amount), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/Contrast.cs b/src/ImageSharp/Processing/Effects/Contrast.cs index 52eb0d5eca..e94605a75d 100644 --- a/src/ImageSharp/Processing/Effects/Contrast.cs +++ b/src/ImageSharp/Processing/Effects/Contrast.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The new contrast of the image. Must be between -100 and 100. /// The . - public static IImageOperations Contrast(this IImageOperations source, int amount) + public static IImageProcessorApplicator Contrast(this IImageProcessorApplicator source, int amount) where TPixel : struct, IPixel => source.ApplyProcessor(new ContrastProcessor(amount)); @@ -38,7 +38,7 @@ public static IImageOperations Contrast(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Contrast(this IImageOperations source, int amount, Rectangle rectangle) + public static IImageProcessorApplicator Contrast(this IImageProcessorApplicator source, int amount, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new ContrastProcessor(amount), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/Invert.cs b/src/ImageSharp/Processing/Effects/Invert.cs index 4f8c6a8864..5e0ceab75e 100644 --- a/src/ImageSharp/Processing/Effects/Invert.cs +++ b/src/ImageSharp/Processing/Effects/Invert.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Invert(this IImageOperations source) + public static IImageProcessorApplicator Invert(this IImageProcessorApplicator source) where TPixel : struct, IPixel => source.ApplyProcessor(new InvertProcessor()); @@ -36,7 +36,7 @@ public static IImageOperations Invert(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Invert(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator Invert(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new InvertProcessor(), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/OilPainting.cs b/src/ImageSharp/Processing/Effects/OilPainting.cs index 23d5528856..e6a8c8373b 100644 --- a/src/ImageSharp/Processing/Effects/OilPainting.cs +++ b/src/ImageSharp/Processing/Effects/OilPainting.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations OilPaint(this IImageOperations source) + public static IImageProcessorApplicator OilPaint(this IImageProcessorApplicator source) where TPixel : struct, IPixel { return OilPaint(source, 10, 15); @@ -40,7 +40,7 @@ public static IImageOperations OilPaint(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations OilPaint(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator OilPaint(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel { return OilPaint(source, 10, 15, rectangle); @@ -54,7 +54,7 @@ public static IImageOperations OilPaint(this IImageOperationsThe number of intensity levels. Higher values result in a broader range of color intensities forming part of the result image. /// The number of neighboring pixels used in calculating each individual pixel value. /// The . - public static IImageOperations OilPaint(this IImageOperations source, int levels, int brushSize) + public static IImageProcessorApplicator OilPaint(this IImageProcessorApplicator source, int levels, int brushSize) where TPixel : struct, IPixel => source.ApplyProcessor(new OilPaintingProcessor(levels, brushSize)); @@ -69,7 +69,7 @@ public static IImageOperations OilPaint(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations OilPaint(this IImageOperations source, int levels, int brushSize, Rectangle rectangle) + public static IImageProcessorApplicator OilPaint(this IImageProcessorApplicator source, int levels, int brushSize, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new OilPaintingProcessor(levels, brushSize), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/Pixelate.cs b/src/ImageSharp/Processing/Effects/Pixelate.cs index b9403b765c..c1e6318381 100644 --- a/src/ImageSharp/Processing/Effects/Pixelate.cs +++ b/src/ImageSharp/Processing/Effects/Pixelate.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Pixelate(this IImageOperations source) + public static IImageProcessorApplicator Pixelate(this IImageProcessorApplicator source) where TPixel : struct, IPixel => source.ApplyProcessor(new PixelateProcessor(4)); @@ -34,7 +34,7 @@ public static IImageOperations Pixelate(this IImageOperationsThe image this method extends. /// The size of the pixels. /// The . - public static IImageOperations Pixelate(this IImageOperations source, int size) + public static IImageProcessorApplicator Pixelate(this IImageProcessorApplicator source, int size) where TPixel : struct, IPixel => source.ApplyProcessor(new PixelateProcessor(size)); @@ -48,7 +48,7 @@ public static IImageOperations Pixelate(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Pixelate(this IImageOperations source, int size, Rectangle rectangle) + public static IImageProcessorApplicator Pixelate(this IImageProcessorApplicator source, int size, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new PixelateProcessor(size), rectangle); } diff --git a/src/ImageSharp/Processing/Overlays/Glow.cs b/src/ImageSharp/Processing/Overlays/Glow.cs index 4c58a27d45..30ff666921 100644 --- a/src/ImageSharp/Processing/Overlays/Glow.cs +++ b/src/ImageSharp/Processing/Overlays/Glow.cs @@ -21,7 +21,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Glow(this IImageOperations source) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source) where TPixel : struct, IPixel { return Glow(source, GraphicsOptions.Default); @@ -34,7 +34,7 @@ public static IImageOperations Glow(this IImageOperationsThe image this method extends. /// The color to set as the glow. /// The . - public static IImageOperations Glow(this IImageOperations source, TPixel color) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color) where TPixel : struct, IPixel { return Glow(source, color, GraphicsOptions.Default); @@ -47,7 +47,7 @@ public static IImageOperations Glow(this IImageOperationsThe image this method extends. /// The the radius. /// The . - public static IImageOperations Glow(this IImageOperations source, float radius) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, float radius) where TPixel : struct, IPixel { return Glow(source, radius, GraphicsOptions.Default); @@ -62,7 +62,7 @@ public static IImageOperations Glow(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Glow(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel => source.Glow(rectangle, GraphicsOptions.Default); @@ -77,7 +77,7 @@ public static IImageOperations Glow(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Glow(this IImageOperations source, TPixel color, float radius, Rectangle rectangle) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, float radius, Rectangle rectangle) where TPixel : struct, IPixel => source.Glow(color, ValueSize.Absolute(radius), rectangle, GraphicsOptions.Default); @@ -88,7 +88,7 @@ public static IImageOperations Glow(this IImageOperationsThe image this method extends. /// The options effecting things like blending. /// The . - public static IImageOperations Glow(this IImageOperations source, GraphicsOptions options) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(NamedColors.Black, ValueSize.PercentageOfWidth(0.5f), options); @@ -100,7 +100,7 @@ public static IImageOperations Glow(this IImageOperationsThe color to set as the glow. /// The options effecting things like blending. /// The . - public static IImageOperations Glow(this IImageOperations source, TPixel color, GraphicsOptions options) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(color, ValueSize.PercentageOfWidth(0.5f), options); @@ -112,7 +112,7 @@ public static IImageOperations Glow(this IImageOperationsThe the radius. /// The options effecting things like blending. /// The . - public static IImageOperations Glow(this IImageOperations source, float radius, GraphicsOptions options) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, float radius, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(NamedColors.Black, ValueSize.Absolute(radius), options); @@ -126,7 +126,7 @@ public static IImageOperations Glow(this IImageOperations /// The options effecting things like blending. /// The . - public static IImageOperations Glow(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(NamedColors.Black, ValueSize.PercentageOfWidth(0.5f), rectangle, options); @@ -142,7 +142,7 @@ public static IImageOperations Glow(this IImageOperations /// The options effecting things like blending. /// The . - public static IImageOperations Glow(this IImageOperations source, TPixel color, float radius, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, float radius, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(color, ValueSize.Absolute(radius), rectangle, options); @@ -158,7 +158,7 @@ public static IImageOperations Glow(this IImageOperations /// The options effecting things like blending. /// The . - private static IImageOperations Glow(this IImageOperations source, TPixel color, ValueSize radius, Rectangle rectangle, GraphicsOptions options) + private static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, ValueSize radius, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new GlowProcessor(color, radius, options), rectangle); @@ -171,7 +171,7 @@ private static IImageOperations Glow(this IImageOperationsThe the radius. /// The options effecting things like blending. /// The . - private static IImageOperations Glow(this IImageOperations source, TPixel color, ValueSize radius, GraphicsOptions options) + private static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, ValueSize radius, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new GlowProcessor(color, radius, options)); } diff --git a/src/ImageSharp/Processing/Overlays/Vignette.cs b/src/ImageSharp/Processing/Overlays/Vignette.cs index 175d3ea3a2..81cd773b2b 100644 --- a/src/ImageSharp/Processing/Overlays/Vignette.cs +++ b/src/ImageSharp/Processing/Overlays/Vignette.cs @@ -21,7 +21,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageOperations Vignette(this IImageOperations source) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source) where TPixel : struct, IPixel { return Vignette(source, GraphicsOptions.Default); @@ -34,7 +34,7 @@ public static IImageOperations Vignette(this IImageOperationsThe image this method extends. /// The color to set as the vignette. /// The . - public static IImageOperations Vignette(this IImageOperations source, TPixel color) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, TPixel color) where TPixel : struct, IPixel { return Vignette(source, color, GraphicsOptions.Default); @@ -48,7 +48,7 @@ public static IImageOperations Vignette(this IImageOperationsThe the x-radius. /// The the y-radius. /// The . - public static IImageOperations Vignette(this IImageOperations source, float radiusX, float radiusY) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, float radiusX, float radiusY) where TPixel : struct, IPixel { return Vignette(source, radiusX, radiusY, GraphicsOptions.Default); @@ -63,7 +63,7 @@ public static IImageOperations Vignette(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Vignette(this IImageOperations source, Rectangle rectangle) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, Rectangle rectangle) where TPixel : struct, IPixel { return Vignette(source, rectangle, GraphicsOptions.Default); @@ -81,7 +81,7 @@ public static IImageOperations Vignette(this IImageOperations structure that specifies the portion of the image object to alter. /// /// The . - public static IImageOperations Vignette(this IImageOperations source, TPixel color, float radiusX, float radiusY, Rectangle rectangle) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, TPixel color, float radiusX, float radiusY, Rectangle rectangle) where TPixel : struct, IPixel => source.Vignette(color, radiusX, radiusY, rectangle, GraphicsOptions.Default); @@ -92,7 +92,7 @@ public static IImageOperations Vignette(this IImageOperationsThe image this method extends. /// The options effecting pixel blending. /// The . - public static IImageOperations Vignette(this IImageOperations source, GraphicsOptions options) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(NamedColors.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options); @@ -104,7 +104,7 @@ public static IImageOperations Vignette(this IImageOperationsThe color to set as the vignette. /// The options effecting pixel blending. /// The . - public static IImageOperations Vignette(this IImageOperations source, TPixel color, GraphicsOptions options) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(color, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options); @@ -117,7 +117,7 @@ public static IImageOperations Vignette(this IImageOperationsThe the y-radius. /// The options effecting pixel blending. /// The . - public static IImageOperations Vignette(this IImageOperations source, float radiusX, float radiusY, GraphicsOptions options) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, float radiusX, float radiusY, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(NamedColors.Black, radiusX, radiusY, options); @@ -131,7 +131,7 @@ public static IImageOperations Vignette(this IImageOperations /// The options effecting pixel blending. /// The . - public static IImageOperations Vignette(this IImageOperations source, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(NamedColors.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), rectangle, options); @@ -148,15 +148,15 @@ public static IImageOperations Vignette(this IImageOperations /// The options effecting pixel blending. /// The . - public static IImageOperations Vignette(this IImageOperations source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(color, radiusX, radiusY, rectangle, options); - private static IImageOperations VignetteInternal(this IImageOperations source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options) + private static IImageProcessorApplicator VignetteInternal(this IImageProcessorApplicator source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new VignetteProcessor(color, radiusX, radiusY, options), rectangle); - private static IImageOperations VignetteInternal(this IImageOperations source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options) + private static IImageProcessorApplicator VignetteInternal(this IImageProcessorApplicator source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new VignetteProcessor(color, radiusX, radiusY, options)); } diff --git a/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs index ceb985b0b7..e5813f0d5c 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs @@ -50,7 +50,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan using (var firstPassPixels = new PixelAccessor(width, height)) using (PixelAccessor sourcePixels = source.Lock()) { - this.ApplyConvolution(firstPassPixels, sourcePixels, source.Bounds, this.KernelX); + this.ApplyConvolution(firstPassPixels, sourcePixels, source.Bounds(), this.KernelX); this.ApplyConvolution(sourcePixels, firstPassPixels, sourceRectangle, this.KernelY); } } diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs index 367c288fca..cc21c3e19e 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs @@ -89,7 +89,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan int maxY = Math.Min(source.Height, endY); // we need a clean copy for each pass to start from - using (ImageBase cleanCopy = new Image(source)) + using (ImageBase cleanCopy = source.Clone()) { new ConvolutionProcessor(kernels[0]).Apply(source, sourceRectangle); @@ -116,7 +116,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan // ReSharper disable once ForCanBeConvertedToForeach for (int i = 1; i < kernels.Length; i++) { - using (ImageBase pass = new Image(cleanCopy)) + using (ImageBase pass = cleanCopy.Clone()) { new ConvolutionProcessor(kernels[i]).Apply(pass, sourceRectangle); diff --git a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs index 5da6a96dcf..2b9c88f2d6 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs @@ -62,7 +62,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan TPixel glowColor = this.GlowColor; Vector2 centre = Rectangle.Center(sourceRectangle); - var finalRadius = this.Radius.Calculate(source.Bounds.Size); + var finalRadius = this.Radius.Calculate(source.Size()); float maxDistance = finalRadius > 0 ? MathF.Min(finalRadius, sourceRectangle.Width * .5F) : sourceRectangle.Width * .5F; diff --git a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs index 07c45f4f03..de50dd84bf 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs @@ -81,8 +81,8 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan TPixel vignetteColor = this.VignetteColor; Vector2 centre = Rectangle.Center(sourceRectangle); - var finalradiusX = this.RadiusX.Calculate(source.Bounds.Size); - var finalradiusY = this.RadiusY.Calculate(source.Bounds.Size); + var finalradiusX = this.RadiusX.Calculate(source.Size()); + var finalradiusY = this.RadiusY.Calculate(source.Size()); float rX = finalradiusX > 0 ? MathF.Min(finalradiusX, sourceRectangle.Width * .5F) : sourceRectangle.Width * .5F; float rY = finalradiusY > 0 ? MathF.Min(finalradiusY, sourceRectangle.Height * .5F) : sourceRectangle.Height * .5F; float maxDistance = MathF.Sqrt((rX * rX) + (rY * rY)); diff --git a/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs index a52065ea9b..648e86d3c9 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs @@ -39,7 +39,7 @@ public EntropyCropProcessor(float threshold) /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) { - using (ImageBase temp = new Image(source)) + using (ImageBase temp = source.Clone()) { // Detect the edges. new SobelProcessor().Apply(temp, sourceRectangle); diff --git a/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs index e6b1d180f1..45d04626e8 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs @@ -45,6 +45,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan int height = this.CanvasRectangle.Height; int width = this.CanvasRectangle.Width; Matrix3x2 matrix = this.GetCenteredMatrix(source, this.processMatrix); + Rectangle sourceBounds = source.Bounds(); using (var targetPixels = new PixelAccessor(width, height)) { @@ -60,7 +61,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan { var transformedPoint = Point.Rotate(new Point(x, y), matrix); - if (source.Bounds.Contains(transformedPoint.X, transformedPoint.Y)) + if (sourceBounds.Contains(transformedPoint.X, transformedPoint.Y)) { targetRow[x] = source[transformedPoint.X, transformedPoint.Y]; } diff --git a/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs index 9766caa696..757f3fa0be 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs @@ -45,6 +45,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan int height = this.CanvasRectangle.Height; int width = this.CanvasRectangle.Width; Matrix3x2 matrix = this.GetCenteredMatrix(source, this.processMatrix); + Rectangle sourceBounds = source.Bounds(); using (var targetPixels = new PixelAccessor(width, height)) { @@ -60,7 +61,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan { var transformedPoint = Point.Skew(new Point(x, y), matrix); - if (source.Bounds.Contains(transformedPoint.X, transformedPoint.Y)) + if (sourceBounds.Contains(transformedPoint.X, transformedPoint.Y)) { targetRow[x] = source[transformedPoint.X, transformedPoint.Y]; } diff --git a/src/ImageSharp/Processing/Transforms/AutoOrient.cs b/src/ImageSharp/Processing/Transforms/AutoOrient.cs index 6f7d1b665c..f741e41b13 100644 --- a/src/ImageSharp/Processing/Transforms/AutoOrient.cs +++ b/src/ImageSharp/Processing/Transforms/AutoOrient.cs @@ -21,7 +21,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image to auto rotate. /// The - public static IImageOperations AutoOrient(this IImageOperations source) + public static IImageProcessorApplicator AutoOrient(this IImageProcessorApplicator source) where TPixel : struct, IPixel => source.ApplyProcessor(new Processing.Processors.AutoRotateProcessor()); } diff --git a/src/ImageSharp/Processing/Transforms/Crop.cs b/src/ImageSharp/Processing/Transforms/Crop.cs index c518ac5ac1..aad80fa0fc 100644 --- a/src/ImageSharp/Processing/Transforms/Crop.cs +++ b/src/ImageSharp/Processing/Transforms/Crop.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The target image width. /// The target image height. /// The - public static IImageOperations Crop(this IImageOperations source, int width, int height) + public static IImageProcessorApplicator Crop(this IImageProcessorApplicator source, int width, int height) where TPixel : struct, IPixel => Crop(source, new Rectangle(0, 0, width, height)); @@ -38,7 +38,7 @@ public static IImageOperations Crop(this IImageOperations structure that specifies the portion of the image object to retain. /// /// The - public static IImageOperations Crop(this IImageOperations source, Rectangle cropRectangle) + public static IImageProcessorApplicator Crop(this IImageProcessorApplicator source, Rectangle cropRectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new CropProcessor(cropRectangle)); } diff --git a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs b/src/ImageSharp/Processing/Transforms/EntropyCrop.cs index 00f4043215..a0704619c2 100644 --- a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs +++ b/src/ImageSharp/Processing/Transforms/EntropyCrop.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The image to crop. /// The threshold for entropic density. /// The - public static IImageOperations EntropyCrop(this IImageOperations source, float threshold = .5f) + public static IImageProcessorApplicator EntropyCrop(this IImageProcessorApplicator source, float threshold = .5f) where TPixel : struct, IPixel => source.ApplyProcessor(new EntropyCropProcessor(threshold)); } diff --git a/src/ImageSharp/Processing/Transforms/Flip.cs b/src/ImageSharp/Processing/Transforms/Flip.cs index 6cde1257c9..2f20c3bd8a 100644 --- a/src/ImageSharp/Processing/Transforms/Flip.cs +++ b/src/ImageSharp/Processing/Transforms/Flip.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image to rotate, flip, or both. /// The to perform the flip. /// The - public static IImageOperations Flip(this IImageOperations source, FlipType flipType) + public static IImageProcessorApplicator Flip(this IImageProcessorApplicator source, FlipType flipType) where TPixel : struct, IPixel => source.ApplyProcessor(new FlipProcessor(flipType)); } diff --git a/src/ImageSharp/Processing/Transforms/Pad.cs b/src/ImageSharp/Processing/Transforms/Pad.cs index fb064f5ce5..90a9e281b0 100644 --- a/src/ImageSharp/Processing/Transforms/Pad.cs +++ b/src/ImageSharp/Processing/Transforms/Pad.cs @@ -26,7 +26,7 @@ public static partial class ImageExtensions /// The new width. /// The new height. /// The . - public static IImageOperations Pad(this IImageOperations source, int width, int height) + public static IImageProcessorApplicator Pad(this IImageProcessorApplicator source, int width, int height) where TPixel : struct, IPixel { ResizeOptions options = new ResizeOptions diff --git a/src/ImageSharp/Processing/Transforms/Resize.cs b/src/ImageSharp/Processing/Transforms/Resize.cs index 6ccea5f42d..4c04991c02 100644 --- a/src/ImageSharp/Processing/Transforms/Resize.cs +++ b/src/ImageSharp/Processing/Transforms/Resize.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The resize options. /// The /// Passing zero for one of height or width within the resize options will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, ResizeOptions options) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, ResizeOptions options) where TPixel : struct, IPixel { return source.Run(img => @@ -56,7 +56,7 @@ public static IImageOperations Resize(this IImageOperationsThe target image size. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, Size size) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, Size size) where TPixel : struct, IPixel { return Resize(source, size.Width, size.Height, new BicubicResampler(), false); @@ -71,7 +71,7 @@ public static IImageOperations Resize(this IImageOperationsWhether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, Size size, bool compand) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, Size size, bool compand) where TPixel : struct, IPixel { return Resize(source, size.Width, size.Height, new BicubicResampler(), compand); @@ -86,7 +86,7 @@ public static IImageOperations Resize(this IImageOperationsThe target image height. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, int width, int height) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height) where TPixel : struct, IPixel { return Resize(source, width, height, new BicubicResampler(), false); @@ -102,7 +102,7 @@ public static IImageOperations Resize(this IImageOperationsWhether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, int width, int height, bool compand) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, bool compand) where TPixel : struct, IPixel { return Resize(source, width, height, new BicubicResampler(), compand); @@ -118,7 +118,7 @@ public static IImageOperations Resize(this IImageOperationsThe to perform the resampling. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, int width, int height, IResampler sampler) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, IResampler sampler) where TPixel : struct, IPixel { return Resize(source, width, height, sampler, false); @@ -135,7 +135,7 @@ public static IImageOperations Resize(this IImageOperationsWhether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, int width, int height, IResampler sampler, bool compand) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, IResampler sampler, bool compand) where TPixel : struct, IPixel { return Resize(source, width, height, sampler, new Rectangle(0, 0, width, height), compand); @@ -159,7 +159,7 @@ public static IImageOperations Resize(this IImageOperationsWhether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel { return source.Run(img => @@ -199,7 +199,7 @@ public static IImageOperations Resize(this IImageOperationsWhether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageOperations Resize(this IImageOperations source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand) + public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel { return source.Run(img => diff --git a/src/ImageSharp/Processing/Transforms/Rotate.cs b/src/ImageSharp/Processing/Transforms/Rotate.cs index 92349dba37..08ac44dad5 100644 --- a/src/ImageSharp/Processing/Transforms/Rotate.cs +++ b/src/ImageSharp/Processing/Transforms/Rotate.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image to rotate. /// The angle in degrees to perform the rotation. /// The - public static IImageOperations Rotate(this IImageOperations source, float degrees) + public static IImageProcessorApplicator Rotate(this IImageProcessorApplicator source, float degrees) where TPixel : struct, IPixel { return Rotate(source, degrees, true); @@ -37,7 +37,7 @@ public static IImageOperations Rotate(this IImageOperationsThe image to rotate. /// The to perform the rotation. /// The - public static IImageOperations Rotate(this IImageOperations source, RotateType rotateType) + public static IImageProcessorApplicator Rotate(this IImageProcessorApplicator source, RotateType rotateType) where TPixel : struct, IPixel => Rotate(source, (float)rotateType, false); @@ -49,7 +49,7 @@ public static IImageOperations Rotate(this IImageOperationsThe angle in degrees to perform the rotation. /// Whether to expand the image to fit the rotated result. /// The - public static IImageOperations Rotate(this IImageOperations source, float degrees, bool expand) + public static IImageProcessorApplicator Rotate(this IImageProcessorApplicator source, float degrees, bool expand) where TPixel : struct, IPixel => source.ApplyProcessor(new RotateProcessor { Angle = degrees, Expand = expand }); } diff --git a/src/ImageSharp/Processing/Transforms/RotateFlip.cs b/src/ImageSharp/Processing/Transforms/RotateFlip.cs index fda11d8338..2c321358ec 100644 --- a/src/ImageSharp/Processing/Transforms/RotateFlip.cs +++ b/src/ImageSharp/Processing/Transforms/RotateFlip.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The to perform the rotation. /// The to perform the flip. /// The - public static IImageOperations RotateFlip(this IImageOperations source, RotateType rotateType, FlipType flipType) + public static IImageProcessorApplicator RotateFlip(this IImageProcessorApplicator source, RotateType rotateType, FlipType flipType) where TPixel : struct, IPixel { return source.Rotate(rotateType).Flip(flipType); diff --git a/src/ImageSharp/Processing/Transforms/Skew.cs b/src/ImageSharp/Processing/Transforms/Skew.cs index f38606eda1..8fde7270d5 100644 --- a/src/ImageSharp/Processing/Transforms/Skew.cs +++ b/src/ImageSharp/Processing/Transforms/Skew.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The angle in degrees to perform the rotation along the x-axis. /// The angle in degrees to perform the rotation along the y-axis. /// The - public static IImageOperations Skew(this IImageOperations source, float degreesX, float degreesY) + public static IImageProcessorApplicator Skew(this IImageProcessorApplicator source, float degreesX, float degreesY) where TPixel : struct, IPixel { return Skew(source, degreesX, degreesY, true); @@ -39,7 +39,7 @@ public static IImageOperations Skew(this IImageOperationsThe angle in degrees to perform the rotation along the y-axis. /// Whether to expand the image to fit the skewed result. /// The - public static IImageOperations Skew(this IImageOperations source, float degreesX, float degreesY, bool expand) + public static IImageProcessorApplicator Skew(this IImageProcessorApplicator source, float degreesX, float degreesY, bool expand) where TPixel : struct, IPixel => source.ApplyProcessor(new SkewProcessor { AngleX = degreesX, AngleY = degreesY, Expand = expand }); } diff --git a/src/ImageSharp/Quantizers/Quantize.cs b/src/ImageSharp/Quantizers/Quantize.cs index 2b5130f8c1..54c57b508f 100644 --- a/src/ImageSharp/Quantizers/Quantize.cs +++ b/src/ImageSharp/Quantizers/Quantize.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The quantization mode to apply to perform the operation. /// The maximum number of colors to return. Defaults to 256. /// The . - public static IImageOperations Quantize(this IImageOperations source, Quantization mode = Quantization.Octree, int maxColors = 256) + public static IImageProcessorApplicator Quantize(this IImageProcessorApplicator source, Quantization mode = Quantization.Octree, int maxColors = 256) where TPixel : struct, IPixel { IQuantizer quantizer; @@ -54,7 +54,7 @@ public static IImageOperations Quantize(this IImageOperationsThe quantizer to apply to perform the operation. /// The maximum number of colors to return. /// The . - public static IImageOperations Quantize(this IImageOperations source, IQuantizer quantizer, int maxColors) + public static IImageProcessorApplicator Quantize(this IImageProcessorApplicator source, IQuantizer quantizer, int maxColors) where TPixel : struct, IPixel { return source.Run(img => diff --git a/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs b/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs index 2e3ea7a543..d8a2de148e 100644 --- a/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs @@ -70,7 +70,7 @@ public virtual QuantizedImage Quantize(ImageBase image, int maxC if (this.Dither) { // We clone the image as we don't want to alter the original. - using (var clone = new Image(image)) + using (ImageBase clone = image.Clone()) { this.SecondPass(clone, quantizedPixels, width, height); } diff --git a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs index 53cdb1b93e..88851bd0ca 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs @@ -35,7 +35,7 @@ public CoreSize GlowBulk() { using (Image image = new Image(800, 800)) { - image.ApplyProcessor(bulk, image.Bounds); + bulk.Apply(image, image.Bounds()); return new CoreSize(image.Width, image.Height); } } @@ -45,7 +45,7 @@ public CoreSize GLowSimple() { using (Image image = new Image(800, 800)) { - image.ApplyProcessor(parallel, image.Bounds); + parallel.Apply(image, image.Bounds()); return new CoreSize(image.Width, image.Height); } } diff --git a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs index 398db976e5..997215ce2e 100644 --- a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs +++ b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs @@ -17,7 +17,7 @@ public BaseImageOperationsExtensionTest() { this.options = new GraphicsOptions(false) { }; this.rect = new Rectangle(91, 123, 324, 56); // make this random? - this.operations = new FakeImageOperationsProvider.FakeImageOperations(null); + this.operations = new FakeImageOperationsProvider.FakeImageOperations(null, false); } public T Verify(int index = 0) @@ -28,6 +28,7 @@ public T Verify(int index = 0) return Assert.IsType(operation.Processor); } + public T Verify(Rectangle rect, int index = 0) { Assert.InRange(index, 0, this.operations.applied.Count - 1); diff --git a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs index b9a1d80a20..70e55b4269 100644 --- a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs +++ b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs @@ -8,7 +8,7 @@ using ImageSharp.Processing; using SixLabors.Primitives; - public class FakeImageOperationsProvider : IImageOperationsProvider + public class FakeImageOperationsProvider : IImageProcessorApplicatorFactory { private List ImageOperators = new List(); @@ -29,27 +29,41 @@ public IEnumerable> Created(Image so .SelectMany(x => x.applied); } - public IImageOperations CreateMutator(Image source) where TPixel : struct, IPixel + public IInternalImageProcessorApplicator CreateImageOperations(Image source, bool mutate) where TPixel : struct, IPixel { - var op = new FakeImageOperations(source); + var op = new FakeImageOperations(source, mutate); this.ImageOperators.Add(op); return op; } - public class FakeImageOperations : IImageOperations + public class FakeImageOperations : IInternalImageProcessorApplicator where TPixel : struct, IPixel { public Image source; public List applied = new List(); + public bool mutate; - public FakeImageOperations(Image source) + public FakeImageOperations(Image source, bool mutate) { - this.source = source; + this.mutate = mutate; + if (mutate) + { + this.source = source; + } + else + { + this.source = source.Clone(); + } + } + + public Image Apply() + { + return source; } - public IImageOperations ApplyProcessor(IImageProcessor processor, Rectangle rectangle) + public IImageProcessorApplicator ApplyProcessor(IImageProcessor processor, Rectangle rectangle) { applied.Add(new AppliedOpperation { @@ -59,7 +73,7 @@ public IImageOperations ApplyProcessor(IImageProcessor processor return this; } - public IImageOperations ApplyProcessor(IImageProcessor processor) + public IImageProcessorApplicator ApplyProcessor(IImageProcessor processor) { applied.Add(new AppliedOpperation { diff --git a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs index 1f669ba240..be6ce13433 100644 --- a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs +++ b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs @@ -64,7 +64,7 @@ public void QuantizeImageShouldPreserveMaximumColorPrecision() { using (Image srcImage = Image.Load(file.Bytes, out var mimeType)) { - using (Image image = new Image(srcImage)) + using (Image image = srcImage.Clone()) { using (FileStream output = File.OpenWrite($"{path}/Octree-{file.FileName}")) { @@ -74,7 +74,7 @@ public void QuantizeImageShouldPreserveMaximumColorPrecision() } } - using (Image image = new Image(srcImage)) + using (Image image = srcImage.Clone()) { using (FileStream output = File.OpenWrite($"{path}/Wu-{file.FileName}")) { @@ -83,7 +83,7 @@ public void QuantizeImageShouldPreserveMaximumColorPrecision() } } - using (Image image = new Image(srcImage)) + using (Image image = srcImage.Clone()) { using (FileStream output = File.OpenWrite($"{path}/Palette-{file.FileName}")) { diff --git a/tests/ImageSharp.Tests/ImageOperationTests.cs b/tests/ImageSharp.Tests/ImageOperationTests.cs index a84b0fcb0c..f7352a8eae 100644 --- a/tests/ImageSharp.Tests/ImageOperationTests.cs +++ b/tests/ImageSharp.Tests/ImageOperationTests.cs @@ -92,9 +92,9 @@ public void CloneCallsImageOperationsProvider_ListOfProcessors_NotOnOrigional() } [Fact] - public void ApplyProcessors_ListOfProcessors_AppliesALlProcessorsToOperation() + public void ApplyProcessors_ListOfProcessors_AppliesAllProcessorsToOperation() { - var operations = new FakeImageOperationsProvider.FakeImageOperations(null); + var operations = new FakeImageOperationsProvider.FakeImageOperations(null, false); operations.ApplyProcessors(this.processor); Assert.Contains(this.processor, operations.applied.Select(x => x.Processor)); } diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs index 3e8c99e359..209d506615 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs @@ -37,7 +37,7 @@ public void ImageShouldApplyBinaryThresholdInBox(TestImageProvider source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs index 0a4ccaeb1d..edaede58da 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs @@ -49,7 +49,7 @@ public void ImageShouldApplyDitherFilterInBox(TestImageProvider where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); @@ -78,7 +78,7 @@ public void ImageShouldApplyDiffusionFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs index 5b4953d600..dcc61a629a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs @@ -29,7 +29,7 @@ public void ImageShouldApplyBlackWhiteFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs index 6d2df4c9b3..59f389cfd8 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs @@ -43,7 +43,7 @@ public void ImageShouldApplyColorBlindnessFilterInBox(TestImageProvider< where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs index 3fba626c28..7fdc070050 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs @@ -48,7 +48,7 @@ public void ImageShouldApplyGrayscaleFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); image.Mutate(x => x.Grayscale(value, bounds)); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs index 1019e2def6..30beb61d07 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplyHueFilterInBox(TestImageProvider pro where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs index 9e7c2c02f9..be2464d1d9 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs @@ -29,7 +29,7 @@ public void ImageShouldApplyKodachromeFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs index d44f7005fd..1709995943 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs @@ -31,7 +31,7 @@ public void ImageShouldApplyLomographFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs index 29ae45be49..367ce04c78 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs @@ -29,7 +29,7 @@ public void ImageShouldApplyPolaroidFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs index df0af2bb68..ba0cc344ee 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplySaturationFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs index 82bd4b26e0..5879a8bb76 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs @@ -29,7 +29,7 @@ public void ImageShouldApplySepiaFilterInBox(TestImageProvider p where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs index 71b5ee69b4..3daa8c9334 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplyBoxBlurFilterInBox(TestImageProvider where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs index 7a5dbc1fca..72a3e90231 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs @@ -45,7 +45,7 @@ public void ImageShouldApplyDetectEdgesFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs index 5bb372e544..9ccc4e4536 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplyGaussianBlurFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs index 71eae5b093..dab576c2b8 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplyGaussianSharpenFilterInBox(TestImageProvider where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs index c29267b106..a7626f386b 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplyAlphaFilterInBox(TestImageProvider p where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs index 2e2768115d..70c2844de4 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs @@ -29,7 +29,7 @@ public void ImageShouldApplyBackgroundColorFilterInBox(TestImageProvider where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs index abd9951ab0..57b7cd8d9f 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplyBrightnessFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs index c9d322a976..a5423ba937 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplyContrastFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs index 839b1bb993..2816cb9258 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs @@ -29,7 +29,7 @@ public void ImageShouldApplyInvertFilterInBox(TestImageProvider where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs index 17598c6486..0a26cee69b 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs @@ -36,7 +36,7 @@ public void ImageShouldApplyOilPaintFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs index e24b359e38..92703ca076 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs @@ -52,7 +52,7 @@ public void ImageShouldApplyPixelateFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(image.Width / 4, image.Height / 4, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs index cab607973d..3f69ba148c 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs @@ -53,7 +53,7 @@ public void ImageShouldApplyGlowFilterInBox(TestImageProvider pr where TPixel : struct, IPixel { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs index 6f856c6867..c65b254c00 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs @@ -53,7 +53,7 @@ public void ImageShouldApplyVignetteFilterInBox(TestImageProvider { using (Image source = provider.GetImage()) - using (var image = new Image(source)) + using (var image = source.Clone()) { var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2); diff --git a/tests/ImageSharp.Tests/TestFile.cs b/tests/ImageSharp.Tests/TestFile.cs index f634eb3f4e..2b505a2e46 100644 --- a/tests/ImageSharp.Tests/TestFile.cs +++ b/tests/ImageSharp.Tests/TestFile.cs @@ -129,7 +129,7 @@ public string GetFileNameWithoutExtension(object value) /// public Image CreateImage() { - return new Image(this.image); + return this.image.Clone(); } /// diff --git a/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs b/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs index 4a0950788d..bfa70a2a50 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs @@ -28,7 +28,7 @@ public virtual Image CreateImage(byte[] bytes) public virtual Image CreateImage(Image other) { - return new Image(other); + return other.Clone(); } } } \ No newline at end of file diff --git a/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs b/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs index 20af430a5f..052a4c774f 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs @@ -15,7 +15,7 @@ public class ImageFactory : GenericFactory public override Image CreateImage(Image other) { - return new Image(other); + return other.Clone(); } } } diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs index e939d78bba..ae10bf9af4 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs @@ -85,7 +85,7 @@ public static TestImageProvider Solid( /// /// Returns an instance to the test case with the necessary traits. /// - public Image GetImage(Action> operationsToApply) + public Image GetImage(Action> operationsToApply) { var img = GetImage(); img.Mutate(operationsToApply); diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs index 96d38fc401..f25beb7269 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs @@ -49,7 +49,7 @@ public override Image GetImage() } } - return new Image(testImages[this.SourceFileOrDescription]); + return testImages[this.SourceFileOrDescription].Clone(); } /// From 9b865253a6fdb5de4786f635103e21460859bbc8 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Sat, 15 Jul 2017 09:39:48 +0100 Subject: [PATCH 13/33] fix some comments --- src/ImageSharp/ApplyProcessors.cs | 2 +- src/ImageSharp/IImageProcessorApplicatorFactory.cs | 2 +- src/ImageSharp/Image/ImageExtensions.cs | 2 +- src/ImageSharp/Image/Image{TPixel}.cs | 7 +------ 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index 78a5fc079b..c0a7f20df7 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // diff --git a/src/ImageSharp/IImageProcessorApplicatorFactory.cs b/src/ImageSharp/IImageProcessorApplicatorFactory.cs index b79353ef51..e07b1a7529 100644 --- a/src/ImageSharp/IImageProcessorApplicatorFactory.cs +++ b/src/ImageSharp/IImageProcessorApplicatorFactory.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // diff --git a/src/ImageSharp/Image/ImageExtensions.cs b/src/ImageSharp/Image/ImageExtensions.cs index 9c2575a86f..6095b49e3a 100644 --- a/src/ImageSharp/Image/ImageExtensions.cs +++ b/src/ImageSharp/Image/ImageExtensions.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // diff --git a/src/ImageSharp/Image/Image{TPixel}.cs b/src/ImageSharp/Image/Image{TPixel}.cs index ae89b777cd..70e0a83491 100644 --- a/src/ImageSharp/Image/Image{TPixel}.cs +++ b/src/ImageSharp/Image/Image{TPixel}.cs @@ -114,17 +114,12 @@ private Image(ImageBase other) /// The stream to save the image to. /// The encoder to save the image with. /// Thrown if the stream or encoder is null. - /// - /// The . - /// - public Image Save(Stream stream, IImageEncoder encoder) + public void Save(Stream stream, IImageEncoder encoder) { Guard.NotNull(stream, nameof(stream)); Guard.NotNull(encoder, nameof(encoder)); encoder.Encode(this, stream); - - return this; } /// From 41cadf98ac05a5b6ef73e10e3721dc8db9eb87c7 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Sat, 15 Jul 2017 15:12:30 +0100 Subject: [PATCH 14/33] fix broken tests --- tests/ImageSharp.Tests/FakeImageOperationsProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs index 70e55b4269..e06b918afd 100644 --- a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs +++ b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs @@ -54,7 +54,7 @@ public FakeImageOperations(Image source, bool mutate) } else { - this.source = source.Clone(); + this.source = source?.Clone(); } } From c421e6de0a69716f570701dee44e50483f5e16b1 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Sat, 15 Jul 2017 22:27:19 +0100 Subject: [PATCH 15/33] Cloneing Image Processor --- ...DefaultInternalImageProcessorApplicator.cs | 16 +- .../Image/ICloningImageProcessor.cs | 37 ++++ src/ImageSharp/Image/ImageBase{TPixel}.cs | 21 ++ src/ImageSharp/Image/ImageFrame{TPixel}.cs | 23 ++- src/ImageSharp/MetaData/ImageFrameMetaData.cs | 9 + src/ImageSharp/MetaData/ImageMetaData.cs | 9 + .../Processors/CLoneingImageProcessor.cs | 166 ++++++++++++++++ .../Transforms/ResamplingWeightedProcessor.cs | 8 +- .../Processors/Transforms/ResizeProcessor.cs | 180 ++++++++++-------- 9 files changed, 376 insertions(+), 93 deletions(-) create mode 100644 src/ImageSharp/Image/ICloningImageProcessor.cs create mode 100644 src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs diff --git a/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs b/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs index 4dda4f070f..ba476ba335 100644 --- a/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs +++ b/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs @@ -54,9 +54,19 @@ public IImageProcessorApplicator ApplyProcessor(IImageProcessor { if (!this.mutate && this.destination == null) { - // TODO check if the processor implements a special interface and if it does then allow it to take - // over and crereate the clone on behalf ImageOperations class. - this.destination = this.source.Clone(); + // this will only work if the first processor applied is the cloning one thus + // realistically for this optermissation to work the resize must the first processor + // applied any only up processors will take the douple data path. + if (processor is ICloningImageProcessor) + { + var cloningProcessor = (ICloningImageProcessor)processor; + this.destination = cloningProcessor.CloneAndApply(this.source, rectangle); + return this; + } + else + { + this.destination = this.source.Clone(); + } } processor.Apply(this.destination, rectangle); diff --git a/src/ImageSharp/Image/ICloningImageProcessor.cs b/src/ImageSharp/Image/ICloningImageProcessor.cs new file mode 100644 index 0000000000..8906063f9c --- /dev/null +++ b/src/ImageSharp/Image/ICloningImageProcessor.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Processing +{ + using System; + using System.Threading.Tasks; + + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + + /// + /// Encapsulates methods to alter the pixels of an image. + /// + /// The pixel format. + public interface ICloningImageProcessor : IImageProcessor + where TPixel : struct, IPixel + { + /// + /// Applies the process to the specified portion of the specified . + /// + /// The source image. Cannot be null. + /// + /// The structure that specifies the portion of the image object to draw. + /// + /// + /// is null. + /// + /// + /// doesnt fit the dimension of the image. + /// + /// Returns the cloned image after thre processor has been applied to it. + Image CloneAndApply(Image source, Rectangle sourceRectangle); + } +} diff --git a/src/ImageSharp/Image/ImageBase{TPixel}.cs b/src/ImageSharp/Image/ImageBase{TPixel}.cs index 95d5375185..7d965cb050 100644 --- a/src/ImageSharp/Image/ImageBase{TPixel}.cs +++ b/src/ImageSharp/Image/ImageBase{TPixel}.cs @@ -244,6 +244,27 @@ internal void SwapPixelsBuffers(PixelAccessor pixelSource) this.PixelBuffer = newPixels; } + /// + /// Switches the buffers used by the image and the pixelSource meaning that the Image will "own" the buffer from the pixelSource and the pixelSource will now own the Images buffer. + /// + /// The pixel source. + internal void SwapPixelsData(ImageBase pixelSource) + { + Guard.NotNull(pixelSource, nameof(pixelSource)); + + int newWidth = pixelSource.Width; + int newHeight = pixelSource.Height; + TPixel[] newPixels = pixelSource.PixelBuffer; + + pixelSource.PixelBuffer = this.PixelBuffer; + pixelSource.Width = this.Width; + pixelSource.Height = this.Height; + + this.Width = newWidth; + this.Height = newHeight; + this.PixelBuffer = newPixels; + } + /// /// Clones the image /// diff --git a/src/ImageSharp/Image/ImageFrame{TPixel}.cs b/src/ImageSharp/Image/ImageFrame{TPixel}.cs index c8cad16482..1e55d7b3b3 100644 --- a/src/ImageSharp/Image/ImageFrame{TPixel}.cs +++ b/src/ImageSharp/Image/ImageFrame{TPixel}.cs @@ -28,6 +28,23 @@ public sealed class ImageFrame : ImageBase, IImageFrame public ImageFrame(Configuration configuration, int width, int height) : base(configuration, width, height) { + this.MetaData = new ImageFrameMetaData(); + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The configuration providing initialization code which allows extending the library. + /// + /// The width of the image in pixels. + /// The height of the image in pixels. + /// The metadata of the frame. + public ImageFrame(Configuration configuration, int width, int height, ImageFrameMetaData metadata) + : base(configuration, width, height) + { + Guard.NotNull(metadata, nameof(metadata)); + this.MetaData = metadata; } /// @@ -38,6 +55,7 @@ public ImageFrame(Configuration configuration, int width, int height) public ImageFrame(int width, int height) : this(null, width, height) { + this.MetaData = new ImageFrameMetaData(); } /// @@ -47,6 +65,7 @@ public ImageFrame(int width, int height) internal ImageFrame(ImageBase image) : base(image) { + this.MetaData = new ImageFrameMetaData(); } /// @@ -62,12 +81,12 @@ private ImageFrame(ImageFrame image) /// /// Gets the meta data of the frame. /// - public ImageFrameMetaData MetaData { get; private set; } = new ImageFrameMetaData(); + public ImageFrameMetaData MetaData { get; private set; } /// public override string ToString() { - return $"ImageFrame: {this.Width}x{this.Height}"; + return $"ImageFrame<{typeof(TPixel).Name}>: {this.Width}x{this.Height}"; } /// diff --git a/src/ImageSharp/MetaData/ImageFrameMetaData.cs b/src/ImageSharp/MetaData/ImageFrameMetaData.cs index b55bfd1ad1..9004fbd1df 100644 --- a/src/ImageSharp/MetaData/ImageFrameMetaData.cs +++ b/src/ImageSharp/MetaData/ImageFrameMetaData.cs @@ -39,5 +39,14 @@ internal ImageFrameMetaData(ImageFrameMetaData other) /// public DisposalMethod DisposalMethod { get; set; } + + /// + /// Clones this ImageFrameMetaData. + /// + /// The cloned instance. + public ImageFrameMetaData Clone() + { + return new ImageFrameMetaData(this); + } } } diff --git a/src/ImageSharp/MetaData/ImageMetaData.cs b/src/ImageSharp/MetaData/ImageMetaData.cs index 5361b486d4..a5b36f884d 100644 --- a/src/ImageSharp/MetaData/ImageMetaData.cs +++ b/src/ImageSharp/MetaData/ImageMetaData.cs @@ -132,6 +132,15 @@ public double VerticalResolution /// public ushort RepeatCount { get; set; } + /// + /// Clones this into a new instance + /// + /// The cloned metadata instance + public ImageMetaData Clone() + { + return new ImageMetaData(this); + } + /// /// Synchronizes the profiles with the current meta data. /// diff --git a/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs b/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs new file mode 100644 index 0000000000..0b6dbd3ed2 --- /dev/null +++ b/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs @@ -0,0 +1,166 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Processing +{ + using System; + using System.Threading.Tasks; + + using ImageSharp.PixelFormats; + using SixLabors.Primitives; + + /// + /// Allows the application of processors to images. + /// + /// The pixel format. + internal abstract class CloneingImageProcessor : IImageProcessor, ICloningImageProcessor + where TPixel : struct, IPixel + { + /// + public virtual ParallelOptions ParallelOptions { get; set; } + + /// + public virtual bool Compand { get; set; } = false; + + /// + public Image CloneAndApply(Image source, Rectangle sourceRectangle) + { + if (this.ParallelOptions == null) + { + this.ParallelOptions = source.Configuration.ParallelOptions; + } + + try + { + Image clone = this.CreateDestination(source, sourceRectangle); + + if (clone.Frames.Count != source.Frames.Count) + { + throw new ImageProcessingException($"An error occured when processing the image using {this.GetType().Name}. The processor changed the number of frames."); + } + + this.BeforeImageApply(source, clone, sourceRectangle); + + this.BeforeApply(source, clone, sourceRectangle); + this.OnApply(source, clone, sourceRectangle); + this.AfterApply(source, clone, sourceRectangle); + + for (int i = 0; i < source.Frames.Count; i++) + { + ImageFrame sourceFrame = source.Frames[i]; + ImageFrame clonedFrame = clone.Frames[i]; + + this.BeforeApply(sourceFrame, clonedFrame, sourceRectangle); + + this.OnApply(sourceFrame, clonedFrame, sourceRectangle); + this.AfterApply(sourceFrame, clonedFrame, sourceRectangle); + } + + this.AfterImageApply(source, clone, sourceRectangle); + + return clone; + } +#if DEBUG + catch (Exception) + { + throw; +#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); +#endif + } + } + + /// + public void Apply(Image source, Rectangle sourceRectangle) + { + using (Image cloned = this.CloneAndApply(source, sourceRectangle)) + { + // we now need to move the pixel data/size data from one image base to another + if (cloned.Frames.Count != source.Frames.Count) + { + throw new ImageProcessingException($"An error occured when processing the image using {this.GetType().Name}. The processor changed the number of frames."); + } + + source.SwapPixelsData(cloned); + for (int i = 0; i < source.Frames.Count; i++) + { + source.Frames[i].SwapPixelsData(cloned.Frames[i]); + } + } + } + + /// + /// Generates the clone of the source image that operatinos should be applied to. + /// + /// The source image. Cannot be null. + /// The source rectangle. + /// The cloned image. + protected virtual Image CreateDestination(Image source, Rectangle sourceRectangle) + { + return source.Clone(); + } + + /// + /// This method is called before the process is applied to prepare the processor. + /// + /// The source image. Cannot be null. + /// The cloned/destination image. Cannot be null. + /// + /// The structure that specifies the portion of the image object to draw. + /// + protected virtual void BeforeImageApply(Image source, Image destination, Rectangle sourceRectangle) + { + } + + /// + /// This method is called before the process is applied to prepare the processor. + /// + /// The source image. Cannot be null. + /// The cloned/destination image. Cannot be null. + /// + /// The structure that specifies the portion of the image object to draw. + /// + protected virtual void BeforeApply(ImageBase source, ImageBase destination, Rectangle sourceRectangle) + { + } + + /// + /// Applies the process to the specified portion of the specified at the specified location + /// and with the specified size. + /// + /// The source image. Cannot be null. + /// The cloned/destination image. Cannot be null. + /// + /// The structure that specifies the portion of the image object to draw. + /// + protected abstract void OnApply(ImageBase source, ImageBase destination, Rectangle sourceRectangle); + + /// + /// This method is called after the process is applied to prepare the processor. + /// + /// The source image. Cannot be null. + /// The cloned/destination image. Cannot be null. + /// + /// The structure that specifies the portion of the image object to draw. + /// + protected virtual void AfterApply(ImageBase source, ImageBase destination, Rectangle sourceRectangle) + { + } + + /// + /// This method is called after the process is applied to prepare the processor. + /// + /// The source image. Cannot be null. + /// The cloned/destination image. Cannot be null. + /// + /// The structure that specifies the portion of the image object to draw. + /// + protected virtual void AfterImageApply(Image source, Image destination, Rectangle sourceRectangle) + { + } + } +} \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs index 0f1e166fdc..957f917be5 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs @@ -16,7 +16,7 @@ namespace ImageSharp.Processing.Processors /// Adapted from /// /// The pixel format. - internal abstract partial class ResamplingWeightedProcessor : ImageProcessor + internal abstract partial class ResamplingWeightedProcessor : CloneingImageProcessor where TPixel : struct, IPixel { /// @@ -140,7 +140,7 @@ internal unsafe WeightsBuffer PrecomputeWeights(int destinationSize, int sourceS } /// - protected override void BeforeApply(ImageBase source, Rectangle sourceRectangle) + protected override void BeforeApply(ImageBase source, ImageBase destination, Rectangle sourceRectangle) { if (!(this.Sampler is NearestNeighborResampler)) { @@ -155,9 +155,9 @@ protected override void BeforeApply(ImageBase source, Rectangle sourceRe } /// - protected override void AfterApply(ImageBase source, Rectangle sourceRectangle) + protected override void AfterApply(ImageBase source, ImageBase destination, Rectangle sourceRectangle) { - base.AfterApply(source, sourceRectangle); + base.AfterApply(source, destination, sourceRectangle); this.HorizontalWeights?.Dispose(); this.HorizontalWeights = null; this.VerticalWeights?.Dispose(); diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs index be1680cf1c..65fbb65fb0 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs @@ -46,11 +46,33 @@ public ResizeProcessor(IResampler sampler, int width, int height, Rectangle resi } /// - protected override unsafe void OnApply(ImageBase source, Rectangle sourceRectangle) + protected override Image CreateDestination(Image source, Rectangle sourceRectangle) + { + // we will always be creating the clone even for mutate because thatsa the way this base processor works + // ------------ + // for resize we know we are going to populate every pixel with fresh data and we want a different target size so + // lets manually clone an empty set of images at the correct target and then have the base class processs them in. + // turn. + var image = new Image(source.Configuration, this.Width, this.Height, source.MetaData.Clone()); + + // now 'clone' the ImageFrames + foreach (ImageFrame sourceFrame in source.Frames) + { + var targetFrame = new ImageFrame(sourceFrame.Configuration, this.Width, this.Height, sourceFrame.MetaData.Clone()); + image.Frames.Add(targetFrame); + } + + return image; + } + + /// + protected override unsafe void OnApply(ImageBase source, ImageBase cloned, Rectangle sourceRectangle) { // Jump out, we'll deal with that later. - if (source.Width == this.Width && source.Height == this.Height && sourceRectangle == this.ResizeRectangle) + if (source.Width == cloned.Width && source.Height == cloned.Height && sourceRectangle == this.ResizeRectangle) { + // the cloned will be blank here copy all the pixel data over + source.Pixels.CopyTo(cloned.Pixels); return; } @@ -74,29 +96,24 @@ protected override unsafe void OnApply(ImageBase source, Rectangle sourc float widthFactor = sourceRectangle.Width / (float)this.ResizeRectangle.Width; float heightFactor = sourceRectangle.Height / (float)this.ResizeRectangle.Height; - using (var targetPixels = new PixelAccessor(width, height)) - { - Parallel.For( - minY, - maxY, - this.ParallelOptions, - y => + Parallel.For( + minY, + maxY, + this.ParallelOptions, + y => + { + // Y coordinates of source points + Span sourceRow = source.GetRowSpan((int)(((y - startY) * heightFactor) + sourceY)); + Span targetRow = cloned.GetRowSpan(y); + + for (int x = minX; x < maxX; x++) { - // Y coordinates of source points - Span sourceRow = source.GetRowSpan((int)(((y - startY) * heightFactor) + sourceY)); - Span targetRow = targetPixels.GetRowSpan(y); + // X coordinates of source points + targetRow[x] = sourceRow[(int)(((x - startX) * widthFactor) + sourceX)]; + } + }); - for (int x = minX; x < maxX; x++) - { - // X coordinates of source points - targetRow[x] = sourceRow[(int)(((x - startX) * widthFactor) + sourceX)]; - } - }); - - // Break out now. - source.SwapPixelsBuffers(targetPixels); - return; - } + return; } // Interpolate the image using the calculated weights. @@ -105,82 +122,77 @@ protected override unsafe void OnApply(ImageBase source, Rectangle sourc // are the upper and lower bounds of the source rectangle. // TODO: Using a transposed variant of 'firstPassPixels' could eliminate the need for the WeightsWindow.ComputeWeightedColumnSum() method, and improve speed! - using (var targetPixels = new PixelAccessor(width, height)) + using (var firstPassPixels = new Buffer2D(width, source.Height)) { - using (var firstPassPixels = new Buffer2D(width, source.Height)) - { - firstPassPixels.Clear(); - - Parallel.For( - 0, - sourceRectangle.Bottom, - this.ParallelOptions, - y => + firstPassPixels.Clear(); + + Parallel.For( + 0, + sourceRectangle.Bottom, + this.ParallelOptions, + y => + { + // TODO: Without Parallel.For() this buffer object could be reused: + using (var tempRowBuffer = new Buffer(source.Width)) { - // TODO: Without Parallel.For() this buffer object could be reused: - using (var tempRowBuffer = new Buffer(source.Width)) - { - Span firstPassRow = firstPassPixels.GetRowSpan(y); - Span sourceRow = source.GetRowSpan(y); - PixelOperations.Instance.ToVector4(sourceRow, tempRowBuffer, sourceRow.Length); + Span firstPassRow = firstPassPixels.GetRowSpan(y); + Span sourceRow = source.GetRowSpan(y); + PixelOperations.Instance.ToVector4(sourceRow, tempRowBuffer, sourceRow.Length); - if (this.Compand) + if (this.Compand) + { + for (int x = minX; x < maxX; x++) { - for (int x = minX; x < maxX; x++) - { - WeightsWindow window = this.HorizontalWeights.Weights[x - startX]; - firstPassRow[x] = window.ComputeExpandedWeightedRowSum(tempRowBuffer, sourceX); - } + WeightsWindow window = this.HorizontalWeights.Weights[x - startX]; + firstPassRow[x] = window.ComputeExpandedWeightedRowSum(tempRowBuffer, sourceX); } - else + } + else + { + for (int x = minX; x < maxX; x++) { - for (int x = minX; x < maxX; x++) - { - WeightsWindow window = this.HorizontalWeights.Weights[x - startX]; - firstPassRow[x] = window.ComputeWeightedRowSum(tempRowBuffer, sourceX); - } + WeightsWindow window = this.HorizontalWeights.Weights[x - startX]; + firstPassRow[x] = window.ComputeWeightedRowSum(tempRowBuffer, sourceX); } } - }); - - // Now process the rows. - Parallel.For( - minY, - maxY, - this.ParallelOptions, - y => - { - // Ensure offsets are normalised for cropping and padding. - WeightsWindow window = this.VerticalWeights.Weights[y - startY]; - Span targetRow = targetPixels.GetRowSpan(y); + } + }); - if (this.Compand) + // Now process the rows. + Parallel.For( + minY, + maxY, + this.ParallelOptions, + y => + { + // Ensure offsets are normalised for cropping and padding. + WeightsWindow window = this.VerticalWeights.Weights[y - startY]; + Span targetRow = cloned.GetRowSpan(y); + + if (this.Compand) + { + for (int x = 0; x < width; x++) { - for (int x = 0; x < width; x++) - { - // Destination color components - Vector4 destination = window.ComputeWeightedColumnSum(firstPassPixels, x, sourceY); - destination = destination.Compress(); + // Destination color components + Vector4 destination = window.ComputeWeightedColumnSum(firstPassPixels, x, sourceY); + destination = destination.Compress(); - ref TPixel pixel = ref targetRow[x]; - pixel.PackFromVector4(destination); - } + ref TPixel pixel = ref targetRow[x]; + pixel.PackFromVector4(destination); } - else + } + else + { + for (int x = 0; x < width; x++) { - for (int x = 0; x < width; x++) - { - // Destination color components - Vector4 destination = window.ComputeWeightedColumnSum(firstPassPixels, x, sourceY); + // Destination color components + Vector4 destination = window.ComputeWeightedColumnSum(firstPassPixels, x, sourceY); - ref TPixel pixel = ref targetRow[x]; - pixel.PackFromVector4(destination); - } + ref TPixel pixel = ref targetRow[x]; + pixel.PackFromVector4(destination); } - }); - } - - source.SwapPixelsBuffers(targetPixels); + } + }); } } } From 7635558f9b2c43373b2eea09c6750445ff312f1e Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Sun, 16 Jul 2017 09:18:01 +0100 Subject: [PATCH 16/33] internalise cloning processor + rename context --- samples/AvatarWithRoundedCorner/Program.cs | 2 +- src/ImageSharp.Drawing/DrawImage.cs | 12 +++++----- src/ImageSharp.Drawing/FillRegion.cs | 14 +++++------ src/ImageSharp.Drawing/Paths/DrawBeziers.cs | 12 +++++----- src/ImageSharp.Drawing/Paths/DrawLines.cs | 12 +++++----- src/ImageSharp.Drawing/Paths/DrawPath.cs | 12 +++++----- .../Paths/DrawPathCollection.cs | 12 +++++----- src/ImageSharp.Drawing/Paths/DrawPolygon.cs | 12 +++++----- src/ImageSharp.Drawing/Paths/DrawRectangle.cs | 12 +++++----- .../Paths/FillPathBuilder.cs | 8 +++---- .../Paths/FillPathCollection.cs | 8 +++---- src/ImageSharp.Drawing/Paths/FillPaths.cs | 8 +++---- src/ImageSharp.Drawing/Paths/FillPolygon.cs | 8 +++---- src/ImageSharp.Drawing/Paths/FillRectangle.cs | 8 +++---- src/ImageSharp.Drawing/Text/DrawText.Path.cs | 16 ++++++------- src/ImageSharp.Drawing/Text/DrawText.cs | 16 ++++++------- src/ImageSharp/ApplyProcessors.cs | 14 +++++------ src/ImageSharp/Configuration.cs | 2 +- ...> DefaultInternalImageProcessorContext.cs} | 14 +++++------ ...y.cs => IImageProcessingContextFactory.cs} | 10 ++++---- ....cs => IImageProcessingContext{TPixel}.cs} | 8 +++---- ...rocessor.cs => ICloneingImageProcessor.cs} | 4 ++-- .../Binarization/BinaryThreshold.cs | 4 ++-- .../Processing/Binarization/Dither.cs | 12 +++++----- .../Processing/ColorMatrix/BlackWhite.cs | 4 ++-- .../Processing/ColorMatrix/ColorBlindness.cs | 4 ++-- .../Processing/ColorMatrix/Grayscale.cs | 8 +++---- src/ImageSharp/Processing/ColorMatrix/Hue.cs | 4 ++-- .../Processing/ColorMatrix/Kodachrome.cs | 4 ++-- .../Processing/ColorMatrix/Lomograph.cs | 8 +++---- .../Processing/ColorMatrix/Polaroid.cs | 8 +++---- .../Processing/ColorMatrix/Saturation.cs | 4 ++-- .../Processing/ColorMatrix/Sepia.cs | 4 ++-- .../Processing/Convolution/BoxBlur.cs | 6 ++--- .../Processing/Convolution/DetectEdges.cs | 14 +++++------ .../Processing/Convolution/GaussianBlur.cs | 6 ++--- .../Processing/Convolution/GaussianSharpen.cs | 6 ++--- src/ImageSharp/Processing/Delegate.cs | 2 +- src/ImageSharp/Processing/Effects/Alpha.cs | 4 ++-- .../Processing/Effects/BackgroundColor.cs | 8 +++---- .../Processing/Effects/Brightness.cs | 4 ++-- src/ImageSharp/Processing/Effects/Contrast.cs | 4 ++-- src/ImageSharp/Processing/Effects/Invert.cs | 4 ++-- .../Processing/Effects/OilPainting.cs | 8 +++---- src/ImageSharp/Processing/Effects/Pixelate.cs | 6 ++--- src/ImageSharp/Processing/Overlays/Glow.cs | 24 +++++++++---------- .../Processing/Overlays/Vignette.cs | 24 +++++++++---------- .../Processors/CLoneingImageProcessor.cs | 2 +- .../Processing/Transforms/AutoOrient.cs | 2 +- src/ImageSharp/Processing/Transforms/Crop.cs | 4 ++-- .../Processing/Transforms/EntropyCrop.cs | 2 +- src/ImageSharp/Processing/Transforms/Flip.cs | 2 +- src/ImageSharp/Processing/Transforms/Pad.cs | 2 +- .../Processing/Transforms/Resize.cs | 18 +++++++------- .../Processing/Transforms/Rotate.cs | 6 ++--- .../Processing/Transforms/RotateFlip.cs | 2 +- src/ImageSharp/Processing/Transforms/Skew.cs | 4 ++-- src/ImageSharp/Quantizers/Quantize.cs | 4 ++-- .../BaseImageOperationsExtensionTest.cs | 14 ++++++----- .../FakeImageOperationsProvider.cs | 10 ++++---- .../ImageProviders/TestImageProvider.cs | 2 +- 61 files changed, 242 insertions(+), 240 deletions(-) rename src/ImageSharp/{DefaultInternalImageProcessorApplicator.cs => DefaultInternalImageProcessorContext.cs} (79%) rename src/ImageSharp/{IImageProcessorApplicatorFactory.cs => IImageProcessingContextFactory.cs} (74%) rename src/ImageSharp/{IImageProcessorApplicator{TPixel}.cs => IImageProcessingContext{TPixel}.cs} (83%) rename src/ImageSharp/Image/{ICloningImageProcessor.cs => ICloneingImageProcessor.cs} (89%) diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index f635ed203e..caed6687f4 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -36,7 +36,7 @@ static void Main(string[] args) } // lets create our custom image mutating pipeline - private static IImageProcessorApplicator ConvertToAvatar(this IImageProcessorApplicator operations, Size size, float cornerRadius) + private static IImageProcessingContext ConvertToAvatar(this IImageProcessingContext operations, Size size, float cornerRadius) { return operations.Resize(new ImageSharp.Processing.ResizeOptions { diff --git a/src/ImageSharp.Drawing/DrawImage.cs b/src/ImageSharp.Drawing/DrawImage.cs index a7b1faa150..a89fc7e6fd 100644 --- a/src/ImageSharp.Drawing/DrawImage.cs +++ b/src/ImageSharp.Drawing/DrawImage.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The location to draw the blended image. /// The options. /// The . - public static IImageProcessorApplicator DrawImage(this IImageProcessorApplicator source, Image image, Size size, Point location, GraphicsOptions options) + public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, Size size, Point location, GraphicsOptions options) where TPixel : struct, IPixel { if (size == default(Size)) @@ -49,7 +49,7 @@ public static IImageProcessorApplicator DrawImage(this IImagePro /// The image to blend with the currently processing image. /// The opacity of the image image to blend. Must be between 0 and 1. /// The . - public static IImageProcessorApplicator Blend(this IImageProcessorApplicator source, Image image, float percent) + public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, float percent) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -66,7 +66,7 @@ public static IImageProcessorApplicator Blend(this IImageProcess /// The blending mode. /// The opacity of the image image to blend. Must be between 0 and 1. /// The . - public static IImageProcessorApplicator Blend(this IImageProcessorApplicator source, Image image, PixelBlenderMode blender, float percent) + public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, PixelBlenderMode blender, float percent) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -83,7 +83,7 @@ public static IImageProcessorApplicator Blend(this IImageProcess /// The image to blend with the currently processing image. /// The options, including the blending type and belnding amount. /// The . - public static IImageProcessorApplicator Blend(this IImageProcessorApplicator source, Image image, GraphicsOptions options) + public static IImageProcessingContext Blend(this IImageProcessingContext source, Image image, GraphicsOptions options) where TPixel : struct, IPixel { return DrawImage(source, image, default(Size), default(Point), options); @@ -99,7 +99,7 @@ public static IImageProcessorApplicator Blend(this IImageProcess /// The size to draw the blended image. /// The location to draw the blended image. /// The . - public static IImageProcessorApplicator DrawImage(this IImageProcessorApplicator source, Image image, float percent, Size size, Point location) + public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, float percent, Size size, Point location) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; @@ -118,7 +118,7 @@ public static IImageProcessorApplicator DrawImage(this IImagePro /// The size to draw the blended image. /// The location to draw the blended image. /// The . - public static IImageProcessorApplicator DrawImage(this IImageProcessorApplicator source, Image image, PixelBlenderMode blender, float percent, Size size, Point location) + public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, PixelBlenderMode blender, float percent, Size size, Point location) where TPixel : struct, IPixel { GraphicsOptions options = GraphicsOptions.Default; diff --git a/src/ImageSharp.Drawing/FillRegion.cs b/src/ImageSharp.Drawing/FillRegion.cs index ff86c7240f..829d7b8261 100644 --- a/src/ImageSharp.Drawing/FillRegion.cs +++ b/src/ImageSharp.Drawing/FillRegion.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The details how to fill the region of interest. /// The graphics options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, GraphicsOptions options) where TPixel : struct, IPixel { return source.ApplyProcessor(new FillProcessor(brush, options)); @@ -36,7 +36,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The image this method extends. /// The details how to fill the region of interest. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush) where TPixel : struct, IPixel { return source.Fill(brush, GraphicsOptions.Default); @@ -49,7 +49,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The image this method extends. /// The color. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color)); @@ -64,7 +64,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The region. /// The graphics options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, Region region, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, Region region, GraphicsOptions options) where TPixel : struct, IPixel { return source.ApplyProcessor(new FillRegionProcessor(brush, region, options)); @@ -78,7 +78,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The brush. /// The region. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, Region region) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, Region region) where TPixel : struct, IPixel { return source.Fill(brush, region, GraphicsOptions.Default); @@ -93,7 +93,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The region. /// The options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, Region region, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, Region region, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), region, options); @@ -107,7 +107,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The color. /// The region. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, Region region) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, Region region) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), region); diff --git a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs index b83edb7a21..07cc832d71 100644 --- a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs +++ b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points)), options); @@ -43,7 +43,7 @@ public static IImageProcessorApplicator DrawBeziers(this IImageP /// The thickness. /// The points. /// The . - public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points) + public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new CubicBezierLineSegment(points))); @@ -58,7 +58,7 @@ public static IImageProcessorApplicator DrawBeziers(this IImageP /// The thickness. /// The points. /// The . - public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points) + public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawBeziers(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static IImageProcessorApplicator DrawBeziers(this IImageP /// The points. /// The options. /// The . - public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawBeziers(new SolidBrush(color), thickness, points, options); @@ -89,7 +89,7 @@ public static IImageProcessorApplicator DrawBeziers(this IImageP /// The points. /// The options. /// The . - public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new CubicBezierLineSegment(points)), options); @@ -103,7 +103,7 @@ public static IImageProcessorApplicator DrawBeziers(this IImageP /// The pen. /// The points. /// The . - public static IImageProcessorApplicator DrawBeziers(this IImageProcessorApplicator source, IPen pen, PointF[] points) + public static IImageProcessingContext DrawBeziers(this IImageProcessingContext source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new CubicBezierLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/DrawLines.cs b/src/ImageSharp.Drawing/Paths/DrawLines.cs index 553ec2ca5a..79a5037db7 100644 --- a/src/ImageSharp.Drawing/Paths/DrawLines.cs +++ b/src/ImageSharp.Drawing/Paths/DrawLines.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawLines(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points)), options); @@ -43,7 +43,7 @@ public static IImageProcessorApplicator DrawLines(this IImagePro /// The thickness. /// The points. /// The . - public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points) + public static IImageProcessingContext DrawLines(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Path(new LinearLineSegment(points))); @@ -58,7 +58,7 @@ public static IImageProcessorApplicator DrawLines(this IImagePro /// The thickness. /// The points. /// The . - public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points) + public static IImageProcessingContext DrawLines(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawLines(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static IImageProcessorApplicator DrawLines(this IImagePro /// The points. /// The options. /// The .> - public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawLines(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawLines(new SolidBrush(color), thickness, points, options); @@ -89,7 +89,7 @@ public static IImageProcessorApplicator DrawLines(this IImagePro /// The points. /// The options. /// The . - public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawLines(this IImageProcessingContext source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new LinearLineSegment(points)), options); @@ -103,7 +103,7 @@ public static IImageProcessorApplicator DrawLines(this IImagePro /// The pen. /// The points. /// The . - public static IImageProcessorApplicator DrawLines(this IImageProcessorApplicator source, IPen pen, PointF[] points) + public static IImageProcessingContext DrawLines(this IImageProcessingContext source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Path(new LinearLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/DrawPath.cs b/src/ImageSharp.Drawing/Paths/DrawPath.cs index 68ba89ff11..91ad05894f 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPath.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPath.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The path. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, IPath path, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(pen.StrokeFill, new ShapePath(path, pen), options); @@ -39,7 +39,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The pen. /// The path. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, IPath path) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, IPath path) where TPixel : struct, IPixel { return source.Draw(pen, path, GraphicsOptions.Default); @@ -55,7 +55,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The shape. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, IPath path, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IBrush brush, float thickness, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), path, options); @@ -70,7 +70,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The thickness. /// The path. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, IPath path) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IBrush brush, float thickness, IPath path) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), path); @@ -86,7 +86,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The path. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, IPath path, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, TPixel color, float thickness, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, path, options); @@ -101,7 +101,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The thickness. /// The path. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, IPath path) + public static IImageProcessingContext Draw(this IImageProcessingContext source, TPixel color, float thickness, IPath path) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, path); diff --git a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs b/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs index 086ce97230..8ac048e3e3 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The paths. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, IPathCollection paths, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { foreach (IPath path in paths) @@ -44,7 +44,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The pen. /// The paths. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, IPathCollection paths) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(pen, paths, GraphicsOptions.Default); @@ -60,7 +60,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The shapes. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, IPathCollection paths, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IBrush brush, float thickness, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), paths, options); @@ -75,7 +75,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The thickness. /// The paths. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, IPathCollection paths) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IBrush brush, float thickness, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), paths); @@ -91,7 +91,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The paths. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, TPixel color, float thickness, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, paths, options); @@ -106,7 +106,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The thickness. /// The paths. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, IPathCollection paths) + public static IImageProcessingContext Draw(this IImageProcessingContext source, TPixel color, float thickness, IPathCollection paths) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, paths); diff --git a/src/ImageSharp.Drawing/Paths/DrawPolygon.cs b/src/ImageSharp.Drawing/Paths/DrawPolygon.cs index 12b687415f..8033e6fb6b 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPolygon.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPolygon.cs @@ -28,7 +28,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawPolygon(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Polygon(new LinearLineSegment(points)), options); @@ -43,7 +43,7 @@ public static IImageProcessorApplicator DrawPolygon(this IImageP /// The thickness. /// The points. /// The . - public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, IBrush brush, float thickness, PointF[] points) + public static IImageProcessingContext DrawPolygon(this IImageProcessingContext source, IBrush brush, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), new Polygon(new LinearLineSegment(points))); @@ -58,7 +58,7 @@ public static IImageProcessorApplicator DrawPolygon(this IImageP /// The thickness. /// The points. /// The . - public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points) + public static IImageProcessingContext DrawPolygon(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points) where TPixel : struct, IPixel { return source.DrawPolygon(new SolidBrush(color), thickness, points); @@ -74,7 +74,7 @@ public static IImageProcessorApplicator DrawPolygon(this IImageP /// The points. /// The options. /// The . - public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawPolygon(this IImageProcessingContext source, TPixel color, float thickness, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.DrawPolygon(new SolidBrush(color), thickness, points, options); @@ -88,7 +88,7 @@ public static IImageProcessorApplicator DrawPolygon(this IImageP /// The pen. /// The points. /// The . - public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, IPen pen, PointF[] points) + public static IImageProcessingContext DrawPolygon(this IImageProcessingContext source, IPen pen, PointF[] points) where TPixel : struct, IPixel { return source.Draw(pen, new Polygon(new LinearLineSegment(points)), GraphicsOptions.Default); @@ -103,7 +103,7 @@ public static IImageProcessorApplicator DrawPolygon(this IImageP /// The points. /// The options. /// The . - public static IImageProcessorApplicator DrawPolygon(this IImageProcessorApplicator source, IPen pen, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext DrawPolygon(this IImageProcessingContext source, IPen pen, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new Polygon(new LinearLineSegment(points)), options); diff --git a/src/ImageSharp.Drawing/Paths/DrawRectangle.cs b/src/ImageSharp.Drawing/Paths/DrawRectangle.cs index a9832a6280..720327270c 100644 --- a/src/ImageSharp.Drawing/Paths/DrawRectangle.cs +++ b/src/ImageSharp.Drawing/Paths/DrawRectangle.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The shape. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, RectangleF shape, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(pen, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height), options); @@ -39,7 +39,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The pen. /// The shape. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IPen pen, RectangleF shape) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IPen pen, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(pen, shape, GraphicsOptions.Default); @@ -55,7 +55,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The shape. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, RectangleF shape, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IBrush brush, float thickness, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), shape, options); @@ -70,7 +70,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The thickness. /// The shape. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, IBrush brush, float thickness, RectangleF shape) + public static IImageProcessingContext Draw(this IImageProcessingContext source, IBrush brush, float thickness, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(new Pen(brush, thickness), shape); @@ -86,7 +86,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The shape. /// The options. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, RectangleF shape, GraphicsOptions options) + public static IImageProcessingContext Draw(this IImageProcessingContext source, TPixel color, float thickness, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, shape, options); @@ -101,7 +101,7 @@ public static IImageProcessorApplicator Draw(this IImageProcesso /// The thickness. /// The shape. /// The . - public static IImageProcessorApplicator Draw(this IImageProcessorApplicator source, TPixel color, float thickness, RectangleF shape) + public static IImageProcessingContext Draw(this IImageProcessingContext source, TPixel color, float thickness, RectangleF shape) where TPixel : struct, IPixel { return source.Draw(new SolidBrush(color), thickness, shape); diff --git a/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs b/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs index 38d3ad10f6..0862882010 100644 --- a/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs +++ b/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The shape. /// The graphics options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, Action path, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, Action path, GraphicsOptions options) where TPixel : struct, IPixel { var pb = new PathBuilder(); @@ -42,7 +42,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The brush. /// The path. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, Action path) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, Action path) where TPixel : struct, IPixel { return source.Fill(brush, path, GraphicsOptions.Default); @@ -57,7 +57,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The path. /// The options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, Action path, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, Action path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path, options); @@ -71,7 +71,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The color. /// The path. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, Action path) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, Action path) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path); diff --git a/src/ImageSharp.Drawing/Paths/FillPathCollection.cs b/src/ImageSharp.Drawing/Paths/FillPathCollection.cs index eec3fa7957..dd7d2cf3e3 100644 --- a/src/ImageSharp.Drawing/Paths/FillPathCollection.cs +++ b/src/ImageSharp.Drawing/Paths/FillPathCollection.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shapes. /// The graphics options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, IPathCollection paths, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { foreach (IPath s in paths) @@ -43,7 +43,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The brush. /// The paths. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, IPathCollection paths) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, IPathCollection paths) where TPixel : struct, IPixel { return source.Fill(brush, paths, GraphicsOptions.Default); @@ -58,7 +58,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The paths. /// The options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, IPathCollection paths, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, IPathCollection paths, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), paths, options); @@ -72,7 +72,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The color. /// The paths. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, IPathCollection paths) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, IPathCollection paths) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), paths); diff --git a/src/ImageSharp.Drawing/Paths/FillPaths.cs b/src/ImageSharp.Drawing/Paths/FillPaths.cs index 7cd6dbe54c..2cd6ab0fc4 100644 --- a/src/ImageSharp.Drawing/Paths/FillPaths.cs +++ b/src/ImageSharp.Drawing/Paths/FillPaths.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shape. /// The graphics options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, IPath path, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new ShapeRegion(path), options); @@ -38,7 +38,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The brush. /// The path. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, IPath path) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, IPath path) where TPixel : struct, IPixel { return source.Fill(brush, new ShapeRegion(path), GraphicsOptions.Default); @@ -53,7 +53,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The path. /// The options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, IPath path, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, IPath path, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path, options); @@ -67,7 +67,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The color. /// The path. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, IPath path) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, IPath path) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), path); diff --git a/src/ImageSharp.Drawing/Paths/FillPolygon.cs b/src/ImageSharp.Drawing/Paths/FillPolygon.cs index 6b6cef8ace..2fc481b5cc 100644 --- a/src/ImageSharp.Drawing/Paths/FillPolygon.cs +++ b/src/ImageSharp.Drawing/Paths/FillPolygon.cs @@ -27,7 +27,7 @@ public static partial class ImageExtensions /// The points. /// The options. /// The . - public static IImageProcessorApplicator FillPolygon(this IImageProcessorApplicator source, IBrush brush, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext FillPolygon(this IImageProcessingContext source, IBrush brush, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new Polygon(new LinearLineSegment(points)), options); @@ -41,7 +41,7 @@ public static IImageProcessorApplicator FillPolygon(this IImageP /// The brush. /// The points. /// The . - public static IImageProcessorApplicator FillPolygon(this IImageProcessorApplicator source, IBrush brush, PointF[] points) + public static IImageProcessingContext FillPolygon(this IImageProcessingContext source, IBrush brush, PointF[] points) where TPixel : struct, IPixel { return source.Fill(brush, new Polygon(new LinearLineSegment(points))); @@ -56,7 +56,7 @@ public static IImageProcessorApplicator FillPolygon(this IImageP /// The points. /// The options. /// The . - public static IImageProcessorApplicator FillPolygon(this IImageProcessorApplicator source, TPixel color, PointF[] points, GraphicsOptions options) + public static IImageProcessingContext FillPolygon(this IImageProcessingContext source, TPixel color, PointF[] points, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), new Polygon(new LinearLineSegment(points)), options); @@ -70,7 +70,7 @@ public static IImageProcessorApplicator FillPolygon(this IImageP /// The color. /// The points. /// The . - public static IImageProcessorApplicator FillPolygon(this IImageProcessorApplicator source, TPixel color, PointF[] points) + public static IImageProcessingContext FillPolygon(this IImageProcessingContext source, TPixel color, PointF[] points) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), new Polygon(new LinearLineSegment(points))); diff --git a/src/ImageSharp.Drawing/Paths/FillRectangle.cs b/src/ImageSharp.Drawing/Paths/FillRectangle.cs index 9e475137a3..22cd1ac163 100644 --- a/src/ImageSharp.Drawing/Paths/FillRectangle.cs +++ b/src/ImageSharp.Drawing/Paths/FillRectangle.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The shape. /// The options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, RectangleF shape, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(brush, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height), options); @@ -38,7 +38,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The brush. /// The shape. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, IBrush brush, RectangleF shape) + public static IImageProcessingContext Fill(this IImageProcessingContext source, IBrush brush, RectangleF shape) where TPixel : struct, IPixel { return source.Fill(brush, new SixLabors.Shapes.RectangularePolygon(shape.X, shape.Y, shape.Width, shape.Height)); @@ -53,7 +53,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The shape. /// The options. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, RectangleF shape, GraphicsOptions options) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, RectangleF shape, GraphicsOptions options) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), shape, options); @@ -67,7 +67,7 @@ public static IImageProcessorApplicator Fill(this IImageProcesso /// The color. /// The shape. /// The . - public static IImageProcessorApplicator Fill(this IImageProcessorApplicator source, TPixel color, RectangleF shape) + public static IImageProcessingContext Fill(this IImageProcessingContext source, TPixel color, RectangleF shape) where TPixel : struct, IPixel { return source.Fill(new SolidBrush(color), shape); diff --git a/src/ImageSharp.Drawing/Text/DrawText.Path.cs b/src/ImageSharp.Drawing/Text/DrawText.Path.cs index c109047b2c..8adab652fe 100644 --- a/src/ImageSharp.Drawing/Text/DrawText.Path.cs +++ b/src/ImageSharp.Drawing/Text/DrawText.Path.cs @@ -31,7 +31,7 @@ public static partial class ImageExtensions /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, TPixel color, IPath path) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, TPixel color, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, color, path, TextGraphicsOptions.Default); @@ -50,7 +50,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, TPixel color, IPath path, TextGraphicsOptions options) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, TPixel color, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, Brushes.Solid(color), null, path, options); @@ -68,7 +68,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPath path) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IBrush brush, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, path, TextGraphicsOptions.Default); @@ -87,7 +87,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPath path, TextGraphicsOptions options) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IBrush brush, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, null, path, options); @@ -105,7 +105,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IPen pen, IPath path) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IPen pen, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, pen, path, TextGraphicsOptions.Default); @@ -124,7 +124,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IPen pen, IPath path, TextGraphicsOptions options) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IPen pen, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, null, pen, path, options); @@ -143,7 +143,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPen pen, IPath path) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IBrush brush, IPen pen, IPath path) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, pen, path, TextGraphicsOptions.Default); @@ -163,7 +163,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPen pen, IPath path, TextGraphicsOptions options) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IBrush brush, IPen pen, IPath path, TextGraphicsOptions options) where TPixel : struct, IPixel { float dpiX = DefaultTextDpi; diff --git a/src/ImageSharp.Drawing/Text/DrawText.cs b/src/ImageSharp.Drawing/Text/DrawText.cs index 338d06058b..340c88d5e2 100644 --- a/src/ImageSharp.Drawing/Text/DrawText.cs +++ b/src/ImageSharp.Drawing/Text/DrawText.cs @@ -34,7 +34,7 @@ public static partial class ImageExtensions /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, TPixel color, PointF location) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, TPixel color, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, color, location, TextGraphicsOptions.Default); @@ -53,7 +53,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, TPixel color, PointF location, TextGraphicsOptions options) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, TPixel color, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, Brushes.Solid(color), null, location, options); @@ -71,7 +71,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, PointF location) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IBrush brush, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, location, TextGraphicsOptions.Default); @@ -90,7 +90,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, PointF location, TextGraphicsOptions options) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IBrush brush, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, null, location, options); @@ -108,7 +108,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IPen pen, PointF location) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IPen pen, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, pen, location, TextGraphicsOptions.Default); @@ -127,7 +127,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IPen pen, PointF location, TextGraphicsOptions options) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IPen pen, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { return source.DrawText(text, font, null, pen, location, options); @@ -146,7 +146,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPen pen, PointF location) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IBrush brush, IPen pen, PointF location) where TPixel : struct, IPixel { return source.DrawText(text, font, brush, pen, location, TextGraphicsOptions.Default); @@ -166,7 +166,7 @@ public static IImageProcessorApplicator DrawText(this IImageProc /// /// The . /// - public static IImageProcessorApplicator DrawText(this IImageProcessorApplicator source, string text, Font font, IBrush brush, IPen pen, PointF location, TextGraphicsOptions options) + public static IImageProcessingContext DrawText(this IImageProcessingContext source, string text, Font font, IBrush brush, IPen pen, PointF location, TextGraphicsOptions options) where TPixel : struct, IPixel { float dpiX = DefaultTextDpi; diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index c0a7f20df7..40cd7500a7 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -22,13 +22,13 @@ public static partial class ImageExtensions /// The pixel format. /// The image to rotate, flip, or both. /// The operations to perform on the source. - public static void Mutate(this Image source, Action> operations) + public static void Mutate(this Image source, Action> operations) where TPixel : struct, IPixel { Guard.NotNull(operations, nameof(operations)); Guard.NotNull(source, nameof(source)); - IInternalImageProcessorApplicator operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, true); + IInternalImageProcessingContext operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, true); operations(operationsRunner); operationsRunner.Apply(); } @@ -45,7 +45,7 @@ public static void Mutate(this Image source, params IImageProces Guard.NotNull(operations, nameof(operations)); Guard.NotNull(source, nameof(source)); - IInternalImageProcessorApplicator operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, true); + IInternalImageProcessingContext operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, true); operationsRunner.ApplyProcessors(operations); operationsRunner.Apply(); } @@ -57,13 +57,13 @@ public static void Mutate(this Image source, params IImageProces /// The image to rotate, flip, or both. /// The operations to perform on the source. /// Anew Image which has teh data from the but with the applied. - public static Image Clone(this Image source, Action> operations) + public static Image Clone(this Image source, Action> operations) where TPixel : struct, IPixel { Guard.NotNull(operations, nameof(operations)); Guard.NotNull(source, nameof(source)); - IInternalImageProcessorApplicator operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, false); + IInternalImageProcessingContext operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, false); operations(operationsRunner); return operationsRunner.Apply(); } @@ -81,7 +81,7 @@ public static Image Clone(this Image source, params IIma Guard.NotNull(operations, nameof(operations)); Guard.NotNull(source, nameof(source)); - IInternalImageProcessorApplicator operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageOperations(source, false); + IInternalImageProcessingContext operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, false); operationsRunner.ApplyProcessors(operations); return operationsRunner.Apply(); } @@ -93,7 +93,7 @@ public static Image Clone(this Image source, params IIma /// The image to rotate, flip, or both. /// The operations to perform on the source. /// returns the current optinoatins class to allow chaining of oprations. - public static IImageProcessorApplicator ApplyProcessors(this IImageProcessorApplicator source, params IImageProcessor[] operations) + public static IImageProcessingContext ApplyProcessors(this IImageProcessingContext source, params IImageProcessor[] operations) where TPixel : struct, IPixel { foreach (IImageProcessor p in operations) diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index b868194306..71f6bf4128 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -111,7 +111,7 @@ public Configuration(params IConfigurationModule[] configurationModules) /// /// Gets or sets the image operations providers. /// - internal IImageProcessorApplicatorFactory ImageOperationsProvider { get; set; } = new DefaultImageOperationsProvider(); + internal IImageProcessingContextFactory ImageOperationsProvider { get; set; } = new DefaultImageOperationsProvider(); /// /// Registers a new format provider. diff --git a/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs b/src/ImageSharp/DefaultInternalImageProcessorContext.cs similarity index 79% rename from src/ImageSharp/DefaultInternalImageProcessorApplicator.cs rename to src/ImageSharp/DefaultInternalImageProcessorContext.cs index ba476ba335..64f444325d 100644 --- a/src/ImageSharp/DefaultInternalImageProcessorApplicator.cs +++ b/src/ImageSharp/DefaultInternalImageProcessorContext.cs @@ -15,7 +15,7 @@ namespace ImageSharp /// The static collection of all the default image formats /// /// The pixel format - internal class DefaultInternalImageProcessorApplicator : IInternalImageProcessorApplicator + internal class DefaultInternalImageProcessorContext : IInternalImageProcessingContext where TPixel : struct, IPixel { private readonly bool mutate; @@ -23,11 +23,11 @@ internal class DefaultInternalImageProcessorApplicator : IInternalImageP private Image destination; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The image. /// The mutate. - public DefaultInternalImageProcessorApplicator(Image source, bool mutate) + public DefaultInternalImageProcessorContext(Image source, bool mutate) { this.mutate = mutate; this.source = source; @@ -50,16 +50,16 @@ public Image Apply() } /// - public IImageProcessorApplicator ApplyProcessor(IImageProcessor processor, Rectangle rectangle) + public IImageProcessingContext ApplyProcessor(IImageProcessor processor, Rectangle rectangle) { if (!this.mutate && this.destination == null) { // this will only work if the first processor applied is the cloning one thus // realistically for this optermissation to work the resize must the first processor // applied any only up processors will take the douple data path. - if (processor is ICloningImageProcessor) + if (processor is ICloneingImageProcessor) { - var cloningProcessor = (ICloningImageProcessor)processor; + var cloningProcessor = (ICloneingImageProcessor)processor; this.destination = cloningProcessor.CloneAndApply(this.source, rectangle); return this; } @@ -74,7 +74,7 @@ public IImageProcessorApplicator ApplyProcessor(IImageProcessor } /// - public IImageProcessorApplicator ApplyProcessor(IImageProcessor processor) + public IImageProcessingContext ApplyProcessor(IImageProcessor processor) { return this.ApplyProcessor(processor, this.source.Bounds()); } diff --git a/src/ImageSharp/IImageProcessorApplicatorFactory.cs b/src/ImageSharp/IImageProcessingContextFactory.cs similarity index 74% rename from src/ImageSharp/IImageProcessorApplicatorFactory.cs rename to src/ImageSharp/IImageProcessingContextFactory.cs index e07b1a7529..a9cd23905a 100644 --- a/src/ImageSharp/IImageProcessorApplicatorFactory.cs +++ b/src/ImageSharp/IImageProcessingContextFactory.cs @@ -11,7 +11,7 @@ namespace ImageSharp /// /// Represents an interface that will create IImageOperations /// - internal interface IImageProcessorApplicatorFactory + internal interface IImageProcessingContextFactory { /// /// Called during Mutate operations to generate the imageoperations provider. @@ -20,20 +20,20 @@ internal interface IImageProcessorApplicatorFactory /// The source image. /// A flag to determin with the image operations is allowed to mutate the source image or not. /// A new IImageOPeration - IInternalImageProcessorApplicator CreateImageOperations(Image source, bool mutate) + IInternalImageProcessingContext CreateImageProcessingContext(Image source, bool mutate) where TPixel : struct, IPixel; } /// /// The default implmentation of IImageOperationsProvider /// - internal class DefaultImageOperationsProvider : IImageProcessorApplicatorFactory + internal class DefaultImageOperationsProvider : IImageProcessingContextFactory { /// - public IInternalImageProcessorApplicator CreateImageOperations(Image source, bool mutate) + public IInternalImageProcessingContext CreateImageProcessingContext(Image source, bool mutate) where TPixel : struct, IPixel { - return new DefaultInternalImageProcessorApplicator(source, mutate); + return new DefaultInternalImageProcessorContext(source, mutate); } } } diff --git a/src/ImageSharp/IImageProcessorApplicator{TPixel}.cs b/src/ImageSharp/IImageProcessingContext{TPixel}.cs similarity index 83% rename from src/ImageSharp/IImageProcessorApplicator{TPixel}.cs rename to src/ImageSharp/IImageProcessingContext{TPixel}.cs index 861c5b010c..e79b20ba6b 100644 --- a/src/ImageSharp/IImageProcessorApplicator{TPixel}.cs +++ b/src/ImageSharp/IImageProcessingContext{TPixel}.cs @@ -15,7 +15,7 @@ namespace ImageSharp /// An interface to queue up image operations. /// /// The pixel format - public interface IImageProcessorApplicator + public interface IImageProcessingContext where TPixel : struct, IPixel { /// @@ -24,21 +24,21 @@ public interface IImageProcessorApplicator /// The processor to apply /// The area to apply it to /// returns the current optinoatins class to allow chaining of oprations. - IImageProcessorApplicator ApplyProcessor(IImageProcessor processor, Rectangle rectangle); + IImageProcessingContext ApplyProcessor(IImageProcessor processor, Rectangle rectangle); /// /// Adds the processor to the current setr of image operations to be applied. /// /// The processor to apply /// returns the current optinoatins class to allow chaining of oprations. - IImageProcessorApplicator ApplyProcessor(IImageProcessor processor); + IImageProcessingContext ApplyProcessor(IImageProcessor processor); } /// /// An internal interface to queue up image operations and have a method to apply them to and return a result /// /// The pixel format - public interface IInternalImageProcessorApplicator : IImageProcessorApplicator + internal interface IInternalImageProcessingContext : IImageProcessingContext where TPixel : struct, IPixel { /// diff --git a/src/ImageSharp/Image/ICloningImageProcessor.cs b/src/ImageSharp/Image/ICloneingImageProcessor.cs similarity index 89% rename from src/ImageSharp/Image/ICloningImageProcessor.cs rename to src/ImageSharp/Image/ICloneingImageProcessor.cs index 8906063f9c..92f87d02e6 100644 --- a/src/ImageSharp/Image/ICloningImageProcessor.cs +++ b/src/ImageSharp/Image/ICloneingImageProcessor.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // @@ -15,7 +15,7 @@ namespace ImageSharp.Processing /// Encapsulates methods to alter the pixels of an image. /// /// The pixel format. - public interface ICloningImageProcessor : IImageProcessor + internal interface ICloneingImageProcessor : IImageProcessor where TPixel : struct, IPixel { /// diff --git a/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs b/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs index 796b4f5973..89d62cc4cb 100644 --- a/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs +++ b/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The threshold to apply binarization of the image. Must be between 0 and 1. /// The . - public static IImageProcessorApplicator BinaryThreshold(this IImageProcessorApplicator source, float threshold) + public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold) where TPixel : struct, IPixel { source.ApplyProcessor(new BinaryThresholdProcessor(threshold)); @@ -41,7 +41,7 @@ public static IImageProcessorApplicator BinaryThreshold(this IIm /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator BinaryThreshold(this IImageProcessorApplicator source, float threshold, Rectangle rectangle) + public static IImageProcessingContext BinaryThreshold(this IImageProcessingContext source, float threshold, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new BinaryThresholdProcessor(threshold), rectangle); diff --git a/src/ImageSharp/Processing/Binarization/Dither.cs b/src/ImageSharp/Processing/Binarization/Dither.cs index 177279cea9..2d9ef42631 100644 --- a/src/ImageSharp/Processing/Binarization/Dither.cs +++ b/src/ImageSharp/Processing/Binarization/Dither.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The ordered ditherer. /// The . - public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IOrderedDither dither) + public static IImageProcessingContext Dither(this IImageProcessingContext source, IOrderedDither dither) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, 0)); @@ -39,7 +39,7 @@ public static IImageProcessorApplicator Dither(this IImageProces /// The ordered ditherer. /// The component index to test the threshold against. Must range from 0 to 3. /// The . - public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IOrderedDither dither, int index) + public static IImageProcessingContext Dither(this IImageProcessingContext source, IOrderedDither dither, int index) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, index)); @@ -56,7 +56,7 @@ public static IImageProcessorApplicator Dither(this IImageProces /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IOrderedDither dither, Rectangle rectangle) + public static IImageProcessingContext Dither(this IImageProcessingContext source, IOrderedDither dither, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, 0), rectangle); @@ -74,7 +74,7 @@ public static IImageProcessorApplicator Dither(this IImageProces /// /// The component index to test the threshold against. Must range from 0 to 3. /// The . - public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IOrderedDither dither, Rectangle rectangle, int index) + public static IImageProcessingContext Dither(this IImageProcessingContext source, IOrderedDither dither, Rectangle rectangle, int index) where TPixel : struct, IPixel { source.ApplyProcessor(new OrderedDitherProcessor(dither, index), rectangle); @@ -89,7 +89,7 @@ public static IImageProcessorApplicator Dither(this IImageProces /// The diffusion algorithm to apply. /// The threshold to apply binarization of the image. Must be between 0 and 1. /// The . - public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IErrorDiffuser diffuser, float threshold) + public static IImageProcessingContext Dither(this IImageProcessingContext source, IErrorDiffuser diffuser, float threshold) where TPixel : struct, IPixel { source.ApplyProcessor(new ErrorDiffusionDitherProcessor(diffuser, threshold)); @@ -107,7 +107,7 @@ public static IImageProcessorApplicator Dither(this IImageProces /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Dither(this IImageProcessorApplicator source, IErrorDiffuser diffuser, float threshold, Rectangle rectangle) + public static IImageProcessingContext Dither(this IImageProcessingContext source, IErrorDiffuser diffuser, float threshold, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new ErrorDiffusionDitherProcessor(diffuser, threshold), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs b/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs index 3d15d1cbc0..71d1d50707 100644 --- a/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs +++ b/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator BlackWhite(this IImageProcessorApplicator source) + public static IImageProcessingContext BlackWhite(this IImageProcessingContext source) where TPixel : struct, IPixel { source.ApplyProcessor(new BlackWhiteProcessor()); @@ -40,7 +40,7 @@ public static IImageProcessorApplicator BlackWhite(this IImagePr /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator BlackWhite(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext BlackWhite(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new BlackWhiteProcessor(), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs b/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs index 8a055c33cf..9ba961a71a 100644 --- a/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs +++ b/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The type of color blindness simulator to apply. /// The . - public static IImageProcessorApplicator ColorBlindness(this IImageProcessorApplicator source, ColorBlindness colorBlindness) + public static IImageProcessingContext ColorBlindness(this IImageProcessingContext source, ColorBlindness colorBlindness) where TPixel : struct, IPixel { source.ApplyProcessor(GetProcessor(colorBlindness)); @@ -42,7 +42,7 @@ public static IImageProcessorApplicator ColorBlindness(this IIma /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator ColorBlindness(this IImageProcessorApplicator source, ColorBlindness colorBlindness, Rectangle rectangle) + public static IImageProcessingContext ColorBlindness(this IImageProcessingContext source, ColorBlindness colorBlindness, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(GetProcessor(colorBlindness), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs b/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs index 7b00ae0d85..6109c54048 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs @@ -22,7 +22,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Grayscale(this IImageProcessorApplicator source) + public static IImageProcessingContext Grayscale(this IImageProcessingContext source) where TPixel : struct, IPixel { return Grayscale(source, GrayscaleMode.Bt709); @@ -35,7 +35,7 @@ public static IImageProcessorApplicator Grayscale(this IImagePro /// The image this method extends. /// The formula to apply to perform the operation. /// The . - public static IImageProcessorApplicator Grayscale(this IImageProcessorApplicator source, GrayscaleMode mode) + public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode) where TPixel : struct, IPixel { IImageProcessor processor = mode == GrayscaleMode.Bt709 @@ -55,7 +55,7 @@ public static IImageProcessorApplicator Grayscale(this IImagePro /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Grayscale(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext Grayscale(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel { return Grayscale(source, GrayscaleMode.Bt709, rectangle); @@ -71,7 +71,7 @@ public static IImageProcessorApplicator Grayscale(this IImagePro /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Grayscale(this IImageProcessorApplicator source, GrayscaleMode mode, Rectangle rectangle) + public static IImageProcessingContext Grayscale(this IImageProcessingContext source, GrayscaleMode mode, Rectangle rectangle) where TPixel : struct, IPixel { IImageProcessor processor = mode == GrayscaleMode.Bt709 diff --git a/src/ImageSharp/Processing/ColorMatrix/Hue.cs b/src/ImageSharp/Processing/ColorMatrix/Hue.cs index cd2adaadb3..d299b650ae 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Hue.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Hue.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The angle in degrees to adjust the image. /// The . - public static IImageProcessorApplicator Hue(this IImageProcessorApplicator source, float degrees) + public static IImageProcessingContext Hue(this IImageProcessingContext source, float degrees) where TPixel : struct, IPixel { source.ApplyProcessor(new HueProcessor(degrees)); @@ -42,7 +42,7 @@ public static IImageProcessorApplicator Hue(this IImageProcessor /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Hue(this IImageProcessorApplicator source, float degrees, Rectangle rectangle) + public static IImageProcessingContext Hue(this IImageProcessingContext source, float degrees, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new HueProcessor(degrees), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs b/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs index b16f241c01..c0cd7caf7a 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Kodachrome(this IImageProcessorApplicator source) + public static IImageProcessingContext Kodachrome(this IImageProcessingContext source) where TPixel : struct, IPixel { source.ApplyProcessor(new KodachromeProcessor()); @@ -40,7 +40,7 @@ public static IImageProcessorApplicator Kodachrome(this IImagePr /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Kodachrome(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext Kodachrome(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new KodachromeProcessor(), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs b/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs index 0a2f80cc42..a90551bf3c 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Lomograph(this IImageProcessorApplicator source) + public static IImageProcessingContext Lomograph(this IImageProcessingContext source) where TPixel : struct, IPixel { return Lomograph(source, GraphicsOptions.Default); @@ -39,7 +39,7 @@ public static IImageProcessorApplicator Lomograph(this IImagePro /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Lomograph(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext Lomograph(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel { return Lomograph(source, rectangle, GraphicsOptions.Default); @@ -52,7 +52,7 @@ public static IImageProcessorApplicator Lomograph(this IImagePro /// The image this method extends. /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Lomograph(this IImageProcessorApplicator source, GraphicsOptions options) + public static IImageProcessingContext Lomograph(this IImageProcessingContext source, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new LomographProcessor(options)); @@ -69,7 +69,7 @@ public static IImageProcessorApplicator Lomograph(this IImagePro /// /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Lomograph(this IImageProcessorApplicator source, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessingContext Lomograph(this IImageProcessingContext source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new LomographProcessor(options), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs b/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs index e579a32511..b968aedfc4 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Polaroid(this IImageProcessorApplicator source) + public static IImageProcessingContext Polaroid(this IImageProcessingContext source) where TPixel : struct, IPixel { return Polaroid(source, GraphicsOptions.Default); @@ -39,7 +39,7 @@ public static IImageProcessorApplicator Polaroid(this IImageProc /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Polaroid(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext Polaroid(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel { return Polaroid(source, rectangle, GraphicsOptions.Default); @@ -52,7 +52,7 @@ public static IImageProcessorApplicator Polaroid(this IImageProc /// The image this method extends. /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Polaroid(this IImageProcessorApplicator source, GraphicsOptions options) + public static IImageProcessingContext Polaroid(this IImageProcessingContext source, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new PolaroidProcessor(options)); @@ -69,7 +69,7 @@ public static IImageProcessorApplicator Polaroid(this IImageProc /// /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Polaroid(this IImageProcessorApplicator source, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessingContext Polaroid(this IImageProcessingContext source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel { source.ApplyProcessor(new PolaroidProcessor(options), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Saturation.cs b/src/ImageSharp/Processing/ColorMatrix/Saturation.cs index 768eb97c54..895362c681 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Saturation.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Saturation.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The new saturation of the image. Must be between -100 and 100. /// The . - public static IImageProcessorApplicator Saturation(this IImageProcessorApplicator source, int amount) + public static IImageProcessingContext Saturation(this IImageProcessingContext source, int amount) where TPixel : struct, IPixel { source.ApplyProcessor(new SaturationProcessor(amount)); @@ -42,7 +42,7 @@ public static IImageProcessorApplicator Saturation(this IImagePr /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Saturation(this IImageProcessorApplicator source, int amount, Rectangle rectangle) + public static IImageProcessingContext Saturation(this IImageProcessingContext source, int amount, Rectangle rectangle) where TPixel : struct, IPixel { source.ApplyProcessor(new SaturationProcessor(amount), rectangle); diff --git a/src/ImageSharp/Processing/ColorMatrix/Sepia.cs b/src/ImageSharp/Processing/ColorMatrix/Sepia.cs index 5cf64a020b..4ef4db14ea 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Sepia.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Sepia.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Sepia(this IImageProcessorApplicator source) + public static IImageProcessingContext Sepia(this IImageProcessingContext source) where TPixel : struct, IPixel => source.ApplyProcessor(new SepiaProcessor()); @@ -37,7 +37,7 @@ public static IImageProcessorApplicator Sepia(this IImageProcess /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Sepia(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext Sepia(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new SepiaProcessor(), rectangle); } diff --git a/src/ImageSharp/Processing/Convolution/BoxBlur.cs b/src/ImageSharp/Processing/Convolution/BoxBlur.cs index c25de35718..eaddfe2dc9 100644 --- a/src/ImageSharp/Processing/Convolution/BoxBlur.cs +++ b/src/ImageSharp/Processing/Convolution/BoxBlur.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator BoxBlur(this IImageProcessorApplicator source) + public static IImageProcessingContext BoxBlur(this IImageProcessingContext source) where TPixel : struct, IPixel => source.ApplyProcessor(new BoxBlurProcessor(7)); @@ -34,7 +34,7 @@ public static IImageProcessorApplicator BoxBlur(this IImageProce /// The image this method extends. /// The 'radius' value representing the size of the area to sample. /// The . - public static IImageProcessorApplicator BoxBlur(this IImageProcessorApplicator source, int radius) + public static IImageProcessingContext BoxBlur(this IImageProcessingContext source, int radius) where TPixel : struct, IPixel => source.ApplyProcessor(new BoxBlurProcessor(radius)); @@ -48,7 +48,7 @@ public static IImageProcessorApplicator BoxBlur(this IImageProce /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator BoxBlur(this IImageProcessorApplicator source, int radius, Rectangle rectangle) + public static IImageProcessingContext BoxBlur(this IImageProcessingContext source, int radius, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new BoxBlurProcessor(radius), rectangle); } diff --git a/src/ImageSharp/Processing/Convolution/DetectEdges.cs b/src/ImageSharp/Processing/Convolution/DetectEdges.cs index 7ececcfe23..8721bf4f89 100644 --- a/src/ImageSharp/Processing/Convolution/DetectEdges.cs +++ b/src/ImageSharp/Processing/Convolution/DetectEdges.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source) + public static IImageProcessingContext DetectEdges(this IImageProcessingContext source) where TPixel : struct, IPixel { return DetectEdges(source, new SobelProcessor { Grayscale = true }); @@ -41,7 +41,7 @@ public static IImageProcessorApplicator DetectEdges(this IImageP /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext DetectEdges(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel { return DetectEdges(source, rectangle, new SobelProcessor { Grayscale = true }); @@ -54,7 +54,7 @@ public static IImageProcessorApplicator DetectEdges(this IImageP /// The image this method extends. /// The filter for detecting edges. /// The . - public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, EdgeDetection filter) + public static IImageProcessingContext DetectEdges(this IImageProcessingContext source, EdgeDetection filter) where TPixel : struct, IPixel => DetectEdges(source, GetProcessor(filter, true)); @@ -66,7 +66,7 @@ public static IImageProcessorApplicator DetectEdges(this IImageP /// The filter for detecting edges. /// Whether to convert the image to Grayscale first. Defaults to true. /// The . - public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, EdgeDetection filter, bool grayscale) + public static IImageProcessingContext DetectEdges(this IImageProcessingContext source, EdgeDetection filter, bool grayscale) where TPixel : struct, IPixel => DetectEdges(source, GetProcessor(filter, grayscale)); @@ -81,7 +81,7 @@ public static IImageProcessorApplicator DetectEdges(this IImageP /// /// Whether to convert the image to Grayscale first. Defaults to true. /// The . - public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true) + public static IImageProcessingContext DetectEdges(this IImageProcessingContext source, EdgeDetection filter, Rectangle rectangle, bool grayscale = true) where TPixel : struct, IPixel => DetectEdges(source, rectangle, GetProcessor(filter, grayscale)); @@ -92,7 +92,7 @@ public static IImageProcessorApplicator DetectEdges(this IImageP /// The image this method extends. /// The filter for detecting edges. /// The . - public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, IEdgeDetectorProcessor filter) + public static IImageProcessingContext DetectEdges(this IImageProcessingContext source, IEdgeDetectorProcessor filter) where TPixel : struct, IPixel { return source.ApplyProcessor(filter); @@ -108,7 +108,7 @@ public static IImageProcessorApplicator DetectEdges(this IImageP /// /// The filter for detecting edges. /// The . - public static IImageProcessorApplicator DetectEdges(this IImageProcessorApplicator source, Rectangle rectangle, IEdgeDetectorProcessor filter) + public static IImageProcessingContext DetectEdges(this IImageProcessingContext source, Rectangle rectangle, IEdgeDetectorProcessor filter) where TPixel : struct, IPixel { source.ApplyProcessor(filter, rectangle); diff --git a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs index 4b1682818a..1db4fd5009 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator GaussianBlur(this IImageProcessorApplicator source) + public static IImageProcessingContext GaussianBlur(this IImageProcessingContext source) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianBlurProcessor(3f)); @@ -35,7 +35,7 @@ public static IImageProcessorApplicator GaussianBlur(this IImage /// The image this method extends. /// The 'sigma' value representing the weight of the blur. /// The . - public static IImageProcessorApplicator GaussianBlur(this IImageProcessorApplicator source, float sigma) + public static IImageProcessingContext GaussianBlur(this IImageProcessingContext source, float sigma) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianBlurProcessor(sigma)); @@ -49,7 +49,7 @@ public static IImageProcessorApplicator GaussianBlur(this IImage /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator GaussianBlur(this IImageProcessorApplicator source, float sigma, Rectangle rectangle) + public static IImageProcessingContext GaussianBlur(this IImageProcessingContext source, float sigma, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianBlurProcessor(sigma), rectangle); } diff --git a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs index 8c8ac6ed2c..5f66f1771b 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator GaussianSharpen(this IImageProcessorApplicator source) + public static IImageProcessingContext GaussianSharpen(this IImageProcessingContext source) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianSharpenProcessor(3f)); @@ -35,7 +35,7 @@ public static IImageProcessorApplicator GaussianSharpen(this IIm /// The image this method extends. /// The 'sigma' value representing the weight of the blur. /// The . - public static IImageProcessorApplicator GaussianSharpen(this IImageProcessorApplicator source, float sigma) + public static IImageProcessingContext GaussianSharpen(this IImageProcessingContext source, float sigma) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianSharpenProcessor(sigma)); @@ -49,7 +49,7 @@ public static IImageProcessorApplicator GaussianSharpen(this IIm /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator GaussianSharpen(this IImageProcessorApplicator source, float sigma, Rectangle rectangle) + public static IImageProcessingContext GaussianSharpen(this IImageProcessingContext source, float sigma, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new GaussianSharpenProcessor(sigma), rectangle); } diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs index a5647d69eb..733c4d090e 100644 --- a/src/ImageSharp/Processing/Delegate.cs +++ b/src/ImageSharp/Processing/Delegate.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The image to rotate, flip, or both. /// The operations to perform on the source. /// returns the current optinoatins class to allow chaining of oprations. - public static IImageProcessorApplicator Run(this IImageProcessorApplicator source, Action> operation) + public static IImageProcessingContext Run(this IImageProcessingContext source, Action> operation) where TPixel : struct, IPixel => source.ApplyProcessor(new DelegateProcessor(operation)); } diff --git a/src/ImageSharp/Processing/Effects/Alpha.cs b/src/ImageSharp/Processing/Effects/Alpha.cs index b49a697da8..2081c91bda 100644 --- a/src/ImageSharp/Processing/Effects/Alpha.cs +++ b/src/ImageSharp/Processing/Effects/Alpha.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The new opacity of the image. Must be between 0 and 1. /// The . - public static IImageProcessorApplicator Alpha(this IImageProcessorApplicator source, float percent) + public static IImageProcessingContext Alpha(this IImageProcessingContext source, float percent) where TPixel : struct, IPixel => source.ApplyProcessor(new AlphaProcessor(percent)); @@ -38,7 +38,7 @@ public static IImageProcessorApplicator Alpha(this IImageProcess /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Alpha(this IImageProcessorApplicator source, float percent, Rectangle rectangle) + public static IImageProcessingContext Alpha(this IImageProcessingContext source, float percent, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new AlphaProcessor(percent), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/BackgroundColor.cs b/src/ImageSharp/Processing/Effects/BackgroundColor.cs index c4754c8e6f..ec9fe32d6e 100644 --- a/src/ImageSharp/Processing/Effects/BackgroundColor.cs +++ b/src/ImageSharp/Processing/Effects/BackgroundColor.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The color to set as the background. /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator BackgroundColor(this IImageProcessorApplicator source, TPixel color, GraphicsOptions options) + public static IImageProcessingContext BackgroundColor(this IImageProcessingContext source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new BackgroundColorProcessor(color, options)); @@ -40,7 +40,7 @@ public static IImageProcessorApplicator BackgroundColor(this IIm /// /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator BackgroundColor(this IImageProcessorApplicator source, TPixel color, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessingContext BackgroundColor(this IImageProcessingContext source, TPixel color, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new BackgroundColorProcessor(color, options), rectangle); @@ -51,7 +51,7 @@ public static IImageProcessorApplicator BackgroundColor(this IIm /// The image this method extends. /// The color to set as the background. /// The . - public static IImageProcessorApplicator BackgroundColor(this IImageProcessorApplicator source, TPixel color) + public static IImageProcessingContext BackgroundColor(this IImageProcessingContext source, TPixel color) where TPixel : struct, IPixel { return BackgroundColor(source, color, GraphicsOptions.Default); @@ -67,7 +67,7 @@ public static IImageProcessorApplicator BackgroundColor(this IIm /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator BackgroundColor(this IImageProcessorApplicator source, TPixel color, Rectangle rectangle) + public static IImageProcessingContext BackgroundColor(this IImageProcessingContext source, TPixel color, Rectangle rectangle) where TPixel : struct, IPixel { return BackgroundColor(source, color, rectangle, GraphicsOptions.Default); diff --git a/src/ImageSharp/Processing/Effects/Brightness.cs b/src/ImageSharp/Processing/Effects/Brightness.cs index 59a02d4562..d9ed576121 100644 --- a/src/ImageSharp/Processing/Effects/Brightness.cs +++ b/src/ImageSharp/Processing/Effects/Brightness.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The new brightness of the image. Must be between -100 and 100. /// The . - public static IImageProcessorApplicator Brightness(this IImageProcessorApplicator source, int amount) + public static IImageProcessingContext Brightness(this IImageProcessingContext source, int amount) where TPixel : struct, IPixel => source.ApplyProcessor(new BrightnessProcessor(amount)); @@ -38,7 +38,7 @@ public static IImageProcessorApplicator Brightness(this IImagePr /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Brightness(this IImageProcessorApplicator source, int amount, Rectangle rectangle) + public static IImageProcessingContext Brightness(this IImageProcessingContext source, int amount, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new BrightnessProcessor(amount), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/Contrast.cs b/src/ImageSharp/Processing/Effects/Contrast.cs index e94605a75d..0af86e1df4 100644 --- a/src/ImageSharp/Processing/Effects/Contrast.cs +++ b/src/ImageSharp/Processing/Effects/Contrast.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image this method extends. /// The new contrast of the image. Must be between -100 and 100. /// The . - public static IImageProcessorApplicator Contrast(this IImageProcessorApplicator source, int amount) + public static IImageProcessingContext Contrast(this IImageProcessingContext source, int amount) where TPixel : struct, IPixel => source.ApplyProcessor(new ContrastProcessor(amount)); @@ -38,7 +38,7 @@ public static IImageProcessorApplicator Contrast(this IImageProc /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Contrast(this IImageProcessorApplicator source, int amount, Rectangle rectangle) + public static IImageProcessingContext Contrast(this IImageProcessingContext source, int amount, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new ContrastProcessor(amount), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/Invert.cs b/src/ImageSharp/Processing/Effects/Invert.cs index 5e0ceab75e..cc480cf0c3 100644 --- a/src/ImageSharp/Processing/Effects/Invert.cs +++ b/src/ImageSharp/Processing/Effects/Invert.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Invert(this IImageProcessorApplicator source) + public static IImageProcessingContext Invert(this IImageProcessingContext source) where TPixel : struct, IPixel => source.ApplyProcessor(new InvertProcessor()); @@ -36,7 +36,7 @@ public static IImageProcessorApplicator Invert(this IImageProces /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Invert(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext Invert(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new InvertProcessor(), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/OilPainting.cs b/src/ImageSharp/Processing/Effects/OilPainting.cs index e6a8c8373b..844b5ceb6a 100644 --- a/src/ImageSharp/Processing/Effects/OilPainting.cs +++ b/src/ImageSharp/Processing/Effects/OilPainting.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator OilPaint(this IImageProcessorApplicator source) + public static IImageProcessingContext OilPaint(this IImageProcessingContext source) where TPixel : struct, IPixel { return OilPaint(source, 10, 15); @@ -40,7 +40,7 @@ public static IImageProcessorApplicator OilPaint(this IImageProc /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator OilPaint(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext OilPaint(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel { return OilPaint(source, 10, 15, rectangle); @@ -54,7 +54,7 @@ public static IImageProcessorApplicator OilPaint(this IImageProc /// The number of intensity levels. Higher values result in a broader range of color intensities forming part of the result image. /// The number of neighboring pixels used in calculating each individual pixel value. /// The . - public static IImageProcessorApplicator OilPaint(this IImageProcessorApplicator source, int levels, int brushSize) + public static IImageProcessingContext OilPaint(this IImageProcessingContext source, int levels, int brushSize) where TPixel : struct, IPixel => source.ApplyProcessor(new OilPaintingProcessor(levels, brushSize)); @@ -69,7 +69,7 @@ public static IImageProcessorApplicator OilPaint(this IImageProc /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator OilPaint(this IImageProcessorApplicator source, int levels, int brushSize, Rectangle rectangle) + public static IImageProcessingContext OilPaint(this IImageProcessingContext source, int levels, int brushSize, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new OilPaintingProcessor(levels, brushSize), rectangle); } diff --git a/src/ImageSharp/Processing/Effects/Pixelate.cs b/src/ImageSharp/Processing/Effects/Pixelate.cs index c1e6318381..3ae152c2ba 100644 --- a/src/ImageSharp/Processing/Effects/Pixelate.cs +++ b/src/ImageSharp/Processing/Effects/Pixelate.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Pixelate(this IImageProcessorApplicator source) + public static IImageProcessingContext Pixelate(this IImageProcessingContext source) where TPixel : struct, IPixel => source.ApplyProcessor(new PixelateProcessor(4)); @@ -34,7 +34,7 @@ public static IImageProcessorApplicator Pixelate(this IImageProc /// The image this method extends. /// The size of the pixels. /// The . - public static IImageProcessorApplicator Pixelate(this IImageProcessorApplicator source, int size) + public static IImageProcessingContext Pixelate(this IImageProcessingContext source, int size) where TPixel : struct, IPixel => source.ApplyProcessor(new PixelateProcessor(size)); @@ -48,7 +48,7 @@ public static IImageProcessorApplicator Pixelate(this IImageProc /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Pixelate(this IImageProcessorApplicator source, int size, Rectangle rectangle) + public static IImageProcessingContext Pixelate(this IImageProcessingContext source, int size, Rectangle rectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new PixelateProcessor(size), rectangle); } diff --git a/src/ImageSharp/Processing/Overlays/Glow.cs b/src/ImageSharp/Processing/Overlays/Glow.cs index 30ff666921..e34cbf5915 100644 --- a/src/ImageSharp/Processing/Overlays/Glow.cs +++ b/src/ImageSharp/Processing/Overlays/Glow.cs @@ -21,7 +21,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source) + public static IImageProcessingContext Glow(this IImageProcessingContext source) where TPixel : struct, IPixel { return Glow(source, GraphicsOptions.Default); @@ -34,7 +34,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// The image this method extends. /// The color to set as the glow. /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color) + public static IImageProcessingContext Glow(this IImageProcessingContext source, TPixel color) where TPixel : struct, IPixel { return Glow(source, color, GraphicsOptions.Default); @@ -47,7 +47,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// The image this method extends. /// The the radius. /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, float radius) + public static IImageProcessingContext Glow(this IImageProcessingContext source, float radius) where TPixel : struct, IPixel { return Glow(source, radius, GraphicsOptions.Default); @@ -62,7 +62,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext Glow(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel => source.Glow(rectangle, GraphicsOptions.Default); @@ -77,7 +77,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, float radius, Rectangle rectangle) + public static IImageProcessingContext Glow(this IImageProcessingContext source, TPixel color, float radius, Rectangle rectangle) where TPixel : struct, IPixel => source.Glow(color, ValueSize.Absolute(radius), rectangle, GraphicsOptions.Default); @@ -88,7 +88,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// The image this method extends. /// The options effecting things like blending. /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, GraphicsOptions options) + public static IImageProcessingContext Glow(this IImageProcessingContext source, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(NamedColors.Black, ValueSize.PercentageOfWidth(0.5f), options); @@ -100,7 +100,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// The color to set as the glow. /// The options effecting things like blending. /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, GraphicsOptions options) + public static IImageProcessingContext Glow(this IImageProcessingContext source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(color, ValueSize.PercentageOfWidth(0.5f), options); @@ -112,7 +112,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// The the radius. /// The options effecting things like blending. /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, float radius, GraphicsOptions options) + public static IImageProcessingContext Glow(this IImageProcessingContext source, float radius, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(NamedColors.Black, ValueSize.Absolute(radius), options); @@ -126,7 +126,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// /// The options effecting things like blending. /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessingContext Glow(this IImageProcessingContext source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(NamedColors.Black, ValueSize.PercentageOfWidth(0.5f), rectangle, options); @@ -142,7 +142,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// /// The options effecting things like blending. /// The . - public static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, float radius, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessingContext Glow(this IImageProcessingContext source, TPixel color, float radius, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.Glow(color, ValueSize.Absolute(radius), rectangle, options); @@ -158,7 +158,7 @@ public static IImageProcessorApplicator Glow(this IImageProcesso /// /// The options effecting things like blending. /// The . - private static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, ValueSize radius, Rectangle rectangle, GraphicsOptions options) + private static IImageProcessingContext Glow(this IImageProcessingContext source, TPixel color, ValueSize radius, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new GlowProcessor(color, radius, options), rectangle); @@ -171,7 +171,7 @@ private static IImageProcessorApplicator Glow(this IImageProcess /// The the radius. /// The options effecting things like blending. /// The . - private static IImageProcessorApplicator Glow(this IImageProcessorApplicator source, TPixel color, ValueSize radius, GraphicsOptions options) + private static IImageProcessingContext Glow(this IImageProcessingContext source, TPixel color, ValueSize radius, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new GlowProcessor(color, radius, options)); } diff --git a/src/ImageSharp/Processing/Overlays/Vignette.cs b/src/ImageSharp/Processing/Overlays/Vignette.cs index 81cd773b2b..f0c962627e 100644 --- a/src/ImageSharp/Processing/Overlays/Vignette.cs +++ b/src/ImageSharp/Processing/Overlays/Vignette.cs @@ -21,7 +21,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image this method extends. /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source) + public static IImageProcessingContext Vignette(this IImageProcessingContext source) where TPixel : struct, IPixel { return Vignette(source, GraphicsOptions.Default); @@ -34,7 +34,7 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// The image this method extends. /// The color to set as the vignette. /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, TPixel color) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, TPixel color) where TPixel : struct, IPixel { return Vignette(source, color, GraphicsOptions.Default); @@ -48,7 +48,7 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// The the x-radius. /// The the y-radius. /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, float radiusX, float radiusY) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, float radiusX, float radiusY) where TPixel : struct, IPixel { return Vignette(source, radiusX, radiusY, GraphicsOptions.Default); @@ -63,7 +63,7 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, Rectangle rectangle) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, Rectangle rectangle) where TPixel : struct, IPixel { return Vignette(source, rectangle, GraphicsOptions.Default); @@ -81,7 +81,7 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// The structure that specifies the portion of the image object to alter. /// /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, TPixel color, float radiusX, float radiusY, Rectangle rectangle) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, TPixel color, float radiusX, float radiusY, Rectangle rectangle) where TPixel : struct, IPixel => source.Vignette(color, radiusX, radiusY, rectangle, GraphicsOptions.Default); @@ -92,7 +92,7 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// The image this method extends. /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, GraphicsOptions options) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(NamedColors.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options); @@ -104,7 +104,7 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// The color to set as the vignette. /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, TPixel color, GraphicsOptions options) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, TPixel color, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(color, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), options); @@ -117,7 +117,7 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// The the y-radius. /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, float radiusX, float radiusY, GraphicsOptions options) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, float radiusX, float radiusY, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(NamedColors.Black, radiusX, radiusY, options); @@ -131,7 +131,7 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(NamedColors.Black, ValueSize.PercentageOfWidth(.5f), ValueSize.PercentageOfHeight(.5f), rectangle, options); @@ -148,15 +148,15 @@ public static IImageProcessorApplicator Vignette(this IImageProc /// /// The options effecting pixel blending. /// The . - public static IImageProcessorApplicator Vignette(this IImageProcessorApplicator source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options) + public static IImageProcessingContext Vignette(this IImageProcessingContext source, TPixel color, float radiusX, float radiusY, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.VignetteInternal(color, radiusX, radiusY, rectangle, options); - private static IImageProcessorApplicator VignetteInternal(this IImageProcessorApplicator source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options) + private static IImageProcessingContext VignetteInternal(this IImageProcessingContext source, TPixel color, ValueSize radiusX, ValueSize radiusY, Rectangle rectangle, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new VignetteProcessor(color, radiusX, radiusY, options), rectangle); - private static IImageProcessorApplicator VignetteInternal(this IImageProcessorApplicator source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options) + private static IImageProcessingContext VignetteInternal(this IImageProcessingContext source, TPixel color, ValueSize radiusX, ValueSize radiusY, GraphicsOptions options) where TPixel : struct, IPixel => source.ApplyProcessor(new VignetteProcessor(color, radiusX, radiusY, options)); } diff --git a/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs b/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs index 0b6dbd3ed2..a95e466abe 100644 --- a/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs @@ -15,7 +15,7 @@ namespace ImageSharp.Processing /// Allows the application of processors to images. /// /// The pixel format. - internal abstract class CloneingImageProcessor : IImageProcessor, ICloningImageProcessor + internal abstract class CloneingImageProcessor : IImageProcessor, ICloneingImageProcessor where TPixel : struct, IPixel { /// diff --git a/src/ImageSharp/Processing/Transforms/AutoOrient.cs b/src/ImageSharp/Processing/Transforms/AutoOrient.cs index f741e41b13..f01fbef3dc 100644 --- a/src/ImageSharp/Processing/Transforms/AutoOrient.cs +++ b/src/ImageSharp/Processing/Transforms/AutoOrient.cs @@ -21,7 +21,7 @@ public static partial class ImageExtensions /// The pixel format. /// The image to auto rotate. /// The - public static IImageProcessorApplicator AutoOrient(this IImageProcessorApplicator source) + public static IImageProcessingContext AutoOrient(this IImageProcessingContext source) where TPixel : struct, IPixel => source.ApplyProcessor(new Processing.Processors.AutoRotateProcessor()); } diff --git a/src/ImageSharp/Processing/Transforms/Crop.cs b/src/ImageSharp/Processing/Transforms/Crop.cs index aad80fa0fc..6a8b02d023 100644 --- a/src/ImageSharp/Processing/Transforms/Crop.cs +++ b/src/ImageSharp/Processing/Transforms/Crop.cs @@ -25,7 +25,7 @@ public static partial class ImageExtensions /// The target image width. /// The target image height. /// The - public static IImageProcessorApplicator Crop(this IImageProcessorApplicator source, int width, int height) + public static IImageProcessingContext Crop(this IImageProcessingContext source, int width, int height) where TPixel : struct, IPixel => Crop(source, new Rectangle(0, 0, width, height)); @@ -38,7 +38,7 @@ public static IImageProcessorApplicator Crop(this IImageProcesso /// The structure that specifies the portion of the image object to retain. /// /// The - public static IImageProcessorApplicator Crop(this IImageProcessorApplicator source, Rectangle cropRectangle) + public static IImageProcessingContext Crop(this IImageProcessingContext source, Rectangle cropRectangle) where TPixel : struct, IPixel => source.ApplyProcessor(new CropProcessor(cropRectangle)); } diff --git a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs b/src/ImageSharp/Processing/Transforms/EntropyCrop.cs index a0704619c2..8c5f32dd04 100644 --- a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs +++ b/src/ImageSharp/Processing/Transforms/EntropyCrop.cs @@ -23,7 +23,7 @@ public static partial class ImageExtensions /// The image to crop. /// The threshold for entropic density. /// The - public static IImageProcessorApplicator EntropyCrop(this IImageProcessorApplicator source, float threshold = .5f) + public static IImageProcessingContext EntropyCrop(this IImageProcessingContext source, float threshold = .5f) where TPixel : struct, IPixel => source.ApplyProcessor(new EntropyCropProcessor(threshold)); } diff --git a/src/ImageSharp/Processing/Transforms/Flip.cs b/src/ImageSharp/Processing/Transforms/Flip.cs index 2f20c3bd8a..071662ae66 100644 --- a/src/ImageSharp/Processing/Transforms/Flip.cs +++ b/src/ImageSharp/Processing/Transforms/Flip.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image to rotate, flip, or both. /// The to perform the flip. /// The - public static IImageProcessorApplicator Flip(this IImageProcessorApplicator source, FlipType flipType) + public static IImageProcessingContext Flip(this IImageProcessingContext source, FlipType flipType) where TPixel : struct, IPixel => source.ApplyProcessor(new FlipProcessor(flipType)); } diff --git a/src/ImageSharp/Processing/Transforms/Pad.cs b/src/ImageSharp/Processing/Transforms/Pad.cs index 90a9e281b0..40fd6da6e4 100644 --- a/src/ImageSharp/Processing/Transforms/Pad.cs +++ b/src/ImageSharp/Processing/Transforms/Pad.cs @@ -26,7 +26,7 @@ public static partial class ImageExtensions /// The new width. /// The new height. /// The . - public static IImageProcessorApplicator Pad(this IImageProcessorApplicator source, int width, int height) + public static IImageProcessingContext Pad(this IImageProcessingContext source, int width, int height) where TPixel : struct, IPixel { ResizeOptions options = new ResizeOptions diff --git a/src/ImageSharp/Processing/Transforms/Resize.cs b/src/ImageSharp/Processing/Transforms/Resize.cs index 4c04991c02..c73581a93a 100644 --- a/src/ImageSharp/Processing/Transforms/Resize.cs +++ b/src/ImageSharp/Processing/Transforms/Resize.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The resize options. /// The /// Passing zero for one of height or width within the resize options will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, ResizeOptions options) + public static IImageProcessingContext Resize(this IImageProcessingContext source, ResizeOptions options) where TPixel : struct, IPixel { return source.Run(img => @@ -56,7 +56,7 @@ public static IImageProcessorApplicator Resize(this IImageProces /// The target image size. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, Size size) + public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size) where TPixel : struct, IPixel { return Resize(source, size.Width, size.Height, new BicubicResampler(), false); @@ -71,7 +71,7 @@ public static IImageProcessorApplicator Resize(this IImageProces /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, Size size, bool compand) + public static IImageProcessingContext Resize(this IImageProcessingContext source, Size size, bool compand) where TPixel : struct, IPixel { return Resize(source, size.Width, size.Height, new BicubicResampler(), compand); @@ -86,7 +86,7 @@ public static IImageProcessorApplicator Resize(this IImageProces /// The target image height. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height) + public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height) where TPixel : struct, IPixel { return Resize(source, width, height, new BicubicResampler(), false); @@ -102,7 +102,7 @@ public static IImageProcessorApplicator Resize(this IImageProces /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, bool compand) + public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, bool compand) where TPixel : struct, IPixel { return Resize(source, width, height, new BicubicResampler(), compand); @@ -118,7 +118,7 @@ public static IImageProcessorApplicator Resize(this IImageProces /// The to perform the resampling. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, IResampler sampler) + public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler) where TPixel : struct, IPixel { return Resize(source, width, height, sampler, false); @@ -135,7 +135,7 @@ public static IImageProcessorApplicator Resize(this IImageProces /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, IResampler sampler, bool compand) + public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, bool compand) where TPixel : struct, IPixel { return Resize(source, width, height, sampler, new Rectangle(0, 0, width, height), compand); @@ -159,7 +159,7 @@ public static IImageProcessorApplicator Resize(this IImageProces /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand) + public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel { return source.Run(img => @@ -199,7 +199,7 @@ public static IImageProcessorApplicator Resize(this IImageProces /// Whether to compress and expand the image color-space to gamma correct the image during processing. /// The /// Passing zero for one of height or width will automatically preserve the aspect ratio of the original image - public static IImageProcessorApplicator Resize(this IImageProcessorApplicator source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand) + public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel { return source.Run(img => diff --git a/src/ImageSharp/Processing/Transforms/Rotate.cs b/src/ImageSharp/Processing/Transforms/Rotate.cs index 08ac44dad5..435efa30fa 100644 --- a/src/ImageSharp/Processing/Transforms/Rotate.cs +++ b/src/ImageSharp/Processing/Transforms/Rotate.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The image to rotate. /// The angle in degrees to perform the rotation. /// The - public static IImageProcessorApplicator Rotate(this IImageProcessorApplicator source, float degrees) + public static IImageProcessingContext Rotate(this IImageProcessingContext source, float degrees) where TPixel : struct, IPixel { return Rotate(source, degrees, true); @@ -37,7 +37,7 @@ public static IImageProcessorApplicator Rotate(this IImageProces /// The image to rotate. /// The to perform the rotation. /// The - public static IImageProcessorApplicator Rotate(this IImageProcessorApplicator source, RotateType rotateType) + public static IImageProcessingContext Rotate(this IImageProcessingContext source, RotateType rotateType) where TPixel : struct, IPixel => Rotate(source, (float)rotateType, false); @@ -49,7 +49,7 @@ public static IImageProcessorApplicator Rotate(this IImageProces /// The angle in degrees to perform the rotation. /// Whether to expand the image to fit the rotated result. /// The - public static IImageProcessorApplicator Rotate(this IImageProcessorApplicator source, float degrees, bool expand) + public static IImageProcessingContext Rotate(this IImageProcessingContext source, float degrees, bool expand) where TPixel : struct, IPixel => source.ApplyProcessor(new RotateProcessor { Angle = degrees, Expand = expand }); } diff --git a/src/ImageSharp/Processing/Transforms/RotateFlip.cs b/src/ImageSharp/Processing/Transforms/RotateFlip.cs index 2c321358ec..83edba0f92 100644 --- a/src/ImageSharp/Processing/Transforms/RotateFlip.cs +++ b/src/ImageSharp/Processing/Transforms/RotateFlip.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The to perform the rotation. /// The to perform the flip. /// The - public static IImageProcessorApplicator RotateFlip(this IImageProcessorApplicator source, RotateType rotateType, FlipType flipType) + public static IImageProcessingContext RotateFlip(this IImageProcessingContext source, RotateType rotateType, FlipType flipType) where TPixel : struct, IPixel { return source.Rotate(rotateType).Flip(flipType); diff --git a/src/ImageSharp/Processing/Transforms/Skew.cs b/src/ImageSharp/Processing/Transforms/Skew.cs index 8fde7270d5..5f7853f05c 100644 --- a/src/ImageSharp/Processing/Transforms/Skew.cs +++ b/src/ImageSharp/Processing/Transforms/Skew.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The angle in degrees to perform the rotation along the x-axis. /// The angle in degrees to perform the rotation along the y-axis. /// The - public static IImageProcessorApplicator Skew(this IImageProcessorApplicator source, float degreesX, float degreesY) + public static IImageProcessingContext Skew(this IImageProcessingContext source, float degreesX, float degreesY) where TPixel : struct, IPixel { return Skew(source, degreesX, degreesY, true); @@ -39,7 +39,7 @@ public static IImageProcessorApplicator Skew(this IImageProcesso /// The angle in degrees to perform the rotation along the y-axis. /// Whether to expand the image to fit the skewed result. /// The - public static IImageProcessorApplicator Skew(this IImageProcessorApplicator source, float degreesX, float degreesY, bool expand) + public static IImageProcessingContext Skew(this IImageProcessingContext source, float degreesX, float degreesY, bool expand) where TPixel : struct, IPixel => source.ApplyProcessor(new SkewProcessor { AngleX = degreesX, AngleY = degreesY, Expand = expand }); } diff --git a/src/ImageSharp/Quantizers/Quantize.cs b/src/ImageSharp/Quantizers/Quantize.cs index 54c57b508f..0edc1557a5 100644 --- a/src/ImageSharp/Quantizers/Quantize.cs +++ b/src/ImageSharp/Quantizers/Quantize.cs @@ -24,7 +24,7 @@ public static partial class ImageExtensions /// The quantization mode to apply to perform the operation. /// The maximum number of colors to return. Defaults to 256. /// The . - public static IImageProcessorApplicator Quantize(this IImageProcessorApplicator source, Quantization mode = Quantization.Octree, int maxColors = 256) + public static IImageProcessingContext Quantize(this IImageProcessingContext source, Quantization mode = Quantization.Octree, int maxColors = 256) where TPixel : struct, IPixel { IQuantizer quantizer; @@ -54,7 +54,7 @@ public static IImageProcessorApplicator Quantize(this IImageProc /// The quantizer to apply to perform the operation. /// The maximum number of colors to return. /// The . - public static IImageProcessorApplicator Quantize(this IImageProcessorApplicator source, IQuantizer quantizer, int maxColors) + public static IImageProcessingContext Quantize(this IImageProcessingContext source, IQuantizer quantizer, int maxColors) where TPixel : struct, IPixel { return source.Run(img => diff --git a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs index 997215ce2e..f2afe2f4f8 100644 --- a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs +++ b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs @@ -9,7 +9,8 @@ namespace ImageSharp.Tests { public abstract class BaseImageOperationsExtensionTest { - protected readonly FakeImageOperationsProvider.FakeImageOperations operations; + protected readonly IImageProcessingContext operations; + private readonly FakeImageOperationsProvider.FakeImageOperations internalOperations; protected readonly Rectangle rect; protected readonly GraphicsOptions options; @@ -17,23 +18,24 @@ public BaseImageOperationsExtensionTest() { this.options = new GraphicsOptions(false) { }; this.rect = new Rectangle(91, 123, 324, 56); // make this random? - this.operations = new FakeImageOperationsProvider.FakeImageOperations(null, false); + this.internalOperations = new FakeImageOperationsProvider.FakeImageOperations(null, false); + this.operations = this.internalOperations; } public T Verify(int index = 0) { - Assert.InRange(index, 0, this.operations.applied.Count - 1); + Assert.InRange(index, 0, this.internalOperations.applied.Count - 1); - var operation = this.operations.applied[index]; + var operation = this.internalOperations.applied[index]; return Assert.IsType(operation.Processor); } public T Verify(Rectangle rect, int index = 0) { - Assert.InRange(index, 0, this.operations.applied.Count - 1); + Assert.InRange(index, 0, this.internalOperations.applied.Count - 1); - var operation = this.operations.applied[index]; + var operation = this.internalOperations.applied[index]; Assert.Equal(rect, operation.Rectangle); return Assert.IsType(operation.Processor); diff --git a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs index e06b918afd..1c6fec0a43 100644 --- a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs +++ b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs @@ -8,7 +8,7 @@ using ImageSharp.Processing; using SixLabors.Primitives; - public class FakeImageOperationsProvider : IImageProcessorApplicatorFactory + internal class FakeImageOperationsProvider : IImageProcessingContextFactory { private List ImageOperators = new List(); @@ -29,7 +29,7 @@ public IEnumerable> Created(Image so .SelectMany(x => x.applied); } - public IInternalImageProcessorApplicator CreateImageOperations(Image source, bool mutate) where TPixel : struct, IPixel + public IInternalImageProcessingContext CreateImageProcessingContext(Image source, bool mutate) where TPixel : struct, IPixel { var op = new FakeImageOperations(source, mutate); this.ImageOperators.Add(op); @@ -37,7 +37,7 @@ public IInternalImageProcessorApplicator CreateImageOperations(I } - public class FakeImageOperations : IInternalImageProcessorApplicator + public class FakeImageOperations : IInternalImageProcessingContext where TPixel : struct, IPixel { public Image source; @@ -63,7 +63,7 @@ public Image Apply() return source; } - public IImageProcessorApplicator ApplyProcessor(IImageProcessor processor, Rectangle rectangle) + public IImageProcessingContext ApplyProcessor(IImageProcessor processor, Rectangle rectangle) { applied.Add(new AppliedOpperation { @@ -73,7 +73,7 @@ public IImageProcessorApplicator ApplyProcessor(IImageProcessor return this; } - public IImageProcessorApplicator ApplyProcessor(IImageProcessor processor) + public IImageProcessingContext ApplyProcessor(IImageProcessor processor) { applied.Add(new AppliedOpperation { diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs index ae10bf9af4..8681bb334a 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs @@ -85,7 +85,7 @@ public static TestImageProvider Solid( /// /// Returns an instance to the test case with the necessary traits. /// - public Image GetImage(Action> operationsToApply) + public Image GetImage(Action> operationsToApply) { var img = GetImage(); img.Mutate(operationsToApply); From 3e233139aa9a5d394ef4722b47bd3e3013a3a2e3 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 17 Jul 2017 02:23:45 +0200 Subject: [PATCH 17/33] made FormatsDirectory a lazy value -> folders are no longer walked in TestFile type initializer. Might be healthy for test discoverers. Conflicts: tests/ImageSharp.Tests/TestFile.cs --- tests/ImageSharp.Tests/TestFile.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/ImageSharp.Tests/TestFile.cs b/tests/ImageSharp.Tests/TestFile.cs index 2b505a2e46..13944cc3c3 100644 --- a/tests/ImageSharp.Tests/TestFile.cs +++ b/tests/ImageSharp.Tests/TestFile.cs @@ -25,10 +25,10 @@ public class TestFile private static readonly ConcurrentDictionary Cache = new ConcurrentDictionary(); /// - /// The formats directory. + /// The formats directory, as lazy value /// - private static readonly string FormatsDirectory = GetFormatsDirectory(); - + private static readonly Lazy formatsDirectory = new Lazy(GetFormatsDirectory); + private Image _image; private byte[] _bytes; @@ -71,6 +71,11 @@ private TestFile(string file) /// public string FileNameWithoutExtension => Path.GetFileNameWithoutExtension(this.file); + /// + /// Gets the "Formats" test file directory. + /// + private static string FormatsDirectory => formatsDirectory.Value; + /// /// Gets the full qualified path to the file. /// From d9fb5bda4db1a1f9f3a67f5cccb956a91ac5d02d Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Mon, 17 Jul 2017 02:29:37 +0200 Subject: [PATCH 18/33] clean up TestFile.cs --- tests/ImageSharp.Tests/TestFile.cs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tests/ImageSharp.Tests/TestFile.cs b/tests/ImageSharp.Tests/TestFile.cs index 13944cc3c3..4f286f4da0 100644 --- a/tests/ImageSharp.Tests/TestFile.cs +++ b/tests/ImageSharp.Tests/TestFile.cs @@ -25,17 +25,19 @@ public class TestFile private static readonly ConcurrentDictionary Cache = new ConcurrentDictionary(); /// - /// The formats directory, as lazy value + /// The "Formats" directory, as lazy value /// private static readonly Lazy formatsDirectory = new Lazy(GetFormatsDirectory); - private Image _image; - private byte[] _bytes; + /// + /// The image (lazy initialized value) + /// + private Image image; /// - /// The image. + /// The image bytes /// - private Image image => this._image ?? (this._image = Image.Load(this.Bytes)); + private byte[] bytes; /// /// The file. @@ -52,9 +54,9 @@ private TestFile(string file) } /// - /// Gets the bytes. + /// Gets the image bytes. /// - public byte[] Bytes => this._bytes ?? (this._bytes = File.ReadAllBytes(this.file)); + public byte[] Bytes => this.bytes ?? (this.bytes = File.ReadAllBytes(this.file)); /// /// The file name. @@ -71,6 +73,11 @@ private TestFile(string file) /// public string FileNameWithoutExtension => Path.GetFileNameWithoutExtension(this.file); + /// + /// Gets the image with lazy initialization. + /// + private Image Image => this.image ?? (this.image = ImageSharp.Image.Load(this.Bytes)); + /// /// Gets the "Formats" test file directory. /// @@ -130,22 +137,22 @@ public string GetFileNameWithoutExtension(object value) /// Creates a new image. /// /// - /// The . + /// The . /// public Image CreateImage() { - return this.image.Clone(); + return this.Image.Clone(); } /// /// Creates a new image. /// /// - /// The . + /// The . /// public Image CreateImage(IImageDecoder decoder) { - return Image.Load(this.image.Configuration, this.Bytes, decoder); + return ImageSharp.Image.Load(this.Image.Configuration, this.Bytes, decoder); } /// From 06271fa69362ae165a030c422ee5aa00e72df1e2 Mon Sep 17 00:00:00 2001 From: JimBobSquarePants Date: Tue, 18 Jul 2017 17:07:54 +1000 Subject: [PATCH 19/33] Fix spelling errors --- src/ImageSharp/ApplyProcessors.cs | 22 +++++++++---------- .../DefaultInternalImageProcessorContext.cs | 4 ++-- ...Processor.cs => ICloningImageProcessor.cs} | 9 +++----- ...eProcessor.cs => CloningImageProcessor.cs} | 2 +- .../Transforms/ResamplingWeightedProcessor.cs | 2 +- 5 files changed, 18 insertions(+), 21 deletions(-) rename src/ImageSharp/Image/{ICloneingImageProcessor.cs => ICloningImageProcessor.cs} (82%) rename src/ImageSharp/Processing/Processors/{CLoneingImageProcessor.cs => CloningImageProcessor.cs} (98%) diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index 40cd7500a7..aa44dfc215 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -17,19 +17,19 @@ namespace ImageSharp public static partial class ImageExtensions { /// - /// Mutates the image by applying the operations to it. + /// Mutates the image by applying the image operation to it. /// /// The pixel format. /// The image to rotate, flip, or both. - /// The operations to perform on the source. - public static void Mutate(this Image source, Action> operations) + /// The operations to perform on the source. + public static void Mutate(this Image source, Action> operation) where TPixel : struct, IPixel { - Guard.NotNull(operations, nameof(operations)); + Guard.NotNull(operation, nameof(operation)); Guard.NotNull(source, nameof(source)); IInternalImageProcessingContext operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, true); - operations(operationsRunner); + operation(operationsRunner); operationsRunner.Apply(); } @@ -51,20 +51,20 @@ public static void Mutate(this Image source, params IImageProces } /// - /// Clones the current image mutating the clone by applying the operations to it. + /// Clones the current image mutating the clone by applying the operation to it. /// /// The pixel format. /// The image to rotate, flip, or both. - /// The operations to perform on the source. - /// Anew Image which has teh data from the but with the applied. - public static Image Clone(this Image source, Action> operations) + /// The operations to perform on the source. + /// Anew Image which has teh data from the but with the applied. + public static Image Clone(this Image source, Action> operation) where TPixel : struct, IPixel { - Guard.NotNull(operations, nameof(operations)); + Guard.NotNull(operation, nameof(operation)); Guard.NotNull(source, nameof(source)); IInternalImageProcessingContext operationsRunner = source.Configuration.ImageOperationsProvider.CreateImageProcessingContext(source, false); - operations(operationsRunner); + operation(operationsRunner); return operationsRunner.Apply(); } diff --git a/src/ImageSharp/DefaultInternalImageProcessorContext.cs b/src/ImageSharp/DefaultInternalImageProcessorContext.cs index 64f444325d..0562f90ce4 100644 --- a/src/ImageSharp/DefaultInternalImageProcessorContext.cs +++ b/src/ImageSharp/DefaultInternalImageProcessorContext.cs @@ -57,9 +57,9 @@ public IImageProcessingContext ApplyProcessor(IImageProcessor pr // this will only work if the first processor applied is the cloning one thus // realistically for this optermissation to work the resize must the first processor // applied any only up processors will take the douple data path. - if (processor is ICloneingImageProcessor) + if (processor is ICloningImageProcessor) { - var cloningProcessor = (ICloneingImageProcessor)processor; + var cloningProcessor = (ICloningImageProcessor)processor; this.destination = cloningProcessor.CloneAndApply(this.source, rectangle); return this; } diff --git a/src/ImageSharp/Image/ICloneingImageProcessor.cs b/src/ImageSharp/Image/ICloningImageProcessor.cs similarity index 82% rename from src/ImageSharp/Image/ICloneingImageProcessor.cs rename to src/ImageSharp/Image/ICloningImageProcessor.cs index 92f87d02e6..a6a3a9a73d 100644 --- a/src/ImageSharp/Image/ICloneingImageProcessor.cs +++ b/src/ImageSharp/Image/ICloningImageProcessor.cs @@ -1,21 +1,18 @@ -// +// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageSharp.Processing { - using System; - using System.Threading.Tasks; - using ImageSharp.PixelFormats; using SixLabors.Primitives; /// - /// Encapsulates methods to alter the pixels of an image. + /// Encapsulates methods to alter the pixels of a new image, cloned from the original image. /// /// The pixel format. - internal interface ICloneingImageProcessor : IImageProcessor + internal interface ICloningImageProcessor : IImageProcessor where TPixel : struct, IPixel { /// diff --git a/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs similarity index 98% rename from src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs rename to src/ImageSharp/Processing/Processors/CloningImageProcessor.cs index a95e466abe..cf84462c5d 100644 --- a/src/ImageSharp/Processing/Processors/CLoneingImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs @@ -15,7 +15,7 @@ namespace ImageSharp.Processing /// Allows the application of processors to images. /// /// The pixel format. - internal abstract class CloneingImageProcessor : IImageProcessor, ICloneingImageProcessor + internal abstract class CloningImageProcessor : IImageProcessor, ICloningImageProcessor where TPixel : struct, IPixel { /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs index 957f917be5..59c0c37a27 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs @@ -16,7 +16,7 @@ namespace ImageSharp.Processing.Processors /// Adapted from /// /// The pixel format. - internal abstract partial class ResamplingWeightedProcessor : CloneingImageProcessor + internal abstract partial class ResamplingWeightedProcessor : CloningImageProcessor where TPixel : struct, IPixel { /// From 70892a146826e337ae95e6a535dd7e6e6faa301a Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Wed, 26 Jul 2017 16:54:47 +1000 Subject: [PATCH 20/33] Cleanup + Rename Run to Apply --- samples/AvatarWithRoundedCorner/Program.cs | 20 ++++---- src/ImageSharp/ApplyProcessors.cs | 4 +- .../DefaultInternalImageProcessorContext.cs | 20 +++----- .../IImageProcessingContextFactory.cs | 5 +- .../IImageProcessingContext{TPixel}.cs | 12 ++--- src/ImageSharp/Processing/Delegate.cs | 6 +-- .../Processors/DelegateProcessor.cs | 5 +- .../Processors/Transforms/ResizeProcessor.cs | 10 ++-- .../Processing/Transforms/Resize.cs | 51 +++++++++---------- src/ImageSharp/Quantizers/Quantize.cs | 4 +- .../Processing/DelegateTest.cs | 2 +- 11 files changed, 64 insertions(+), 75 deletions(-) diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index caed6687f4..4fa2912c1b 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -42,13 +42,13 @@ private static IImageProcessingContext ConvertToAvatar(this IImageProces { Size = size, Mode = ImageSharp.Processing.ResizeMode.Crop - }).Run(i => ApplyRoundedCourners(i, cornerRadius)); + }).Apply(i => ApplyRoundedCorners(i, cornerRadius)); } // the combination of `IImageOperations.Run()` + this could be replaced with an `IImageProcessor` - public static void ApplyRoundedCourners(Image img, float cornerRadius) + public static void ApplyRoundedCorners(Image img, float cornerRadius) { - var corners = BuildCorners(img.Width, img.Height, cornerRadius); + IPathCollection corners = BuildCorners(img.Width, img.Height, cornerRadius); // mutating in here as we already have a cloned original img.Mutate(x => x.Fill(Rgba32.Transparent, corners, new GraphicsOptions(true) @@ -60,22 +60,22 @@ public static void ApplyRoundedCourners(Image img, float cornerRadius) public static IPathCollection BuildCorners(int imageWidth, int imageHeight, float cornerRadius) { // first create a square - var rect = new SixLabors.Shapes.RectangularePolygon(-0.5f, -0.5f, cornerRadius, cornerRadius); + var rect = new RectangularePolygon(-0.5f, -0.5f, cornerRadius, cornerRadius); // then cut out of the square a circle so we are left with a corner - var cornerToptLeft = rect.Clip(new SixLabors.Shapes.EllipsePolygon(cornerRadius - 0.5f, cornerRadius - 0.5f, cornerRadius)); + IPath cornerToptLeft = rect.Clip(new EllipsePolygon(cornerRadius - 0.5f, cornerRadius - 0.5f, cornerRadius)); // corner is now a corner shape positions top left - //lets make 3 more positioned correctly, we cando that by translating the orgional artound the center of the image - var center = new Vector2(imageWidth / 2, imageHeight / 2); + //lets make 3 more positioned correctly, we can do that by translating the orgional artound the center of the image + var center = new Vector2(imageWidth / 2F, imageHeight / 2F); float rightPos = imageWidth - cornerToptLeft.Bounds.Width + 1; float bottomPos = imageHeight - cornerToptLeft.Bounds.Height + 1; // move it across the widthof the image - the width of the shape - var cornerTopRight = cornerToptLeft.RotateDegree(90).Translate(rightPos, 0); - var cornerBottomLeft = cornerToptLeft.RotateDegree(-90).Translate(0, bottomPos); - var cornerBottomRight = cornerToptLeft.RotateDegree(180).Translate(rightPos, bottomPos); + IPath cornerTopRight = cornerToptLeft.RotateDegree(90).Translate(rightPos, 0); + IPath cornerBottomLeft = cornerToptLeft.RotateDegree(-90).Translate(0, bottomPos); + IPath cornerBottomRight = cornerToptLeft.RotateDegree(180).Translate(rightPos, bottomPos); return new PathCollection(cornerToptLeft, cornerBottomLeft, cornerTopRight, cornerBottomRight); } diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index aa44dfc215..e60cff2e08 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -92,7 +92,7 @@ public static Image Clone(this Image source, params IIma /// The pixel format. /// The image to rotate, flip, or both. /// The operations to perform on the source. - /// returns the current optinoatins class to allow chaining of oprations. + /// returns the current operations class to allow chaining of operations. public static IImageProcessingContext ApplyProcessors(this IImageProcessingContext source, params IImageProcessor[] operations) where TPixel : struct, IPixel { @@ -104,4 +104,4 @@ public static IImageProcessingContext ApplyProcessors(this IImag return source; } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/DefaultInternalImageProcessorContext.cs b/src/ImageSharp/DefaultInternalImageProcessorContext.cs index 0562f90ce4..6165fbf004 100644 --- a/src/ImageSharp/DefaultInternalImageProcessorContext.cs +++ b/src/ImageSharp/DefaultInternalImageProcessorContext.cs @@ -5,14 +5,12 @@ namespace ImageSharp { - using System; - using System.Collections.Generic; using ImageSharp.PixelFormats; using ImageSharp.Processing; using SixLabors.Primitives; /// - /// The static collection of all the default image formats + /// Performs processor application operations on the source image /// /// The pixel format internal class DefaultInternalImageProcessorContext : IInternalImageProcessingContext @@ -42,7 +40,7 @@ public Image Apply() { if (!this.mutate && this.destination == null) { - // ensure we have cloned it if we are not mutating as we might have failed to register any Processors + // Ensure we have cloned it if we are not mutating as we might have failed to register any Processors this.destination = this.source.Clone(); } @@ -54,19 +52,17 @@ public IImageProcessingContext ApplyProcessor(IImageProcessor pr { if (!this.mutate && this.destination == null) { - // this will only work if the first processor applied is the cloning one thus + // This will only work if the first processor applied is the cloning one thus // realistically for this optermissation to work the resize must the first processor // applied any only up processors will take the douple data path. - if (processor is ICloningImageProcessor) + var cloningImageProcessor = processor as ICloningImageProcessor; + if (cloningImageProcessor != null) { - var cloningProcessor = (ICloningImageProcessor)processor; - this.destination = cloningProcessor.CloneAndApply(this.source, rectangle); + this.destination = cloningImageProcessor.CloneAndApply(this.source, rectangle); return this; } - else - { - this.destination = this.source.Clone(); - } + + this.destination = this.source.Clone(); } processor.Apply(this.destination, rectangle); diff --git a/src/ImageSharp/IImageProcessingContextFactory.cs b/src/ImageSharp/IImageProcessingContextFactory.cs index a9cd23905a..394f198bf9 100644 --- a/src/ImageSharp/IImageProcessingContextFactory.cs +++ b/src/ImageSharp/IImageProcessingContextFactory.cs @@ -5,16 +5,15 @@ namespace ImageSharp { - using System; using ImageSharp.PixelFormats; /// - /// Represents an interface that will create IImageOperations + /// Represents an interface that will create IInternalImageProcessingContext instances /// internal interface IImageProcessingContextFactory { /// - /// Called during Mutate operations to generate the imageoperations provider. + /// Called during Mutate operations to generate the image operations provider. /// /// The pixel format /// The source image. diff --git a/src/ImageSharp/IImageProcessingContext{TPixel}.cs b/src/ImageSharp/IImageProcessingContext{TPixel}.cs index e79b20ba6b..a3f24186b6 100644 --- a/src/ImageSharp/IImageProcessingContext{TPixel}.cs +++ b/src/ImageSharp/IImageProcessingContext{TPixel}.cs @@ -5,8 +5,6 @@ namespace ImageSharp { - using System; - using ImageSharp.Formats; using ImageSharp.PixelFormats; using ImageSharp.Processing; using SixLabors.Primitives; @@ -19,18 +17,18 @@ public interface IImageProcessingContext where TPixel : struct, IPixel { /// - /// Adds the processor to the current setr of image operations to be applied. + /// Adds the processor to the current set of image operations to be applied. /// /// The processor to apply /// The area to apply it to - /// returns the current optinoatins class to allow chaining of oprations. + /// The current operations class to allow chaining of operations. IImageProcessingContext ApplyProcessor(IImageProcessor processor, Rectangle rectangle); /// - /// Adds the processor to the current setr of image operations to be applied. + /// Adds the processor to the current set of image operations to be applied. /// /// The processor to apply - /// returns the current optinoatins class to allow chaining of oprations. + /// The current operations class to allow chaining of operations. IImageProcessingContext ApplyProcessor(IImageProcessor processor); } @@ -44,7 +42,7 @@ internal interface IInternalImageProcessingContext : IImageProcessingCon /// /// Adds the processors to the current image /// - /// returns the current image or a new image depending on withere this is alloed to mutate the source image. + /// The current image or a new image depending on withere this is alloed to mutate the source image. Image Apply(); } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs index 733c4d090e..76f968dec6 100644 --- a/src/ImageSharp/Processing/Delegate.cs +++ b/src/ImageSharp/Processing/Delegate.cs @@ -17,13 +17,13 @@ namespace ImageSharp public static partial class ImageExtensions { /// - /// Queues up a simple operation that provides access to the mutatable image. + /// Queues up an operation that provides access to the mutatable image. /// /// The pixel format. /// The image to rotate, flip, or both. /// The operations to perform on the source. - /// returns the current optinoatins class to allow chaining of oprations. - public static IImageProcessingContext Run(this IImageProcessingContext source, Action> operation) + /// returns the current operations class to allow chaining of operations. + public static IImageProcessingContext Apply(this IImageProcessingContext source, Action> operation) where TPixel : struct, IPixel => source.ApplyProcessor(new DelegateProcessor(operation)); } diff --git a/src/ImageSharp/Processing/Processors/DelegateProcessor.cs b/src/ImageSharp/Processing/Processors/DelegateProcessor.cs index 756c3d8e4e..d594bf23ee 100644 --- a/src/ImageSharp/Processing/Processors/DelegateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/DelegateProcessor.cs @@ -6,7 +6,6 @@ namespace ImageSharp.Processing { using System; - using System.Threading.Tasks; using ImageSharp.PixelFormats; using SixLabors.Primitives; @@ -37,13 +36,13 @@ public DelegateProcessor(Action> action) /// protected override void BeforeImageApply(Image source, Rectangle sourceRectangle) { - this.action?.Invoke((Image)source); + this.action?.Invoke(source); } /// protected override void OnApply(ImageBase source, Rectangle sourceRectangle) { - // no op, we did all we wanted to do inside BeforeImageApply + // NOP, we did all we wanted to do inside BeforeImageApply } } } \ No newline at end of file diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs index 65fbb65fb0..2853867460 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs @@ -48,14 +48,13 @@ public ResizeProcessor(IResampler sampler, int width, int height, Rectangle resi /// protected override Image CreateDestination(Image source, Rectangle sourceRectangle) { - // we will always be creating the clone even for mutate because thatsa the way this base processor works + // We will always be creating the clone even for mutate because thats the way this base processor works // ------------ - // for resize we know we are going to populate every pixel with fresh data and we want a different target size so - // lets manually clone an empty set of images at the correct target and then have the base class processs them in. - // turn. + // For resize we know we are going to populate every pixel with fresh data and we want a different target size so + // let's manually clone an empty set of images at the correct target and then have the base class processs them in turn. var image = new Image(source.Configuration, this.Width, this.Height, source.MetaData.Clone()); - // now 'clone' the ImageFrames + // Now 'clone' the ImageFrames foreach (ImageFrame sourceFrame in source.Frames) { var targetFrame = new ImageFrame(sourceFrame.Configuration, this.Width, this.Height, sourceFrame.MetaData.Clone()); @@ -120,7 +119,6 @@ protected override unsafe void OnApply(ImageBase source, ImageBase(width, source.Height)) { diff --git a/src/ImageSharp/Processing/Transforms/Resize.cs b/src/ImageSharp/Processing/Transforms/Resize.cs index c73581a93a..38662317bf 100644 --- a/src/ImageSharp/Processing/Transforms/Resize.cs +++ b/src/ImageSharp/Processing/Transforms/Resize.cs @@ -27,10 +27,9 @@ public static partial class ImageExtensions public static IImageProcessingContext Resize(this IImageProcessingContext source, ResizeOptions options) where TPixel : struct, IPixel { - return source.Run(img => + return source.Apply(img => { - // cheat and bound through a run, inside here we should just be mutating, this reallt needs moving over to a processor - + // Cheat and bound through a run, inside here we should just be mutating, this really needs moving over to a processor // Ensure size is populated across both dimensions. if (options.Size.Width == 0 && options.Size.Height > 0) { @@ -162,26 +161,26 @@ public static IImageProcessingContext Resize(this IImageProcessi public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, Rectangle sourceRectangle, Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel { - return source.Run(img => - { - // todo : stop cheeting here and move this stuff into the processors itself - if (width == 0 && height > 0) - { - width = (int)MathF.Round(img.Width * height / (float)img.Height); - targetRectangle.Width = width; - } - - if (height == 0 && width > 0) - { - height = (int)MathF.Round(img.Height * width / (float)img.Width); - targetRectangle.Height = height; - } - - Guard.MustBeGreaterThan(width, 0, nameof(width)); - Guard.MustBeGreaterThan(height, 0, nameof(height)); - - img.Mutate(x => x.ApplyProcessor(new ResizeProcessor(sampler, width, height, targetRectangle) { Compand = compand }, sourceRectangle)); - }); + return source.Apply(img => + { + // TODO : Stop cheating here and move this stuff into the processors itself + if (width == 0 && height > 0) + { + width = (int)MathF.Round(img.Width * height / (float)img.Height); + targetRectangle.Width = width; + } + + if (height == 0 && width > 0) + { + height = (int)MathF.Round(img.Height * width / (float)img.Width); + targetRectangle.Height = height; + } + + Guard.MustBeGreaterThan(width, 0, nameof(width)); + Guard.MustBeGreaterThan(height, 0, nameof(height)); + + img.Mutate(x => x.ApplyProcessor(new ResizeProcessor(sampler, width, height, targetRectangle) { Compand = compand }, sourceRectangle)); + }); } /// @@ -202,9 +201,9 @@ public static IImageProcessingContext Resize(this IImageProcessi public static IImageProcessingContext Resize(this IImageProcessingContext source, int width, int height, IResampler sampler, Rectangle targetRectangle, bool compand) where TPixel : struct, IPixel { - return source.Run(img => + return source.Apply(img => { - // todo : stop cheeting here and move this stuff into the processors itself + // TODO : stop cheating here and move this stuff into the processors itself if (width == 0 && height > 0) { width = (int)MathF.Round(img.Width * height / (float)img.Height); @@ -224,4 +223,4 @@ public static IImageProcessingContext Resize(this IImageProcessi }); } } -} +} \ No newline at end of file diff --git a/src/ImageSharp/Quantizers/Quantize.cs b/src/ImageSharp/Quantizers/Quantize.cs index 0edc1557a5..612816eef2 100644 --- a/src/ImageSharp/Quantizers/Quantize.cs +++ b/src/ImageSharp/Quantizers/Quantize.cs @@ -57,13 +57,13 @@ public static IImageProcessingContext Quantize(this IImageProces public static IImageProcessingContext Quantize(this IImageProcessingContext source, IQuantizer quantizer, int maxColors) where TPixel : struct, IPixel { - return source.Run(img => + return source.Apply(img => { // TODO : move helper logic into the processor QuantizedImage quantized = quantizer.Quantize(img, maxColors); int palleteCount = quantized.Palette.Length - 1; - using (PixelAccessor pixels = new PixelAccessor(quantized.Width, quantized.Height)) + using (var pixels = new PixelAccessor(quantized.Width, quantized.Height)) { Parallel.For( 0, diff --git a/tests/ImageSharp.Tests/Processing/DelegateTest.cs b/tests/ImageSharp.Tests/Processing/DelegateTest.cs index 73011bee1f..d5846b1589 100644 --- a/tests/ImageSharp.Tests/Processing/DelegateTest.cs +++ b/tests/ImageSharp.Tests/Processing/DelegateTest.cs @@ -16,7 +16,7 @@ public class DelegateTest : BaseImageOperationsExtensionTest public void Run_CreatedDelegateProcessor() { Action> action = (i) => { }; - this.operations.Run(action); + this.operations.Apply(action); DelegateProcessor processor = this.Verify>(); Assert.Equal(action, processor.Action); From 9c5798bb4b60626b7f9766820bb616059e366b4a Mon Sep 17 00:00:00 2001 From: JimBobSquarePants Date: Mon, 14 Aug 2017 11:13:11 +1000 Subject: [PATCH 21/33] Intellisense docs cleanup --- src/ImageSharp/ApplyProcessors.cs | 32 +++++++++---------- src/ImageSharp/Configuration.cs | 12 +++---- .../DefaultInternalImageProcessorContext.cs | 2 +- .../IImageProcessingContextFactory.cs | 8 ++--- .../IImageProcessingContext{TPixel}.cs | 2 +- src/ImageSharp/Processing/Delegate.cs | 8 ++--- .../Processors/CloningImageProcessor.cs | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index e60cff2e08..a04c02a428 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -17,11 +17,11 @@ namespace ImageSharp public static partial class ImageExtensions { /// - /// Mutates the image by applying the image operation to it. + /// Mutates the source image by applying the image operation to it. /// /// The pixel format. - /// The image to rotate, flip, or both. - /// The operations to perform on the source. + /// The image to mutate. + /// The operation to perform on the source. public static void Mutate(this Image source, Action> operation) where TPixel : struct, IPixel { @@ -34,10 +34,10 @@ public static void Mutate(this Image source, Action - /// Mutates the image by applying the operations to it. + /// Mutates the source image by applying the operations to it. /// /// The pixel format. - /// The image to rotate, flip, or both. + /// The image to mutate. /// The operations to perform on the source. public static void Mutate(this Image source, params IImageProcessor[] operations) where TPixel : struct, IPixel @@ -51,12 +51,12 @@ public static void Mutate(this Image source, params IImageProces } /// - /// Clones the current image mutating the clone by applying the operation to it. + /// Creates a deep clone of the current image. The clone is then mutated by the given operation. /// /// The pixel format. - /// The image to rotate, flip, or both. - /// The operations to perform on the source. - /// Anew Image which has teh data from the but with the applied. + /// The image to clone. + /// The operation to perform on the clone. + /// The new public static Image Clone(this Image source, Action> operation) where TPixel : struct, IPixel { @@ -69,12 +69,12 @@ public static Image Clone(this Image source, Action - /// Clones the current image mutating the clone by applying the operations to it. + /// Creates a deep clone of the current image. The clone is then mutated by the given operations. /// /// The pixel format. - /// The image to rotate, flip, or both. - /// The operations to perform on the source. - /// Anew Image which has teh data from the but with the applied. + /// The image to clone. + /// The operations to perform on the clone. + /// The new public static Image Clone(this Image source, params IImageProcessor[] operations) where TPixel : struct, IPixel { @@ -87,12 +87,12 @@ public static Image Clone(this Image source, params IIma } /// - /// Applies all the ImageProcessors agains the operation + /// Applies the given collection against the context /// /// The pixel format. - /// The image to rotate, flip, or both. + /// The image processing context. /// The operations to perform on the source. - /// returns the current operations class to allow chaining of operations. + /// The to allow chaining of operations. public static IImageProcessingContext ApplyProcessors(this IImageProcessingContext source, params IImageProcessor[] operations) where TPixel : struct, IPixel { diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index 71f6bf4128..a34544ab09 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -109,9 +109,9 @@ public Configuration(params IConfigurationModule[] configurationModules) #endif /// - /// Gets or sets the image operations providers. + /// Gets or sets the image operations provider factory. /// - internal IImageProcessingContextFactory ImageOperationsProvider { get; set; } = new DefaultImageOperationsProvider(); + internal IImageProcessingContextFactory ImageOperationsProvider { get; set; } = new DefaultImageOperationsProviderFactory(); /// /// Registers a new format provider. @@ -126,7 +126,7 @@ public void Configure(IConfigurationModule configuration) /// /// Registers a new format provider. /// - /// The format to register as a well know format. + /// The format to register as a known format. public void AddImageFormat(IImageFormat format) { Guard.NotNull(format, nameof(format)); @@ -136,10 +136,10 @@ public void AddImageFormat(IImageFormat format) } /// - /// For the specified file extensions type find the e . + /// For the specified file extensions type find the . /// /// The extension to discover - /// The if found otherwise null + /// The if found; otherwise null public IImageFormat FindFormatByFileExtensions(string extension) { return this.imageFormats.FirstOrDefault(x => x.FileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase)); @@ -149,7 +149,7 @@ public IImageFormat FindFormatByFileExtensions(string extension) /// For the specified mime type find the . /// /// The mime-type to discover - /// The if found otherwise null + /// The if found; otherwise null public IImageFormat FindFormatByMimeType(string mimeType) { return this.imageFormats.FirstOrDefault(x => x.MimeTypes.Contains(mimeType, StringComparer.OrdinalIgnoreCase)); diff --git a/src/ImageSharp/DefaultInternalImageProcessorContext.cs b/src/ImageSharp/DefaultInternalImageProcessorContext.cs index 6165fbf004..4b919db14e 100644 --- a/src/ImageSharp/DefaultInternalImageProcessorContext.cs +++ b/src/ImageSharp/DefaultInternalImageProcessorContext.cs @@ -40,7 +40,7 @@ public Image Apply() { if (!this.mutate && this.destination == null) { - // Ensure we have cloned it if we are not mutating as we might have failed to register any Processors + // Ensure we have cloned it if we are not mutating as we might have failed to register any processors this.destination = this.source.Clone(); } diff --git a/src/ImageSharp/IImageProcessingContextFactory.cs b/src/ImageSharp/IImageProcessingContextFactory.cs index 394f198bf9..08c536a602 100644 --- a/src/ImageSharp/IImageProcessingContextFactory.cs +++ b/src/ImageSharp/IImageProcessingContextFactory.cs @@ -13,20 +13,20 @@ namespace ImageSharp internal interface IImageProcessingContextFactory { /// - /// Called during Mutate operations to generate the image operations provider. + /// Called during mutate operations to generate the image operations provider. /// /// The pixel format /// The source image. - /// A flag to determin with the image operations is allowed to mutate the source image or not. + /// A flag to determine whether image operations are allowed to mutate the source image. /// A new IImageOPeration IInternalImageProcessingContext CreateImageProcessingContext(Image source, bool mutate) where TPixel : struct, IPixel; } /// - /// The default implmentation of IImageOperationsProvider + /// The default implmentation of /// - internal class DefaultImageOperationsProvider : IImageProcessingContextFactory + internal class DefaultImageOperationsProviderFactory : IImageProcessingContextFactory { /// public IInternalImageProcessingContext CreateImageProcessingContext(Image source, bool mutate) diff --git a/src/ImageSharp/IImageProcessingContext{TPixel}.cs b/src/ImageSharp/IImageProcessingContext{TPixel}.cs index a3f24186b6..6aa2b799fa 100644 --- a/src/ImageSharp/IImageProcessingContext{TPixel}.cs +++ b/src/ImageSharp/IImageProcessingContext{TPixel}.cs @@ -10,7 +10,7 @@ namespace ImageSharp using SixLabors.Primitives; /// - /// An interface to queue up image operations. + /// An interface to queue up image operations to apply to an image. /// /// The pixel format public interface IImageProcessingContext diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs index 76f968dec6..5edb900df4 100644 --- a/src/ImageSharp/Processing/Delegate.cs +++ b/src/ImageSharp/Processing/Delegate.cs @@ -17,12 +17,12 @@ namespace ImageSharp public static partial class ImageExtensions { /// - /// Queues up an operation that provides access to the mutatable image. + /// Applies the given operation to the mutable image. /// /// The pixel format. - /// The image to rotate, flip, or both. - /// The operations to perform on the source. - /// returns the current operations class to allow chaining of operations. + /// The image to mutate. + /// The operation to perform on the source. + /// The to allow chaining of operations. public static IImageProcessingContext Apply(this IImageProcessingContext source, Action> operation) where TPixel : struct, IPixel => source.ApplyProcessor(new DelegateProcessor(operation)); diff --git a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs index cf84462c5d..5db2d0865d 100644 --- a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs @@ -94,7 +94,7 @@ public void Apply(Image source, Rectangle sourceRectangle) } /// - /// Generates the clone of the source image that operatinos should be applied to. + /// Generates a deep clone of the source image that operatinos should be applied to. /// /// The source image. Cannot be null. /// The source rectangle. From f8a0ed3fd963dfc3af89f614c2bcf3cab6156da6 Mon Sep 17 00:00:00 2001 From: JimBobSquarePants Date: Mon, 14 Aug 2017 12:06:40 +1000 Subject: [PATCH 22/33] Update rotate test to use new API --- tests/ImageSharp.Tests/Image/ImageRotationTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/ImageSharp.Tests/Image/ImageRotationTests.cs b/tests/ImageSharp.Tests/Image/ImageRotationTests.cs index 56cec42192..d9106399e0 100644 --- a/tests/ImageSharp.Tests/Image/ImageRotationTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageRotationTests.cs @@ -42,12 +42,12 @@ public void RotateImageBy360Degrees() private static (Size original, Size rotated) Rotate(int angle) { - TestFile file = TestFile.Create(TestImages.Bmp.Car); - using (Image image = Image.Load(file.FilePath)) + var file = TestFile.Create(TestImages.Bmp.Car); + using (var image = Image.Load(file.FilePath)) { - Size original = image.Bounds.Size; - image.Rotate(angle); - return (original, image.Bounds.Size); + Size original = image.Bounds().Size; + image.Mutate(x => x.Rotate(angle)); + return (original, image.Bounds().Size); } } } From de964e53b44d42b90d5558aa9612b310e88debf9 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Tue, 15 Aug 2017 13:37:29 +0200 Subject: [PATCH 23/33] added comments, docs + a CloneAndConvertToAvatarWithoutApply() example --- samples/AvatarWithRoundedCorner/Program.cs | 39 ++++++++++++++++++---- src/ImageSharp/Processing/Delegate.cs | 2 ++ 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index 4fa2912c1b..39bbfbd660 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -16,9 +16,9 @@ static void Main(string[] args) using (var img = Image.Load("fb.jpg")) { // as generate returns a new IImage make sure we dispose of it - using (Image dest = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 20))) + using (Image destRound = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 20))) { - dest.Save("output/fb.png"); + destRound.Save("output/fb.png"); } using (Image destRound = img.Clone(x => x.ConvertToAvatar(new Size(200, 200), 100))) @@ -30,22 +30,47 @@ static void Main(string[] args) { destRound.Save("output/fb-rounder.png"); } - + + using (Image destRound = img.CloneAndConvertToAvatarWithoutApply(new Size(200, 200), 150)) + { + destRound.Save("output/fb-rounder-without-apply.png"); + } + // the original `img` object has not been altered at all. } } - // lets create our custom image mutating pipeline - private static IImageProcessingContext ConvertToAvatar(this IImageProcessingContext operations, Size size, float cornerRadius) + // 1. The short way: + // Implements a full image mutating pipeline operating on IImageProcessingContext + // We need the dimensions of the resized image to deduce 'IPathCollection' needed to build the corners, + // so we implement an "inline" image processor by utilizing 'ImageExtensions.Apply()' + private static IImageProcessingContext ConvertToAvatar(this IImageProcessingContext processingContext, Size size, float cornerRadius) { - return operations.Resize(new ImageSharp.Processing.ResizeOptions + return processingContext.Resize(new ImageSharp.Processing.ResizeOptions { Size = size, Mode = ImageSharp.Processing.ResizeMode.Crop }).Apply(i => ApplyRoundedCorners(i, cornerRadius)); } - // the combination of `IImageOperations.Run()` + this could be replaced with an `IImageProcessor` + // 2. A more verbose way, avoiding 'Apply()': + // First we create a resized clone of the image, then we draw the corners on that that instance it with Mutate(). + private static Image CloneAndConvertToAvatarWithoutApply(this Image image, Size size, float cornerRadius) + { + Image result = image.Clone( + ctx => ctx.Resize( + new ImageSharp.Processing.ResizeOptions + { + Size = size, + Mode = ImageSharp.Processing.ResizeMode.Crop + })); + + ApplyRoundedCorners(result, cornerRadius); + return result; + } + + // This method can be seen as an inline implementation of an `IImageProcessor`: + // (The combination of `IImageOperations.Apply()` + this could be replaced with an `IImageProcessor`) public static void ApplyRoundedCorners(Image img, float cornerRadius) { IPathCollection corners = BuildCorners(img.Width, img.Height, cornerRadius); diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs index 5edb900df4..4b2677c853 100644 --- a/src/ImageSharp/Processing/Delegate.cs +++ b/src/ImageSharp/Processing/Delegate.cs @@ -18,6 +18,8 @@ public static partial class ImageExtensions { /// /// Applies the given operation to the mutable image. + /// Useful when we need to extract information like Width/Height to parameterize the next operation working on the chain. + /// To achieve this the method actually implements an "inline" with as it's processing logic. /// /// The pixel format. /// The image to mutate. From 9245631f174ab9bc86b9a8cb3ca0d3226748b833 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Tue, 15 Aug 2017 14:26:43 +0200 Subject: [PATCH 24/33] fix typo --- samples/AvatarWithRoundedCorner/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index 39bbfbd660..e894d96a62 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -54,7 +54,7 @@ private static IImageProcessingContext ConvertToAvatar(this IImageProces } // 2. A more verbose way, avoiding 'Apply()': - // First we create a resized clone of the image, then we draw the corners on that that instance it with Mutate(). + // First we create a resized clone of the image, then we draw the corners on that instance with Mutate(). private static Image CloneAndConvertToAvatarWithoutApply(this Image image, Size size, float cornerRadius) { Image result = image.Clone( From 94c60cb3387fa3e7992c03076b189bc498632501 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Wed, 16 Aug 2017 21:17:19 +0100 Subject: [PATCH 25/33] inital rename packages and namespaces --- .vscode/launch.json | 28 ++ ImageSharp.ruleset | 6 +- ImageSharp.sln | 38 +- build.cmd | 34 +- build/Program.cs | 463 ------------------ build/Properties/launchSettings.json | 8 - build/build.cmd | 18 - build/build.csproj | 16 - build/reset-versions.cmd | 8 - global.json | 5 + samples/AvatarWithRoundedCorner/Program.cs | 27 +- .../ChangeDefaultEncoderOptions/Program.cs | 11 +- src/ImageSharp.Drawing/Brushes/Brushes.cs | 10 +- src/ImageSharp.Drawing/Brushes/IBrush.cs | 14 +- .../Brushes/ImageBrush{TPixel}.cs | 19 +- .../Brushes/PatternBrush{TPixel}.cs | 21 +- .../Brushes/Processors/BrushApplicator.cs | 15 +- .../Brushes/RecolorBrush{TPixel}.cs | 21 +- .../Brushes/SolidBrush{TPixel}.cs | 21 +- src/ImageSharp.Drawing/DrawImage.cs | 14 +- src/ImageSharp.Drawing/FillRegion.cs | 16 +- .../ImageSharp.Drawing.csproj | 19 +- src/ImageSharp.Drawing/Paths/DrawBeziers.cs | 22 +- src/ImageSharp.Drawing/Paths/DrawLines.cs | 22 +- src/ImageSharp.Drawing/Paths/DrawPath.cs | 18 +- .../Paths/DrawPathCollection.cs | 18 +- src/ImageSharp.Drawing/Paths/DrawPolygon.cs | 22 +- src/ImageSharp.Drawing/Paths/DrawRectangle.cs | 18 +- .../Paths/FillPathBuilder.cs | 18 +- .../Paths/FillPathCollection.cs | 16 +- src/ImageSharp.Drawing/Paths/FillPaths.cs | 16 +- src/ImageSharp.Drawing/Paths/FillPolygon.cs | 22 +- src/ImageSharp.Drawing/Paths/FillRectangle.cs | 16 +- src/ImageSharp.Drawing/Paths/ShapePath.cs | 17 +- src/ImageSharp.Drawing/Paths/ShapeRegion.cs | 20 +- src/ImageSharp.Drawing/Pens/IPen.cs | 12 +- src/ImageSharp.Drawing/Pens/Pens.cs | 10 +- src/ImageSharp.Drawing/Pens/Pen{TPixel}.cs | 19 +- src/ImageSharp.Drawing/PointInfo.cs | 6 +- .../Processors/DrawImageProcessor.cs | 23 +- .../Processors/FillProcessor.cs | 26 +- .../Processors/FillRegionProcessor.cs | 25 +- .../Properties/AssemblyInfo.cs | 4 +- src/ImageSharp.Drawing/Region.cs | 12 +- src/ImageSharp.Drawing/Text/DrawText.Path.cs | 23 +- src/ImageSharp.Drawing/Text/DrawText.cs | 25 +- .../Text/TextGraphicsOptions.cs | 12 +- src/ImageSharp/ApplyProcessors.cs | 16 +- src/ImageSharp/ColorSpaces/CieLab.cs | 16 +- src/ImageSharp/ColorSpaces/CieLch.cs | 16 +- src/ImageSharp/ColorSpaces/CieLchuv.cs | 16 +- src/ImageSharp/ColorSpaces/CieLuv.cs | 16 +- .../CieXyChromaticityCoordinates.cs | 16 +- src/ImageSharp/ColorSpaces/CieXyy.cs | 16 +- src/ImageSharp/ColorSpaces/CieXyz.cs | 16 +- src/ImageSharp/ColorSpaces/Cmyk.cs | 16 +- .../ColorSpaces/Conversion/CieConstants.cs | 6 +- .../Conversion/ColorSpaceConverter.Adapt.cs | 15 +- .../Conversion/ColorSpaceConverter.CieLab.cs | 14 +- .../Conversion/ColorSpaceConverter.CieLch.cs | 10 +- .../ColorSpaceConverter.CieLchuv.cs | 10 +- .../Conversion/ColorSpaceConverter.CieLuv.cs | 14 +- .../Conversion/ColorSpaceConverter.CieXyy.cs | 10 +- .../Conversion/ColorSpaceConverter.CieXyz.cs | 18 +- .../Conversion/ColorSpaceConverter.Cmyk.cs | 12 +- .../Conversion/ColorSpaceConverter.Hsl.cs | 12 +- .../Conversion/ColorSpaceConverter.Hsv.cs | 12 +- .../ColorSpaceConverter.HunterLab.cs | 10 +- .../ColorSpaceConverter.LinearRgb.cs | 10 +- .../Conversion/ColorSpaceConverter.Lms.cs | 10 +- .../Conversion/ColorSpaceConverter.Rgb.cs | 10 +- .../Conversion/ColorSpaceConverter.YCbCr.cs | 12 +- .../Conversion/ColorSpaceConverter.cs | 15 +- .../Conversion/IChromaticAdaptation.cs | 10 +- .../Conversion/IColorConversion.cs | 6 +- .../CieLab/CieLabToCieXyzConverter.cs | 13 +- .../CieLab/CieXyzToCieLabConverter.cs | 13 +- .../CieLch/CIeLchToCieLabConverter.cs | 13 +- .../CieLch/CieLabToCieLchConverter.cs | 13 +- .../CieLchuv/CieLchuvToCieLuvConverter.cs | 13 +- .../CieLchuv/CieLuvToCieLchuvConverter.cs | 13 +- .../CieLuv/CieLuvToCieXyzConverter.cs | 12 +- .../CieLuv/CieXyzToCieLuvConverter.cs | 13 +- .../CieXyy/CieXyzAndCieXyyConverter.cs | 13 +- .../Cmyk/CmykAndRgbConverter.cs | 15 +- .../Implementation/Hsl/HslAndRgbConverter.cs | 13 +- .../Implementation/Hsv/HsvAndRgbConverter.cs | 15 +- .../CieXyzAndHunterLabConverterBase.cs | 10 +- .../HunterLab/CieXyzToHunterLabConverter.cs | 13 +- .../HunterLab/HunterLabToCieXyzConverter.cs | 13 +- .../Lms/CieXyzAndLmsConverter.cs | 15 +- .../Implementation/Lms/LmsAdaptationMatrix.cs | 10 +- .../Rgb/CieXyzToLinearRgbConverter.cs | 12 +- .../Implementation/Rgb/GammaCompanding.cs | 12 +- .../Implementation/Rgb/LCompanding.cs | 10 +- .../Rgb/LinearRgbAndCieXyzConverterBase.cs | 10 +- .../Rgb/LinearRgbToCieXyzConverter.cs | 12 +- .../Rgb/LinearRgbToRgbConverter.cs | 12 +- .../RGBPrimariesChromaticityCoordinates.cs | 10 +- .../Implementation/Rgb/Rec2020Companding.cs | 10 +- .../Implementation/Rgb/Rec709Companding.cs | 10 +- .../Rgb/RgbToLinearRgbConverter.cs | 12 +- .../Implementation/Rgb/RgbWorkingSpace.cs | 6 +- .../Implementation/Rgb/SRgbCompanding.cs | 10 +- .../YCbCr/YCbCrAndRgbConverter.cs | 17 +- .../Conversion/VonKriesChromaticAdaptation.cs | 15 +- src/ImageSharp/ColorSpaces/Hsl.cs | 16 +- src/ImageSharp/ColorSpaces/Hsv.cs | 16 +- src/ImageSharp/ColorSpaces/HunterLab.cs | 16 +- .../ColorSpaces/IAlmostEquatable.cs | 10 +- src/ImageSharp/ColorSpaces/IColorVector.cs | 10 +- src/ImageSharp/ColorSpaces/ICompanding.cs | 6 +- .../ColorSpaces/IRgbWorkingSpace.cs | 13 +- src/ImageSharp/ColorSpaces/Illuminants.cs | 5 +- src/ImageSharp/ColorSpaces/LinearRgb.cs | 16 +- src/ImageSharp/ColorSpaces/Lms.cs | 16 +- src/ImageSharp/ColorSpaces/Rgb.cs | 16 +- .../ColorSpaces/RgbWorkingSpaces.cs | 10 +- src/ImageSharp/ColorSpaces/YCbCr.cs | 16 +- src/ImageSharp/Common/Constants.cs | 6 +- .../Common/Exceptions/ImageFormatException.cs | 10 +- .../Exceptions/ImageProcessingException.cs | 10 +- .../Common/Extensions/ByteExtensions.cs | 15 +- .../Common/Extensions/ComparableExtensions.cs | 12 +- .../Common/Extensions/EnumerableExtensions.cs | 12 +- .../Common/Extensions/StreamExtensions.cs | 12 +- .../Common/Extensions/Vector4Extensions.cs | 14 +- src/ImageSharp/Common/Helpers/DebugGuard.cs | 12 +- src/ImageSharp/Common/Helpers/Guard.cs | 16 +- src/ImageSharp/Common/Helpers/ImageMaths.cs | 21 +- src/ImageSharp/Common/Helpers/MathF.cs | 12 +- src/ImageSharp/Configuration.cs | 23 +- .../DefaultInternalImageProcessorContext.cs | 14 +- .../Dithering/ErrorDiffusion/Atkinson.cs | 10 +- .../Dithering/ErrorDiffusion/Burks.cs | 10 +- .../Dithering/ErrorDiffusion/ErrorDiffuser.cs | 19 +- .../ErrorDiffusion/FloydSteinberg.cs | 10 +- .../ErrorDiffusion/IErrorDiffuser.cs | 10 +- .../ErrorDiffusion/JarvisJudiceNinke.cs | 10 +- .../Dithering/ErrorDiffusion/Sierra2.cs | 10 +- .../Dithering/ErrorDiffusion/Sierra3.cs | 10 +- .../Dithering/ErrorDiffusion/SierraLite.cs | 10 +- .../Dithering/ErrorDiffusion/Stucki.cs | 10 +- src/ImageSharp/Dithering/Ordered/Bayer.cs | 10 +- .../Dithering/Ordered/IOrderedDither.cs | 10 +- src/ImageSharp/Dithering/Ordered/Ordered.cs | 10 +- .../Dithering/Ordered/OrderedDither4x4.cs | 12 +- src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs | 6 +- src/ImageSharp/Formats/Bmp/BmpCompression.cs | 6 +- .../Formats/Bmp/BmpConfigurationModule.cs | 6 +- src/ImageSharp/Formats/Bmp/BmpConstants.cs | 10 +- src/ImageSharp/Formats/Bmp/BmpDecoder.cs | 17 +- src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs | 18 +- src/ImageSharp/Formats/Bmp/BmpEncoder.cs | 17 +- src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs | 18 +- src/ImageSharp/Formats/Bmp/BmpFileHeader.cs | 6 +- src/ImageSharp/Formats/Bmp/BmpFormat.cs | 10 +- .../Formats/Bmp/BmpImageFormatDetector.cs | 10 +- src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs | 6 +- .../Formats/Bmp/IBmpDecoderOptions.cs | 17 +- .../Formats/Bmp/IBmpEncoderOptions.cs | 17 +- src/ImageSharp/Formats/Bmp/ImageExtensions.cs | 18 +- src/ImageSharp/Formats/Gif/DisposalMethod.cs | 6 +- .../Formats/Gif/GifConfigurationModule.cs | 6 +- src/ImageSharp/Formats/Gif/GifConstants.cs | 12 +- src/ImageSharp/Formats/Gif/GifDecoder.cs | 18 +- src/ImageSharp/Formats/Gif/GifDecoderCore.cs | 23 +- src/ImageSharp/Formats/Gif/GifEncoder.cs | 20 +- src/ImageSharp/Formats/Gif/GifEncoderCore.cs | 25 +- src/ImageSharp/Formats/Gif/GifFormat.cs | 10 +- .../Formats/Gif/GifImageFormatDetector.cs | 10 +- .../Formats/Gif/IGifDecoderOptions.cs | 18 +- .../Formats/Gif/IGifEncoderOptions.cs | 20 +- src/ImageSharp/Formats/Gif/ImageExtensions.cs | 18 +- src/ImageSharp/Formats/Gif/LzwDecoder.cs | 14 +- src/ImageSharp/Formats/Gif/LzwEncoder.cs | 14 +- src/ImageSharp/Formats/Gif/PackedField.cs | 10 +- .../Sections/GifGraphicsControlExtension.cs | 6 +- .../Gif/Sections/GifImageDescriptor.cs | 6 +- .../Sections/GifLogicalScreenDescriptor.cs | 6 +- src/ImageSharp/Formats/IImageDecoder.cs | 17 +- src/ImageSharp/Formats/IImageEncoder.cs | 17 +- src/ImageSharp/Formats/IImageFormat.cs | 10 +- .../Formats/IImageFormatDetector.cs | 14 +- .../Jpeg/Components/Block8x8F.Generated.cs | 2 +- .../Jpeg/Components/Block8x8F.Generated.tt | 2 +- .../Formats/Jpeg/Components/Block8x8F.cs | 19 +- .../Formats/Jpeg/Components/BlockQuad.cs | 6 +- src/ImageSharp/Formats/Jpeg/Components/DCT.cs | 12 +- .../Formats/Jpeg/Components/Decoder/Bits.cs | 10 +- .../Formats/Jpeg/Components/Decoder/Bytes.cs | 16 +- .../Jpeg/Components/Decoder/Component.cs | 6 +- .../Jpeg/Components/Decoder/ComponentScan.cs | 10 +- .../Jpeg/Components/Decoder/DecodedBlock.cs | 10 +- .../Components/Decoder/DecoderErrorCode.cs | 6 +- .../Components/Decoder/DecoderThrowHelper.cs | 12 +- .../Jpeg/Components/Decoder/EOFException.cs | 10 +- .../Jpeg/Components/Decoder/HuffmanTree.cs | 12 +- .../Jpeg/Components/Decoder/InputProcessor.cs | 14 +- .../Components/Decoder/JpegBlockProcessor.cs | 15 +- .../Jpeg/Components/Decoder/JpegPixelArea.cs | 13 +- .../JpegScanDecoder.ComputationData.cs | 10 +- .../Decoder/JpegScanDecoder.DataPointers.cs | 6 +- .../Components/Decoder/JpegScanDecoder.cs | 18 +- .../Decoder/MissingFF00Exception.cs | 10 +- .../Jpeg/Components/Decoder/YCbCrImage.cs | 17 +- .../Components/Decoder/YCbCrToRgbTables.cs | 12 +- .../Jpeg/Components/Encoder/HuffIndex.cs | 6 +- .../Jpeg/Components/Encoder/HuffmanLut.cs | 6 +- .../Jpeg/Components/Encoder/HuffmanSpec.cs | 6 +- .../Jpeg/Components/Encoder/QuantIndex.cs | 6 +- .../Components/Encoder/RgbToYCbCrTables.cs | 10 +- .../Formats/Jpeg/IJpegDecoderOptions.cs | 17 +- .../Formats/Jpeg/IJpegEncoderOptions.cs | 17 +- .../Formats/Jpeg/ImageExtensions.cs | 18 +- .../Formats/Jpeg/JpegConfigurationModule.cs | 6 +- src/ImageSharp/Formats/Jpeg/JpegConstants.cs | 10 +- src/ImageSharp/Formats/Jpeg/JpegDecoder.cs | 17 +- .../Formats/Jpeg/JpegDecoderCore.cs | 25 +- src/ImageSharp/Formats/Jpeg/JpegEncoder.cs | 17 +- .../Formats/Jpeg/JpegEncoderCore.cs | 24 +- src/ImageSharp/Formats/Jpeg/JpegFormat.cs | 10 +- .../Formats/Jpeg/JpegImageFormatDetector.cs | 10 +- src/ImageSharp/Formats/Jpeg/JpegSubsample.cs | 6 +- src/ImageSharp/Formats/Jpeg/UnzigData.cs | 12 +- .../Formats/Jpeg/Utils/JpegUtils.cs | 17 +- .../Formats/Jpeg/Utils/MutableSpan.cs | 10 +- .../Jpeg/Utils/MutableSpanExtensions.cs | 12 +- .../Formats/Png/Filters/AverageFilter.cs | 12 +- .../Formats/Png/Filters/FilterType.cs | 6 +- .../Formats/Png/Filters/NoneFilter.cs | 15 +- .../Formats/Png/Filters/PaethFilter.cs | 12 +- .../Formats/Png/Filters/SubFilter.cs | 12 +- .../Formats/Png/Filters/UpFilter.cs | 12 +- .../Formats/Png/IPngDecoderOptions.cs | 18 +- .../Formats/Png/IPngEncoderOptions.cs | 17 +- src/ImageSharp/Formats/Png/ImageExtensions.cs | 16 +- src/ImageSharp/Formats/Png/PngChunk.cs | 6 +- src/ImageSharp/Formats/Png/PngChunkTypes.cs | 6 +- src/ImageSharp/Formats/Png/PngColorType.cs | 6 +- .../Formats/Png/PngConfigurationModule.cs | 6 +- src/ImageSharp/Formats/Png/PngConstants.cs | 12 +- src/ImageSharp/Formats/Png/PngDecoder.cs | 18 +- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 29 +- src/ImageSharp/Formats/Png/PngEncoder.cs | 17 +- src/ImageSharp/Formats/Png/PngEncoderCore.cs | 29 +- src/ImageSharp/Formats/Png/PngFormat.cs | 10 +- src/ImageSharp/Formats/Png/PngHeader.cs | 6 +- .../Formats/Png/PngImageFormatDetector.cs | 10 +- .../Formats/Png/PngInterlaceMode.cs | 6 +- src/ImageSharp/Formats/Png/Zlib/Adler32.cs | 10 +- src/ImageSharp/Formats/Png/Zlib/Crc32.cs | 10 +- src/ImageSharp/Formats/Png/Zlib/IChecksum.cs | 6 +- .../Formats/Png/Zlib/ZlibDeflateStream.cs | 14 +- .../Formats/Png/Zlib/ZlibInflateStream.cs | 17 +- src/ImageSharp/GraphicsOptions.cs | 10 +- src/ImageSharp/IConfigurationModule.cs | 6 +- .../IImageProcessingContextFactory.cs | 10 +- .../IImageProcessingContext{TPixel}.cs | 14 +- src/ImageSharp/IO/BigEndianBitConverter.cs | 6 +- src/ImageSharp/IO/EndianBinaryReader.cs | 14 +- src/ImageSharp/IO/EndianBinaryWriter.cs | 14 +- .../IO/EndianBitConverter.Conversion.cs | 10 +- .../IO/EndianBitConverter.CopyBytes.cs | 10 +- .../IO/EndianBitConverter.GetBytes.cs | 10 +- .../IO/EndianBitConverter.ToType.cs | 10 +- src/ImageSharp/IO/EndianBitConverter.cs | 12 +- src/ImageSharp/IO/Endianness.cs | 6 +- src/ImageSharp/IO/IFileSystem.cs | 10 +- src/ImageSharp/IO/LittleEndianBitConverter.cs | 6 +- src/ImageSharp/IO/LocalFileSystem.cs | 16 +- .../Image/ICloningImageProcessor.cs | 12 +- src/ImageSharp/Image/IImage.cs | 10 +- src/ImageSharp/Image/IImageBase.cs | 10 +- src/ImageSharp/Image/IImageBase{TPixel}.cs | 12 +- src/ImageSharp/Image/IImageFrame.cs | 6 +- src/ImageSharp/Image/IImageProcessor.cs | 17 +- src/ImageSharp/Image/Image.Decode.cs | 18 +- src/ImageSharp/Image/Image.FromBytes.cs | 15 +- src/ImageSharp/Image/Image.FromFile.cs | 20 +- src/ImageSharp/Image/Image.FromStream.cs | 21 +- src/ImageSharp/Image/Image.LoadPixelData.cs | 22 +- src/ImageSharp/Image/ImageBase{TPixel}.cs | 23 +- src/ImageSharp/Image/ImageExtensions.cs | 22 +- src/ImageSharp/Image/ImageFrame{TPixel}.cs | 16 +- src/ImageSharp/Image/Image{TPixel}.cs | 31 +- src/ImageSharp/Image/PixelAccessor{TPixel}.cs | 21 +- src/ImageSharp/Image/PixelArea{TPixel}.cs | 19 +- src/ImageSharp/ImageFormats.cs | 10 +- src/ImageSharp/ImageSharp.csproj | 25 +- src/ImageSharp/Memory/Buffer.cs | 14 +- src/ImageSharp/Memory/Buffer2D.cs | 10 +- src/ImageSharp/Memory/Buffer2DExtensions.cs | 12 +- src/ImageSharp/Memory/Fast2DArray{T}.cs | 14 +- src/ImageSharp/Memory/IBuffer2D.cs | 10 +- src/ImageSharp/Memory/PixelDataPool{T}.cs | 13 +- src/ImageSharp/Memory/SpanHelper.cs | 14 +- src/ImageSharp/MetaData/IMetaData.cs | 10 +- src/ImageSharp/MetaData/ImageFrameMetaData.cs | 10 +- src/ImageSharp/MetaData/ImageMetaData.cs | 12 +- src/ImageSharp/MetaData/ImageProperty.cs | 10 +- .../MetaData/Profiles/Exif/ExifDataType.cs | 6 +- .../MetaData/Profiles/Exif/ExifParts.cs | 10 +- .../MetaData/Profiles/Exif/ExifProfile.cs | 17 +- .../MetaData/Profiles/Exif/ExifReader.cs | 18 +- .../MetaData/Profiles/Exif/ExifTag.cs | 6 +- .../Exif/ExifTagDescriptionAttribute.cs | 12 +- .../MetaData/Profiles/Exif/ExifValue.cs | 14 +- .../MetaData/Profiles/Exif/ExifWriter.cs | 16 +- .../Profiles/ICC/Curves/IccCurveSegment.cs | 10 +- .../ICC/Curves/IccFormulaCurveElement.cs | 10 +- .../ICC/Curves/IccOneDimensionalCurve.cs | 12 +- .../Profiles/ICC/Curves/IccParametricCurve.cs | 10 +- .../Profiles/ICC/Curves/IccResponseCurve.cs | 14 +- .../ICC/Curves/IccSampledCurveElement.cs | 12 +- .../ICC/DataReader/IccDataReader.Curves.cs | 10 +- .../ICC/DataReader/IccDataReader.Lut.cs | 10 +- .../ICC/DataReader/IccDataReader.Matrix.cs | 6 +- .../IccDataReader.MultiProcessElement.cs | 6 +- .../DataReader/IccDataReader.NonPrimitives.cs | 12 +- .../DataReader/IccDataReader.Primitives.cs | 12 +- .../DataReader/IccDataReader.TagDataEntry.cs | 14 +- .../Profiles/ICC/DataReader/IccDataReader.cs | 14 +- .../ICC/DataWriter/IccDataWriter.Curves.cs | 10 +- .../ICC/DataWriter/IccDataWriter.Lut.cs | 6 +- .../ICC/DataWriter/IccDataWriter.Matrix.cs | 13 +- .../IccDataWriter.MultiProcessElement.cs | 6 +- .../DataWriter/IccDataWriter.NonPrimitives.cs | 12 +- .../DataWriter/IccDataWriter.Primitives.cs | 12 +- .../DataWriter/IccDataWriter.TagDataEntry.cs | 10 +- .../Profiles/ICC/DataWriter/IccDataWriter.cs | 14 +- .../Profiles/ICC/Enums/IccClutDataType.cs | 6 +- .../Profiles/ICC/Enums/IccColorSpaceType.cs | 6 +- .../Profiles/ICC/Enums/IccColorantEncoding.cs | 6 +- .../ICC/Enums/IccCurveMeasurementEncodings.cs | 6 +- .../ICC/Enums/IccCurveSegmentSignature.cs | 6 +- .../Profiles/ICC/Enums/IccDataType.cs | 6 +- .../Profiles/ICC/Enums/IccDeviceAttribute.cs | 10 +- .../Profiles/ICC/Enums/IccFormulaCurveType.cs | 6 +- .../ICC/Enums/IccMeasurementGeometry.cs | 6 +- .../Enums/IccMultiProcessElementSignature.cs | 6 +- .../ICC/Enums/IccParametricCurveType.cs | 6 +- .../ICC/Enums/IccPrimaryPlatformType.cs | 6 +- .../Profiles/ICC/Enums/IccProfileClass.cs | 6 +- .../Profiles/ICC/Enums/IccProfileFlag.cs | 10 +- .../Profiles/ICC/Enums/IccProfileTag.cs | 6 +- .../Profiles/ICC/Enums/IccRenderingIntent.cs | 6 +- .../Profiles/ICC/Enums/IccScreeningFlag.cs | 10 +- .../ICC/Enums/IccScreeningSpotType.cs | 6 +- .../Profiles/ICC/Enums/IccSignatureName.cs | 6 +- .../ICC/Enums/IccStandardIlluminant.cs | 6 +- .../Profiles/ICC/Enums/IccStandardObserver.cs | 6 +- .../Profiles/ICC/Enums/IccTypeSignature.cs | 6 +- .../Exceptions/InvalidIccProfileException.cs | 10 +- .../MetaData/Profiles/ICC/IccProfile.cs | 15 +- .../MetaData/Profiles/ICC/IccProfileHeader.cs | 12 +- .../MetaData/Profiles/ICC/IccReader.cs | 10 +- .../MetaData/Profiles/ICC/IccTagDataEntry.cs | 10 +- .../MetaData/Profiles/ICC/IccWriter.cs | 14 +- .../IccBAcsProcessElement.cs | 10 +- .../IccClutProcessElement.cs | 10 +- .../IccCurveSetProcessElement.cs | 12 +- .../IccEAcsProcessElement.cs | 10 +- .../IccMatrixProcessElement.cs | 15 +- .../IccMultiProcessElement.cs | 10 +- .../IccChromaticityTagDataEntry.cs | 12 +- .../IccColorantOrderTagDataEntry.cs | 12 +- .../IccColorantTableTagDataEntry.cs | 12 +- .../TagDataEntries/IccCrdInfoTagDataEntry.cs | 10 +- .../TagDataEntries/IccCurveTagDataEntry.cs | 12 +- .../ICC/TagDataEntries/IccDataTagDataEntry.cs | 14 +- .../TagDataEntries/IccDateTimeTagDataEntry.cs | 10 +- .../IccFix16ArrayTagDataEntry.cs | 12 +- .../TagDataEntries/IccLut16TagDataEntry.cs | 14 +- .../ICC/TagDataEntries/IccLut8TagDataEntry.cs | 14 +- .../TagDataEntries/IccLutAToBTagDataEntry.cs | 14 +- .../TagDataEntries/IccLutBToATagDataEntry.cs | 14 +- .../IccMeasurementTagDataEntry.cs | 12 +- .../IccMultiLocalizedUnicodeTagDataEntry.cs | 12 +- .../IccMultiProcessElementsTagDataEntry.cs | 12 +- .../IccNamedColor2TagDataEntry.cs | 12 +- .../IccParametricCurveTagDataEntry.cs | 10 +- .../IccProfileSequenceDescTagDataEntry.cs | 12 +- ...ccProfileSequenceIdentifierTagDataEntry.cs | 12 +- .../IccResponseCurveSet16TagDataEntry.cs | 12 +- .../IccScreeningTagDataEntry.cs | 12 +- .../IccSignatureTagDataEntry.cs | 10 +- .../IccTextDescriptionTagDataEntry.cs | 12 +- .../ICC/TagDataEntries/IccTextTagDataEntry.cs | 10 +- .../IccUFix16ArrayTagDataEntry.cs | 12 +- .../IccUInt16ArrayTagDataEntry.cs | 12 +- .../IccUInt32ArrayTagDataEntry.cs | 12 +- .../IccUInt64ArrayTagDataEntry.cs | 12 +- .../IccUInt8ArrayTagDataEntry.cs | 12 +- .../TagDataEntries/IccUcrBgTagDataEntry.cs | 12 +- .../TagDataEntries/IccUnknownTagDataEntry.cs | 12 +- .../IccViewingConditionsTagDataEntry.cs | 12 +- .../ICC/TagDataEntries/IccXyzTagDataEntry.cs | 14 +- .../MetaData/Profiles/ICC/Various/IccClut.cs | 12 +- .../ICC/Various/IccColorantTableEntry.cs | 10 +- .../ICC/Various/IccLocalizedString.cs | 12 +- .../MetaData/Profiles/ICC/Various/IccLut.cs | 12 +- .../Profiles/ICC/Various/IccNamedColor.cs | 12 +- .../Profiles/ICC/Various/IccPositionNumber.cs | 10 +- .../ICC/Various/IccProfileDescription.cs | 12 +- .../Profiles/ICC/Various/IccProfileId.cs | 10 +- .../Various/IccProfileSequenceIdentifier.cs | 12 +- .../Profiles/ICC/Various/IccResponseNumber.cs | 10 +- .../ICC/Various/IccScreeningChannel.cs | 10 +- .../Profiles/ICC/Various/IccTagTableEntry.cs | 10 +- src/ImageSharp/Numerics/LongRational.cs | 14 +- src/ImageSharp/Numerics/Rational.cs | 12 +- src/ImageSharp/Numerics/SignedRational.cs | 12 +- src/ImageSharp/Numerics/ValueSize.cs | 12 +- src/ImageSharp/PixelFormats/Alpha8.cs | 14 +- src/ImageSharp/PixelFormats/Argb32.cs | 14 +- src/ImageSharp/PixelFormats/Bgr24.cs | 16 +- src/ImageSharp/PixelFormats/Bgr565.cs | 14 +- src/ImageSharp/PixelFormats/Bgra32.cs | 16 +- src/ImageSharp/PixelFormats/Bgra4444.cs | 14 +- src/ImageSharp/PixelFormats/Bgra5551.cs | 14 +- src/ImageSharp/PixelFormats/Byte4.cs | 14 +- .../PixelFormats/ColorBuilder{TPixel}.cs | 12 +- src/ImageSharp/PixelFormats/ColorConstants.cs | 12 +- src/ImageSharp/PixelFormats/ComponentOrder.cs | 6 +- .../PixelOperations{TPixel}.Generated.cs | 2 +- .../PixelOperations{TPixel}.Generated.tt | 2 +- .../Rgba32.PixelOperations.Generated.cs | 6 +- .../Rgba32.PixelOperations.Generated.tt | 6 +- src/ImageSharp/PixelFormats/HalfSingle.cs | 14 +- src/ImageSharp/PixelFormats/HalfTypeHelper.cs | 12 +- src/ImageSharp/PixelFormats/HalfVector2.cs | 14 +- src/ImageSharp/PixelFormats/HalfVector4.cs | 14 +- .../PixelFormats/IPackedVector{TPacked}.cs | 10 +- src/ImageSharp/PixelFormats/IPixel.cs | 12 +- .../PixelFormats/NamedColors{TPixel}.cs | 6 +- .../PixelFormats/NormalizedByte2.cs | 14 +- .../PixelFormats/NormalizedByte4.cs | 14 +- .../PixelFormats/NormalizedShort2.cs | 14 +- .../PixelFormats/NormalizedShort4.cs | 14 +- .../PackedPixelConverterHelper.cs | 12 +- .../PixelFormats/PixelBlenderMode.cs | 14 +- .../DefaultPixelBlenders.Generated.cs | 4 +- .../DefaultPixelBlenders.Generated.tt | 4 +- .../PorterDuffFunctions.Generated.cs | 2 +- .../PorterDuffFunctions.Generated.tt | 2 +- .../PixelBlenders/PorterDuffFunctions.cs | 12 +- .../PixelFormats/PixelBlender{TPixel}.cs | 10 +- .../PixelFormats/PixelConversionExtensions.cs | 11 +- .../PixelOperations{TPixel}.PixelBenders.cs | 10 +- .../PixelFormats/PixelOperations{TPixel}.cs | 14 +- src/ImageSharp/PixelFormats/Rg32.cs | 14 +- src/ImageSharp/PixelFormats/Rgb24.cs | 16 +- src/ImageSharp/PixelFormats/Rgba1010102.cs | 14 +- .../PixelFormats/Rgba32.Definitions.cs | 10 +- .../PixelFormats/Rgba32.PixelOperations.cs | 21 +- src/ImageSharp/PixelFormats/Rgba32.cs | 19 +- src/ImageSharp/PixelFormats/Rgba64.cs | 14 +- src/ImageSharp/PixelFormats/RgbaComponent.cs | 6 +- .../PixelFormats/RgbaVector.Definitions.cs | 6 +- .../RgbaVector.PixelOperations.cs | 15 +- src/ImageSharp/PixelFormats/RgbaVector.cs | 14 +- src/ImageSharp/PixelFormats/Short2.cs | 14 +- src/ImageSharp/PixelFormats/Short4.cs | 14 +- .../Binarization/BinaryThreshold.cs | 18 +- .../Processing/Binarization/Dither.cs | 19 +- .../Processing/ColorMatrix/BlackWhite.cs | 20 +- .../Processing/ColorMatrix/ColorBlindness.cs | 20 +- .../Processing/ColorMatrix/Grayscale.cs | 17 +- src/ImageSharp/Processing/ColorMatrix/Hue.cs | 20 +- .../Processing/ColorMatrix/Kodachrome.cs | 20 +- .../Processing/ColorMatrix/Lomograph.cs | 20 +- .../ColorMatrix/Options/ColorBlindness.cs | 6 +- .../ColorMatrix/Options/GrayscaleMode.cs | 6 +- .../Processing/ColorMatrix/Polaroid.cs | 20 +- .../Processing/ColorMatrix/Saturation.cs | 20 +- .../Processing/ColorMatrix/Sepia.cs | 20 +- .../Processing/Convolution/BoxBlur.cs | 18 +- .../Processing/Convolution/DetectEdges.cs | 20 +- .../Processing/Convolution/GaussianBlur.cs | 20 +- .../Processing/Convolution/GaussianSharpen.cs | 20 +- .../Convolution/Options/EdgeDetection.cs | 6 +- src/ImageSharp/Processing/Delegate.cs | 16 +- src/ImageSharp/Processing/Effects/Alpha.cs | 18 +- .../Processing/Effects/BackgroundColor.cs | 18 +- .../Processing/Effects/Brightness.cs | 18 +- src/ImageSharp/Processing/Effects/Contrast.cs | 18 +- src/ImageSharp/Processing/Effects/Invert.cs | 18 +- .../Processing/Effects/OilPainting.cs | 18 +- src/ImageSharp/Processing/Effects/Pixelate.cs | 18 +- src/ImageSharp/Processing/Overlays/Glow.cs | 15 +- .../Processing/Overlays/Vignette.cs | 15 +- .../Binarization/BinaryThresholdProcessor.cs | 17 +- .../ErrorDiffusionDitherProcessor.cs | 17 +- .../Binarization/OrderedDitherProcessor.cs | 19 +- .../Processors/CloningImageProcessor.cs | 17 +- .../ColorMatrix/BlackWhiteProcessor.cs | 15 +- .../ColorBlindness/AchromatomalyProcessor.cs | 15 +- .../ColorBlindness/AchromatopsiaProcessor.cs | 15 +- .../ColorBlindness/DeuteranomalyProcessor.cs | 15 +- .../ColorBlindness/DeuteranopiaProcessor.cs | 15 +- .../ColorBlindness/ProtanomalyProcessor.cs | 15 +- .../ColorBlindness/ProtanopiaProcessor.cs | 15 +- .../ColorBlindness/TritanomalyProcessor.cs | 15 +- .../ColorBlindness/TritanopiaProcessor.cs | 15 +- .../ColorMatrix/ColorMatrixProcessor.cs | 19 +- .../ColorMatrix/GrayscaleBt601Processor.cs | 15 +- .../ColorMatrix/GrayscaleBt709Processor.cs | 15 +- .../Processors/ColorMatrix/HueProcessor.cs | 15 +- .../ColorMatrix/IColorMatrixFilter.cs | 15 +- .../ColorMatrix/KodachromeProcessor.cs | 15 +- .../ColorMatrix/LomographProcessor.cs | 17 +- .../ColorMatrix/PolaroidProcessor.cs | 17 +- .../ColorMatrix/SaturationProcessor.cs | 15 +- .../Processors/ColorMatrix/SepiaProcessor.cs | 15 +- .../Convolution/BoxBlurProcessor.cs | 17 +- .../Convolution/Convolution2DProcessor.cs | 21 +- .../Convolution/Convolution2PassProcessor.cs | 21 +- .../Convolution/ConvolutionProcessor.cs | 21 +- .../EdgeDetection/EdgeDetector2DProcessor.cs | 17 +- .../EdgeDetectorCompassProcessor.cs | 21 +- .../EdgeDetection/EdgeDetectorProcessor.cs | 17 +- .../EdgeDetection/IEdgeDetectorProcessor.cs | 13 +- .../EdgeDetection/KayyaliProcessor.cs | 17 +- .../EdgeDetection/KirschProcessor.cs | 17 +- .../EdgeDetection/Laplacian3X3Processor.cs | 17 +- .../EdgeDetection/Laplacian5X5Processor.cs | 17 +- .../LaplacianOfGaussianProcessor.cs | 17 +- .../EdgeDetection/PrewittProcessor.cs | 17 +- .../EdgeDetection/RobertsCrossProcessor.cs | 17 +- .../EdgeDetection/RobinsonProcessor.cs | 17 +- .../EdgeDetection/ScharrProcessor.cs | 17 +- .../EdgeDetection/SobelProcessor.cs | 17 +- .../Convolution/GaussianBlurProcessor.cs | 17 +- .../Convolution/GaussianSharpenProcessor.cs | 17 +- .../Processors/DelegateProcessor.cs | 15 +- .../Processors/Effects/AlphaProcessor.cs | 19 +- .../Effects/BackgroundColorProcessor.cs | 19 +- .../Processors/Effects/BrightnessProcessor.cs | 19 +- .../Processors/Effects/ContrastProcessor.cs | 19 +- .../Processors/Effects/InvertProcessor.cs | 19 +- .../Effects/OilPaintingProcessor.cs | 20 +- .../Processors/Effects/PixelateProcessor.cs | 19 +- .../Processing/Processors/ImageProcessor.cs | 17 +- .../Processors/Overlays/GlowProcessor.cs | 21 +- .../Processors/Overlays/VignetteProcessor.cs | 21 +- .../Transforms/AutoRotateProcessor.cs | 19 +- .../Processors/Transforms/CropProcessor.cs | 18 +- .../Transforms/EntropyCropProcessor.cs | 15 +- .../Processors/Transforms/FlipProcessor.cs | 19 +- .../Transforms/Matrix3x2Processor.cs | 15 +- .../ResamplingWeightedProcessor.Weights.cs | 17 +- .../Transforms/ResamplingWeightedProcessor.cs | 17 +- .../Processors/Transforms/ResizeProcessor.cs | 21 +- .../Processors/Transforms/RotateProcessor.cs | 20 +- .../Processors/Transforms/SkewProcessor.cs | 20 +- .../Processing/Transforms/AutoOrient.cs | 15 +- src/ImageSharp/Processing/Transforms/Crop.cs | 18 +- .../Processing/Transforms/EntropyCrop.cs | 16 +- src/ImageSharp/Processing/Transforms/Flip.cs | 18 +- .../Transforms/Options/AnchorPosition.cs | 6 +- .../Processing/Transforms/Options/FlipType.cs | 6 +- .../Transforms/Options/Orientation.cs | 6 +- .../Transforms/Options/ResizeHelper.cs | 15 +- .../Transforms/Options/ResizeMode.cs | 6 +- .../Transforms/Options/ResizeOptions.cs | 14 +- .../Transforms/Options/RotateType.cs | 6 +- src/ImageSharp/Processing/Transforms/Pad.cs | 20 +- .../Transforms/Resamplers/BicubicResampler.cs | 6 +- .../Transforms/Resamplers/BoxResampler.cs | 6 +- .../Resamplers/CatmullRomResampler.cs | 6 +- .../Transforms/Resamplers/HermiteResampler.cs | 6 +- .../Transforms/Resamplers/IResampler.cs | 6 +- .../Resamplers/Lanczos2Resampler.cs | 6 +- .../Resamplers/Lanczos3Resampler.cs | 6 +- .../Resamplers/Lanczos5Resampler.cs | 6 +- .../Resamplers/Lanczos8Resampler.cs | 6 +- .../Resamplers/MitchellNetravaliResampler.cs | 6 +- .../Resamplers/NearestNeighborResampler.cs | 6 +- .../Resamplers/RobidouxResampler.cs | 6 +- .../Resamplers/RobidouxSharpResampler.cs | 6 +- .../Transforms/Resamplers/SplineResampler.cs | 6 +- .../Resamplers/TriangleResampler.cs | 6 +- .../Transforms/Resamplers/WelchResampler.cs | 6 +- .../Processing/Transforms/Resize.cs | 17 +- .../Processing/Transforms/Rotate.cs | 18 +- .../Processing/Transforms/RotateFlip.cs | 16 +- src/ImageSharp/Processing/Transforms/Skew.cs | 16 +- src/ImageSharp/Properties/AssemblyInfo.cs | 6 +- src/ImageSharp/Quantizers/Box.cs | 6 +- .../Quantizers/IQuantizer{TPixel}.cs | 12 +- .../Quantizers/OctreeQuantizer{TPixel}.cs | 16 +- .../Quantizers/PaletteQuantizer{TPixel}.cs | 16 +- src/ImageSharp/Quantizers/Quantization.cs | 6 +- src/ImageSharp/Quantizers/Quantize.cs | 17 +- .../Quantizers/QuantizedImage{TPixel}.cs | 12 +- .../Quantizers/Quantizer{TPixel}.cs | 20 +- src/ImageSharp/Quantizers/WuArrayPool.cs | 10 +- .../Quantizers/WuQuantizer{TPixel}.cs | 20 +- src/Shared/AssemblyInfo.Common.cs | 18 +- src/Shared/stylecop.json | 9 - tests/ImageSharp.Benchmarks/BenchmarkBase.cs | 4 +- .../Bulk/PackFromVector4ReferenceVsPointer.cs | 6 +- .../Color/Bulk/PackFromXyzw.cs | 6 +- .../Color/Bulk/ToVector4.cs | 6 +- .../ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs | 6 +- .../Color/Bulk/ToXyzw.cs | 6 +- .../Color/ColorEquality.cs | 4 +- .../Color/ColorspaceCieXyzToCieLabConvert.cs | 6 +- .../ColorspaceCieXyzToHunterLabConvert.cs | 6 +- .../Color/ColorspaceCieXyzToLmsConvert.cs | 6 +- .../Color/ColorspaceCieXyzToRgbConvert.cs | 6 +- .../Color/RgbToYCbCr.LookupTables.cs | 2 +- .../ImageSharp.Benchmarks/Color/RgbToYCbCr.cs | 4 +- .../Color/RgbWorkingSpaceAdapt.cs | 6 +- .../ImageSharp.Benchmarks/Color/YcbCrToRgb.cs | 2 +- tests/ImageSharp.Benchmarks/Config.cs | 2 +- .../Drawing/DrawBeziers.cs | 4 +- .../Drawing/DrawLines.cs | 4 +- .../Drawing/DrawPolygon.cs | 4 +- .../Drawing/FillPolygon.cs | 4 +- .../Drawing/FillRectangle.cs | 4 +- .../Drawing/FillWithPattern.cs | 6 +- tests/ImageSharp.Benchmarks/General/Abs.cs | 2 +- .../ImageSharp.Benchmarks/General/Array2D.cs | 4 +- .../General/ArrayCopy.cs | 2 +- .../General/ArrayReverse.cs | 2 +- tests/ImageSharp.Benchmarks/General/Clamp.cs | 2 +- .../General/ClearBuffer.cs | 4 +- .../General/IterateArray.cs | 4 +- .../ImageSharp.Benchmarks/General/Modulus.cs | 2 +- .../PixelConversion_ConvertFromRgba32.cs | 2 +- .../PixelConversion_ConvertFromVector4.cs | 2 +- .../PixelConversion_ConvertToRgba32.cs | 2 +- .../General/PixelIndexing.cs | 4 +- .../General/RoundSinglePrecisionBlocks.cs | 4 +- .../General/Vector4Constants.cs | 2 +- .../General/Vectorization/BitwiseOrUint32.cs | 2 +- .../General/Vectorization/DivFloat.cs | 2 +- .../General/Vectorization/DivUInt32.cs | 2 +- .../General/Vectorization/MulFloat.cs | 2 +- .../General/Vectorization/MulUInt32.cs | 2 +- .../Vectorization/ReinterpretUInt32AsFloat.cs | 2 +- .../General/Vectorization/VectorFetching.cs | 4 +- .../ImageSharp.Benchmarks/Image/CopyPixels.cs | 4 +- .../ImageSharp.Benchmarks/Image/DecodeBmp.cs | 2 +- .../Image/DecodeFilteredPng.cs | 4 +- .../ImageSharp.Benchmarks/Image/DecodeGif.cs | 2 +- .../ImageSharp.Benchmarks/Image/DecodeJpeg.cs | 2 +- .../Image/DecodeJpegMultiple.cs | 2 +- .../ImageSharp.Benchmarks/Image/DecodePng.cs | 2 +- .../ImageSharp.Benchmarks/Image/EncodeBmp.cs | 2 +- .../Image/EncodeBmpMultiple.cs | 4 +- .../ImageSharp.Benchmarks/Image/EncodeGif.cs | 2 +- .../Image/EncodeGifMultiple.cs | 4 +- .../Image/EncodeIndexedPng.cs | 8 +- .../ImageSharp.Benchmarks/Image/EncodeJpeg.cs | 2 +- .../Image/EncodeJpegMultiple.cs | 4 +- .../ImageSharp.Benchmarks/Image/EncodePng.cs | 6 +- .../Image/GetSetPixel.cs | 4 +- .../Image/ImageBenchmarkTests.cs | 2 +- .../Image/MultiImageBenchmarkBase.cs | 2 +- .../ImageSharp.Benchmarks.csproj | 8 +- .../PixelBlenders/PorterDuffBulkVsPixel.cs | 8 +- tests/ImageSharp.Benchmarks/Program.cs | 4 +- tests/ImageSharp.Benchmarks/Samplers/Crop.cs | 4 +- .../Samplers/DetectEdges.cs | 4 +- tests/ImageSharp.Benchmarks/Samplers/Glow.cs | 10 +- .../ImageSharp.Benchmarks/Samplers/Resize.cs | 4 +- .../BaseImageOperationsExtensionTest.cs | 9 +- .../CieLabAndCieLchConversionTests.cs | 14 +- .../CieLuvAndCieLchuvConversionTests.cs | 14 +- .../CieXyzAndCieLabConversionTest.cs | 14 +- .../CieXyzAndCieLuvConversionTest.cs | 14 +- .../CieXyzAndCieXyyConversionTest.cs | 15 +- .../CieXyzAndHunterLabConversionTest.cs | 14 +- .../Colorspaces/CieXyzAndLmsConversionTest.cs | 14 +- .../Colorspaces/ColorConverterAdaptTest.cs | 17 +- .../Colorspaces/ColorSpaceEqualityTests.cs | 17 +- .../Colorspaces/RgbAndCieXyzConversionTest.cs | 14 +- .../Colorspaces/RgbAndCmykConversionTest.cs | 15 +- .../Colorspaces/RgbAndHslConversionTest.cs | 15 +- .../Colorspaces/RgbAndHsvConversionTest.cs | 15 +- .../Colorspaces/RgbAndYCbCrConversionTest.cs | 15 +- .../ImageSharp.Tests/Common/Buffer2DTests.cs | 19 +- .../Common/BufferSpanTests.cs | 27 +- tests/ImageSharp.Tests/Common/BufferTests.cs | 25 +- .../ImageSharp.Tests/Common/ConstantsTests.cs | 10 +- .../Common/Fast2DArrayTests.cs | 16 +- .../Common/PixelDataPoolTests.cs | 18 +- tests/ImageSharp.Tests/Common/TestStructs.cs | 9 +- tests/ImageSharp.Tests/ConfigurationTests.cs | 27 +- .../ImageSharp.Tests/Drawing/BeziersTests.cs | 26 +- .../ImageSharp.Tests/Drawing/BlendedShapes.cs | 22 +- .../ImageSharp.Tests/Drawing/DrawImageTest.cs | 18 +- .../ImageSharp.Tests/Drawing/DrawPathTests.cs | 24 +- .../Drawing/FillPatternTests.cs | 23 +- .../Drawing/FillRegionProcessorTests.cs | 25 +- .../Drawing/FillSolidBrushTests.cs | 26 +- .../Drawing/LineComplexPolygonTests.cs | 25 +- tests/ImageSharp.Tests/Drawing/LineTests.cs | 23 +- .../Drawing/Paths/FillPath.cs | 26 +- .../Drawing/Paths/FillPathCollection.cs | 26 +- .../Drawing/Paths/FillPolygon.cs | 26 +- .../Drawing/Paths/FillRectangle.cs | 20 +- .../Drawing/Paths/ShapePathTests.cs | 36 +- .../Drawing/Paths/ShapeRegionTests.cs | 38 +- .../ImageSharp.Tests/Drawing/PolygonTests.cs | 27 +- .../Drawing/RecolorImageTest.cs | 22 +- .../Drawing/SolidBezierTests.cs | 21 +- .../Drawing/SolidComplexPolygonTests.cs | 24 +- .../Drawing/SolidPolygonTests.cs | 29 +- .../Drawing/Text/DrawText.Path.cs | 33 +- .../ImageSharp.Tests/Drawing/Text/DrawText.cs | 33 +- .../Drawing/Text/OutputText.cs | 35 +- .../Drawing/Text/TextGraphicsOptionsTests.cs | 24 +- .../FakeImageOperationsProvider.cs | 21 +- tests/ImageSharp.Tests/FileTestBase.cs | 10 +- .../Formats/Bmp/BmpEncoderTests.cs | 14 +- .../Formats/GeneralFormatTests.cs | 17 +- .../Formats/Gif/GifDecoderTests.cs | 19 +- .../Formats/Gif/GifEncoderTests.cs | 17 +- .../Formats/Jpg/BadEofJpegTests.cs | 19 +- .../Formats/Jpg/Block8x8FTests.cs | 22 +- .../Formats/Jpg/JpegDecoderTests.cs | 20 +- .../Formats/Jpg/JpegEncoderTests.cs | 18 +- .../Formats/Jpg/JpegProfilingBenchmarks.cs | 26 +- .../Formats/Jpg/JpegUtilityTestFixture.cs | 17 +- .../Formats/Jpg/JpegUtilsTests.cs | 20 +- .../Formats/Jpg/ReferenceImplementations.cs | 19 +- .../Jpg/ReferenceImplementationsTests.cs | 15 +- .../Formats/Jpg/YCbCrImageTests.cs | 16 +- .../Formats/Png/PngDecoderTests.cs | 10 +- .../Formats/Png/PngEncoderTests.cs | 24 +- .../Formats/Png/PngSmokeTests.cs | 29 +- tests/ImageSharp.Tests/GlobalSuppressions.cs | 8 + tests/ImageSharp.Tests/Helpers/GuardTests.cs | 15 +- tests/ImageSharp.Tests/Helpers/MathFTests.cs | 10 +- .../BigEndianBitConverter.CopyBytesTests.cs | 14 +- .../IO/BigEndianBitConverter.GetBytesTests.cs | 12 +- .../IO/BigEndianBitConverter.ToTypeTests.cs | 14 +- .../IO/EndianBinaryReaderTests.cs | 20 +- ...LittleEndianBitConverter.CopyBytesTests.cs | 14 +- .../LittleEndianBitConverter.GetBytesTests.cs | 12 +- .../LittleEndianBitConverter.ToTypeTests.cs | 14 +- tests/ImageSharp.Tests/IO/LocalFileSystem.cs | 17 +- .../Image/ImageDiscoverMimeType.cs | 23 +- .../ImageSharp.Tests/Image/ImageEqualTests.cs | 10 +- .../ImageSharp.Tests/Image/ImageLoadTests.cs | 21 +- .../Image/ImageRotationTests.cs | 7 +- .../ImageSharp.Tests/Image/ImageSaveTests.cs | 25 +- tests/ImageSharp.Tests/Image/ImageTests.cs | 18 +- .../Image/NoneSeekableStream.cs | 7 +- .../Image/PixelAccessorTests.cs | 19 +- tests/ImageSharp.Tests/ImageComparer.cs | 20 +- tests/ImageSharp.Tests/ImageOperationTests.cs | 31 +- .../ImageSharp.Tests/ImageSharp.Tests.csproj | 14 +- .../MetaData/ImageFrameMetaDataTests.cs | 12 +- .../MetaData/ImageMetaDataTests.cs | 15 +- .../MetaData/ImagePropertyTests.cs | 12 +- .../Profiles/Exif/ExifProfileTests.cs | 24 +- .../MetaData/Profiles/Exif/ExifReaderTests.cs | 12 +- .../Exif/ExifTagDescriptionAttributeTests.cs | 10 +- .../MetaData/Profiles/Exif/ExifValueTests.cs | 16 +- .../DataReader/IccDataReader.CurvesTests.cs | 10 +- .../ICC/DataReader/IccDataReader.LutTests.cs | 10 +- .../DataReader/IccDataReader.MatrixTests.cs | 10 +- .../IccDataReader.MultiProcessElementTests.cs | 10 +- .../IccDataReader.NonPrimitivesTests.cs | 14 +- .../IccDataReader.PrimitivesTests.cs | 12 +- .../IccDataReader.TagDataEntryTests.cs | 10 +- .../ICC/DataReader/IccDataReaderTests.cs | 12 +- .../DataWriter/IccDataWriter.CurvesTests.cs | 10 +- .../ICC/DataWriter/IccDataWriter.LutTests.cs | 10 +- .../DataWriter/IccDataWriter.MatrixTests.cs | 16 +- .../IccDataWriter.MultiProcessElementTests.cs | 10 +- .../IccDataWriter.NonPrimitivesTests.cs | 14 +- .../IccDataWriter.PrimitivesTests.cs | 12 +- .../IccDataWriter.TagDataEntryTests.cs | 10 +- .../ICC/DataWriter/IccDataWriterTests.cs | 10 +- .../MetaData/Profiles/ICC/IccReaderTests.cs | 10 +- .../MetaData/Profiles/ICC/IccWriterTests.cs | 10 +- .../Numerics/RationalTests.cs | 10 +- .../Numerics/SignedRationalTests.cs | 10 +- .../PixelFormats/Bgr24Tests.cs | 14 +- .../PixelFormats/Bgra32Tests.cs | 14 +- .../PixelFormats/ColorConstructorTests.cs | 18 +- .../PixelFormats/ColorDefinitionTests.cs | 20 +- .../PixelFormats/ColorEqualityTests.cs | 18 +- .../PixelFormats/ColorPackingTests.cs | 18 +- .../PixelFormats/PackedPixelTests.cs | 20 +- .../PixelBlenders/PorterDuffFunctionsTests.cs | 22 +- .../PorterDuffFunctionsTests_TPixel.cs | 24 +- .../PixelOperationsTests.Blender.cs | 22 +- .../PixelFormats/PixelOperationsTests.cs | 21 +- .../PixelFormats/Rgb24Tests.cs | 16 +- .../PixelFormats/Rgba32Tests.cs | 18 +- .../PixelFormats/RgbaVectorTests.cs | 18 +- .../PixelFormats/UnPackedPixelTests.cs | 13 +- .../Binarization/BinaryThresholdTest.cs | 16 +- .../Processing/Binarization/DitherTest.cs | 22 +- .../Processing/ColorMatrix/BlackWhiteTest.cs | 16 +- .../ColorMatrix/ColorBlindnessTest.cs | 22 +- .../Processing/ColorMatrix/GrayscaleTest.cs | 24 +- .../Processing/ColorMatrix/HueTest.cs | 16 +- .../Processing/ColorMatrix/KodachromeTest.cs | 16 +- .../Processing/ColorMatrix/LomographTest.cs | 19 +- .../Processing/ColorMatrix/PolaroidTest.cs | 16 +- .../Processing/ColorMatrix/SaturationTest.cs | 16 +- .../Processing/ColorMatrix/SepiaTest.cs | 16 +- .../Processing/Convolution/BoxBlurTest.cs | 16 +- .../Processing/Convolution/DetectEdgesTest.cs | 22 +- .../Convolution/GaussianBlurTest.cs | 16 +- .../Convolution/GaussianSharpenTest.cs | 16 +- .../Processing/DelegateTest.cs | 16 +- .../Processing/Effects/AlphaTest.cs | 16 +- .../Processing/Effects/BackgroundColorTest.cs | 16 +- .../Processing/Effects/BrightnessTest.cs | 16 +- .../Processing/Effects/ContrastTest.cs | 16 +- .../Processing/Effects/InvertTest.cs | 16 +- .../Processing/Effects/OilPaintTest.cs | 16 +- .../Processing/Effects/PixelateTest.cs | 16 +- .../Processing/Overlays/GlowTest.cs | 18 +- .../Processing/Overlays/VignetteTest.cs | 20 +- .../Binarization/BinaryThresholdTest.cs | 14 +- .../Processors/Binarization/DitherTest.cs | 18 +- .../Processors/ColorMatrix/BlackWhiteTest.cs | 14 +- .../ColorMatrix/ColorBlindnessTest.cs | 16 +- .../Processors/ColorMatrix/GrayscaleTest.cs | 16 +- .../Processors/ColorMatrix/HueTest.cs | 14 +- .../Processors/ColorMatrix/KodachromeTest.cs | 14 +- .../Processors/ColorMatrix/LomographTest.cs | 17 +- .../Processors/ColorMatrix/PolaroidTest.cs | 14 +- .../Processors/ColorMatrix/SaturationTest.cs | 14 +- .../Processors/ColorMatrix/SepiaTest.cs | 14 +- .../Processors/Convolution/BoxBlurTest.cs | 14 +- .../Processors/Convolution/DetectEdgesTest.cs | 16 +- .../Convolution/GaussianBlurTest.cs | 14 +- .../Convolution/GaussianSharpenTest.cs | 14 +- .../Processors/Effects/AlphaTest.cs | 14 +- .../Processors/Effects/BackgroundColorTest.cs | 14 +- .../Processors/Effects/BrightnessTest.cs | 14 +- .../Processors/Effects/ContrastTest.cs | 14 +- .../Processors/Effects/InvertTest.cs | 14 +- .../Processors/Effects/OilPaintTest.cs | 14 +- .../Processors/Effects/PixelateTest.cs | 14 +- .../Processors/Overlays/GlowTest.cs | 14 +- .../Processors/Overlays/VignetteTest.cs | 14 +- .../Processors/Transforms/AutoOrientTests.cs | 17 +- .../Processors/Transforms/CropTest.cs | 13 +- .../Processors/Transforms/EntropyCropTest.cs | 13 +- .../Processors/Transforms/FlipTests.cs | 15 +- .../Processors/Transforms/PadTest.cs | 13 +- .../Transforms/ResizeProfilingBenchmarks.cs | 24 +- .../Processors/Transforms/ResizeTests.cs | 16 +- .../Processors/Transforms/RotateFlipTests.cs | 15 +- .../Processors/Transforms/RotateTests.cs | 15 +- .../Processors/Transforms/SkewTest.cs | 13 +- .../Processing/Transforms/AutoOrientTests.cs | 18 +- .../Processing/Transforms/CropTest.cs | 18 +- .../Processing/Transforms/EntropyCropTest.cs | 16 +- .../Processing/Transforms/FlipTests.cs | 18 +- .../Processing/Transforms/PadTest.cs | 17 +- .../Processing/Transforms/ResizeTests.cs | 20 +- .../Processing/Transforms/RotateFlipTests.cs | 18 +- .../Processing/Transforms/RotateTests.cs | 16 +- .../Processing/Transforms/SkewTest.cs | 14 +- tests/ImageSharp.Tests/TestBase.cs | 15 +- .../TestDataIcc/IccTestDataArray.cs | 6 +- .../TestDataIcc/IccTestDataCurves.cs | 10 +- .../TestDataIcc/IccTestDataLut.cs | 6 +- .../TestDataIcc/IccTestDataMatrix.cs | 9 +- .../IccTestDataMultiProcessElements.cs | 6 +- .../TestDataIcc/IccTestDataNonPrimitives.cs | 13 +- .../TestDataIcc/IccTestDataPrimitives.cs | 6 +- .../TestDataIcc/IccTestDataProfiles.cs | 6 +- .../TestDataIcc/IccTestDataTagDataEntry.cs | 12 +- tests/ImageSharp.Tests/TestFile.cs | 24 +- tests/ImageSharp.Tests/TestFileSystem.cs | 24 +- tests/ImageSharp.Tests/TestFont.cs | 20 +- tests/ImageSharp.Tests/TestFormat.cs | 27 +- tests/ImageSharp.Tests/TestImages.cs | 10 +- .../TestUtilities/ApproximateFloatComparer.cs | 13 +- .../TestUtilities/ArrayHelper.cs | 10 +- .../Attributes/ImageDataAttributeBase.cs | 19 +- .../Attributes/WithBlankImageAttribute.cs | 12 +- .../Attributes/WithFileAttribute.cs | 12 +- .../Attributes/WithFileCollectionAttribute.cs | 16 +- .../Attributes/WithMemberFactoryAttribute.cs | 14 +- .../WithSolidFilledImagesAttribute.cs | 12 +- .../WithTestPatternImageAttribute.cs | 12 +- .../TestUtilities/Factories/GenericFactory.cs | 13 +- .../TestUtilities/Factories/ImageFactory.cs | 10 +- .../TestUtilities/FloatRoundingComparer.cs | 13 +- .../ImageProviders/BlankProvider.cs | 16 +- .../ImageProviders/FileProvider.cs | 18 +- .../ImageProviders/LambdaProvider.cs | 13 +- .../ImageProviders/SolidProvider.cs | 16 +- .../ImageProviders/TestImageProvider.cs | 17 +- .../ImageProviders/TestPatternProvider.cs | 20 +- .../TestUtilities/ImagingTestCaseUtility.cs | 21 +- .../TestUtilities/MeasureFixture.cs | 17 +- .../TestUtilities/PixelTypes.cs | 10 +- .../TestUtilities/TestImageExtensions.cs | 19 +- .../TestUtilities/TestPixel.cs | 9 +- .../TestUtilities/TestType.cs | 9 +- .../TestUtilities/TestUtilityExtensions.cs | 21 +- .../TestUtilities/TestVector4.cs | 9 +- .../Tests/TestImageProviderTests.cs | 18 +- .../Tests/TestUtilityExtensionsTests.cs | 26 +- tests/ImageSharp.Tests/VectorAssert.cs | 20 +- 911 files changed, 5159 insertions(+), 7417 deletions(-) create mode 100644 .vscode/launch.json delete mode 100644 build/Program.cs delete mode 100644 build/Properties/launchSettings.json delete mode 100644 build/build.cmd delete mode 100644 build/build.csproj delete mode 100644 build/reset-versions.cmd create mode 100644 global.json delete mode 100644 src/Shared/stylecop.json create mode 100644 tests/ImageSharp.Tests/GlobalSuppressions.cs diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..c9c7453f64 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (console)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + // If you have changed target frameworks, make sure to update the program path. + "program": "${workspaceRoot}/samples/AvatarWithRoundedCorner/bin/Debug/netcoreapp1.1/AvatarWithRoundedCorner.dll", + "args": [], + "cwd": "${workspaceRoot}/samples/AvatarWithRoundedCorner", + // For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window + "console": "internalConsole", + "stopAtEntry": false, + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/ImageSharp.ruleset b/ImageSharp.ruleset index 0bd9cd11ab..c1de1bc434 100644 --- a/ImageSharp.ruleset +++ b/ImageSharp.ruleset @@ -2,10 +2,10 @@ - - + \ No newline at end of file diff --git a/ImageSharp.sln b/ImageSharp.sln index a584c56868..c3bd150683 100644 --- a/ImageSharp.sln +++ b/ImageSharp.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.14 +VisualStudioVersion = 15.0.26730.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}" ProjectSection(SolutionItems) = preProject @@ -30,26 +30,21 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{9E574A07-F879-4811-9C41-5CBDC6BAFDB7}" ProjectSection(SolutionItems) = preProject src\Shared\AssemblyInfo.Common.cs = src\Shared\AssemblyInfo.Common.cs - src\Shared\stylecop.json = src\Shared\stylecop.json EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp", "src\ImageSharp\ImageSharp.csproj", "{2AA31A1F-142C-43F4-8687-09ABCA4B3A26}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Drawing", "src\ImageSharp.Drawing\ImageSharp.Drawing.csproj", "{2E33181E-6E28-4662-A801-E2E7DC206029}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "build", "build\build.csproj", "{575A5002-DD9F-4335-AA47-1DD87FA13645}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Tests", "tests\ImageSharp.Tests\ImageSharp.Tests.csproj", "{EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Benchmarks", "tests\ImageSharp.Benchmarks\ImageSharp.Benchmarks.csproj", "{2BF743D8-2A06-412D-96D7-F448F00C5EA5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Sandbox46", "tests\ImageSharp.Sandbox46\ImageSharp.Sandbox46.csproj", "{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{7CC6D57E-B916-43B8-B315-A0BB92F260A2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvatarWithRoundedCorner", "samples\AvatarWithRoundedCorner\AvatarWithRoundedCorner.csproj", "{844FC582-4E78-4371-847D-EFD4D1103578}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ChangeDefaultEncoderOptions", "samples\ChangeDefaultEncoderOptions\ChangeDefaultEncoderOptions.csproj", "{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChangeDefaultEncoderOptions", "samples\ChangeDefaultEncoderOptions\ChangeDefaultEncoderOptions.csproj", "{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -85,18 +80,6 @@ Global {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x64.Build.0 = Release|Any CPU {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x86.ActiveCfg = Release|Any CPU {2E33181E-6E28-4662-A801-E2E7DC206029}.Release|x86.Build.0 = Release|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|Any CPU.Build.0 = Debug|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x64.ActiveCfg = Debug|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x64.Build.0 = Debug|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x86.ActiveCfg = Debug|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Debug|x86.Build.0 = Debug|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|Any CPU.ActiveCfg = Release|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|Any CPU.Build.0 = Release|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x64.ActiveCfg = Release|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x64.Build.0 = Release|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x86.ActiveCfg = Release|Any CPU - {575A5002-DD9F-4335-AA47-1DD87FA13645}.Release|x86.Build.0 = Release|Any CPU {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|Any CPU.Build.0 = Debug|Any CPU {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -121,18 +104,6 @@ Global {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x64.Build.0 = Release|Any CPU {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x86.ActiveCfg = Release|Any CPU {2BF743D8-2A06-412D-96D7-F448F00C5EA5}.Release|x86.Build.0 = Release|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|x64.ActiveCfg = Debug|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|x64.Build.0 = Debug|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|x86.ActiveCfg = Debug|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|x86.Build.0 = Debug|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|Any CPU.Build.0 = Release|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x64.ActiveCfg = Release|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x64.Build.0 = Release|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x86.ActiveCfg = Release|Any CPU - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|x86.Build.0 = Release|Any CPU {844FC582-4E78-4371-847D-EFD4D1103578}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {844FC582-4E78-4371-847D-EFD4D1103578}.Debug|Any CPU.Build.0 = Debug|Any CPU {844FC582-4E78-4371-847D-EFD4D1103578}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -165,11 +136,12 @@ Global {9E574A07-F879-4811-9C41-5CBDC6BAFDB7} = {815C0625-CD3D-440F-9F80-2D83856AB7AE} {2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {815C0625-CD3D-440F-9F80-2D83856AB7AE} {2E33181E-6E28-4662-A801-E2E7DC206029} = {815C0625-CD3D-440F-9F80-2D83856AB7AE} - {575A5002-DD9F-4335-AA47-1DD87FA13645} = {E919DF0B-2607-4462-8FC0-5C98FE50F8C9} {EA3000E9-2A91-4EC4-8A68-E566DEBDC4F6} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {2BF743D8-2A06-412D-96D7-F448F00C5EA5} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} - {96188137-5FA6-4924-AB6E-4EFF79C6E0BB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {844FC582-4E78-4371-847D-EFD4D1103578} = {7CC6D57E-B916-43B8-B315-A0BB92F260A2} {07EE511D-4BAB-4323-BAFC-3AF2BF9366F0} = {7CC6D57E-B916-43B8-B315-A0BB92F260A2} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795} + EndGlobalSection EndGlobal diff --git a/build.cmd b/build.cmd index e33a230bcd..fd2639da0e 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,34 @@ @echo Off -call build\build.cmd \ No newline at end of file + +if not "%GitVersion_NuGetVersion%" == "" ( + SET versionCommand=/p:packageversion=%GitVersion_NuGetVersion% + @echo building with version set to '%GitVersion_NuGetVersion%' +) + +dotnet restore %versionCommand% + + +ECHO Building nuget packages +dotnet build -c Release %versionCommand% +if not "%errorlevel%"=="0" goto failure + +dotnet test ./tests/ImageSharp.Tests/ImageSharp.Tests.csproj --no-build +if not "%errorlevel%"=="0" goto failure + +dotnet pack ./src/ImageSharp/ -c Release --output ../../artifacts --no-build %versionCommand% +if not "%errorlevel%"=="0" goto failure + +dotnet pack ./src/ImageSharp.Drawing/ -c Release --output ../../artifacts --no-build %versionCommand% +if not "%errorlevel%"=="0" goto failure + +:success +ECHO successfully built project +REM exit 0 +goto end + +:failure +ECHO failed to build. +REM exit -1 +goto end + +:end \ No newline at end of file diff --git a/build/Program.cs b/build/Program.cs deleted file mode 100644 index 4e59b22145..0000000000 --- a/build/Program.cs +++ /dev/null @@ -1,463 +0,0 @@ -// -// Copyright (c) James Jackson-South and contributors. -// Licensed under the Apache License, Version 2.0. -// - -namespace ConsoleApplication -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Text; - using System.Xml; - using LibGit2Sharp; - using Microsoft.Build.Construction; - using Microsoft.Build.Evaluation; - using NuGet.Versioning; - - /// - /// This updates the version numbers for all the projects in the src folder. - /// The version number it will geneate is dependent on if this is a build from master or a branch/PR - /// - /// If its a build on master - /// We take the version number specified in project.json, - /// count how meny commits the repo has had that will affect this project or its dependencies since the version number of manually changed - /// If this is the first commit that effected this project since number change then leave the version number as defined i.e. will build 1.0.0 if thats in project.json - /// unless it is a preview build number in which case we always add the counter - /// - /// If the build is from a PR/branch - /// We take the version number specified in project.json, append a tag for the branch/PR (so we can determin how each package was built) - /// append number of commits effecting the project. - /// - /// - /// - /// for PR#123 and project.json version 2.0.1 and we have had 30 commits affecting the project - /// we would end up with version number 2.0.1-PR124-00030 - /// - /// for branch `fix-stuff` project.json version 2.0.1-alpha1 and we have had 832 commits affecting the project - /// we would end up with version number 2.0.1-alpha1-fix-stuff-00832 - /// - /// for `master` project.json version 2.0.1-alpha1 and we have had 832 commits affecting the project - /// we would end up with version number 2.0.1-alpha1-00832 - /// - /// for `master` project.json version 2.0.1 and we have had 132 commits affecting the project - /// we would end up with version number 2.0.1-CI-00132 - /// - /// for `master` project.json version 2.0.1 and we have had 1 commits affecting the project - /// we would end up with version number 2.0.1 - /// - /// for `master` project.json version 2.0.1-alpha1 and we have had 1 commits affecting the project - /// we would end up with version number 2.0.1-alpha1 - /// - /// - /// TODO Add the option for using this to update the version numbers in a project and its dependent references. - /// - public class Program - { - private const string FallbackTag = "CI"; - - /// - /// Main entry point. - /// - /// The arguments. - public static void Main(string[] args) - { - bool resetmode = args.Contains("reset"); - - // Find the project root - string root = Path.GetFullPath(Path.Combine(LibGit2Sharp.Repository.Discover("."), "..")); - - // Lets find the repo - Repository repo = new LibGit2Sharp.Repository(root); - - // Lets find all the project.json files in the src folder (don't care about versioning `tests`) - IEnumerable projectFiles = Directory.EnumerateFiles(Path.Combine(root, "src"), "*.csproj", SearchOption.AllDirectories); - - ResetProject(projectFiles); - - // Open them and convert them to source projects - List projects = projectFiles.Select(x => ProjectRootElement.Open(x, ProjectCollection.GlobalProjectCollection, true)) - .Select(x => new SourceProject(x, repo.Info.WorkingDirectory)) - .ToList(); - - if (!resetmode) - { - CaclulateProjectVersionNumber(projects, repo); - - UpdateVersionNumbers(projects); - - CreateBuildScript(projects, root); - - foreach (SourceProject p in projects) - { - Console.WriteLine($"{p.Name} {p.FinalVersionNumber}"); - } - } - } - - private static void CreateBuildScript(IEnumerable projects, string root) - { - string outputDir = Path.GetFullPath(Path.Combine(root, @"artifacts\bin\ImageSharp")); - - StringBuilder sb = new StringBuilder(); - foreach (SourceProject p in projects) - { - sb.AppendLine($@"dotnet pack --configuration Release --output ""{outputDir}"" ""{p.ProjectFilePath}"""); - } - - File.WriteAllText("build-inner.cmd", sb.ToString()); - } - - private static void UpdateVersionNumbers(IEnumerable projects) - { - foreach (SourceProject p in projects) - { - // create a backup file so we can rollback later without breaking formatting - File.Copy(p.FullProjectFilePath, $"{p.FullProjectFilePath}.bak", true); - } - - foreach (SourceProject p in projects) - { - // TODO force update of all dependent projects to point to the newest build. - // we skip the build number and standard CI prefix on first commits - string newVersion = p.FinalVersionNumber; - - p.UpdateVersion(newVersion); - } - } - - private static string CurrentBranch(Repository repo) - { - // lets build version friendly commit - string branch = repo.Head.FriendlyName; - - // lets see if we are running in appveyor and if we are use the environment variables instead of the head - string appveryorBranch = Environment.GetEnvironmentVariable("APPVEYOR_REPO_BRANCH"); - if (!string.IsNullOrWhiteSpace(appveryorBranch)) - { - branch = appveryorBranch; - } - - string prNumber = Environment.GetEnvironmentVariable("APPVEYOR_PULL_REQUEST_NUMBER"); - if (!string.IsNullOrWhiteSpace(prNumber)) - { - branch = $"PR{int.Parse(prNumber):000}"; - } - - // this will happen when checking out a comit directly and not a branch (like appveryor does when it builds) - if (branch == "(no branch)") - { - throw new Exception("unable to find branch"); - } - - // clean branch names (might need to be improved) - branch = branch.Replace("/", "-").Replace("--", "-"); - - return branch; - } - - private static void CaclulateProjectVersionNumber(List projects, Repository repo) - { - string branch = CurrentBranch(repo); - - // populate the dependency chains - projects.ForEach(x => x.PopulateDependencies(projects)); - - // update the final version based on the repo history and the currentr branch name - projects.ForEach(x => x.CalculateVersion(repo, branch)); - } - - private static void ResetProject(IEnumerable projectPaths) - { - if (File.Exists("build-inner.cmd")) - { - File.Delete("build-inner.cmd"); - } - - // revert the project.json change be reverting it but skipp all the git stuff as its not needed - foreach (string p in projectPaths) - { - if (File.Exists($"{p}.bak")) - { - File.Copy($"{p}.bak", p, true); - File.Delete($"{p}.bak"); - } - } - } - - /// - /// Project level logic - /// - public class SourceProject - { - private readonly IEnumerable dependencies; - private readonly ProjectRootElement project; - - /// - /// Initializes a new instance of the class. - /// - /// The project. - /// The root. - public SourceProject(ProjectRootElement project, string root) - { - this.Name = project.Properties.FirstOrDefault(x => x.Name == "AssemblyTitle").Value; - - this.ProjectDirectory = project.DirectoryPath.Substring(root.Length); - this.ProjectFilePath = project.ProjectFileLocation.File.Substring(root.Length); - this.FullProjectFilePath = Path.GetFullPath(project.ProjectFileLocation.File); - this.Version = new NuGetVersion(project.Properties.FirstOrDefault(x => x.Name == "VersionPrefix").Value); - this.dependencies = project.Items.Where(x => x.ItemType == "ProjectReference").Select(x => Path.GetFullPath(Path.Combine(project.DirectoryPath, x.Include))); - this.FinalVersionNumber = this.Version.ToFullString(); - this.project = project; - } - - /// - /// Gets the project directory. - /// - /// - /// The project directory. - /// - public string ProjectDirectory { get; } - - /// - /// Gets the version. - /// - /// - /// The version. - /// - public NuGetVersion Version { get; private set; } - - /// - /// Gets the dependent projects. - /// - /// - /// The dependent projects. - /// - public List DependentProjects { get; private set; } - - /// - /// Gets the name. - /// - /// - /// The name. - /// - public string Name { get; private set; } - - /// - /// Gets the project file path. - /// - /// - /// The project file path. - /// - public string ProjectFilePath { get; private set; } - - /// - /// Gets the commit count since version change. - /// - /// - /// The commit count since version change. - /// - public int CommitCountSinceVersionChange { get; private set; } = 0; - - /// - /// Gets the full project file path. - /// - /// - /// The full project file path. - /// - public string FullProjectFilePath { get; private set; } - - /// - /// Gets the final version number. - /// - /// - /// The final version number. - /// - public string FinalVersionNumber { get; private set; } - - /// - /// Populates the dependencies. - /// - /// The projects. - public void PopulateDependencies(IEnumerable projects) - { - this.DependentProjects = projects.Where(x => this.dependencies.Contains(x.FullProjectFilePath)).ToList(); - } - - /// - /// Update the version number in the project file - /// - /// the new version number to save. - internal void UpdateVersion(string versionnumber) - { - this.project.AddProperty("VersionPrefix", versionnumber); - this.Version = new NuGetVersion(versionnumber); - this.project.Save(); - } - - /// - /// Calculates the version. - /// - /// The repo. - /// The branch. - internal void CalculateVersion(Repository repo, string branch) - { - foreach (Commit c in repo.Commits) - { - if (!this.ApplyCommit(c, repo)) - { - // we have finished lets populate the final version number - this.FinalVersionNumber = this.CalculateVersionNumber(branch); - - return; - } - } - } - - private bool MatchPath(string path) - { - if (path.StartsWith(this.ProjectDirectory, StringComparison.OrdinalIgnoreCase)) - { - return true; - } - - if (this.DependentProjects.Any()) - { - return this.DependentProjects.Any(x => x.MatchPath(path)); - } - - return false; - } - - private bool ApplyCommitInternal(Commit commit, TreeChanges changes, Repository repo) - { - this.CommitCountSinceVersionChange++; - - // return false if this is a version number root - TreeEntryChanges projectFileChange = changes.Where(x => x.Path?.Equals(this.ProjectFilePath, StringComparison.OrdinalIgnoreCase) == true).FirstOrDefault(); - if (projectFileChange != null) - { - if (projectFileChange.Status == ChangeKind.Added) - { - // the version must have been set here - return false; - } - else - { - Blob blob = repo.Lookup(projectFileChange.Oid); - using (Stream s = blob.GetContentStream()) - { - using (XmlReader reader = XmlReader.Create(s)) - { - ProjectRootElement proj = ProjectRootElement.Create(reader); - NuGetVersion version = new NuGetVersion(proj.Properties.FirstOrDefault(x => x.Name == "VersionPrefix").Value); - if (version != this.Version) - { - // version changed - return false; - } - } - } - } - - // version must have been the same lets carry on - return true; - } - - return true; - } - - private bool ApplyCommit(Commit commit, Repository repo) - { - foreach (Commit parent in commit.Parents) - { - TreeChanges changes = repo.Diff.Compare(parent.Tree, commit.Tree); - - foreach (TreeEntryChanges change in changes) - { - if (!string.IsNullOrWhiteSpace(change.OldPath)) - { - if (this.MatchPath(change.OldPath)) - { - return this.ApplyCommitInternal(commit, changes, repo); - } - } - - if (!string.IsNullOrWhiteSpace(change.Path)) - { - if (this.MatchPath(change.Path)) - { - return this.ApplyCommitInternal(commit, changes, repo); - } - } - } - } - - return true; - } - - private string CalculateVersionNumber(string branch) - { - string version = this.Version.ToFullString(); - - // master only - if (this.CommitCountSinceVersionChange == 1 && branch == "master") - { - if (this.Version.IsPrerelease) - { - // prerelease always needs the build counter just not on a branch name - return $"{version}-{this.CommitCountSinceVersionChange:00000}"; - } - - // this is the full release happy path, first commit after changing the version number - return version; - } - - string rootSpecialVersion = string.Empty; - - if (this.Version.IsPrerelease) - { - // probably a much easy way for doing this but it work sell enough for a build script - string[] parts = version.Split(new[] { '-' }, 2); - version = parts[0]; - rootSpecialVersion = parts[1]; - } - - // if master and the version doesn't manually specify a prerelease tag force one on for CI builds - if (branch == "master") - { - if (!this.Version.IsPrerelease) - { - branch = FallbackTag; - } - else - { - branch = string.Empty; - } - } - - if (rootSpecialVersion.Length > 0) - { - rootSpecialVersion = "-" + rootSpecialVersion; - } - - if (branch.Length > 0) - { - branch = "-" + branch; - } - - int maxLength = 20; // dotnet will fail to populate the package if the tag is > 20 - maxLength -= rootSpecialVersion.Length; // this is a required tag - maxLength -= 7; // for the counter and dashes - - if (branch.Length > maxLength) - { - branch = branch.Substring(0, maxLength); - } - - return $"{version}{rootSpecialVersion}{branch}-{this.CommitCountSinceVersionChange:00000}"; - } - } - } -} diff --git a/build/Properties/launchSettings.json b/build/Properties/launchSettings.json deleted file mode 100644 index d175ae7547..0000000000 --- a/build/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "build": { - "commandName": "Project", - "commandLineArgs": "reset" - } - } -} \ No newline at end of file diff --git a/build/build.cmd b/build/build.cmd deleted file mode 100644 index 14fc0bdaa9..0000000000 --- a/build/build.cmd +++ /dev/null @@ -1,18 +0,0 @@ -@echo Off -set buildRoot="%cd%" - -ECHO Restoring packages -dotnet restore - -ECHO Updating version numbers and generating build script -cd %~dp0 -dotnet run -- update -cd %buildRoot% - -ECHO Building package -call %~dp0build-inner.cmd - -ECHO Reset version numbers -cd %~dp0 -dotnet run -- reset -cd %buildRoot% \ No newline at end of file diff --git a/build/build.csproj b/build/build.csproj deleted file mode 100644 index dc431284ed..0000000000 --- a/build/build.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - netcoreapp1.1 - portable - true - build - Exe - build - ..\ImageSharp.ruleset - - - - - - - \ No newline at end of file diff --git a/build/reset-versions.cmd b/build/reset-versions.cmd deleted file mode 100644 index 31d1d24318..0000000000 --- a/build/reset-versions.cmd +++ /dev/null @@ -1,8 +0,0 @@ -@echo Off - -set buildRoot="%cd%" -cd %~dp0 - -dotnet run -- reset - -cd %buildRoot% \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 0000000000..cccd8b4545 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "1.1.0" + } +} \ No newline at end of file diff --git a/samples/AvatarWithRoundedCorner/Program.cs b/samples/AvatarWithRoundedCorner/Program.cs index e894d96a62..087bbc29d5 100644 --- a/samples/AvatarWithRoundedCorner/Program.cs +++ b/samples/AvatarWithRoundedCorner/Program.cs @@ -1,13 +1,16 @@ - +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +using SixLabors.Shapes; namespace AvatarWithRoundedCorner { - using System; - using System.Numerics; - using ImageSharp; - using SixLabors.Primitives; - using SixLabors.Shapes; - static class Program { static void Main(string[] args) @@ -46,10 +49,10 @@ static void Main(string[] args) // so we implement an "inline" image processor by utilizing 'ImageExtensions.Apply()' private static IImageProcessingContext ConvertToAvatar(this IImageProcessingContext processingContext, Size size, float cornerRadius) { - return processingContext.Resize(new ImageSharp.Processing.ResizeOptions + return processingContext.Resize(new ResizeOptions { Size = size, - Mode = ImageSharp.Processing.ResizeMode.Crop + Mode = ResizeMode.Crop }).Apply(i => ApplyRoundedCorners(i, cornerRadius)); } @@ -59,10 +62,10 @@ private static Image CloneAndConvertToAvatarWithoutApply(this Image result = image.Clone( ctx => ctx.Resize( - new ImageSharp.Processing.ResizeOptions + new ResizeOptions { Size = size, - Mode = ImageSharp.Processing.ResizeMode.Crop + Mode = ResizeMode.Crop })); ApplyRoundedCorners(result, cornerRadius); @@ -78,7 +81,7 @@ public static void ApplyRoundedCorners(Image img, float cornerRadius) // mutating in here as we already have a cloned original img.Mutate(x => x.Fill(Rgba32.Transparent, corners, new GraphicsOptions(true) { - BlenderMode = ImageSharp.PixelFormats.PixelBlenderMode.Src // enforces that any part of this shape that has color is punched out of the background + BlenderMode = PixelBlenderMode.Src // enforces that any part of this shape that has color is punched out of the background })); } diff --git a/samples/ChangeDefaultEncoderOptions/Program.cs b/samples/ChangeDefaultEncoderOptions/Program.cs index dab8d445ca..d4541043f9 100644 --- a/samples/ChangeDefaultEncoderOptions/Program.cs +++ b/samples/ChangeDefaultEncoderOptions/Program.cs @@ -1,6 +1,9 @@ -using System; -using ImageSharp; -using ImageSharp.Formats; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Formats; namespace ChangeDefaultEncoderOptions { @@ -10,7 +13,7 @@ static void Main(string[] args) { // lets switch out the default encoder for jpeg to one // that saves at 90 quality and ignores the matadata - Configuration.Default.SetEncoder(ImageFormats.Jpeg, new ImageSharp.Formats.JpegEncoder() + Configuration.Default.SetEncoder(ImageFormats.Jpeg, new JpegEncoder() { Quality = 90, IgnoreMetadata = true diff --git a/src/ImageSharp.Drawing/Brushes/Brushes.cs b/src/ImageSharp.Drawing/Brushes/Brushes.cs index e39f3dd497..47e207e8c4 100644 --- a/src/ImageSharp.Drawing/Brushes/Brushes.cs +++ b/src/ImageSharp.Drawing/Brushes/Brushes.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Brushes -{ - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Drawing.Brushes +{ /// /// A collection of methods for creating generic brushes. /// diff --git a/src/ImageSharp.Drawing/Brushes/IBrush.cs b/src/ImageSharp.Drawing/Brushes/IBrush.cs index 33b516e5c2..80393a08c1 100644 --- a/src/ImageSharp.Drawing/Brushes/IBrush.cs +++ b/src/ImageSharp.Drawing/Brushes/IBrush.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing -{ - using ImageSharp.PixelFormats; - using Processors; - using SixLabors.Primitives; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing +{ /// /// Brush represents a logical configuration of a brush which can be used to source pixel colors /// diff --git a/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs index 57fcd8ffa6..f04f16536d 100644 --- a/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Brushes/ImageBrush{TPixel}.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Brushes -{ - using System; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing.Brushes +{ /// /// Provides an implementation of an image brush for painting images within areas. /// diff --git a/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs index 5fcb92bdc7..8d3f74d6c6 100644 --- a/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Brushes/PatternBrush{TPixel}.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Brushes -{ - using System; - using System.Numerics; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using Processors; - using SixLabors.Primitives; +using System; +using System.Numerics; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing.Brushes +{ /// /// Provides an implementation of a pattern brush for painting patterns. /// diff --git a/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs b/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs index 29c625d7f8..34f4201457 100644 --- a/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs +++ b/src/ImageSharp.Drawing/Brushes/Processors/BrushApplicator.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Processors -{ - using System; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Drawing.Processors +{ /// /// primitive that converts a point in to a color for discovering the fill color based on an implementation /// diff --git a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs index 27aa99b975..d0fa81db38 100644 --- a/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Brushes/RecolorBrush{TPixel}.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Brushes -{ - using System; - using System.Numerics; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using Processors; - using SixLabors.Primitives; +using System; +using System.Numerics; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing.Brushes +{ /// /// Provides an implementation of a brush that can recolor an image /// diff --git a/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs b/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs index 21ebb88a04..22d8d805f5 100644 --- a/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs +++ b/src/ImageSharp.Drawing/Brushes/SolidBrush{TPixel}.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Brushes -{ - using System; - using System.Numerics; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using Processors; - using SixLabors.Primitives; +using System; +using System.Numerics; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing.Brushes +{ /// /// Provides an implementation of a solid brush for painting solid color areas. /// diff --git a/src/ImageSharp.Drawing/DrawImage.cs b/src/ImageSharp.Drawing/DrawImage.cs index a89fc7e6fd..d55e224162 100644 --- a/src/ImageSharp.Drawing/DrawImage.cs +++ b/src/ImageSharp.Drawing/DrawImage.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Drawing.Processors; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/FillRegion.cs b/src/ImageSharp.Drawing/FillRegion.cs index 829d7b8261..2e5d311c6d 100644 --- a/src/ImageSharp.Drawing/FillRegion.cs +++ b/src/ImageSharp.Drawing/FillRegion.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Drawing; - using Drawing.Brushes; - using Drawing.Processors; - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj b/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj index 10562b08ca..702c354cdd 100644 --- a/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj +++ b/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj @@ -3,18 +3,18 @@ An extension to ImageSharp that allows the drawing of images, paths, and text. ImageSharp.Drawing 1.0.0-alpha9 - James Jackson-South and contributors + Six Labor and contributors netstandard1.1 true true - ImageSharp.Drawing - ImageSharp.Drawing + SixLabors.ImageSharp.Drawing + SixLabors.ImageSharp.Drawing Image Draw Shape Path Font - https://raw.githubusercontent.com/JimBobSquarePants/ImageSharp/master/build/icons/imagesharp-logo-128.png - https://github.com/JimBobSquarePants/ImageSharp + https://raw.githubusercontent.com/SixLabor/ImageSharp/master/build/icons/imagesharp-logo-128.png + https://github.com/SixLabors/ImageSharp http://www.apache.org/licenses/LICENSE-2.0 git - https://github.com/JimBobSquarePants/ImageSharp + https://github.com/SixLabor/ImageSharp false false false @@ -30,19 +30,20 @@ - + - - + + All ..\..\ImageSharp.ruleset + SixLabors.ImageSharp.Drawing true diff --git a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs index 07cc832d71..de4fdd003b 100644 --- a/src/ImageSharp.Drawing/Paths/DrawBeziers.cs +++ b/src/ImageSharp.Drawing/Paths/DrawBeziers.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; - using Drawing; - using Drawing.Brushes; - using Drawing.Pens; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using SixLabors.Shapes; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/DrawLines.cs b/src/ImageSharp.Drawing/Paths/DrawLines.cs index 79a5037db7..e5d9a1b3b4 100644 --- a/src/ImageSharp.Drawing/Paths/DrawLines.cs +++ b/src/ImageSharp.Drawing/Paths/DrawLines.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; - using Drawing; - using Drawing.Brushes; - using Drawing.Pens; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using SixLabors.Shapes; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/DrawPath.cs b/src/ImageSharp.Drawing/Paths/DrawPath.cs index 91ad05894f..b6c821a60b 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPath.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPath.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Drawing; - using Drawing.Brushes; - using Drawing.Pens; - using ImageSharp.PixelFormats; - using SixLabors.Shapes; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs b/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs index 8ac048e3e3..a126663b05 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPathCollection.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Drawing; - using Drawing.Brushes; - using Drawing.Pens; - using ImageSharp.PixelFormats; - using SixLabors.Shapes; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/DrawPolygon.cs b/src/ImageSharp.Drawing/Paths/DrawPolygon.cs index 8033e6fb6b..771ea9e616 100644 --- a/src/ImageSharp.Drawing/Paths/DrawPolygon.cs +++ b/src/ImageSharp.Drawing/Paths/DrawPolygon.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; - using Drawing; - using Drawing.Brushes; - using Drawing.Pens; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using SixLabors.Shapes; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/DrawRectangle.cs b/src/ImageSharp.Drawing/Paths/DrawRectangle.cs index 720327270c..6b98d1f8e9 100644 --- a/src/ImageSharp.Drawing/Paths/DrawRectangle.cs +++ b/src/ImageSharp.Drawing/Paths/DrawRectangle.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Drawing; - using Drawing.Brushes; - using Drawing.Pens; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs b/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs index 0862882010..fff082f2d9 100644 --- a/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs +++ b/src/ImageSharp.Drawing/Paths/FillPathBuilder.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using Drawing; - using Drawing.Brushes; - using ImageSharp.PixelFormats; - using SixLabors.Shapes; +using System; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/FillPathCollection.cs b/src/ImageSharp.Drawing/Paths/FillPathCollection.cs index dd7d2cf3e3..b252b95d5b 100644 --- a/src/ImageSharp.Drawing/Paths/FillPathCollection.cs +++ b/src/ImageSharp.Drawing/Paths/FillPathCollection.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Drawing; - using Drawing.Brushes; - using ImageSharp.PixelFormats; - using SixLabors.Shapes; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/FillPaths.cs b/src/ImageSharp.Drawing/Paths/FillPaths.cs index 2cd6ab0fc4..f554ed7581 100644 --- a/src/ImageSharp.Drawing/Paths/FillPaths.cs +++ b/src/ImageSharp.Drawing/Paths/FillPaths.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Drawing; - using Drawing.Brushes; - using ImageSharp.PixelFormats; - using SixLabors.Shapes; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/FillPolygon.cs b/src/ImageSharp.Drawing/Paths/FillPolygon.cs index 2fc481b5cc..d8723bc31f 100644 --- a/src/ImageSharp.Drawing/Paths/FillPolygon.cs +++ b/src/ImageSharp.Drawing/Paths/FillPolygon.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; - using Drawing; - using Drawing.Brushes; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using SixLabors.Shapes; +using System; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/FillRectangle.cs b/src/ImageSharp.Drawing/Paths/FillRectangle.cs index 22cd1ac163..52578de178 100644 --- a/src/ImageSharp.Drawing/Paths/FillRectangle.cs +++ b/src/ImageSharp.Drawing/Paths/FillRectangle.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Drawing; - using Drawing.Brushes; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Paths/ShapePath.cs b/src/ImageSharp.Drawing/Paths/ShapePath.cs index ec4f222e09..61f1291c45 100644 --- a/src/ImageSharp.Drawing/Paths/ShapePath.cs +++ b/src/ImageSharp.Drawing/Paths/ShapePath.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing -{ - using System; - using System.Buffers; - using System.Numerics; - - using SixLabors.Shapes; +using System; +using System.Buffers; +using System.Numerics; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp.Drawing +{ /// /// A mapping between a and a region. /// diff --git a/src/ImageSharp.Drawing/Paths/ShapeRegion.cs b/src/ImageSharp.Drawing/Paths/ShapeRegion.cs index a7a72c4f3c..a303179e83 100644 --- a/src/ImageSharp.Drawing/Paths/ShapeRegion.cs +++ b/src/ImageSharp.Drawing/Paths/ShapeRegion.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing -{ - using System; - using System.Buffers; - using System.Numerics; - using ImageSharp.Memory; - using SixLabors.Primitives; - using SixLabors.Shapes; +using System; +using System.Buffers; +using System.Numerics; +using SixLabors.ImageSharp.Memory; +using SixLabors.Primitives; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp.Drawing +{ /// /// A mapping between a and a region. /// diff --git a/src/ImageSharp.Drawing/Pens/IPen.cs b/src/ImageSharp.Drawing/Pens/IPen.cs index 20ac53dafc..3a87bbeb47 100644 --- a/src/ImageSharp.Drawing/Pens/IPen.cs +++ b/src/ImageSharp.Drawing/Pens/IPen.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Pens -{ - using ImageSharp.PixelFormats; - using Processors; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Drawing.Pens +{ /// /// Interface representing a Pen /// diff --git a/src/ImageSharp.Drawing/Pens/Pens.cs b/src/ImageSharp.Drawing/Pens/Pens.cs index 364115cb77..c90e1b8329 100644 --- a/src/ImageSharp.Drawing/Pens/Pens.cs +++ b/src/ImageSharp.Drawing/Pens/Pens.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Pens -{ - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Drawing.Pens +{ /// /// Common Pen styles /// diff --git a/src/ImageSharp.Drawing/Pens/Pen{TPixel}.cs b/src/ImageSharp.Drawing/Pens/Pen{TPixel}.cs index 37cfff9e93..74e4c6596d 100644 --- a/src/ImageSharp.Drawing/Pens/Pen{TPixel}.cs +++ b/src/ImageSharp.Drawing/Pens/Pen{TPixel}.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Pens -{ - using System; - using System.Numerics; - - using ImageSharp.Drawing.Brushes; - using ImageSharp.PixelFormats; - using Processors; +using System; +using System.Numerics; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Drawing.Pens +{ /// /// Provides a pen that can apply a pattern to a line with a set brush and thickness /// diff --git a/src/ImageSharp.Drawing/PointInfo.cs b/src/ImageSharp.Drawing/PointInfo.cs index 7eff24fac8..bdc1917a7b 100644 --- a/src/ImageSharp.Drawing/PointInfo.cs +++ b/src/ImageSharp.Drawing/PointInfo.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing +namespace SixLabors.ImageSharp.Drawing { /// /// Returns details about how far away from the inside of a shape and the color the pixel could be. diff --git a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs index c5b92b4084..221cd9e39e 100644 --- a/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/DrawImageProcessor.cs @@ -1,19 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing.Processors +{ /// /// Combines two images together by blending the pixels. /// diff --git a/src/ImageSharp.Drawing/Processors/FillProcessor.cs b/src/ImageSharp.Drawing/Processors/FillProcessor.cs index 6eb12cf488..66463b590d 100644 --- a/src/ImageSharp.Drawing/Processors/FillProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/FillProcessor.cs @@ -1,21 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using Drawing; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing.Processors +{ /// /// Using the bursh as a source of pixels colors blends the brush color with source. /// diff --git a/src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs b/src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs index c398824323..7f7faa1111 100644 --- a/src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs +++ b/src/ImageSharp.Drawing/Processors/FillRegionProcessor.cs @@ -1,20 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing.Processors -{ - using System; - using System.Buffers; - using System.Runtime.CompilerServices; - using Drawing; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; +using System; +using System.Buffers; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing.Processors +{ /// /// Usinf a brsuh and a shape fills shape with contents of brush the /// diff --git a/src/ImageSharp.Drawing/Properties/AssemblyInfo.cs b/src/ImageSharp.Drawing/Properties/AssemblyInfo.cs index fba25a9dba..2891598b9b 100644 --- a/src/ImageSharp.Drawing/Properties/AssemblyInfo.cs +++ b/src/ImageSharp.Drawing/Properties/AssemblyInfo.cs @@ -1,6 +1,4 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// // Common values read from `AssemblyInfo.Common.cs` diff --git a/src/ImageSharp.Drawing/Region.cs b/src/ImageSharp.Drawing/Region.cs index 23028b9a8f..5d4d471f18 100644 --- a/src/ImageSharp.Drawing/Region.cs +++ b/src/ImageSharp.Drawing/Region.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing -{ - using System; - using SixLabors.Primitives; +using System; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Drawing +{ /// /// Represents a region of an image. /// diff --git a/src/ImageSharp.Drawing/Text/DrawText.Path.cs b/src/ImageSharp.Drawing/Text/DrawText.Path.cs index 8adab652fe..274b592058 100644 --- a/src/ImageSharp.Drawing/Text/DrawText.Path.cs +++ b/src/ImageSharp.Drawing/Text/DrawText.Path.cs @@ -1,19 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; - - using Drawing; - using Drawing.Brushes; - using Drawing.Pens; - using ImageSharp.PixelFormats; - using SixLabors.Fonts; - using SixLabors.Shapes; +using System.Numerics; +using SixLabors.Fonts; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Text/DrawText.cs b/src/ImageSharp.Drawing/Text/DrawText.cs index 340c88d5e2..c0105011e9 100644 --- a/src/ImageSharp.Drawing/Text/DrawText.cs +++ b/src/ImageSharp.Drawing/Text/DrawText.cs @@ -1,20 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; - - using Drawing; - using Drawing.Brushes; - using Drawing.Pens; - using ImageSharp.PixelFormats; - using SixLabors.Fonts; - using SixLabors.Primitives; - using SixLabors.Shapes; +using System.Numerics; +using SixLabors.Fonts; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using SixLabors.Shapes; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs b/src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs index e360e8aeed..c230a8c79e 100644 --- a/src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs +++ b/src/ImageSharp.Drawing/Text/TextGraphicsOptions.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Drawing -{ - using ImageSharp.PixelFormats; - using SixLabors.Fonts; +using SixLabors.Fonts; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Drawing +{ /// /// Options for influencing the drawing functions. /// diff --git a/src/ImageSharp/ApplyProcessors.cs b/src/ImageSharp/ApplyProcessors.cs index a04c02a428..1788332755 100644 --- a/src/ImageSharp/ApplyProcessors.cs +++ b/src/ImageSharp/ApplyProcessors.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/ColorSpaces/CieLab.cs b/src/ImageSharp/ColorSpaces/CieLab.cs index d382bbedb0..107be4cb2b 100644 --- a/src/ImageSharp/ColorSpaces/CieLab.cs +++ b/src/ImageSharp/ColorSpaces/CieLab.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents a CIE L*a*b* 1976 color. /// diff --git a/src/ImageSharp/ColorSpaces/CieLch.cs b/src/ImageSharp/ColorSpaces/CieLch.cs index 03cf80bf12..834ef56a89 100644 --- a/src/ImageSharp/ColorSpaces/CieLch.cs +++ b/src/ImageSharp/ColorSpaces/CieLch.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents the CIE L*C*h°, cylindrical form of the CIE L*a*b* 1976 color. /// diff --git a/src/ImageSharp/ColorSpaces/CieLchuv.cs b/src/ImageSharp/ColorSpaces/CieLchuv.cs index a4e8b424d7..f35914d641 100644 --- a/src/ImageSharp/ColorSpaces/CieLchuv.cs +++ b/src/ImageSharp/ColorSpaces/CieLchuv.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents the CIE L*C*h°, cylindrical form of the CIE L*u*v* 1976 color. /// diff --git a/src/ImageSharp/ColorSpaces/CieLuv.cs b/src/ImageSharp/ColorSpaces/CieLuv.cs index c3fd626e67..9b52517083 100644 --- a/src/ImageSharp/ColorSpaces/CieLuv.cs +++ b/src/ImageSharp/ColorSpaces/CieLuv.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// The CIE 1976 (L*, u*, v*) color space, commonly known by its abbreviation CIELUV, is a color space adopted by the International /// Commission on Illumination (CIE) in 1976, as a simple-to-compute transformation of the 1931 CIE XYZ color space, but which diff --git a/src/ImageSharp/ColorSpaces/CieXyChromaticityCoordinates.cs b/src/ImageSharp/ColorSpaces/CieXyChromaticityCoordinates.cs index d9bfe88cd7..d9767d45ea 100644 --- a/src/ImageSharp/ColorSpaces/CieXyChromaticityCoordinates.cs +++ b/src/ImageSharp/ColorSpaces/CieXyChromaticityCoordinates.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents the coordinates of CIEXY chromaticity space /// diff --git a/src/ImageSharp/ColorSpaces/CieXyy.cs b/src/ImageSharp/ColorSpaces/CieXyy.cs index 1578f1ac3e..d5ef4b15d3 100644 --- a/src/ImageSharp/ColorSpaces/CieXyy.cs +++ b/src/ImageSharp/ColorSpaces/CieXyy.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents an CIE xyY 1931 color /// diff --git a/src/ImageSharp/ColorSpaces/CieXyz.cs b/src/ImageSharp/ColorSpaces/CieXyz.cs index 8d3255e65d..908408000a 100644 --- a/src/ImageSharp/ColorSpaces/CieXyz.cs +++ b/src/ImageSharp/ColorSpaces/CieXyz.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents an CIE XYZ 1931 color /// diff --git a/src/ImageSharp/ColorSpaces/Cmyk.cs b/src/ImageSharp/ColorSpaces/Cmyk.cs index eeaef21bd5..2a58a5762a 100644 --- a/src/ImageSharp/ColorSpaces/Cmyk.cs +++ b/src/ImageSharp/ColorSpaces/Cmyk.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents an CMYK (cyan, magenta, yellow, keyline) color. /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/CieConstants.cs b/src/ImageSharp/ColorSpaces/Conversion/CieConstants.cs index 29200823e2..2bcdc5127f 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/CieConstants.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/CieConstants.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion +namespace SixLabors.ImageSharp.ColorSpaces.Conversion { /// /// Constants use for Cie conversion calculations diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Adapt.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Adapt.cs index acdb356a22..80f9e6789b 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Adapt.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Adapt.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using System; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.Rgb; +using System; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Performs chromatic adaptation on the various color spaces. /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs index 2c274c17a7..9268f3a70c 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLab.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.CieLab; - using ImageSharp.ColorSpaces.Conversion.Implementation.CieLch; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLabColorSapce; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLchColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs index e3b3975a4e..13dae4b174 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLch.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces.Conversion.Implementation.CieLch; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLchColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs index 7f2d184803..cef63e73d2 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLchuv.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces.Conversion.Implementation.CieLchuv; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLchuvColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs index dc63e7a67c..04aee4897b 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieLuv.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.CieLchuv; - using ImageSharp.ColorSpaces.Conversion.Implementation.CieLuv; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLchuvColorSapce; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLuvColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyy.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyy.cs index 6c4b6ca533..31e1e218ea 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyy.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyy.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces.Conversion.Implementation.CieXyy; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieXyyColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyz.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyz.cs index ca8b31d03d..e6847beafe 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyz.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.CieXyz.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.CieLab; - using ImageSharp.ColorSpaces.Conversion.Implementation.CieLuv; - using ImageSharp.ColorSpaces.Conversion.Implementation.HunterLab; - using ImageSharp.ColorSpaces.Conversion.Implementation.Rgb; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLabColorSapce; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLuvColorSapce; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HunterLabColorSapce; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Cmyk.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Cmyk.cs index 9cfa8f0c3d..637c121ea0 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Cmyk.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Cmyk.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.Cmyk; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CmykColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsl.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsl.cs index 9e4a8d9c34..dbc31c52b8 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsl.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsl.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.Hsl; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HslColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsv.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsv.cs index 80b235894b..640461505b 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsv.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Hsv.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.Hsv; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HsvColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.HunterLab.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.HunterLab.cs index b6d9d4cb98..f5ab4d645c 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.HunterLab.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.HunterLab.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces.Conversion.Implementation.HunterLab; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HunterLabColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.LinearRgb.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.LinearRgb.cs index 5fcc2cd5e7..7b45704afc 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.LinearRgb.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.LinearRgb.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces.Conversion.Implementation.Rgb; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Lms.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Lms.cs index 8d888182f9..ac3adee639 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Lms.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Lms.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Rgb.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Rgb.cs index 1cfd565e80..de13b97eb8 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Rgb.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.Rgb.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces.Conversion.Implementation.Rgb; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.YCbCr.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.YCbCr.cs index 6660f579a4..8da7dcb7ef 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.YCbCr.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.YCbCr.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.YCbCr; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.YCbCrColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Allows conversion to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.cs index a52207cb44..f86f505387 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/ColorSpaceConverter.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using System.Numerics; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.Lms; +using System.Numerics; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.LmsColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Converts between color spaces ensuring that the color is adapted using chromatic adaptation. /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/IChromaticAdaptation.cs b/src/ImageSharp/ColorSpaces/Conversion/IChromaticAdaptation.cs index aead65e590..c5d91f9a05 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/IChromaticAdaptation.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/IChromaticAdaptation.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Chromatic adaptation. /// A linear transformation of a source color (XS, YS, ZS) into a destination color (XD, YD, ZD) by a linear transformation [M] diff --git a/src/ImageSharp/ColorSpaces/Conversion/IColorConversion.cs b/src/ImageSharp/ColorSpaces/Conversion/IColorConversion.cs index 920fba18fa..9ef24b38af 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/IColorConversion.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/IColorConversion.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion +namespace SixLabors.ImageSharp.ColorSpaces.Conversion { /// /// Converts color between two color spaces. diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLab/CieLabToCieXyzConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLab/CieLabToCieXyzConverter.cs index 71b1596cac..75689d997c 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLab/CieLabToCieXyzConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLab/CieLabToCieXyzConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieLab -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLabColorSapce +{ /// /// Converts from to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLab/CieXyzToCieLabConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLab/CieXyzToCieLabConverter.cs index 8d877503a2..33a8dc7c8d 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLab/CieXyzToCieLabConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLab/CieXyzToCieLabConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieLab -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLabColorSapce +{ /// /// Converts from to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLch/CIeLchToCieLabConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLch/CIeLchToCieLabConverter.cs index 5b63b167e7..3884d9480a 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLch/CIeLchToCieLabConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLch/CIeLchToCieLabConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieLch -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLchColorSapce +{ /// /// Converts from to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLch/CieLabToCieLchConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLch/CieLabToCieLchConverter.cs index b93dce75a3..50332ebdcf 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLch/CieLabToCieLchConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLch/CieLabToCieLchConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieLch -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLchColorSapce +{ /// /// Converts from to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLchuv/CieLchuvToCieLuvConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLchuv/CieLchuvToCieLuvConverter.cs index 3e399016a9..ceadb01957 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLchuv/CieLchuvToCieLuvConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLchuv/CieLchuvToCieLuvConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieLchuv -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLchuvColorSapce +{ /// /// Converts from to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLchuv/CieLuvToCieLchuvConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLchuv/CieLuvToCieLchuvConverter.cs index 5339f1bcda..d301519208 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLchuv/CieLuvToCieLchuvConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLchuv/CieLuvToCieLchuvConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieLchuv -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLchuvColorSapce +{ /// /// Converts from to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLuv/CieLuvToCieXyzConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLuv/CieLuvToCieXyzConverter.cs index 36c458828d..4fb8fdc809 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLuv/CieLuvToCieXyzConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLuv/CieLuvToCieXyzConverter.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieLuv -{ - using System.Runtime.CompilerServices; - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLuvColorSapce +{ /// /// Converts from to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLuv/CieXyzToCieLuvConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLuv/CieXyzToCieLuvConverter.cs index 3883f3a1ec..82b1b1d3f7 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLuv/CieXyzToCieLuvConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieLuv/CieXyzToCieLuvConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieLuv -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieLuvColorSapce +{ /// /// Converts from to . /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieXyy/CieXyzAndCieXyyConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieXyy/CieXyzAndCieXyyConverter.cs index dc4a5ccf4a..31868ec11a 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieXyy/CieXyzAndCieXyyConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/CieXyy/CieXyzAndCieXyyConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.CieXyy -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CieXyyColorSapce +{ /// /// Color converter between CIE XYZ and CIE xyY /// for formulas. diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Cmyk/CmykAndRgbConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Cmyk/CmykAndRgbConverter.cs index b50e89b18c..404bc811ff 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Cmyk/CmykAndRgbConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Cmyk/CmykAndRgbConverter.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Cmyk -{ - using System; - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.CmykColorSapce +{ /// /// Color converter between CMYK and Rgb /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Hsl/HslAndRgbConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Hsl/HslAndRgbConverter.cs index 6c72cf294a..917cd3bf8a 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Hsl/HslAndRgbConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Hsl/HslAndRgbConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Hsl -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HslColorSapce +{ /// /// Color converter between HSL and Rgb /// See for formulas. diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Hsv/HsvAndRgbConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Hsv/HsvAndRgbConverter.cs index 54c8e405f0..6219533ca5 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Hsv/HsvAndRgbConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Hsv/HsvAndRgbConverter.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Hsv -{ - using System; - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HsvColorSapce +{ /// /// Color converter between HSV and Rgb /// See for formulas. diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/CieXyzAndHunterLabConverterBase.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/CieXyzAndHunterLabConverterBase.cs index 19fc78e9a2..85b0efd16a 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/CieXyzAndHunterLabConverterBase.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/CieXyzAndHunterLabConverterBase.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.HunterLab -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HunterLabColorSapce +{ /// /// The base class for converting between and color spaces. /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/CieXyzToHunterLabConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/CieXyzToHunterLabConverter.cs index 7f2df8336e..8905a0a30f 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/CieXyzToHunterLabConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/CieXyzToHunterLabConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.HunterLab -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HunterLabColorSapce +{ /// /// Color converter between CieXyz and HunterLab /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/HunterLabToCieXyzConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/HunterLabToCieXyzConverter.cs index af7f4f3708..2cd379d853 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/HunterLabToCieXyzConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/HunterLab/HunterLabToCieXyzConverter.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.HunterLab -{ - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.HunterLabColorSapce +{ /// /// Color converter between HunterLab and CieXyz /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Lms/CieXyzAndLmsConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Lms/CieXyzAndLmsConverter.cs index c856c7ff74..780c9e5a6e 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Lms/CieXyzAndLmsConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Lms/CieXyzAndLmsConverter.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Lms -{ - using System.Numerics; - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.LmsColorSapce +{ /// /// Color converter between CIE XYZ and LMS /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Lms/LmsAdaptationMatrix.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Lms/LmsAdaptationMatrix.cs index 279044baa7..1bd0c4ad50 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Lms/LmsAdaptationMatrix.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Lms/LmsAdaptationMatrix.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System.Numerics; // ReSharper disable InconsistentNaming -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Lms +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.LmsColorSapce { - using System.Numerics; - /// /// AdaptionMatrix3X3 used for transformation from XYZ to LMS, defining the cone response domain. /// Used in diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/CieXyzToLinearRgbConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/CieXyzToLinearRgbConverter.cs index c5c6124091..fd76a30fb8 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/CieXyzToLinearRgbConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/CieXyzToLinearRgbConverter.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Numerics; - - using Rgb = ImageSharp.ColorSpaces.Rgb; +using System.Numerics; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Color converter between CieXyz and LinearRgb /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/GammaCompanding.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/GammaCompanding.cs index 08200ce6bd..21a80225ee 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/GammaCompanding.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/GammaCompanding.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Implements gamma companding /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LCompanding.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LCompanding.cs index bbf12ca005..c73a3486ed 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LCompanding.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LCompanding.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Implements L* companding /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbAndCieXyzConverterBase.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbAndCieXyzConverterBase.cs index 4c46e4d8c7..2ec79b353b 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbAndCieXyzConverterBase.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbAndCieXyzConverterBase.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Numerics; +using System.Numerics; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Provides base methods for converting between Rgb and CieXyz color spaces. /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbToCieXyzConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbToCieXyzConverter.cs index 4a04185e84..19d4130373 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbToCieXyzConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbToCieXyzConverter.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Numerics; - - using Rgb = ImageSharp.ColorSpaces.Rgb; +using System.Numerics; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Color converter between LinearRgb and CieXyz /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbToRgbConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbToRgbConverter.cs index cf4638ae71..29ea0f3148 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbToRgbConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/LinearRgbToRgbConverter.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Numerics; - - using Rgb = ColorSpaces.Rgb; +using System.Numerics; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Color converter between LinearRgb and Rgb /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RGBPrimariesChromaticityCoordinates.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RGBPrimariesChromaticityCoordinates.cs index 0148b91d5f..d279aba850 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RGBPrimariesChromaticityCoordinates.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RGBPrimariesChromaticityCoordinates.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System; +using System; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Represents the chromaticity coordinates of RGB primaries. /// One of the specifiers of . diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/Rec2020Companding.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/Rec2020Companding.cs index 630faedcae..f393b133ce 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/Rec2020Companding.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/Rec2020Companding.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Implements Rec. 2020 companding function (for 12-bits). /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/Rec709Companding.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/Rec709Companding.cs index 24dd6ca17b..ba1b1379ef 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/Rec709Companding.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/Rec709Companding.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Implements the Rec. 709 companding function /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RgbToLinearRgbConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RgbToLinearRgbConverter.cs index 0d0d588288..e40ecc192e 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RgbToLinearRgbConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RgbToLinearRgbConverter.cs @@ -1,14 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Numerics; - - using Rgb = ColorSpaces.Rgb; +using System.Numerics; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Color converter between Rgb and LinearRgb /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RgbWorkingSpace.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RgbWorkingSpace.cs index 89e403e761..8a2c66a80c 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RgbWorkingSpace.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/RgbWorkingSpace.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce { /// /// Trivial implementation of diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/SRgbCompanding.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/SRgbCompanding.cs index 18ec94c51d..1e49c11591 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/SRgbCompanding.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/Rgb/SRgbCompanding.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.Rgb -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce +{ /// /// Implements sRGB companding /// diff --git a/src/ImageSharp/ColorSpaces/Conversion/Implementation/YCbCr/YCbCrAndRgbConverter.cs b/src/ImageSharp/ColorSpaces/Conversion/Implementation/YCbCr/YCbCrAndRgbConverter.cs index e58da580d7..f552acbb48 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/Implementation/YCbCr/YCbCrAndRgbConverter.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/Implementation/YCbCr/YCbCrAndRgbConverter.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion.Implementation.YCbCr -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - - using ImageSharp.ColorSpaces; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.ColorSpaces; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.YCbCrColorSapce +{ /// /// Color converter between YCbCr and Rgb /// See for formulas. diff --git a/src/ImageSharp/ColorSpaces/Conversion/VonKriesChromaticAdaptation.cs b/src/ImageSharp/ColorSpaces/Conversion/VonKriesChromaticAdaptation.cs index 55d1d65a3c..6edae93017 100644 --- a/src/ImageSharp/ColorSpaces/Conversion/VonKriesChromaticAdaptation.cs +++ b/src/ImageSharp/ColorSpaces/Conversion/VonKriesChromaticAdaptation.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces.Conversion -{ - using System.Numerics; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion.Implementation.Lms; +using System.Numerics; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.LmsColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces.Conversion +{ /// /// Basic implementation of the von Kries chromatic adaptation model /// diff --git a/src/ImageSharp/ColorSpaces/Hsl.cs b/src/ImageSharp/ColorSpaces/Hsl.cs index 5bbbeec308..cf880f1548 100644 --- a/src/ImageSharp/ColorSpaces/Hsl.cs +++ b/src/ImageSharp/ColorSpaces/Hsl.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents a Hsl (hue, saturation, lightness) color. /// diff --git a/src/ImageSharp/ColorSpaces/Hsv.cs b/src/ImageSharp/ColorSpaces/Hsv.cs index dcbb73692b..9f47393792 100644 --- a/src/ImageSharp/ColorSpaces/Hsv.cs +++ b/src/ImageSharp/ColorSpaces/Hsv.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents a HSV (hue, saturation, value) color. Also known as HSB (hue, saturation, brightness). /// diff --git a/src/ImageSharp/ColorSpaces/HunterLab.cs b/src/ImageSharp/ColorSpaces/HunterLab.cs index 2b49ee944d..b5ba7c86c7 100644 --- a/src/ImageSharp/ColorSpaces/HunterLab.cs +++ b/src/ImageSharp/ColorSpaces/HunterLab.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents an Hunter LAB color. /// diff --git a/src/ImageSharp/ColorSpaces/IAlmostEquatable.cs b/src/ImageSharp/ColorSpaces/IAlmostEquatable.cs index a67eaeb064..3f62f75acb 100644 --- a/src/ImageSharp/ColorSpaces/IAlmostEquatable.cs +++ b/src/ImageSharp/ColorSpaces/IAlmostEquatable.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; +using System; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Defines a generalized method that a value type or class implements to create /// a type-specific method for determining approximate equality of instances. diff --git a/src/ImageSharp/ColorSpaces/IColorVector.cs b/src/ImageSharp/ColorSpaces/IColorVector.cs index 08b70e4829..3903e1c098 100644 --- a/src/ImageSharp/ColorSpaces/IColorVector.cs +++ b/src/ImageSharp/ColorSpaces/IColorVector.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System.Numerics; +using System.Numerics; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Color represented as a vector in its color space /// diff --git a/src/ImageSharp/ColorSpaces/ICompanding.cs b/src/ImageSharp/ColorSpaces/ICompanding.cs index e4f0e4a4c2..2dfa575ed9 100644 --- a/src/ImageSharp/ColorSpaces/ICompanding.cs +++ b/src/ImageSharp/ColorSpaces/ICompanding.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces +namespace SixLabors.ImageSharp.ColorSpaces { /// /// Pair of companding functions for . diff --git a/src/ImageSharp/ColorSpaces/IRgbWorkingSpace.cs b/src/ImageSharp/ColorSpaces/IRgbWorkingSpace.cs index 2360854349..156e94ed3c 100644 --- a/src/ImageSharp/ColorSpaces/IRgbWorkingSpace.cs +++ b/src/ImageSharp/ColorSpaces/IRgbWorkingSpace.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - - using ImageSharp.ColorSpaces.Conversion.Implementation.Rgb; +using System; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Encasulates the RGB working color space /// diff --git a/src/ImageSharp/ColorSpaces/Illuminants.cs b/src/ImageSharp/ColorSpaces/Illuminants.cs index 224cf99392..85c4063bf4 100644 --- a/src/ImageSharp/ColorSpaces/Illuminants.cs +++ b/src/ImageSharp/ColorSpaces/Illuminants.cs @@ -1,4 +1,7 @@ -namespace ImageSharp.ColorSpaces +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +namespace SixLabors.ImageSharp.ColorSpaces { /// /// The well known standard illuminants. diff --git a/src/ImageSharp/ColorSpaces/LinearRgb.cs b/src/ImageSharp/ColorSpaces/LinearRgb.cs index fdfc0d2660..07889c3529 100644 --- a/src/ImageSharp/ColorSpaces/LinearRgb.cs +++ b/src/ImageSharp/ColorSpaces/LinearRgb.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents an linear Rgb color with specified working space /// diff --git a/src/ImageSharp/ColorSpaces/Lms.cs b/src/ImageSharp/ColorSpaces/Lms.cs index c76d87253c..82c291de3d 100644 --- a/src/ImageSharp/ColorSpaces/Lms.cs +++ b/src/ImageSharp/ColorSpaces/Lms.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// LMS is a color space represented by the response of the three types of cones of the human eye, /// named after their responsivity (sensitivity) at long, medium and short wavelengths. diff --git a/src/ImageSharp/ColorSpaces/Rgb.cs b/src/ImageSharp/ColorSpaces/Rgb.cs index 898c81730a..8ac8411b20 100644 --- a/src/ImageSharp/ColorSpaces/Rgb.cs +++ b/src/ImageSharp/ColorSpaces/Rgb.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents an RGB color with specified working space /// diff --git a/src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs b/src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs index 20b9373948..098ca9a4a4 100644 --- a/src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs +++ b/src/ImageSharp/ColorSpaces/RgbWorkingSpaces.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce; // ReSharper disable InconsistentNaming -namespace ImageSharp.ColorSpaces +namespace SixLabors.ImageSharp.ColorSpaces { - using ImageSharp.ColorSpaces.Conversion.Implementation.Rgb; - /// /// Chromaticity coordinates taken from: /// diff --git a/src/ImageSharp/ColorSpaces/YCbCr.cs b/src/ImageSharp/ColorSpaces/YCbCr.cs index cbba023056..708a74308a 100644 --- a/src/ImageSharp/ColorSpaces/YCbCr.cs +++ b/src/ImageSharp/ColorSpaces/YCbCr.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.ColorSpaces -{ - using System; - using System.ComponentModel; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.ComponentModel; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.ColorSpaces +{ /// /// Represents an YCbCr (luminance, blue chroma, red chroma) color as defined in the ITU-T T.871 specification for the JFIF use with Jpeg. /// diff --git a/src/ImageSharp/Common/Constants.cs b/src/ImageSharp/Common/Constants.cs index cf43951bc5..41f2bce247 100644 --- a/src/ImageSharp/Common/Constants.cs +++ b/src/ImageSharp/Common/Constants.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Common constants used throughout the project diff --git a/src/ImageSharp/Common/Exceptions/ImageFormatException.cs b/src/ImageSharp/Common/Exceptions/ImageFormatException.cs index 32a0854359..7a91756b62 100644 --- a/src/ImageSharp/Common/Exceptions/ImageFormatException.cs +++ b/src/ImageSharp/Common/Exceptions/ImageFormatException.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// The exception that is thrown when the library tries to load /// an image, which has an invalid format. diff --git a/src/ImageSharp/Common/Exceptions/ImageProcessingException.cs b/src/ImageSharp/Common/Exceptions/ImageProcessingException.cs index ef84a1e393..eb50d0b654 100644 --- a/src/ImageSharp/Common/Exceptions/ImageProcessingException.cs +++ b/src/ImageSharp/Common/Exceptions/ImageProcessingException.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// The exception that is thrown when an error occurs when applying a process to an image. /// diff --git a/src/ImageSharp/Common/Extensions/ByteExtensions.cs b/src/ImageSharp/Common/Extensions/ByteExtensions.cs index f1161eb6f6..f6c7207950 100644 --- a/src/ImageSharp/Common/Extensions/ByteExtensions.cs +++ b/src/ImageSharp/Common/Extensions/ByteExtensions.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Runtime.CompilerServices; - - using ImageSharp.PixelFormats; +using System; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the struct buffers. /// diff --git a/src/ImageSharp/Common/Extensions/ComparableExtensions.cs b/src/ImageSharp/Common/Extensions/ComparableExtensions.cs index d463301025..8bebb3de79 100644 --- a/src/ImageSharp/Common/Extensions/ComparableExtensions.cs +++ b/src/ImageSharp/Common/Extensions/ComparableExtensions.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for classes that implement . /// diff --git a/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs b/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs index af8e50c7be..f20f1a63e0 100644 --- a/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs +++ b/src/ImageSharp/Common/Extensions/EnumerableExtensions.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Generic; +using System; +using System.Collections.Generic; +namespace SixLabors.ImageSharp +{ /// /// Encapsulates a series of time saving extension methods to the interface. /// diff --git a/src/ImageSharp/Common/Extensions/StreamExtensions.cs b/src/ImageSharp/Common/Extensions/StreamExtensions.cs index 6de94dd229..94445a1773 100644 --- a/src/ImageSharp/Common/Extensions/StreamExtensions.cs +++ b/src/ImageSharp/Common/Extensions/StreamExtensions.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Buffers; - using System.IO; +using System.Buffers; +using System.IO; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Common/Extensions/Vector4Extensions.cs b/src/ImageSharp/Common/Extensions/Vector4Extensions.cs index fac33da140..5fbc3960a3 100644 --- a/src/ImageSharp/Common/Extensions/Vector4Extensions.cs +++ b/src/ImageSharp/Common/Extensions/Vector4Extensions.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; - using System.Runtime.CompilerServices; - using ImageSharp.PixelFormats; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the struct. /// diff --git a/src/ImageSharp/Common/Helpers/DebugGuard.cs b/src/ImageSharp/Common/Helpers/DebugGuard.cs index f6941fc6fc..dc3cff7a2b 100644 --- a/src/ImageSharp/Common/Helpers/DebugGuard.cs +++ b/src/ImageSharp/Common/Helpers/DebugGuard.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Diagnostics; +using System; +using System.Diagnostics; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to protect against invalid parameters for a DEBUG build. /// diff --git a/src/ImageSharp/Common/Helpers/Guard.cs b/src/ImageSharp/Common/Helpers/Guard.cs index 8e55c18af8..b0546bf9a9 100644 --- a/src/ImageSharp/Common/Helpers/Guard.cs +++ b/src/ImageSharp/Common/Helpers/Guard.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.Linq; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to protect against invalid parameters. /// diff --git a/src/ImageSharp/Common/Helpers/ImageMaths.cs b/src/ImageSharp/Common/Helpers/ImageMaths.cs index 367aa12d00..8cf220b300 100644 --- a/src/ImageSharp/Common/Helpers/ImageMaths.cs +++ b/src/ImageSharp/Common/Helpers/ImageMaths.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - using System.Numerics; - using System.Runtime.CompilerServices; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Provides common mathematical methods. /// diff --git a/src/ImageSharp/Common/Helpers/MathF.cs b/src/ImageSharp/Common/Helpers/MathF.cs index 5ce5b5d5dd..7d2f8063fa 100644 --- a/src/ImageSharp/Common/Helpers/MathF.cs +++ b/src/ImageSharp/Common/Helpers/MathF.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp +{ /// /// Provides single-precision floating point constants and static methods for trigonometric, logarithmic, and other common mathematical functions. /// diff --git a/src/ImageSharp/Configuration.cs b/src/ImageSharp/Configuration.cs index ef1e1705c6..2a2351e500 100644 --- a/src/ImageSharp/Configuration.cs +++ b/src/ImageSharp/Configuration.cs @@ -1,19 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - - using Formats; - using ImageSharp.IO; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.IO; +namespace SixLabors.ImageSharp +{ /// /// Provides initialization code which allows extending the library. /// diff --git a/src/ImageSharp/DefaultInternalImageProcessorContext.cs b/src/ImageSharp/DefaultInternalImageProcessorContext.cs index 4b919db14e..8eb1c09fee 100644 --- a/src/ImageSharp/DefaultInternalImageProcessorContext.cs +++ b/src/ImageSharp/DefaultInternalImageProcessorContext.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Performs processor application operations on the source image /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs index 629944ea15..dc15cdcd35 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Atkinson.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Applies error diffusion based dithering using the Atkinson image dithering algorithm. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs index 02d41c369e..66697aab76 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Burks.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Applies error diffusion based dithering using the Burks image dithering algorithm. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuser.cs b/src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuser.cs index 408e6c383e..8d05bfcb64 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuser.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/ErrorDiffuser.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Dithering +{ /// /// The base class for performing error diffusion based dithering. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs b/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs index 6165da6344..5422d83bb8 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/FloydSteinberg.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Applies error diffusion based dithering using the Floyd–Steinberg image dithering algorithm. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/IErrorDiffuser.cs b/src/ImageSharp/Dithering/ErrorDiffusion/IErrorDiffuser.cs index bc785e8971..57eea6b921 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/IErrorDiffuser.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/IErrorDiffuser.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Encapsulates properties and methods required to perfom diffused error dithering on an image. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs b/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs index 6daeab32f7..637240a124 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/JarvisJudiceNinke.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Applies error diffusion based dithering using the JarvisJudiceNinke image dithering algorithm. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs index 0c0944d0eb..db37b45afc 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra2.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Applies error diffusion based dithering using the Sierra2 image dithering algorithm. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs index 2e22208462..f812fcdc30 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Sierra3.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Applies error diffusion based dithering using the Sierra3 image dithering algorithm. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs b/src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs index fe4c933a9f..98af7b432b 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/SierraLite.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Applies error diffusion based dithering using the SierraLite image dithering algorithm. /// diff --git a/src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs b/src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs index b04c164814..2f94639be8 100644 --- a/src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs +++ b/src/ImageSharp/Dithering/ErrorDiffusion/Stucki.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Applies error diffusion based dithering using the Stucki image dithering algorithm. /// diff --git a/src/ImageSharp/Dithering/Ordered/Bayer.cs b/src/ImageSharp/Dithering/Ordered/Bayer.cs index ded17d1e10..cfbdb0888a 100644 --- a/src/ImageSharp/Dithering/Ordered/Bayer.cs +++ b/src/ImageSharp/Dithering/Ordered/Bayer.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering.Ordered -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering.Ordered +{ /// /// Applies error diffusion based dithering using the 4x4 Bayer dithering matrix. /// diff --git a/src/ImageSharp/Dithering/Ordered/IOrderedDither.cs b/src/ImageSharp/Dithering/Ordered/IOrderedDither.cs index c69cddefed..fbd51a2539 100644 --- a/src/ImageSharp/Dithering/Ordered/IOrderedDither.cs +++ b/src/ImageSharp/Dithering/Ordered/IOrderedDither.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering -{ - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Dithering +{ /// /// Encapsulates properties and methods required to perfom ordered dithering on an image. /// diff --git a/src/ImageSharp/Dithering/Ordered/Ordered.cs b/src/ImageSharp/Dithering/Ordered/Ordered.cs index 1fd39eb8ba..4b559c4e12 100644 --- a/src/ImageSharp/Dithering/Ordered/Ordered.cs +++ b/src/ImageSharp/Dithering/Ordered/Ordered.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering.Ordered -{ - using ImageSharp.Memory; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Dithering.Ordered +{ /// /// Applies error diffusion based dithering using the 4x4 ordered dithering matrix. /// diff --git a/src/ImageSharp/Dithering/Ordered/OrderedDither4x4.cs b/src/ImageSharp/Dithering/Ordered/OrderedDither4x4.cs index a180888f70..94292b7b51 100644 --- a/src/ImageSharp/Dithering/Ordered/OrderedDither4x4.cs +++ b/src/ImageSharp/Dithering/Ordered/OrderedDither4x4.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Dithering.Ordered -{ - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Dithering.Ordered +{ /// /// The base class for performing ordered ditheroing using a 4x4 matrix. /// diff --git a/src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs b/src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs index 330326acfc..5ea9baa164 100644 --- a/src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs +++ b/src/ImageSharp/Formats/Bmp/BmpBitsPerPixel.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Enumerates the available bits per pixel for bitmap. diff --git a/src/ImageSharp/Formats/Bmp/BmpCompression.cs b/src/ImageSharp/Formats/Bmp/BmpCompression.cs index a9246d449e..e2a73639d1 100644 --- a/src/ImageSharp/Formats/Bmp/BmpCompression.cs +++ b/src/ImageSharp/Formats/Bmp/BmpCompression.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Defines how the compression type of the image data diff --git a/src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs b/src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs index f70ff1a56d..46340fa85f 100644 --- a/src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs +++ b/src/ImageSharp/Formats/Bmp/BmpConfigurationModule.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Registers the image encoders, decoders and mime type detectors for the bmp format. diff --git a/src/ImageSharp/Formats/Bmp/BmpConstants.cs b/src/ImageSharp/Formats/Bmp/BmpConstants.cs index d394b61f6e..15187e9691 100644 --- a/src/ImageSharp/Formats/Bmp/BmpConstants.cs +++ b/src/ImageSharp/Formats/Bmp/BmpConstants.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.Formats +{ /// /// Defines constants relating to BMPs /// diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoder.cs b/src/ImageSharp/Formats/Bmp/BmpDecoder.cs index 5baf1b1a5a..1b015f8e64 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoder.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoder.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image decoder for generating an image out of a Windows bitmap stream. /// diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs index 817d00f7e7..f26476222f 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.IO; - using System.Runtime.CompilerServices; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.IO; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Performs the bmp decoding operation. /// diff --git a/src/ImageSharp/Formats/Bmp/BmpEncoder.cs b/src/ImageSharp/Formats/Bmp/BmpEncoder.cs index dfba0b41c0..a0db29d7a0 100644 --- a/src/ImageSharp/Formats/Bmp/BmpEncoder.cs +++ b/src/ImageSharp/Formats/Bmp/BmpEncoder.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image encoder for writing an image to a stream as a Windows bitmap. /// diff --git a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs index e41c295012..67754a175a 100644 --- a/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpEncoderCore.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.IO; - - using ImageSharp.PixelFormats; - - using IO; +using System; +using System.IO; +using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image encoder for writing an image to a stream as a Windows bitmap. /// diff --git a/src/ImageSharp/Formats/Bmp/BmpFileHeader.cs b/src/ImageSharp/Formats/Bmp/BmpFileHeader.cs index f9b20a48f8..7fe8cd458b 100644 --- a/src/ImageSharp/Formats/Bmp/BmpFileHeader.cs +++ b/src/ImageSharp/Formats/Bmp/BmpFileHeader.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Stores general information about the Bitmap file. diff --git a/src/ImageSharp/Formats/Bmp/BmpFormat.cs b/src/ImageSharp/Formats/Bmp/BmpFormat.cs index bd25eb9b75..447bf6cb0b 100644 --- a/src/ImageSharp/Formats/Bmp/BmpFormat.cs +++ b/src/ImageSharp/Formats/Bmp/BmpFormat.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.Formats +{ /// /// Registers the image encoders, decoders and mime type detectors for the bmp format. /// diff --git a/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs b/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs index 697ee0f981..6bd1f9d289 100644 --- a/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Bmp/BmpImageFormatDetector.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats +{ /// /// Detects bmp file headers /// diff --git a/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs b/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs index dc6a489d34..d5c9213131 100644 --- a/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs +++ b/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// This block of bytes tells the application detailed information diff --git a/src/ImageSharp/Formats/Bmp/IBmpDecoderOptions.cs b/src/ImageSharp/Formats/Bmp/IBmpDecoderOptions.cs index 9285b9cf7a..08b47c0e1c 100644 --- a/src/ImageSharp/Formats/Bmp/IBmpDecoderOptions.cs +++ b/src/ImageSharp/Formats/Bmp/IBmpDecoderOptions.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image decoder options for decoding Windows bitmap streams. /// diff --git a/src/ImageSharp/Formats/Bmp/IBmpEncoderOptions.cs b/src/ImageSharp/Formats/Bmp/IBmpEncoderOptions.cs index dd17043fad..c89b2b25c0 100644 --- a/src/ImageSharp/Formats/Bmp/IBmpEncoderOptions.cs +++ b/src/ImageSharp/Formats/Bmp/IBmpEncoderOptions.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Configuration options for use during bmp encoding /// diff --git a/src/ImageSharp/Formats/Bmp/ImageExtensions.cs b/src/ImageSharp/Formats/Bmp/ImageExtensions.cs index 96d0ceb9f2..d80abb51e3 100644 --- a/src/ImageSharp/Formats/Bmp/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Bmp/ImageExtensions.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.IO; - - using Formats; - - using ImageSharp.PixelFormats; +using System; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Formats/Gif/DisposalMethod.cs b/src/ImageSharp/Formats/Gif/DisposalMethod.cs index 80b5f3c6e7..94cf820882 100644 --- a/src/ImageSharp/Formats/Gif/DisposalMethod.cs +++ b/src/ImageSharp/Formats/Gif/DisposalMethod.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Provides enumeration for instructing the decoder what to do with the last image diff --git a/src/ImageSharp/Formats/Gif/GifConfigurationModule.cs b/src/ImageSharp/Formats/Gif/GifConfigurationModule.cs index ee134d66cd..676363bbeb 100644 --- a/src/ImageSharp/Formats/Gif/GifConfigurationModule.cs +++ b/src/ImageSharp/Formats/Gif/GifConfigurationModule.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Registers the image encoders, decoders and mime type detectors for the gif format. diff --git a/src/ImageSharp/Formats/Gif/GifConstants.cs b/src/ImageSharp/Formats/Gif/GifConstants.cs index 9bec6c48f9..e65d33c72c 100644 --- a/src/ImageSharp/Formats/Gif/GifConstants.cs +++ b/src/ImageSharp/Formats/Gif/GifConstants.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; - using System.Text; +using System.Collections.Generic; +using System.Text; +namespace SixLabors.ImageSharp.Formats +{ /// /// Constants that define specific points within a gif. /// diff --git a/src/ImageSharp/Formats/Gif/GifDecoder.cs b/src/ImageSharp/Formats/Gif/GifDecoder.cs index 927289094f..9322cec8d0 100644 --- a/src/ImageSharp/Formats/Gif/GifDecoder.cs +++ b/src/ImageSharp/Formats/Gif/GifDecoder.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Decoder for generating an image out of a gif encoded stream. /// diff --git a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs index 948103fed2..1547046582 100644 --- a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs @@ -1,19 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Buffers; - using System.IO; - using System.Runtime.CompilerServices; - using System.Text; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Buffers; +using System.IO; +using System.Runtime.CompilerServices; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Formats +{ /// /// Performs the gif decoding operation. /// diff --git a/src/ImageSharp/Formats/Gif/GifEncoder.cs b/src/ImageSharp/Formats/Gif/GifEncoder.cs index b48db56356..2dde83d9fe 100644 --- a/src/ImageSharp/Formats/Gif/GifEncoder.cs +++ b/src/ImageSharp/Formats/Gif/GifEncoder.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; - using ImageSharp.PixelFormats; - using ImageSharp.Quantizers; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image encoder for writing image data to a stream in gif format. /// diff --git a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs index 81b3cfba4a..8105c695db 100644 --- a/src/ImageSharp/Formats/Gif/GifEncoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifEncoderCore.cs @@ -1,20 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Buffers; - using System.IO; - using System.Linq; - using System.Text; - using ImageSharp.PixelFormats; - - using IO; - using Quantizers; +using System; +using System.Buffers; +using System.IO; +using System.Linq; +using System.Text; +using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers; +namespace SixLabors.ImageSharp.Formats +{ /// /// Performs the gif encoding operation. /// diff --git a/src/ImageSharp/Formats/Gif/GifFormat.cs b/src/ImageSharp/Formats/Gif/GifFormat.cs index 744aadff9a..887081fc7a 100644 --- a/src/ImageSharp/Formats/Gif/GifFormat.cs +++ b/src/ImageSharp/Formats/Gif/GifFormat.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.Formats +{ /// /// Registers the image encoders, decoders and mime type detectors for the gif format. /// diff --git a/src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs b/src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs index 04fcfc516c..7f908ad983 100644 --- a/src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Gif/GifImageFormatDetector.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats +{ /// /// Detects gif file headers /// diff --git a/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs b/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs index caaa8932bb..c5ba972de6 100644 --- a/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs +++ b/src/ImageSharp/Formats/Gif/IGifDecoderOptions.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Decoder for generating an image out of a gif encoded stream. /// diff --git a/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs b/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs index c38ec7e451..1b8cf166e8 100644 --- a/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs +++ b/src/ImageSharp/Formats/Gif/IGifEncoderOptions.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; - using ImageSharp.PixelFormats; - using ImageSharp.Quantizers; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers; +namespace SixLabors.ImageSharp.Formats +{ /// /// The configuration options used for encoding gifs /// diff --git a/src/ImageSharp/Formats/Gif/ImageExtensions.cs b/src/ImageSharp/Formats/Gif/ImageExtensions.cs index 717df44238..cfdd544c71 100644 --- a/src/ImageSharp/Formats/Gif/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Gif/ImageExtensions.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.IO; - - using Formats; - - using ImageSharp.PixelFormats; +using System; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Formats/Gif/LzwDecoder.cs b/src/ImageSharp/Formats/Gif/LzwDecoder.cs index bc0e9717c6..fcc50fe5c4 100644 --- a/src/ImageSharp/Formats/Gif/LzwDecoder.cs +++ b/src/ImageSharp/Formats/Gif/LzwDecoder.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Buffers; - using System.IO; +using System; +using System.Buffers; +using System.IO; +namespace SixLabors.ImageSharp.Formats +{ /// /// Decompresses and decodes data using the dynamic LZW algorithms. /// diff --git a/src/ImageSharp/Formats/Gif/LzwEncoder.cs b/src/ImageSharp/Formats/Gif/LzwEncoder.cs index 69419444ff..e7865f9137 100644 --- a/src/ImageSharp/Formats/Gif/LzwEncoder.cs +++ b/src/ImageSharp/Formats/Gif/LzwEncoder.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Buffers; - using System.IO; +using System; +using System.Buffers; +using System.IO; +namespace SixLabors.ImageSharp.Formats +{ /// /// Encodes and compresses the image data using dynamic Lempel-Ziv compression. /// diff --git a/src/ImageSharp/Formats/Gif/PackedField.cs b/src/ImageSharp/Formats/Gif/PackedField.cs index 21d8f91f29..d0489a13c7 100644 --- a/src/ImageSharp/Formats/Gif/PackedField.cs +++ b/src/ImageSharp/Formats/Gif/PackedField.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats +{ /// /// Represents a byte of data in a GIF data stream which contains a number /// of data items. diff --git a/src/ImageSharp/Formats/Gif/Sections/GifGraphicsControlExtension.cs b/src/ImageSharp/Formats/Gif/Sections/GifGraphicsControlExtension.cs index 503bd4fdf7..13a1fb6a8f 100644 --- a/src/ImageSharp/Formats/Gif/Sections/GifGraphicsControlExtension.cs +++ b/src/ImageSharp/Formats/Gif/Sections/GifGraphicsControlExtension.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// The Graphic Control Extension contains parameters used when diff --git a/src/ImageSharp/Formats/Gif/Sections/GifImageDescriptor.cs b/src/ImageSharp/Formats/Gif/Sections/GifImageDescriptor.cs index 12c13beaf0..8765c9deaf 100644 --- a/src/ImageSharp/Formats/Gif/Sections/GifImageDescriptor.cs +++ b/src/ImageSharp/Formats/Gif/Sections/GifImageDescriptor.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Each image in the Data Stream is composed of an Image Descriptor, diff --git a/src/ImageSharp/Formats/Gif/Sections/GifLogicalScreenDescriptor.cs b/src/ImageSharp/Formats/Gif/Sections/GifLogicalScreenDescriptor.cs index fc2cc974aa..28983fa3f7 100644 --- a/src/ImageSharp/Formats/Gif/Sections/GifLogicalScreenDescriptor.cs +++ b/src/ImageSharp/Formats/Gif/Sections/GifLogicalScreenDescriptor.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// The Logical Screen Descriptor contains the parameters diff --git a/src/ImageSharp/Formats/IImageDecoder.cs b/src/ImageSharp/Formats/IImageDecoder.cs index 66eabb1b82..86d5f5375b 100644 --- a/src/ImageSharp/Formats/IImageDecoder.cs +++ b/src/ImageSharp/Formats/IImageDecoder.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Encapsulates properties and methods required for decoding an image from a stream. /// diff --git a/src/ImageSharp/Formats/IImageEncoder.cs b/src/ImageSharp/Formats/IImageEncoder.cs index 4ad41ebc27..ac0b6e3119 100644 --- a/src/ImageSharp/Formats/IImageEncoder.cs +++ b/src/ImageSharp/Formats/IImageEncoder.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Encapsulates properties and methods required for encoding an image to a stream. /// diff --git a/src/ImageSharp/Formats/IImageFormat.cs b/src/ImageSharp/Formats/IImageFormat.cs index d6ddc0b0bb..15bdc73a84 100644 --- a/src/ImageSharp/Formats/IImageFormat.cs +++ b/src/ImageSharp/Formats/IImageFormat.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.Formats +{ /// /// Describes an image format. /// diff --git a/src/ImageSharp/Formats/IImageFormatDetector.cs b/src/ImageSharp/Formats/IImageFormatDetector.cs index a53da07e8b..8266439bdc 100644 --- a/src/ImageSharp/Formats/IImageFormatDetector.cs +++ b/src/ImageSharp/Formats/IImageFormatDetector.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.Text; +using System; +using System.Collections.Generic; +using System.Text; +namespace SixLabors.ImageSharp.Formats +{ /// /// Used for detecting mime types from a file header /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs index f84dc977f1..22b1d51f02 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs @@ -5,7 +5,7 @@ // ReSharper disable InconsistentNaming // #pragma warning disable -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { using System.Numerics; using System.Runtime.CompilerServices; diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt index 03566acbbc..9c3dcc4a4e 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt @@ -14,7 +14,7 @@ <# char[] coordz = {'X', 'Y', 'Z', 'W'}; #> -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { using System.Numerics; using System.Runtime.CompilerServices; diff --git a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs index 130b5856c0..e6970df82e 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Block8x8F.cs @@ -1,16 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + // ReSharper disable InconsistentNaming -namespace ImageSharp.Formats.Jpg -{ - using System; - using System.Buffers; - using System.Numerics; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; +using System; +using System.Buffers; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// DCT code Ported from https://github.com/norishigefukushima/dct_simd /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/BlockQuad.cs b/src/ImageSharp/Formats/Jpeg/Components/BlockQuad.cs index 63453da21a..4f69bfbe23 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/BlockQuad.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/BlockQuad.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg.Components +namespace SixLabors.ImageSharp.Formats.Jpg.Components { /// /// Poor man's stackalloc: Contains a value-type buffer sized for 4 instances. diff --git a/src/ImageSharp/Formats/Jpeg/Components/DCT.cs b/src/ImageSharp/Formats/Jpeg/Components/DCT.cs index 5729fe46d6..483836d816 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/DCT.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/DCT.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + // ReSharper disable InconsistentNaming +using System.Numerics; +using System.Runtime.CompilerServices; -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { - using System.Numerics; - using System.Runtime.CompilerServices; - /// /// Contains forward and inverse DCT implementations /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/Bits.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/Bits.cs index 02f585be02..3f4b281b68 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/Bits.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/Bits.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Holds the unprocessed bits that have been taken from the byte-stream. /// The n least significant bits of a form the unread bits, to be read in MSB to diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/Bytes.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/Bytes.cs index 0e57e98d89..48eb44233e 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/Bytes.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/Bytes.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; - using System.Buffers; - using System.IO; - using System.Runtime.CompilerServices; +using System; +using System.Buffers; +using System.IO; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Bytes is a byte buffer, similar to a stream, except that it /// has to be able to unread more than 1 byte, due to byte stuffing. diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/Component.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/Component.cs index 5b53db1901..b781c5b3c1 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/Component.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/Component.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { /// /// Represents a single color component diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ComponentScan.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ComponentScan.cs index 89fc115ea3..1b859d2154 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/ComponentScan.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/ComponentScan.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Runtime.InteropServices; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Represents a component scan /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecodedBlock.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecodedBlock.cs index 900d77ec46..bb2f23588e 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecodedBlock.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecodedBlock.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// A structure to store unprocessed instances and their coordinates while scanning the image. /// The is present in a "raw" decoded frequency-domain form. diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecoderErrorCode.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecoderErrorCode.cs index 8b82184faf..729f452d41 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecoderErrorCode.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecoderErrorCode.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Represents "recoverable" decoder errors. diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecoderThrowHelper.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecoderThrowHelper.cs index 9ce5ea4146..6617a297a7 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecoderThrowHelper.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/DecoderThrowHelper.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Encapsulates exception thrower methods for the Jpeg Encoder /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/EOFException.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/EOFException.cs index 5ed25ef049..f01db26bac 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/EOFException.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/EOFException.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// The EOF (End of File exception). /// Thrown when the decoder encounters an EOF marker without a proceeding EOI (End Of Image) marker diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTree.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTree.cs index 390e5dd150..3178b99f4b 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTree.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanTree.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; - using System.Buffers; +using System; +using System.Buffers; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Represents a Huffman tree /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/InputProcessor.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/InputProcessor.cs index 60042d36f8..d3d7481856 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/InputProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/InputProcessor.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; - using System.IO; - using System.Runtime.CompilerServices; +using System; +using System.IO; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Encapsulates stream reading and processing data and operations for . /// It's a value type for imporved data locality, and reduced number of CALLVIRT-s diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockProcessor.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockProcessor.cs index 71472c00fc..4d8f18b1bf 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockProcessor.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegBlockProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; - - using ImageSharp.Memory; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Encapsulates the implementation of processing "raw" -s into Jpeg image channels. /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegPixelArea.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegPixelArea.cs index 342ce299ce..cb138bb1eb 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegPixelArea.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegPixelArea.cs @@ -1,13 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Runtime.CompilerServices; - - using ImageSharp.Memory; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Represents an area of a Jpeg subimage (channel) /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.ComputationData.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.ComputationData.cs index 7b910cdd24..646eaf77a8 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.ComputationData.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.ComputationData.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Runtime.InteropServices; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Conains the definition of /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.DataPointers.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.DataPointers.cs index 52e25f3a81..bd91e78629 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.DataPointers.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.DataPointers.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { /// /// Conains the definition of diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.cs index 7d2e6d4414..d864fbca09 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/JpegScanDecoder.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -// ReSharper disable InconsistentNaming -namespace ImageSharp.Formats.Jpg -{ - using System; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; - using ImageSharp.Memory; +// ReSharper disable InconsistentNaming +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Encapsulates the impementation of Jpeg SOS Huffman decoding. See JpegScanDecoder.md! /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/MissingFF00Exception.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/MissingFF00Exception.cs index f8c157237d..c4eae6df98 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/MissingFF00Exception.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/MissingFF00Exception.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// The missing ff00 exception. /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/YCbCrImage.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/YCbCrImage.cs index c9cc327b86..de9b1dceaa 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/YCbCrImage.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/YCbCrImage.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; - using System.Buffers; - - using ImageSharp.Memory; - using SixLabors.Primitives; +using System; +using System.Buffers; +using SixLabors.ImageSharp.Memory; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Represents an image made up of three color components (luminance, blue chroma, red chroma) /// diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/YCbCrToRgbTables.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/YCbCrToRgbTables.cs index 5c9e8f9fc3..0bdcebfc62 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/YCbCrToRgbTables.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/YCbCrToRgbTables.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Runtime.CompilerServices; - using ImageSharp.PixelFormats; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Provides 8-bit lookup tables for converting from YCbCr to Rgb colorspace. /// Methods to build the tables are based on libjpeg implementation. diff --git a/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffIndex.cs b/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffIndex.cs index 3875cc12fe..ecd03c7b32 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffIndex.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffIndex.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { /// /// Enumerates the Huffman tables diff --git a/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanLut.cs b/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanLut.cs index d0003b919d..4dad8f8665 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanLut.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanLut.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { /// /// A compiled look-up table representation of a huffmanSpec. diff --git a/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanSpec.cs b/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanSpec.cs index a0eea6e718..1d555ee4a9 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanSpec.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Encoder/HuffmanSpec.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { /// /// The Huffman encoding specifications. diff --git a/src/ImageSharp/Formats/Jpeg/Components/Encoder/QuantIndex.cs b/src/ImageSharp/Formats/Jpeg/Components/Encoder/QuantIndex.cs index 5a469e0e9d..750652c87c 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Encoder/QuantIndex.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Encoder/QuantIndex.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg +namespace SixLabors.ImageSharp.Formats.Jpg { /// /// Enumerates the quantization tables diff --git a/src/ImageSharp/Formats/Jpeg/Components/Encoder/RgbToYCbCrTables.cs b/src/ImageSharp/Formats/Jpeg/Components/Encoder/RgbToYCbCrTables.cs index 94173d3e43..a982145848 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Encoder/RgbToYCbCrTables.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Encoder/RgbToYCbCrTables.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Provides 8-bit lookup tables for converting from Rgb to YCbCr colorspace. /// Methods to build the tables are based on libjpeg implementation. diff --git a/src/ImageSharp/Formats/Jpeg/IJpegDecoderOptions.cs b/src/ImageSharp/Formats/Jpeg/IJpegDecoderOptions.cs index 6830e2e4a5..4cbd8379a7 100644 --- a/src/ImageSharp/Formats/Jpeg/IJpegDecoderOptions.cs +++ b/src/ImageSharp/Formats/Jpeg/IJpegDecoderOptions.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image decoder for generating an image out of a jpg stream. /// diff --git a/src/ImageSharp/Formats/Jpeg/IJpegEncoderOptions.cs b/src/ImageSharp/Formats/Jpeg/IJpegEncoderOptions.cs index 947c98ee2a..7867056bfc 100644 --- a/src/ImageSharp/Formats/Jpeg/IJpegEncoderOptions.cs +++ b/src/ImageSharp/Formats/Jpeg/IJpegEncoderOptions.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Encoder for writing the data image to a stream in jpeg format. /// diff --git a/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs b/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs index c69007e664..e0ae0c5a39 100644 --- a/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Jpeg/ImageExtensions.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.IO; - - using Formats; - - using ImageSharp.PixelFormats; +using System; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Formats/Jpeg/JpegConfigurationModule.cs b/src/ImageSharp/Formats/Jpeg/JpegConfigurationModule.cs index bb8c4e83f2..43f56caecd 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegConfigurationModule.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegConfigurationModule.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Registers the image encoders, decoders and mime type detectors for the jpeg format. diff --git a/src/ImageSharp/Formats/Jpeg/JpegConstants.cs b/src/ImageSharp/Formats/Jpeg/JpegConstants.cs index 99c0399dcc..3061c2497b 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegConstants.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegConstants.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.Formats +{ /// /// Defines jpeg constants defined in the specification. /// diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs index b3caddeca7..acba1be269 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoder.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image decoder for generating an image out of a jpg stream. /// diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs index 0ce927e516..f3a53160b5 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs @@ -1,20 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Runtime.CompilerServices; - using System.Threading.Tasks; - - using ImageSharp.Formats.Jpg; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Formats.Jpg; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Performs the jpeg decoding operation. /// diff --git a/src/ImageSharp/Formats/Jpeg/JpegEncoder.cs b/src/ImageSharp/Formats/Jpeg/JpegEncoder.cs index 6c6561468f..d878588ecf 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegEncoder.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegEncoder.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Encoder for writing the data image to a stream in jpeg format. /// diff --git a/src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs b/src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs index d2b7d2d7c4..3fa4a182a6 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegEncoderCore.cs @@ -1,19 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Buffers; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Runtime.CompilerServices; - using ImageSharp.Formats.Jpg; - using ImageSharp.Formats.Jpg.Components; - using ImageSharp.PixelFormats; +using System.Buffers; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Formats.Jpg; +using SixLabors.ImageSharp.Formats.Jpg.Components; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image encoder for writing an image to a stream as a jpeg. /// diff --git a/src/ImageSharp/Formats/Jpeg/JpegFormat.cs b/src/ImageSharp/Formats/Jpeg/JpegFormat.cs index 23cd5d8752..5a7b2e4509 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegFormat.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegFormat.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.Formats +{ /// /// Registers the image encoders, decoders and mime type detectors for the jpeg format. /// diff --git a/src/ImageSharp/Formats/Jpeg/JpegImageFormatDetector.cs b/src/ImageSharp/Formats/Jpeg/JpegImageFormatDetector.cs index b72b290c04..32bd904f03 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegImageFormatDetector.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats +{ /// /// Detects Jpeg file headers /// diff --git a/src/ImageSharp/Formats/Jpeg/JpegSubsample.cs b/src/ImageSharp/Formats/Jpeg/JpegSubsample.cs index 287323bdd4..971a749314 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegSubsample.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegSubsample.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Enumerates the chroma subsampling method applied to the image. diff --git a/src/ImageSharp/Formats/Jpeg/UnzigData.cs b/src/ImageSharp/Formats/Jpeg/UnzigData.cs index e74dd5c73c..d781238278 100644 --- a/src/ImageSharp/Formats/Jpeg/UnzigData.cs +++ b/src/ImageSharp/Formats/Jpeg/UnzigData.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Runtime.InteropServices; +using System; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.Formats +{ /// /// Holds the Jpeg UnZig array in a value/stack type. /// Unzig maps from the zigzag ordering to the natural ordering. For example, diff --git a/src/ImageSharp/Formats/Jpeg/Utils/JpegUtils.cs b/src/ImageSharp/Formats/Jpeg/Utils/JpegUtils.cs index afb8e07007..3d20853601 100644 --- a/src/ImageSharp/Formats/Jpeg/Utils/JpegUtils.cs +++ b/src/ImageSharp/Formats/Jpeg/Utils/JpegUtils.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; - - using ImageSharp.PixelFormats; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Jpeg specific utilities and extension methods /// diff --git a/src/ImageSharp/Formats/Jpeg/Utils/MutableSpan.cs b/src/ImageSharp/Formats/Jpeg/Utils/MutableSpan.cs index 99d1c3e04e..7415fcec3e 100644 --- a/src/ImageSharp/Formats/Jpeg/Utils/MutableSpan.cs +++ b/src/ImageSharp/Formats/Jpeg/Utils/MutableSpan.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// Like corefxlab Span, but with an AddOffset() method for efficiency. /// TODO: When Span will be official, consider replacing this class! diff --git a/src/ImageSharp/Formats/Jpeg/Utils/MutableSpanExtensions.cs b/src/ImageSharp/Formats/Jpeg/Utils/MutableSpanExtensions.cs index 45ecfc0920..92148a256f 100644 --- a/src/ImageSharp/Formats/Jpeg/Utils/MutableSpanExtensions.cs +++ b/src/ImageSharp/Formats/Jpeg/Utils/MutableSpanExtensions.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats.Jpg -{ - using System.Numerics; - using System.Runtime.CompilerServices; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats.Jpg +{ /// /// MutableSpan Extensions /// diff --git a/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs b/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs index db2189b3c4..061fea8a40 100644 --- a/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/AverageFilter.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats +{ /// /// The Average filter uses the average of the two neighboring pixels (left and above) to predict /// the value of a pixel. diff --git a/src/ImageSharp/Formats/Png/Filters/FilterType.cs b/src/ImageSharp/Formats/Png/Filters/FilterType.cs index 0eddf08f20..33fc646568 100644 --- a/src/ImageSharp/Formats/Png/Filters/FilterType.cs +++ b/src/ImageSharp/Formats/Png/Filters/FilterType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Provides enumeration of the various PNG filter types. diff --git a/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs b/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs index ee77d1a5eb..be3c06d70b 100644 --- a/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/NoneFilter.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Runtime.CompilerServices; - - using ImageSharp.Memory; +using System; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Formats +{ /// /// The None filter, the scanline is transmitted unmodified; it is only necessary to /// insert a filter type byte before the data. diff --git a/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs b/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs index ec12eca058..6db580534c 100644 --- a/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/PaethFilter.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats +{ /// /// The Paeth filter computes a simple linear function of the three neighboring pixels (left, above, upper left), /// then chooses as predictor the neighboring pixel closest to the computed value. diff --git a/src/ImageSharp/Formats/Png/Filters/SubFilter.cs b/src/ImageSharp/Formats/Png/Filters/SubFilter.cs index f81122ad24..62cc57718b 100644 --- a/src/ImageSharp/Formats/Png/Filters/SubFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/SubFilter.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats +{ /// /// The Sub filter transmits the difference between each byte and the value of the corresponding byte /// of the prior pixel. diff --git a/src/ImageSharp/Formats/Png/Filters/UpFilter.cs b/src/ImageSharp/Formats/Png/Filters/UpFilter.cs index b89a3c5fcc..a2051d33ff 100644 --- a/src/ImageSharp/Formats/Png/Filters/UpFilter.cs +++ b/src/ImageSharp/Formats/Png/Filters/UpFilter.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Formats +{ /// /// The Up filter is just like the Sub filter except that the pixel immediately above the current pixel, /// rather than just to its left, is used as the predictor. diff --git a/src/ImageSharp/Formats/Png/IPngDecoderOptions.cs b/src/ImageSharp/Formats/Png/IPngDecoderOptions.cs index de163ba7e5..c612a7159b 100644 --- a/src/ImageSharp/Formats/Png/IPngDecoderOptions.cs +++ b/src/ImageSharp/Formats/Png/IPngDecoderOptions.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// The optioas for decoding png images /// diff --git a/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs b/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs index 8f0a4cd829..73d7a393b4 100644 --- a/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs +++ b/src/ImageSharp/Formats/Png/IPngEncoderOptions.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; - using ImageSharp.Quantizers; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers; +namespace SixLabors.ImageSharp.Formats +{ /// /// The options availible for manipulating the encoder pipeline /// diff --git a/src/ImageSharp/Formats/Png/ImageExtensions.cs b/src/ImageSharp/Formats/Png/ImageExtensions.cs index 697380c19f..70815e0faf 100644 --- a/src/ImageSharp/Formats/Png/ImageExtensions.cs +++ b/src/ImageSharp/Formats/Png/ImageExtensions.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.IO; - - using Formats; - - using ImageSharp.PixelFormats; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Formats/Png/PngChunk.cs b/src/ImageSharp/Formats/Png/PngChunk.cs index 3d769057ca..9e7357f00a 100644 --- a/src/ImageSharp/Formats/Png/PngChunk.cs +++ b/src/ImageSharp/Formats/Png/PngChunk.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Stores header information about a chunk. diff --git a/src/ImageSharp/Formats/Png/PngChunkTypes.cs b/src/ImageSharp/Formats/Png/PngChunkTypes.cs index 72486b50d7..b501783d54 100644 --- a/src/ImageSharp/Formats/Png/PngChunkTypes.cs +++ b/src/ImageSharp/Formats/Png/PngChunkTypes.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Contains a list of possible chunk type identifiers. diff --git a/src/ImageSharp/Formats/Png/PngColorType.cs b/src/ImageSharp/Formats/Png/PngColorType.cs index 421e27ba33..093edaddd9 100644 --- a/src/ImageSharp/Formats/Png/PngColorType.cs +++ b/src/ImageSharp/Formats/Png/PngColorType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Provides enumeration of available PNG color types. diff --git a/src/ImageSharp/Formats/Png/PngConfigurationModule.cs b/src/ImageSharp/Formats/Png/PngConfigurationModule.cs index bb1c2086cc..c362e19529 100644 --- a/src/ImageSharp/Formats/Png/PngConfigurationModule.cs +++ b/src/ImageSharp/Formats/Png/PngConfigurationModule.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Registers the image encoders, decoders and mime type detectors for the png format. diff --git a/src/ImageSharp/Formats/Png/PngConstants.cs b/src/ImageSharp/Formats/Png/PngConstants.cs index 84e76a3419..3c8992a540 100644 --- a/src/ImageSharp/Formats/Png/PngConstants.cs +++ b/src/ImageSharp/Formats/Png/PngConstants.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; - using System.Text; +using System.Collections.Generic; +using System.Text; +namespace SixLabors.ImageSharp.Formats +{ /// /// Defines png constants defined in the specification. /// diff --git a/src/ImageSharp/Formats/Png/PngDecoder.cs b/src/ImageSharp/Formats/Png/PngDecoder.cs index 61a8cb2127..da3a2f139c 100644 --- a/src/ImageSharp/Formats/Png/PngDecoder.cs +++ b/src/ImageSharp/Formats/Png/PngDecoder.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Formats +{ /// /// Encoder for generating an image out of a png encoded stream. /// diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index d9df44a091..75ca69684a 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -1,22 +1,19 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +using System; +using System.Buffers; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using static SixLabors.ImageSharp.ComparableExtensions; + +namespace SixLabors.ImageSharp.Formats { - using System; - using System.Buffers; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Runtime.CompilerServices; - using System.Text; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - - using static ComparableExtensions; - /// /// Performs the png decoding operation. /// diff --git a/src/ImageSharp/Formats/Png/PngEncoder.cs b/src/ImageSharp/Formats/Png/PngEncoder.cs index bfd82a0748..583d77a8ab 100644 --- a/src/ImageSharp/Formats/Png/PngEncoder.cs +++ b/src/ImageSharp/Formats/Png/PngEncoder.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; - using System.IO; - - using ImageSharp.PixelFormats; - using ImageSharp.Quantizers; +using System.Collections.Generic; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers; +namespace SixLabors.ImageSharp.Formats +{ /// /// Image encoder for writing image data to a stream in png format. /// diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs index cfbd0c4493..cee62fde36 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs @@ -1,23 +1,18 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +using System; +using System.Buffers; +using System.IO; +using System.Linq; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers; +using static SixLabors.ImageSharp.ComparableExtensions; + +namespace SixLabors.ImageSharp.Formats { - using System; - using System.Buffers; - using System.IO; - using System.Linq; - using System.Runtime.CompilerServices; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - - using Quantizers; - - using static ComparableExtensions; - /// /// Performs the png encoding operation. /// diff --git a/src/ImageSharp/Formats/Png/PngFormat.cs b/src/ImageSharp/Formats/Png/PngFormat.cs index 6df2aa7c58..9cfa660126 100644 --- a/src/ImageSharp/Formats/Png/PngFormat.cs +++ b/src/ImageSharp/Formats/Png/PngFormat.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.Formats +{ /// /// Registers the image encoders, decoders and mime type detectors for the png format. /// diff --git a/src/ImageSharp/Formats/Png/PngHeader.cs b/src/ImageSharp/Formats/Png/PngHeader.cs index 9cf823fa19..3bbf10526a 100644 --- a/src/ImageSharp/Formats/Png/PngHeader.cs +++ b/src/ImageSharp/Formats/Png/PngHeader.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Represents the png header chunk. diff --git a/src/ImageSharp/Formats/Png/PngImageFormatDetector.cs b/src/ImageSharp/Formats/Png/PngImageFormatDetector.cs index fdea3eb8ae..bf4a91caf2 100644 --- a/src/ImageSharp/Formats/Png/PngImageFormatDetector.cs +++ b/src/ImageSharp/Formats/Png/PngImageFormatDetector.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats +{ /// /// Detects png file headers /// diff --git a/src/ImageSharp/Formats/Png/PngInterlaceMode.cs b/src/ImageSharp/Formats/Png/PngInterlaceMode.cs index b43aff0b78..a39ccd6bed 100644 --- a/src/ImageSharp/Formats/Png/PngInterlaceMode.cs +++ b/src/ImageSharp/Formats/Png/PngInterlaceMode.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Provides enumeration of available PNG interlace modes. diff --git a/src/ImageSharp/Formats/Png/Zlib/Adler32.cs b/src/ImageSharp/Formats/Png/Zlib/Adler32.cs index 5f92cc9e09..d0ddd84405 100644 --- a/src/ImageSharp/Formats/Png/Zlib/Adler32.cs +++ b/src/ImageSharp/Formats/Png/Zlib/Adler32.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats +{ /// /// Computes Adler32 checksum for a stream of data. An Adler32 /// checksum is not as reliable as a CRC32 checksum, but a lot faster to diff --git a/src/ImageSharp/Formats/Png/Zlib/Crc32.cs b/src/ImageSharp/Formats/Png/Zlib/Crc32.cs index d940112a8d..7ca0f668b5 100644 --- a/src/ImageSharp/Formats/Png/Zlib/Crc32.cs +++ b/src/ImageSharp/Formats/Png/Zlib/Crc32.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; +using System; +namespace SixLabors.ImageSharp.Formats +{ /// /// Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: /// x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. diff --git a/src/ImageSharp/Formats/Png/Zlib/IChecksum.cs b/src/ImageSharp/Formats/Png/Zlib/IChecksum.cs index cbd292dc4c..4b656ab9cd 100644 --- a/src/ImageSharp/Formats/Png/Zlib/IChecksum.cs +++ b/src/ImageSharp/Formats/Png/Zlib/IChecksum.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats +namespace SixLabors.ImageSharp.Formats { /// /// Interface to compute a data checksum used by checked input/output streams. diff --git a/src/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs b/src/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs index c1f04fa981..11ddb10730 100644 --- a/src/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs +++ b/src/ImageSharp/Formats/Png/Zlib/ZlibDeflateStream.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Formats -{ - using System; - using System.IO; - using System.IO.Compression; +using System; +using System.IO; +using System.IO.Compression; +namespace SixLabors.ImageSharp.Formats +{ /// /// Provides methods and properties for compressing streams by using the Zlib Deflate algorithm. /// diff --git a/src/ImageSharp/Formats/Png/Zlib/ZlibInflateStream.cs b/src/ImageSharp/Formats/Png/Zlib/ZlibInflateStream.cs index 136f919da7..d668ff4176 100644 --- a/src/ImageSharp/Formats/Png/Zlib/ZlibInflateStream.cs +++ b/src/ImageSharp/Formats/Png/Zlib/ZlibInflateStream.cs @@ -1,11 +1,14 @@ -namespace ImageSharp.Formats -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.IO.Compression; - using System.Text; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Text; +namespace SixLabors.ImageSharp.Formats +{ /// /// Provides methods and properties for deframing streams from PNGs. /// diff --git a/src/ImageSharp/GraphicsOptions.cs b/src/ImageSharp/GraphicsOptions.cs index f45582e1e6..114eaab2a6 100644 --- a/src/ImageSharp/GraphicsOptions.cs +++ b/src/ImageSharp/GraphicsOptions.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Options for influencing the drawing functions. /// diff --git a/src/ImageSharp/IConfigurationModule.cs b/src/ImageSharp/IConfigurationModule.cs index 95b92ed056..93c40497da 100644 --- a/src/ImageSharp/IConfigurationModule.cs +++ b/src/ImageSharp/IConfigurationModule.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Represents an interface that can register image encoders, decoders and image format detectors. diff --git a/src/ImageSharp/IImageProcessingContextFactory.cs b/src/ImageSharp/IImageProcessingContextFactory.cs index 08c536a602..b7b935ecd5 100644 --- a/src/ImageSharp/IImageProcessingContextFactory.cs +++ b/src/ImageSharp/IImageProcessingContextFactory.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Represents an interface that will create IInternalImageProcessingContext instances /// diff --git a/src/ImageSharp/IImageProcessingContext{TPixel}.cs b/src/ImageSharp/IImageProcessingContext{TPixel}.cs index 6aa2b799fa..552e8d579d 100644 --- a/src/ImageSharp/IImageProcessingContext{TPixel}.cs +++ b/src/ImageSharp/IImageProcessingContext{TPixel}.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// An interface to queue up image operations to apply to an image. /// diff --git a/src/ImageSharp/IO/BigEndianBitConverter.cs b/src/ImageSharp/IO/BigEndianBitConverter.cs index debe1706c9..6b5cf3b9c7 100644 --- a/src/ImageSharp/IO/BigEndianBitConverter.cs +++ b/src/ImageSharp/IO/BigEndianBitConverter.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO +namespace SixLabors.ImageSharp.IO { /// /// Implementation of EndianBitConverter which converts to/from big-endian byte arrays. diff --git a/src/ImageSharp/IO/EndianBinaryReader.cs b/src/ImageSharp/IO/EndianBinaryReader.cs index e21d3d3db3..0d660c68d5 100644 --- a/src/ImageSharp/IO/EndianBinaryReader.cs +++ b/src/ImageSharp/IO/EndianBinaryReader.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System; - using System.IO; - using System.Text; +using System; +using System.IO; +using System.Text; +namespace SixLabors.ImageSharp.IO +{ /// /// Equivalent of , but with either endianness, depending on the it is constructed with. /// No data is buffered in the reader; the client may seek within the stream at will. diff --git a/src/ImageSharp/IO/EndianBinaryWriter.cs b/src/ImageSharp/IO/EndianBinaryWriter.cs index ef026f00c2..dd87faf455 100644 --- a/src/ImageSharp/IO/EndianBinaryWriter.cs +++ b/src/ImageSharp/IO/EndianBinaryWriter.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System; - using System.IO; - using System.Text; +using System; +using System.IO; +using System.Text; +namespace SixLabors.ImageSharp.IO +{ /// /// Equivalent of , but with either endianness, depending on /// the it is constructed with. diff --git a/src/ImageSharp/IO/EndianBitConverter.Conversion.cs b/src/ImageSharp/IO/EndianBitConverter.Conversion.cs index 0858acfedc..844c81cc9e 100644 --- a/src/ImageSharp/IO/EndianBitConverter.Conversion.cs +++ b/src/ImageSharp/IO/EndianBitConverter.Conversion.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System; +using System; +namespace SixLabors.ImageSharp.IO +{ /// /// Equivalent of , but with either endianness. /// diff --git a/src/ImageSharp/IO/EndianBitConverter.CopyBytes.cs b/src/ImageSharp/IO/EndianBitConverter.CopyBytes.cs index b46a453a4f..ea1d7aa5ac 100644 --- a/src/ImageSharp/IO/EndianBitConverter.CopyBytes.cs +++ b/src/ImageSharp/IO/EndianBitConverter.CopyBytes.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System; +using System; +namespace SixLabors.ImageSharp.IO +{ /// /// Equivalent of , but with either endianness. /// diff --git a/src/ImageSharp/IO/EndianBitConverter.GetBytes.cs b/src/ImageSharp/IO/EndianBitConverter.GetBytes.cs index b3e0133e43..5686c829c4 100644 --- a/src/ImageSharp/IO/EndianBitConverter.GetBytes.cs +++ b/src/ImageSharp/IO/EndianBitConverter.GetBytes.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System; +using System; +namespace SixLabors.ImageSharp.IO +{ /// /// Equivalent of , but with either endianness. /// diff --git a/src/ImageSharp/IO/EndianBitConverter.ToType.cs b/src/ImageSharp/IO/EndianBitConverter.ToType.cs index 93b49558ad..0c0e49911b 100644 --- a/src/ImageSharp/IO/EndianBitConverter.ToType.cs +++ b/src/ImageSharp/IO/EndianBitConverter.ToType.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System; +using System; +namespace SixLabors.ImageSharp.IO +{ /// /// Equivalent of , but with either endianness. /// diff --git a/src/ImageSharp/IO/EndianBitConverter.cs b/src/ImageSharp/IO/EndianBitConverter.cs index 06b88dbc90..b563a09cb8 100644 --- a/src/ImageSharp/IO/EndianBitConverter.cs +++ b/src/ImageSharp/IO/EndianBitConverter.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.IO +{ /// /// Equivalent of , but with either endianness. /// diff --git a/src/ImageSharp/IO/Endianness.cs b/src/ImageSharp/IO/Endianness.cs index aefda6dc4b..59b2ae77c1 100644 --- a/src/ImageSharp/IO/Endianness.cs +++ b/src/ImageSharp/IO/Endianness.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO +namespace SixLabors.ImageSharp.IO { /// /// Endianness of a converter diff --git a/src/ImageSharp/IO/IFileSystem.cs b/src/ImageSharp/IO/IFileSystem.cs index ee1ef84d7b..072c05ea7f 100644 --- a/src/ImageSharp/IO/IFileSystem.cs +++ b/src/ImageSharp/IO/IFileSystem.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System.IO; +using System.IO; +namespace SixLabors.ImageSharp.IO +{ #if !NETSTANDARD1_1 /// /// A simple interface representing the filesystem. diff --git a/src/ImageSharp/IO/LittleEndianBitConverter.cs b/src/ImageSharp/IO/LittleEndianBitConverter.cs index 81ed8d55c2..712bfd97b1 100644 --- a/src/ImageSharp/IO/LittleEndianBitConverter.cs +++ b/src/ImageSharp/IO/LittleEndianBitConverter.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO +namespace SixLabors.ImageSharp.IO { /// /// Implementation of EndianBitConverter which converts to/from little-endian byte arrays. diff --git a/src/ImageSharp/IO/LocalFileSystem.cs b/src/ImageSharp/IO/LocalFileSystem.cs index 02a9914ead..9c419698ff 100644 --- a/src/ImageSharp/IO/LocalFileSystem.cs +++ b/src/ImageSharp/IO/LocalFileSystem.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.IO -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +namespace SixLabors.ImageSharp.IO +{ #if !NETSTANDARD1_1 /// /// A wrapper around the local File apis. diff --git a/src/ImageSharp/Image/ICloningImageProcessor.cs b/src/ImageSharp/Image/ICloningImageProcessor.cs index a6a3a9a73d..1e7d6e4f0a 100644 --- a/src/ImageSharp/Image/ICloningImageProcessor.cs +++ b/src/ImageSharp/Image/ICloningImageProcessor.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing +{ /// /// Encapsulates methods to alter the pixels of a new image, cloned from the original image. /// diff --git a/src/ImageSharp/Image/IImage.cs b/src/ImageSharp/Image/IImage.cs index b9e8e392a3..6e05757276 100644 --- a/src/ImageSharp/Image/IImage.cs +++ b/src/ImageSharp/Image/IImage.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using Formats; +using SixLabors.ImageSharp.Formats; +namespace SixLabors.ImageSharp +{ /// /// Encapsulates the basic properties and methods required to manipulate images. /// diff --git a/src/ImageSharp/Image/IImageBase.cs b/src/ImageSharp/Image/IImageBase.cs index 9e0c10606b..9aea1517d6 100644 --- a/src/ImageSharp/Image/IImageBase.cs +++ b/src/ImageSharp/Image/IImageBase.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using SixLabors.Primitives; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Encapsulates the basic properties and methods required to manipulate images. /// diff --git a/src/ImageSharp/Image/IImageBase{TPixel}.cs b/src/ImageSharp/Image/IImageBase{TPixel}.cs index 8b4977b7dc..a05867db3c 100644 --- a/src/ImageSharp/Image/IImageBase{TPixel}.cs +++ b/src/ImageSharp/Image/IImageBase{TPixel}.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using ImageSharp.PixelFormats; +using System; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Encapsulates the basic properties and methods required to manipulate images in varying formats. /// diff --git a/src/ImageSharp/Image/IImageFrame.cs b/src/ImageSharp/Image/IImageFrame.cs index bf3261d93c..3d23d6e09a 100644 --- a/src/ImageSharp/Image/IImageFrame.cs +++ b/src/ImageSharp/Image/IImageFrame.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Encapsulates the basic properties and methods required to manipulate images. diff --git a/src/ImageSharp/Image/IImageProcessor.cs b/src/ImageSharp/Image/IImageProcessor.cs index 1e144e835c..5eec31b478 100644 --- a/src/ImageSharp/Image/IImageProcessor.cs +++ b/src/ImageSharp/Image/IImageProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing -{ - using System; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing +{ /// /// Encapsulates methods to alter the pixels of an image. /// diff --git a/src/ImageSharp/Image/Image.Decode.cs b/src/ImageSharp/Image/Image.Decode.cs index 1013107062..b4ab712d05 100644 --- a/src/ImageSharp/Image/Image.Decode.cs +++ b/src/ImageSharp/Image/Image.Decode.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.IO; - using System.Linq; - using Formats; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System.IO; +using System.Linq; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Adds static methods allowing the decoding of new images. /// diff --git a/src/ImageSharp/Image/Image.FromBytes.cs b/src/ImageSharp/Image/Image.FromBytes.cs index c7023b860b..9da9c5e432 100644 --- a/src/ImageSharp/Image/Image.FromBytes.cs +++ b/src/ImageSharp/Image/Image.FromBytes.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.IO; - using Formats; - - using ImageSharp.PixelFormats; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Adds static methods allowing the creation of new image from a byte array. /// diff --git a/src/ImageSharp/Image/Image.FromFile.cs b/src/ImageSharp/Image/Image.FromFile.cs index ca395ce088..0474a6d476 100644 --- a/src/ImageSharp/Image/Image.FromFile.cs +++ b/src/ImageSharp/Image/Image.FromFile.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ #if !NETSTANDARD1_1 - using System; - using System.IO; - using Formats; - using ImageSharp.PixelFormats; +using System; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Adds static methods allowing the creation of new image from a given file. /// @@ -217,5 +215,5 @@ public static Image Load(Configuration config, string path, IIma } } } -#endif -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/ImageSharp/Image/Image.FromStream.cs b/src/ImageSharp/Image/Image.FromStream.cs index 29d93ae859..90fa12e3f5 100644 --- a/src/ImageSharp/Image/Image.FromStream.cs +++ b/src/ImageSharp/Image/Image.FromStream.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; - using Formats; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Adds static methods allowing the creation of new image from a given stream. /// diff --git a/src/ImageSharp/Image/Image.LoadPixelData.cs b/src/ImageSharp/Image/Image.LoadPixelData.cs index 7b6a4d6684..2438d9eec8 100644 --- a/src/ImageSharp/Image/Image.LoadPixelData.cs +++ b/src/ImageSharp/Image/Image.LoadPixelData.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.IO; - using System.Runtime.CompilerServices; - using System.Threading.Tasks; - using Formats; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.IO; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Adds static methods allowing the creation of new image from raw pixel data. /// diff --git a/src/ImageSharp/Image/ImageBase{TPixel}.cs b/src/ImageSharp/Image/ImageBase{TPixel}.cs index 7d965cb050..db8964fa31 100644 --- a/src/ImageSharp/Image/ImageBase{TPixel}.cs +++ b/src/ImageSharp/Image/ImageBase{TPixel}.cs @@ -1,19 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Diagnostics; - using System.Runtime.CompilerServices; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// The base class of all images. Encapsulates the basic properties and methods required to manipulate /// images in different pixel formats. diff --git a/src/ImageSharp/Image/ImageExtensions.cs b/src/ImageSharp/Image/ImageExtensions.cs index 6095b49e3a..acf209dcbb 100644 --- a/src/ImageSharp/Image/ImageExtensions.cs +++ b/src/ImageSharp/Image/ImageExtensions.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Text; - using ImageSharp.Formats; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods over Image{TPixel} /// diff --git a/src/ImageSharp/Image/ImageFrame{TPixel}.cs b/src/ImageSharp/Image/ImageFrame{TPixel}.cs index 1e55d7b3b3..333fd9c5f2 100644 --- a/src/ImageSharp/Image/ImageFrame{TPixel}.cs +++ b/src/ImageSharp/Image/ImageFrame{TPixel}.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Represents a single frame in a animation. /// diff --git a/src/ImageSharp/Image/Image{TPixel}.cs b/src/ImageSharp/Image/Image{TPixel}.cs index 70e0a83491..47ddfac210 100644 --- a/src/ImageSharp/Image/Image{TPixel}.cs +++ b/src/ImageSharp/Image/Image{TPixel}.cs @@ -1,23 +1,20 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Numerics; +using System.Text; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; + +namespace SixLabors.ImageSharp { - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.IO; - using System.Numerics; - using System.Text; - using System.Threading.Tasks; - - using Formats; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; - /// /// Encapsulates an image, which consists of the pixel data for a graphics image and its attributes. /// diff --git a/src/ImageSharp/Image/PixelAccessor{TPixel}.cs b/src/ImageSharp/Image/PixelAccessor{TPixel}.cs index 3902ba4255..84d7d04450 100644 --- a/src/ImageSharp/Image/PixelAccessor{TPixel}.cs +++ b/src/ImageSharp/Image/PixelAccessor{TPixel}.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Diagnostics; - using System.Runtime.CompilerServices; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Provides per-pixel access to generic pixels. /// diff --git a/src/ImageSharp/Image/PixelArea{TPixel}.cs b/src/ImageSharp/Image/PixelArea{TPixel}.cs index 4ddfcadb7b..e9924f8235 100644 --- a/src/ImageSharp/Image/PixelArea{TPixel}.cs +++ b/src/ImageSharp/Image/PixelArea{TPixel}.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Diagnostics; - using System.IO; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics; +using System.IO; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Represents an area of generic pixels. /// diff --git a/src/ImageSharp/ImageFormats.cs b/src/ImageSharp/ImageFormats.cs index f79191eae6..d677839688 100644 --- a/src/ImageSharp/ImageFormats.cs +++ b/src/ImageSharp/ImageFormats.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.Formats; +using SixLabors.ImageSharp.Formats; +namespace SixLabors.ImageSharp +{ /// /// The static collection of all the default image formats /// diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index 8733131a74..c16045d61d 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -3,18 +3,18 @@ A cross-platform library for the processing of image files; written in C# ImageSharp 1.0.0-alpha9 - James Jackson-South and contributors + Six Labors and contributors netstandard1.3;netstandard1.1 true true - ImageSharp - ImageSharp + SixLabors.ImageSharp + SixLabors.ImageSharp Image Resize Crop Gif Jpg Jpeg Bitmap Png Core - https://raw.githubusercontent.com/JimBobSquarePants/ImageSharp/master/build/icons/imagesharp-logo-128.png - https://github.com/JimBobSquarePants/ImageSharp + https://raw.githubusercontent.com/SixLabor/ImageSharp/master/build/icons/imagesharp-logo-128.png + https://github.com/SixLabor/ImageSharp http://www.apache.org/licenses/LICENSE-2.0 git - https://github.com/JimBobSquarePants/ImageSharp + https://github.com/SixLabor/ImageSharp false false false @@ -31,23 +31,24 @@ - - + + All - + - - + + - + ..\..\ImageSharp.ruleset + SixLabors.ImageSharp true diff --git a/src/ImageSharp/Memory/Buffer.cs b/src/ImageSharp/Memory/Buffer.cs index 4b3681c744..bbe37b8594 100644 --- a/src/ImageSharp/Memory/Buffer.cs +++ b/src/ImageSharp/Memory/Buffer.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Memory -{ - using System; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.Memory +{ /// /// Manages a buffer of value type objects as a Disposable resource. /// The backing array is either pooled or comes from the outside. diff --git a/src/ImageSharp/Memory/Buffer2D.cs b/src/ImageSharp/Memory/Buffer2D.cs index 59cabb1bd4..d86eb5b267 100644 --- a/src/ImageSharp/Memory/Buffer2D.cs +++ b/src/ImageSharp/Memory/Buffer2D.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Memory -{ - using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Memory +{ /// /// Represents a buffer of value type objects /// interpreted as a 2D region of x elements. diff --git a/src/ImageSharp/Memory/Buffer2DExtensions.cs b/src/ImageSharp/Memory/Buffer2DExtensions.cs index 046bfd81fc..d9c6801a1d 100644 --- a/src/ImageSharp/Memory/Buffer2DExtensions.cs +++ b/src/ImageSharp/Memory/Buffer2DExtensions.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Memory -{ - using System; - using System.Runtime.CompilerServices; +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Memory +{ /// /// Defines extension methods for . /// diff --git a/src/ImageSharp/Memory/Fast2DArray{T}.cs b/src/ImageSharp/Memory/Fast2DArray{T}.cs index 260c829e21..e8e785c029 100644 --- a/src/ImageSharp/Memory/Fast2DArray{T}.cs +++ b/src/ImageSharp/Memory/Fast2DArray{T}.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Memory -{ - using System; - using System.Diagnostics; - using System.Runtime.CompilerServices; +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Memory +{ /// /// Provides fast access to 2D arrays. /// diff --git a/src/ImageSharp/Memory/IBuffer2D.cs b/src/ImageSharp/Memory/IBuffer2D.cs index 300c29a1ba..2f60fd02a0 100644 --- a/src/ImageSharp/Memory/IBuffer2D.cs +++ b/src/ImageSharp/Memory/IBuffer2D.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Memory -{ - using System; +using System; +namespace SixLabors.ImageSharp.Memory +{ /// /// An interface that represents a pinned buffer of value type objects /// interpreted as a 2D region of x elements. diff --git a/src/ImageSharp/Memory/PixelDataPool{T}.cs b/src/ImageSharp/Memory/PixelDataPool{T}.cs index 643f1c6ca3..6f4cef707a 100644 --- a/src/ImageSharp/Memory/PixelDataPool{T}.cs +++ b/src/ImageSharp/Memory/PixelDataPool{T}.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Memory -{ - using System.Buffers; - - using ImageSharp.PixelFormats; +using System.Buffers; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Memory +{ /// /// Provides a resource pool that enables reusing instances of value type arrays for image data . /// diff --git a/src/ImageSharp/Memory/SpanHelper.cs b/src/ImageSharp/Memory/SpanHelper.cs index 0e794e1b57..73bc5f55d8 100644 --- a/src/ImageSharp/Memory/SpanHelper.cs +++ b/src/ImageSharp/Memory/SpanHelper.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Memory -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.Memory +{ /// /// Utility methods for /// diff --git a/src/ImageSharp/MetaData/IMetaData.cs b/src/ImageSharp/MetaData/IMetaData.cs index 6daa04dd63..61a906c03d 100644 --- a/src/ImageSharp/MetaData/IMetaData.cs +++ b/src/ImageSharp/MetaData/IMetaData.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.Formats; +using SixLabors.ImageSharp.Formats; +namespace SixLabors.ImageSharp +{ /// /// Encapsulates the metadata of an image frame. /// diff --git a/src/ImageSharp/MetaData/ImageFrameMetaData.cs b/src/ImageSharp/MetaData/ImageFrameMetaData.cs index 9004fbd1df..71051d11af 100644 --- a/src/ImageSharp/MetaData/ImageFrameMetaData.cs +++ b/src/ImageSharp/MetaData/ImageFrameMetaData.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.Formats; +using SixLabors.ImageSharp.Formats; +namespace SixLabors.ImageSharp +{ /// /// Encapsulates the metadata of an image frame. /// diff --git a/src/ImageSharp/MetaData/ImageMetaData.cs b/src/ImageSharp/MetaData/ImageMetaData.cs index a5b36f884d..5e99f30239 100644 --- a/src/ImageSharp/MetaData/ImageMetaData.cs +++ b/src/ImageSharp/MetaData/ImageMetaData.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Collections.Generic; - using ImageSharp.Formats; +using System.Collections.Generic; +using SixLabors.ImageSharp.Formats; +namespace SixLabors.ImageSharp +{ /// /// Encapsulates the metadata of an image. /// diff --git a/src/ImageSharp/MetaData/ImageProperty.cs b/src/ImageSharp/MetaData/ImageProperty.cs index 178794283c..0c575cf260 100644 --- a/src/ImageSharp/MetaData/ImageProperty.cs +++ b/src/ImageSharp/MetaData/ImageProperty.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Stores meta information about a image, like the name of the author, /// the copyright information, the date, where the image was created diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs index f2d012c6c8..aa874df79a 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifDataType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Specifies exif data types. diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs index 880a434534..3bfa3281a3 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifParts.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Specifies which parts will be written when the profile is added to an image. /// diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs index a7fd8fd6a8..48f1b6e940 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifProfile.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.IO; - - using ImageSharp.PixelFormats; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Represents an EXIF profile providing access to the collection of values. /// diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs index 53123bfc29..d7d4c8b114 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifReader.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Linq; - using System.Text; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +namespace SixLabors.ImageSharp +{ /// /// Reads and parses EXIF data from a byte array /// diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs index 6f4b494857..c6a9740568 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifTag.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// All exif tags from the Exif standard 2.2 diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs index e08bddd3ff..6135033254 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifTagDescriptionAttribute.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Reflection; +using System; +using System.Reflection; +namespace SixLabors.ImageSharp +{ /// /// Class that provides a description for an ExifTag value. /// diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs index a2965917b1..c20aa2cbc7 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Globalization; - using System.Text; +using System; +using System.Globalization; +using System.Text; +namespace SixLabors.ImageSharp +{ /// /// Represent the value of the EXIF profile. /// diff --git a/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs b/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs index bf8f4caa26..2156240224 100644 --- a/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs +++ b/src/ImageSharp/MetaData/Profiles/Exif/ExifWriter.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Text; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +namespace SixLabors.ImageSharp +{ /// /// Contains methods for writing EXIF metadata. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs index f34f006e7c..c1b30bc816 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccCurveSegment.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// A segment of a curve /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs index ad03c8ff8a..44ec136d81 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccFormulaCurveElement.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// A formula based curve segment /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs index 3f6497cccf..377d5d0808 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccOneDimensionalCurve.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// A one dimensional curve /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs index 14aaf153ef..870c994a8d 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// A parametric curve /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs index a5816e212e..435d014926 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - using System.Numerics; +using System; +using System.Linq; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// A response curve /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs index 859d43338e..de3f348c75 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Curves/IccSampledCurveElement.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// A sampled curve segment /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs index ba32586fea..6ea81f9cc6 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Curves.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to read ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs index a34ee42fce..0c39cc7bfc 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Lut.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to read ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs index 23ad9feb22..c209741875 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Matrix.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs index 371c5c42a6..fd41ec5b67 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElement.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Provides methods to read ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs index 44a892084c..c4642ed25e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitives.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; +using System; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to read ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs index 85d80c7a84..544a57c7ab 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.Primitives.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Text; +using System; +using System.Text; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to read ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs index 711de818b3..c988c9198d 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntry.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Globalization; - using System.Numerics; +using System; +using System.Globalization; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to read ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs index cb1fe5b55e..8e269a474a 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataReader/IccDataReader.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Text; - using ImageSharp.IO; +using System; +using System.Text; +using SixLabors.ImageSharp.IO; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to read ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs index 4b6e454a1d..6cbb7148af 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Curves.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to write ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs index f85d59714f..0cfae36fc2 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Lut.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs index 13a15b4836..3f873d3b0f 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Matrix.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Numerics; - - using ImageSharp.Memory; +using System.Numerics; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to write ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs index b3ddb538cd..2522aee805 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElement.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Provides methods to write ICC data types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs index d90c1ff549..9f8d8d0579 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitives.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; +using System; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to write ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs index fbb7065e6b..eb5f7eddb3 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.Primitives.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Text; +using System; +using System.Text; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to write ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs index b74f22054e..8c0640cbdd 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Linq; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to write ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs index a9a65b80be..6a0ddf6399 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/DataWriter/IccDataWriter.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.IO; - using System.Text; +using System; +using System.IO; +using System.Text; +namespace SixLabors.ImageSharp +{ /// /// Provides methods to write ICC data types /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs index 066cbe8489..021051b256 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccClutDataType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Color lookup table data type diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs index 3f57ded742..77967ad663 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorSpaceType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Color Space Type diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs index 251a848b7b..22c29d31d1 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccColorantEncoding.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Colorant Encoding diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs index 14515c113a..6d5e1b6f74 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveMeasurementEncodings.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Curve Measurement Encodings diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs index 77ded0d1b5..d1c0f28434 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccCurveSegmentSignature.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Curve Segment Signature diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs index a4ca4befab..4fcca3f249 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDataType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Enumerates the basic data types as defined in ICC.1:2010 version 4.3.0.0 diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs index c57cf4f977..131434cfdc 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccDeviceAttribute.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Device attributes. Can be combined with a logical OR /// The least-significant 32 bits are defined by the ICC, diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs index eacc1eb281..8810bbbb04 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccFormulaCurveType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Formula curve segment type diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs index fdfb78049d..dc8db74629 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMeasurementGeometry.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Measurement Geometry diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs index 8ab690b64f..80c74952ab 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccMultiProcessElementSignature.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Multi process element signature diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs index 823b413402..563a40c901 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccParametricCurveType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Formula curve segment type diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs index 8fdeb3f418..ee6f719109 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccPrimaryPlatformType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Enumerates the primary platform/operating system framework for which the profile was created diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs index 9fb0b51f32..dbb6d61ed6 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileClass.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Profile Class Name diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs index aa8df88bd8..f149415d81 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileFlag.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Profile flags. Can be combined with a logical OR. /// The least-significant 16 bits are reserved for the ICC, diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs index 6eab5b3fe8..7c71fe9a54 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccProfileTag.cs @@ -1,10 +1,8 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// // ReSharper disable InconsistentNaming -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Enumerates the ICC Profile Tags as defined in ICC.1:2010 version 4.3.0.0 diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs index 10e0fbac99..cfcb8312eb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccRenderingIntent.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Rendering intent diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs index 2938d44698..422b752023 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningFlag.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Screening flags. Can be combined with a logical OR. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs index 0d24c3ae5b..02138be3b3 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccScreeningSpotType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Enumerates the screening spot types diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs index 5fc2fa228c..b929afd9a9 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccSignatureName.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Signature Name diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs index 3526887edc..c4482de1f1 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardIlluminant.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Standard Illuminant diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs index 0efc5fd406..cfbec77689 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccStandardObserver.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Standard Observer diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs index a42cc8cd11..2249341af2 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Enums/IccTypeSignature.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Type Signature diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs b/src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs index 54fe7c7641..13e20fd9d5 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Exceptions/InvalidIccProfileException.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Represents an error that happened while reading or writing a corrupt/invalid ICC profile /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs index 978d5bc24f..e569cd1694 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccProfile.cs @@ -1,16 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Generic; +using System; +using System.Collections.Generic; + #if !NETSTANDARD1_1 - using System.Security.Cryptography; +using System.Security.Cryptography; #endif +namespace SixLabors.ImageSharp +{ /// /// Represents an ICC profile /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs index 8237dc7a82..e08914a973 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccProfileHeader.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; +using System; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// Contains all values of an ICC profile header /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs index b24c96f023..a01a0beac3 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccReader.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp +{ /// /// Reads and parses ICC data from a byte array /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs index 5db3d96eac..5bada6e772 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccTagDataEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// The data of an ICC tag entry /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs b/src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs index 19c00e8f55..c7f39aff4d 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/IccWriter.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Collections.Generic; - using System.Linq; +using System; +using System.Collections.Generic; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// Contains methods for writing ICC profiles. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs index a20a52d8e6..566a9cff4e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccBAcsProcessElement.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// A placeholder (might be used for future ICC versions) /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs index 7d5855168e..2c93796630 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccClutProcessElement.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// A CLUT (color lookup table) element to process data /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs index c16ca93d24..e081c084e8 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccCurveSetProcessElement.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// A set of curves to process data /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs index 9219f52002..c4a49eeb3f 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccEAcsProcessElement.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// A placeholder (might be used for future ICC versions) /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs index 259f714896..afe41c624c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMatrixProcessElement.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - - using ImageSharp.Memory; +using System; +using System.Linq; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp +{ /// /// A matrix element to process data /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs index 205e61f011..ebac2912b4 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/MultiProcessElements/IccMultiProcessElement.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// An element to process data /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs index 85f40f5e41..a7a70c11bd 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// The chromaticity tag type provides basic chromaticity data /// and type of phosphors or colorants of a monitor to applications and utilities. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs index 9be5541a28..654af027eb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This tag specifies the laydown order in which colorants /// will be printed on an n-colorant device. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs index 041f74f391..5adc7ca283 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// The purpose of this tag is to identify the colorants used in /// the profile by a unique name and set of PCSXYZ or PCSLAB values diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs index 73588bbf05..431ffa887c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// This type contains the PostScript product name to which this profile /// corresponds and the names of the companion CRDs diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs index c14995748b..0ab80e5065 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// The type contains a one-dimensional table of double values. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs index 57f04b11ae..f39330d6cd 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - using System.Text; +using System; +using System.Linq; +using System.Text; +namespace SixLabors.ImageSharp +{ /// /// The dataType is a simple data structure that contains /// either 7-bit ASCII or binary data, i.e. textType data or transparent bytes. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs index 7111913cbf..4dc935b9b5 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// This type is a representation of the time and date. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs index c91347d23f..d8d67465bb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type represents an array of doubles (from 32bit fixed point values). /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs index 45d7b3c50c..fec50e3e3a 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - using System.Numerics; +using System; +using System.Linq; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// This structure represents a color transform using tables /// with 16-bit precision. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs index 538cf0505b..89e5e38949 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - using System.Numerics; +using System; +using System.Linq; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// This structure represents a color transform using tables /// with 8-bit precision. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs index d440447cca..17720dd5dd 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - using System.Numerics; +using System; +using System.Linq; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// This structure represents a color transform. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs index 9d63dd171f..51566c4b0f 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - using System.Numerics; +using System; +using System.Linq; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// This structure represents a color transform. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs index 390a5ba54d..31278da621 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; +using System; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// The measurementType information refers only to the internal /// profile data and is meant to provide profile makers an alternative diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs index 573e77ed47..bdf9162018 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This tag structure contains a set of records each referencing /// a multilingual string associated with a profile. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs index e3e6ef1437..954096f44f 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This structure represents a color transform, containing /// a sequence of processing elements. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs index 17b7213b24..e7a13c28a8 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// The namedColor2Type is a count value and array of structures /// that provide color coordinates for color names. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs index 4264c0b24d..3791083710 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// The parametricCurveType describes a one-dimensional curve by /// specifying one of a predefined set of functions using the parameters. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs index 547483e233..e4f6b2e28e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type is an array of structures, each of which contains information /// from the header fields and tags from the original profiles which were diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs index 1a1b02c0bc..e980a9715c 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type is an array of structures, each of which contains information /// for identification of a profile used in a sequence. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs index f4fc7fbd21..dd3f782957 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// The purpose of this tag type is to provide a mechanism to relate physical /// colorant amounts with the normalized device codes produced by lut8Type, lut16Type, diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs index 8c3a2d83b1..dad5d86587 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type describes various screening parameters including /// screen frequency, screening angle, and spot shape. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs index 9ce2c1b9ae..a6367f55b8 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Typically this type is used for registered tags that can /// be displayed on many development systems as a sequence of four characters. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs index 202220f93f..306ad2689f 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Globalization; +using System; +using System.Globalization; +namespace SixLabors.ImageSharp +{ /// /// The TextDescriptionType contains three types of text description. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs index 9e56a1cf8a..772782619b 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// This is a simple text structure that contains a text string. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs index 2b7b4044d8..77f8e1c87e 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type represents an array of doubles (from 32bit values). /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs index da77253102..c42d5338ce 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type represents an array of unsigned shorts. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs index 0dabdecc12..d322d48a73 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type represents an array of unsigned 32bit integers. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs index d62a4a8a79..5ff2b37b75 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type represents an array of unsigned 64bit integers. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs index 30363df9dd..72f6dcc573 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type represents an array of bytes. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs index e668e5cfdd..e189e9ae70 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This type contains curves representing the under color removal and black generation /// and a text string which is a general description of the method used for the UCR and BG. diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs index 79549b7c81..7628a2e14d 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// This tag stores data of an unknown tag data entry /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs index 5f7406ef11..980f5b53bd 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; +using System; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// This type represents a set of viewing condition parameters. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs index 77f9ff7069..8b41cb5fba 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccXyzTagDataEntry.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; - using System.Numerics; +using System; +using System.Linq; +using System.Numerics; +namespace SixLabors.ImageSharp +{ /// /// The XYZType contains an array of XYZ values. /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs index d527d4052e..d9d8dc9ee7 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// Color Lookup Table /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs index bd89550750..b9b43e9b2a 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Entry of ICC colorant table /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs index 0e27729638..6ffc51dbbd 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLocalizedString.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Globalization; +using System; +using System.Globalization; +namespace SixLabors.ImageSharp +{ /// /// A string with a specific locale /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs index 9b86e11139..3777a96eb3 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// Lookup Table /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs index 5d51615684..b59778caf4 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// A specific color with a name /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccPositionNumber.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccPositionNumber.cs index 768aead0ef..9e58fd0281 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccPositionNumber.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccPositionNumber.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Position of an object within an ICC profile /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs index 4f744631d8..2bb894d338 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// ICC Profile description /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs index fc4760d3f1..955fd89eb0 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// ICC Profile ID /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs index 65507bf6bf..7f5ab7d7fb 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Linq; +using System; +using System.Linq; +namespace SixLabors.ImageSharp +{ /// /// Description of a profile within a sequence /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs index 5c58aa1b16..4607857c68 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Associates a normalized device code with a measurement value /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs index ac0e89bb05..dae6abb4da 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// A single channel of a /// diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs index 7937569991..4d900444fa 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; +using System; +namespace SixLabors.ImageSharp +{ /// /// Entry of ICC tag table /// diff --git a/src/ImageSharp/Numerics/LongRational.cs b/src/ImageSharp/Numerics/LongRational.cs index f56abc2899..48494d6466 100644 --- a/src/ImageSharp/Numerics/LongRational.cs +++ b/src/ImageSharp/Numerics/LongRational.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Globalization; - using System.Text; +using System; +using System.Globalization; +using System.Text; +namespace SixLabors.ImageSharp +{ /// /// Represents a number that can be expressed as a fraction /// diff --git a/src/ImageSharp/Numerics/Rational.cs b/src/ImageSharp/Numerics/Rational.cs index d219a54696..03941b90d8 100644 --- a/src/ImageSharp/Numerics/Rational.cs +++ b/src/ImageSharp/Numerics/Rational.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Globalization; +using System; +using System.Globalization; +namespace SixLabors.ImageSharp +{ /// /// Represents a number that can be expressed as a fraction. /// diff --git a/src/ImageSharp/Numerics/SignedRational.cs b/src/ImageSharp/Numerics/SignedRational.cs index bd2213dce0..8821bd28c6 100644 --- a/src/ImageSharp/Numerics/SignedRational.cs +++ b/src/ImageSharp/Numerics/SignedRational.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Globalization; +using System; +using System.Globalization; +namespace SixLabors.ImageSharp +{ /// /// Represents a number that can be expressed as a fraction. /// diff --git a/src/ImageSharp/Numerics/ValueSize.cs b/src/ImageSharp/Numerics/ValueSize.cs index af7454c191..659e0ebfe1 100644 --- a/src/ImageSharp/Numerics/ValueSize.cs +++ b/src/ImageSharp/Numerics/ValueSize.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using SixLabors.Primitives; +using System; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Represents a value in relation to a value on the image /// diff --git a/src/ImageSharp/PixelFormats/Alpha8.cs b/src/ImageSharp/PixelFormats/Alpha8.cs index 59934fdc64..c266035a6b 100644 --- a/src/ImageSharp/PixelFormats/Alpha8.cs +++ b/src/ImageSharp/PixelFormats/Alpha8.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing a single 8 bit normalized W values. /// diff --git a/src/ImageSharp/PixelFormats/Argb32.cs b/src/ImageSharp/PixelFormats/Argb32.cs index f389723dc3..33294838e6 100644 --- a/src/ImageSharp/PixelFormats/Argb32.cs +++ b/src/ImageSharp/PixelFormats/Argb32.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. /// The color components are stored in alpha, red, green, and blue order. diff --git a/src/ImageSharp/PixelFormats/Bgr24.cs b/src/ImageSharp/PixelFormats/Bgr24.cs index aaed5c3852..e210856b36 100644 --- a/src/ImageSharp/PixelFormats/Bgr24.cs +++ b/src/ImageSharp/PixelFormats/Bgr24.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Pixel type containing three 8-bit unsigned normalized values ranging from 0 to 255. /// The color components are stored in blue, green, red order. diff --git a/src/ImageSharp/PixelFormats/Bgr565.cs b/src/ImageSharp/PixelFormats/Bgr565.cs index af22b14a09..b4e7aad583 100644 --- a/src/ImageSharp/PixelFormats/Bgr565.cs +++ b/src/ImageSharp/PixelFormats/Bgr565.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing unsigned normalized values ranging from 0 to 1. The x and z components use 5 bits, and the y component uses 6 bits. /// diff --git a/src/ImageSharp/PixelFormats/Bgra32.cs b/src/ImageSharp/PixelFormats/Bgra32.cs index f1ac20b567..e8469414d3 100644 --- a/src/ImageSharp/PixelFormats/Bgra32.cs +++ b/src/ImageSharp/PixelFormats/Bgra32.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. /// The color components are stored in blue, green, red, and alpha order. diff --git a/src/ImageSharp/PixelFormats/Bgra4444.cs b/src/ImageSharp/PixelFormats/Bgra4444.cs index 746e1062ba..c51a872d1a 100644 --- a/src/ImageSharp/PixelFormats/Bgra4444.cs +++ b/src/ImageSharp/PixelFormats/Bgra4444.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing unsigned normalized values, ranging from 0 to 1, using 4 bits each for x, y, z, and w. /// diff --git a/src/ImageSharp/PixelFormats/Bgra5551.cs b/src/ImageSharp/PixelFormats/Bgra5551.cs index 198f911088..8be4ce82c9 100644 --- a/src/ImageSharp/PixelFormats/Bgra5551.cs +++ b/src/ImageSharp/PixelFormats/Bgra5551.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing unsigned normalized values ranging from 0 to 1. The x , y and z components use 5 bits, and the w component uses 1 bit. /// diff --git a/src/ImageSharp/PixelFormats/Byte4.cs b/src/ImageSharp/PixelFormats/Byte4.cs index 14053ba122..829937c8ad 100644 --- a/src/ImageSharp/PixelFormats/Byte4.cs +++ b/src/ImageSharp/PixelFormats/Byte4.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing four 8-bit unsigned integer values, ranging from 0 to 255. /// diff --git a/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs b/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs index 92fb006abf..c646d804ac 100644 --- a/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs +++ b/src/ImageSharp/PixelFormats/ColorBuilder{TPixel}.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Globalization; +using System; +using System.Globalization; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// A set of named colors mapped to the provided Color space. /// diff --git a/src/ImageSharp/PixelFormats/ColorConstants.cs b/src/ImageSharp/PixelFormats/ColorConstants.cs index 236d3a889e..f97d3b190e 100644 --- a/src/ImageSharp/PixelFormats/ColorConstants.cs +++ b/src/ImageSharp/PixelFormats/ColorConstants.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Collections.Generic; +using System; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Provides useful color definitions. /// diff --git a/src/ImageSharp/PixelFormats/ComponentOrder.cs b/src/ImageSharp/PixelFormats/ComponentOrder.cs index 8f151b41d6..d7d35726c8 100644 --- a/src/ImageSharp/PixelFormats/ComponentOrder.cs +++ b/src/ImageSharp/PixelFormats/ComponentOrder.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats +namespace SixLabors.ImageSharp.PixelFormats { /// /// Enumerates the various component orders. diff --git a/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs b/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs index c042d76786..04ce766e56 100644 --- a/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs +++ b/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.cs @@ -5,7 +5,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.PixelFormats +namespace SixLabors.ImageSharp.PixelFormats { using System; using System.Numerics; diff --git a/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.tt b/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.tt index 16292489fc..4f64086c9e 100644 --- a/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.tt +++ b/src/ImageSharp/PixelFormats/Generated/PixelOperations{TPixel}.Generated.tt @@ -102,7 +102,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.PixelFormats +namespace SixLabors.ImageSharp.PixelFormats { using System; using System.Numerics; diff --git a/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.cs b/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.cs index e42c575d89..952b8baeb5 100644 --- a/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.cs +++ b/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.cs @@ -5,15 +5,15 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp +namespace SixLabors.ImageSharp { using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.Memory; + using SixLabors.ImageSharp.PixelFormats; /// /// Provides optimized overrides for bulk operations. diff --git a/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt b/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt index 9c01fa9157..0492fa40ae 100644 --- a/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt +++ b/src/ImageSharp/PixelFormats/Generated/Rgba32.PixelOperations.Generated.tt @@ -66,15 +66,15 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp +namespace SixLabors.ImageSharp { using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.Memory; + using SixLabors.ImageSharp.PixelFormats; /// /// Provides optimized overrides for bulk operations. diff --git a/src/ImageSharp/PixelFormats/HalfSingle.cs b/src/ImageSharp/PixelFormats/HalfSingle.cs index 3bdfc9f1cf..2394b1be88 100644 --- a/src/ImageSharp/PixelFormats/HalfSingle.cs +++ b/src/ImageSharp/PixelFormats/HalfSingle.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing a single 16 bit floating point value. /// diff --git a/src/ImageSharp/PixelFormats/HalfTypeHelper.cs b/src/ImageSharp/PixelFormats/HalfTypeHelper.cs index 740795adc6..4d6ef0fb40 100644 --- a/src/ImageSharp/PixelFormats/HalfTypeHelper.cs +++ b/src/ImageSharp/PixelFormats/HalfTypeHelper.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Helper methods for packing and unpacking floating point values /// diff --git a/src/ImageSharp/PixelFormats/HalfVector2.cs b/src/ImageSharp/PixelFormats/HalfVector2.cs index 7f1fe4ebdd..aa5f321908 100644 --- a/src/ImageSharp/PixelFormats/HalfVector2.cs +++ b/src/ImageSharp/PixelFormats/HalfVector2.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing two 16-bit floating-point values. /// diff --git a/src/ImageSharp/PixelFormats/HalfVector4.cs b/src/ImageSharp/PixelFormats/HalfVector4.cs index 062287dbe6..87a1c9a498 100644 --- a/src/ImageSharp/PixelFormats/HalfVector4.cs +++ b/src/ImageSharp/PixelFormats/HalfVector4.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing four 16-bit floating-point values. /// diff --git a/src/ImageSharp/PixelFormats/IPackedVector{TPacked}.cs b/src/ImageSharp/PixelFormats/IPackedVector{TPacked}.cs index ec283e6f2a..6775cbc589 100644 --- a/src/ImageSharp/PixelFormats/IPackedVector{TPacked}.cs +++ b/src/ImageSharp/PixelFormats/IPackedVector{TPacked}.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; +using System; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// This interface exists for ensuring signature compatibility to MonoGame and XNA packed color types. /// diff --git a/src/ImageSharp/PixelFormats/IPixel.cs b/src/ImageSharp/PixelFormats/IPixel.cs index 9090e1210c..37c505c848 100644 --- a/src/ImageSharp/PixelFormats/IPixel.cs +++ b/src/ImageSharp/PixelFormats/IPixel.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; +using System; +using System.Numerics; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// An interface that represents a generic pixel type. /// diff --git a/src/ImageSharp/PixelFormats/NamedColors{TPixel}.cs b/src/ImageSharp/PixelFormats/NamedColors{TPixel}.cs index 0b55dcbf91..45050de72e 100644 --- a/src/ImageSharp/PixelFormats/NamedColors{TPixel}.cs +++ b/src/ImageSharp/PixelFormats/NamedColors{TPixel}.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats +namespace SixLabors.ImageSharp.PixelFormats { /// /// A set of named colors mapped to the provided color space. diff --git a/src/ImageSharp/PixelFormats/NormalizedByte2.cs b/src/ImageSharp/PixelFormats/NormalizedByte2.cs index 992986f92b..9a69f6ab36 100644 --- a/src/ImageSharp/PixelFormats/NormalizedByte2.cs +++ b/src/ImageSharp/PixelFormats/NormalizedByte2.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed packed pixel type containing two 8-bit signed normalized values, ranging from −1 to 1. /// diff --git a/src/ImageSharp/PixelFormats/NormalizedByte4.cs b/src/ImageSharp/PixelFormats/NormalizedByte4.cs index 99f603f690..920f92cae7 100644 --- a/src/ImageSharp/PixelFormats/NormalizedByte4.cs +++ b/src/ImageSharp/PixelFormats/NormalizedByte4.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing four 8-bit signed normalized values, ranging from −1 to 1. /// diff --git a/src/ImageSharp/PixelFormats/NormalizedShort2.cs b/src/ImageSharp/PixelFormats/NormalizedShort2.cs index a0615563f0..6d28f61c25 100644 --- a/src/ImageSharp/PixelFormats/NormalizedShort2.cs +++ b/src/ImageSharp/PixelFormats/NormalizedShort2.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing two 16-bit signed normalized values, ranging from −1 to 1. /// diff --git a/src/ImageSharp/PixelFormats/NormalizedShort4.cs b/src/ImageSharp/PixelFormats/NormalizedShort4.cs index f35fb63684..45f984da0b 100644 --- a/src/ImageSharp/PixelFormats/NormalizedShort4.cs +++ b/src/ImageSharp/PixelFormats/NormalizedShort4.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing four 16-bit signed normalized values, ranging from −1 to 1. /// diff --git a/src/ImageSharp/PixelFormats/PackedPixelConverterHelper.cs b/src/ImageSharp/PixelFormats/PackedPixelConverterHelper.cs index 2a25ffc164..0537ff514e 100644 --- a/src/ImageSharp/PixelFormats/PackedPixelConverterHelper.cs +++ b/src/ImageSharp/PixelFormats/PackedPixelConverterHelper.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; +using System; +using System.Numerics; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Assists with the conversion of known packed pixel formats from one to another. /// diff --git a/src/ImageSharp/PixelFormats/PixelBlenderMode.cs b/src/ImageSharp/PixelFormats/PixelBlenderMode.cs index 1e48f71814..ae70cdee43 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenderMode.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenderMode.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Collections.Generic; - using System.Text; +using System; +using System.Collections.Generic; +using System.Text; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// The various blending modes. /// diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs index 915d9a9244..e76ff4b803 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.cs @@ -4,11 +4,11 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.PixelFormats.PixelBlenders +namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders { using System; using System.Numerics; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; /// diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt index 230b05499f..0dfe7101a1 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelBlenders/DefaultPixelBlenders.Generated.tt @@ -16,11 +16,11 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.PixelFormats.PixelBlenders +namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders { using System; using System.Numerics; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; /// diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs index 4213be0bae..c221b1b0e9 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.cs @@ -4,7 +4,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.PixelFormats.PixelBlenders +namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders { using System.Numerics; using System.Runtime.CompilerServices; diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt index 53d22d8f38..4387caaf89 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt +++ b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.Generated.tt @@ -16,7 +16,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.PixelFormats.PixelBlenders +namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders { using System.Numerics; using System.Runtime.CompilerServices; diff --git a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.cs b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.cs index b1fca9520c..04c750255f 100644 --- a/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.cs +++ b/src/ImageSharp/PixelFormats/PixelBlenders/PorterDuffFunctions.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats.PixelBlenders -{ - using System.Numerics; - using System.Runtime.CompilerServices; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats.PixelBlenders +{ /// /// Collection of Porter Duff alpha blending functions applying an the 'Over' composition model. /// diff --git a/src/ImageSharp/PixelFormats/PixelBlender{TPixel}.cs b/src/ImageSharp/PixelFormats/PixelBlender{TPixel}.cs index 1a1d1cd054..54cb09c28a 100644 --- a/src/ImageSharp/PixelFormats/PixelBlender{TPixel}.cs +++ b/src/ImageSharp/PixelFormats/PixelBlender{TPixel}.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; +using System; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Abstract base class for calling pixel composition functions /// diff --git a/src/ImageSharp/PixelFormats/PixelConversionExtensions.cs b/src/ImageSharp/PixelFormats/PixelConversionExtensions.cs index 1ea2628951..37b225d2e0 100644 --- a/src/ImageSharp/PixelFormats/PixelConversionExtensions.cs +++ b/src/ImageSharp/PixelFormats/PixelConversionExtensions.cs @@ -1,8 +1,11 @@ -namespace ImageSharp.PixelFormats -{ - using System; - using System.Runtime.CompilerServices; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Extension methods for copying single pixel data into byte Spans. /// TODO: This utility class exists for legacy reasons. Need to do a lot of chore work to remove it (mostly in test classes). diff --git a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.PixelBenders.cs b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.PixelBenders.cs index 5a3737dc66..154ec73738 100644 --- a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.PixelBenders.cs +++ b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.PixelBenders.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using ImageSharp.PixelFormats.PixelBlenders; +using SixLabors.ImageSharp.PixelFormats.PixelBlenders; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Provides access to pixel blenders /// diff --git a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs index a62d14527a..4f879fbdc7 100644 --- a/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs +++ b/src/ImageSharp/PixelFormats/PixelOperations{TPixel}.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// A stateless class implementing Strategy Pattern for batched pixel-data conversion operations /// for pixel buffers of type . diff --git a/src/ImageSharp/PixelFormats/Rg32.cs b/src/ImageSharp/PixelFormats/Rg32.cs index 0575689a77..d2c296515f 100644 --- a/src/ImageSharp/PixelFormats/Rg32.cs +++ b/src/ImageSharp/PixelFormats/Rg32.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing two 16-bit unsigned normalized values ranging from 0 to 1. /// diff --git a/src/ImageSharp/PixelFormats/Rgb24.cs b/src/ImageSharp/PixelFormats/Rgb24.cs index b8cc8dc24f..5a12cff201 100644 --- a/src/ImageSharp/PixelFormats/Rgb24.cs +++ b/src/ImageSharp/PixelFormats/Rgb24.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Pixel type containing three 8-bit unsigned normalized values ranging from 0 to 255. /// The color components are stored in red, green, blue order. diff --git a/src/ImageSharp/PixelFormats/Rgba1010102.cs b/src/ImageSharp/PixelFormats/Rgba1010102.cs index e682aa4772..e6967d23ea 100644 --- a/src/ImageSharp/PixelFormats/Rgba1010102.cs +++ b/src/ImageSharp/PixelFormats/Rgba1010102.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed vector type containing unsigned normalized values ranging from 0 to 1. /// The x, y and z components use 10 bits, and the w component uses 2 bits. diff --git a/src/ImageSharp/PixelFormats/Rgba32.Definitions.cs b/src/ImageSharp/PixelFormats/Rgba32.Definitions.cs index ab4c2ea606..b5fed5a357 100644 --- a/src/ImageSharp/PixelFormats/Rgba32.Definitions.cs +++ b/src/ImageSharp/PixelFormats/Rgba32.Definitions.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Provides standardized deifinitions for named colors. /// diff --git a/src/ImageSharp/PixelFormats/Rgba32.PixelOperations.cs b/src/ImageSharp/PixelFormats/Rgba32.PixelOperations.cs index 63e40e9cf7..a99c10d87d 100644 --- a/src/ImageSharp/PixelFormats/Rgba32.PixelOperations.cs +++ b/src/ImageSharp/PixelFormats/Rgba32.PixelOperations.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Provides optimized overrides for bulk operations. /// diff --git a/src/ImageSharp/PixelFormats/Rgba32.cs b/src/ImageSharp/PixelFormats/Rgba32.cs index 85322c7c5c..045332ccf8 100644 --- a/src/ImageSharp/PixelFormats/Rgba32.cs +++ b/src/ImageSharp/PixelFormats/Rgba32.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp +{ /// /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. /// The color components are stored in red, green, blue, and alpha order. diff --git a/src/ImageSharp/PixelFormats/Rgba64.cs b/src/ImageSharp/PixelFormats/Rgba64.cs index bdcf13763d..040ae15b1c 100644 --- a/src/ImageSharp/PixelFormats/Rgba64.cs +++ b/src/ImageSharp/PixelFormats/Rgba64.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing four 16-bit unsigned normalized values ranging from 0 to 1. /// diff --git a/src/ImageSharp/PixelFormats/RgbaComponent.cs b/src/ImageSharp/PixelFormats/RgbaComponent.cs index ed85fb86bb..edadd5818e 100644 --- a/src/ImageSharp/PixelFormats/RgbaComponent.cs +++ b/src/ImageSharp/PixelFormats/RgbaComponent.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Enumerates the RGBA (red, green, blue, alpha) color components. diff --git a/src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs b/src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs index dc965f9ff5..2ef37c43ae 100644 --- a/src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs +++ b/src/ImageSharp/PixelFormats/RgbaVector.Definitions.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats +namespace SixLabors.ImageSharp.PixelFormats { /// /// Provides operators and composition algorithms. diff --git a/src/ImageSharp/PixelFormats/RgbaVector.PixelOperations.cs b/src/ImageSharp/PixelFormats/RgbaVector.PixelOperations.cs index 00b7461661..1886df29f1 100644 --- a/src/ImageSharp/PixelFormats/RgbaVector.PixelOperations.cs +++ b/src/ImageSharp/PixelFormats/RgbaVector.PixelOperations.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - - using ImageSharp.Memory; +using System; +using System.Numerics; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Provides optimized overrides for bulk operations. /// diff --git a/src/ImageSharp/PixelFormats/RgbaVector.cs b/src/ImageSharp/PixelFormats/RgbaVector.cs index c6eed1122e..ba641d590c 100644 --- a/src/ImageSharp/PixelFormats/RgbaVector.cs +++ b/src/ImageSharp/PixelFormats/RgbaVector.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Unpacked pixel type containing four 16-bit floating-point values typically ranging from 0 to 1. /// The color components are stored in red, green, blue, and alpha order. diff --git a/src/ImageSharp/PixelFormats/Short2.cs b/src/ImageSharp/PixelFormats/Short2.cs index 0b3f4be934..1355a94135 100644 --- a/src/ImageSharp/PixelFormats/Short2.cs +++ b/src/ImageSharp/PixelFormats/Short2.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing two 16-bit signed integer values. /// diff --git a/src/ImageSharp/PixelFormats/Short4.cs b/src/ImageSharp/PixelFormats/Short4.cs index 9583009293..aecb4d2de8 100644 --- a/src/ImageSharp/PixelFormats/Short4.cs +++ b/src/ImageSharp/PixelFormats/Short4.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.PixelFormats -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +namespace SixLabors.ImageSharp.PixelFormats +{ /// /// Packed pixel type containing four 16-bit signed integer values. /// diff --git a/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs b/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs index 89d62cc4cb..5a165659b8 100644 --- a/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs +++ b/src/ImageSharp/Processing/Binarization/BinaryThreshold.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Binarization/Dither.cs b/src/ImageSharp/Processing/Binarization/Dither.cs index 2d9ef42631..f21ccf0bd3 100644 --- a/src/ImageSharp/Processing/Binarization/Dither.cs +++ b/src/ImageSharp/Processing/Binarization/Dither.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.Dithering; - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.Dithering; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs b/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs index 71d1d50707..300c073818 100644 --- a/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs +++ b/src/ImageSharp/Processing/ColorMatrix/BlackWhite.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs b/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs index 9ba961a71a..ebfa9ffdcd 100644 --- a/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs +++ b/src/ImageSharp/Processing/ColorMatrix/ColorBlindness.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs b/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs index 6109c54048..bcf48d3e2c 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Grayscale.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/Hue.cs b/src/ImageSharp/Processing/ColorMatrix/Hue.cs index d299b650ae..bfc931977d 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Hue.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Hue.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs b/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs index c0cd7caf7a..d7845320ad 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Kodachrome.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs b/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs index a90551bf3c..947e531578 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Lomograph.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/Options/ColorBlindness.cs b/src/ImageSharp/Processing/ColorMatrix/Options/ColorBlindness.cs index def253234f..1b92029f6b 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Options/ColorBlindness.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Options/ColorBlindness.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the various types of defined color blindness filters. diff --git a/src/ImageSharp/Processing/ColorMatrix/Options/GrayscaleMode.cs b/src/ImageSharp/Processing/ColorMatrix/Options/GrayscaleMode.cs index f1294ffaff..370071b7ab 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Options/GrayscaleMode.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Options/GrayscaleMode.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the various types of defined Grayscale filters. diff --git a/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs b/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs index b968aedfc4..c96087d57e 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Polaroid.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/Saturation.cs b/src/ImageSharp/Processing/ColorMatrix/Saturation.cs index 895362c681..26ca5ec204 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Saturation.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Saturation.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/ColorMatrix/Sepia.cs b/src/ImageSharp/Processing/ColorMatrix/Sepia.cs index 4ef4db14ea..d1116fac8b 100644 --- a/src/ImageSharp/Processing/ColorMatrix/Sepia.cs +++ b/src/ImageSharp/Processing/ColorMatrix/Sepia.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Convolution/BoxBlur.cs b/src/ImageSharp/Processing/Convolution/BoxBlur.cs index eaddfe2dc9..b0c6ffc8d2 100644 --- a/src/ImageSharp/Processing/Convolution/BoxBlur.cs +++ b/src/ImageSharp/Processing/Convolution/BoxBlur.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Convolution/DetectEdges.cs b/src/ImageSharp/Processing/Convolution/DetectEdges.cs index 8721bf4f89..79e7ac6cf4 100644 --- a/src/ImageSharp/Processing/Convolution/DetectEdges.cs +++ b/src/ImageSharp/Processing/Convolution/DetectEdges.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs index 1db4fd5009..9bca97242c 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianBlur.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianBlur.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs index 5f66f1771b..1cea2dae9b 100644 --- a/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs +++ b/src/ImageSharp/Processing/Convolution/GaussianSharpen.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Convolution/Options/EdgeDetection.cs b/src/ImageSharp/Processing/Convolution/Options/EdgeDetection.cs index 809992f005..b01bb945cf 100644 --- a/src/ImageSharp/Processing/Convolution/Options/EdgeDetection.cs +++ b/src/ImageSharp/Processing/Convolution/Options/EdgeDetection.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the various types of defined edge detection filters. diff --git a/src/ImageSharp/Processing/Delegate.cs b/src/ImageSharp/Processing/Delegate.cs index 4b2677c853..b390e46ae9 100644 --- a/src/ImageSharp/Processing/Delegate.cs +++ b/src/ImageSharp/Processing/Delegate.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Effects/Alpha.cs b/src/ImageSharp/Processing/Effects/Alpha.cs index 2081c91bda..2fac64e1cf 100644 --- a/src/ImageSharp/Processing/Effects/Alpha.cs +++ b/src/ImageSharp/Processing/Effects/Alpha.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Effects/BackgroundColor.cs b/src/ImageSharp/Processing/Effects/BackgroundColor.cs index ec9fe32d6e..da00b4ddd0 100644 --- a/src/ImageSharp/Processing/Effects/BackgroundColor.cs +++ b/src/ImageSharp/Processing/Effects/BackgroundColor.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Effects/Brightness.cs b/src/ImageSharp/Processing/Effects/Brightness.cs index d9ed576121..5c76287858 100644 --- a/src/ImageSharp/Processing/Effects/Brightness.cs +++ b/src/ImageSharp/Processing/Effects/Brightness.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Effects/Contrast.cs b/src/ImageSharp/Processing/Effects/Contrast.cs index 0af86e1df4..562ab54dff 100644 --- a/src/ImageSharp/Processing/Effects/Contrast.cs +++ b/src/ImageSharp/Processing/Effects/Contrast.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Effects/Invert.cs b/src/ImageSharp/Processing/Effects/Invert.cs index cc480cf0c3..9c0a7d3772 100644 --- a/src/ImageSharp/Processing/Effects/Invert.cs +++ b/src/ImageSharp/Processing/Effects/Invert.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Effects/OilPainting.cs b/src/ImageSharp/Processing/Effects/OilPainting.cs index 844b5ceb6a..0494c9a8b9 100644 --- a/src/ImageSharp/Processing/Effects/OilPainting.cs +++ b/src/ImageSharp/Processing/Effects/OilPainting.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Effects/Pixelate.cs b/src/ImageSharp/Processing/Effects/Pixelate.cs index 3ae152c2ba..29e348f6e6 100644 --- a/src/ImageSharp/Processing/Effects/Pixelate.cs +++ b/src/ImageSharp/Processing/Effects/Pixelate.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Overlays/Glow.cs b/src/ImageSharp/Processing/Overlays/Glow.cs index e34cbf5915..ee35963487 100644 --- a/src/ImageSharp/Processing/Overlays/Glow.cs +++ b/src/ImageSharp/Processing/Overlays/Glow.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Overlays/Vignette.cs b/src/ImageSharp/Processing/Overlays/Vignette.cs index f0c962627e..cc93ccedc6 100644 --- a/src/ImageSharp/Processing/Overlays/Vignette.cs +++ b/src/ImageSharp/Processing/Overlays/Vignette.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs index ea1b759ab5..7070c993ef 100644 --- a/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/BinaryThresholdProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to perform binary threshold filtering against an /// . The image will be converted to grayscale before thresholding occurs. diff --git a/src/ImageSharp/Processing/Processors/Binarization/ErrorDiffusionDitherProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/ErrorDiffusionDitherProcessor.cs index 85522e2886..2590aa6a00 100644 --- a/src/ImageSharp/Processing/Processors/Binarization/ErrorDiffusionDitherProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/ErrorDiffusionDitherProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - - using ImageSharp.Dithering; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.Dithering; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An that dithers an image using error diffusion. /// diff --git a/src/ImageSharp/Processing/Processors/Binarization/OrderedDitherProcessor.cs b/src/ImageSharp/Processing/Processors/Binarization/OrderedDitherProcessor.cs index a190bcd61b..b71ea97cf7 100644 --- a/src/ImageSharp/Processing/Processors/Binarization/OrderedDitherProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Binarization/OrderedDitherProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Buffers; - - using ImageSharp.Dithering; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Buffers; +using SixLabors.ImageSharp.Dithering; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An that dithers an image using error diffusion. /// diff --git a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs index 5db2d0865d..b4324a9ae3 100644 --- a/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/CloningImageProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing -{ - using System; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing +{ /// /// Allows the application of processors to images. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs index d37d119a41..d8b6ab9514 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/BlackWhiteProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image to their black and white equivalent. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs index a91bd19467..1366a8fe1b 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatomalyProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating Achromatomaly (Color desensitivity) color blindness. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs index d543c4edca..d1925e04df 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/AchromatopsiaProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating Achromatopsia (Monochrome) color blindness. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs index ea73d0c662..964921d262 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranomalyProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating Deuteranomaly (Green-Weak) color blindness. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs index 4b5129a8bf..f35d25a287 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/DeuteranopiaProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating Deuteranopia (Green-Blind) color blindness. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs index 14eea08126..4c43ad0e21 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanomalyProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating Protanopia (Red-Weak) color blindness. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs index 39cb715bde..3a18ed91e2 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/ProtanopiaProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating Protanopia (Red-Blind) color blindness. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs index 2b402197bc..0c337af2d0 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanomalyProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating Tritanomaly (Blue-Weak) color blindness. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs index 5d228afa79..76c9f98e74 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorBlindness/TritanopiaProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating Tritanopia (Blue-Blind) color blindness. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs index 1bac145bc9..45ee1de59e 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/ColorMatrixProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The color matrix filter. Inherit from this class to perform operation involving color matrices. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs index 65de8a66d2..a7033cfc95 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt601Processor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image to Grayscale applying the formula as specified by ITU-R Recommendation BT.601 /// . diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs index 5f71e357b7..db7077620a 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/GrayscaleBt709Processor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image to Grayscale applying the formula as specified by ITU-R Recommendation BT.709 /// . diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs index f286839776..a222f195e9 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/HueProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to change the hue of an . /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs index 0c29c65a10..d7785045fb 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/IColorMatrixFilter.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Encapsulates properties and methods for creating processors that utilize a matrix to /// alter the image pixels. diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs index 18514236f7..e2ab32a70a 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/KodachromeProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating an old Kodachrome camera effect. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs index bb33e51513..7ce96fa355 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/LomographProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating an old Lomograph effect. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs index 5c1bd20b16..96fb084cfd 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/PolaroidProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image recreating an old Polaroid effect. /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs index ffc8eb6b19..38788d9f9e 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/SaturationProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to change the saturation of an . /// diff --git a/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs b/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs index 89be3acad5..610b3d5f1c 100644 --- a/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ColorMatrix/SepiaProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Converts the colors of the image to their sepia equivalent. /// The formula used matches the svg specification. diff --git a/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs index 93a9254802..3c95d29974 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/BoxBlurProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Applies a Box blur sampler to the image. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs index 708b6c6fd8..1fe31be448 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2DProcessor.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Defines a sampler that uses two one-dimensional matrices to perform convolution against an image. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs index e5813f0d5c..16b8075fcf 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/Convolution2PassProcessor.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Defines a sampler that uses two one-dimensional matrices to perform two-pass convolution against an image. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs index cd2eb27004..9e256975e3 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/ConvolutionProcessor.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Defines a sampler that uses a 2 dimensional matrix to perform convolution against an image. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs index ab0b459076..af7a5e276e 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetector2DProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Defines a sampler that detects edges within an image using two one-dimensional matrices. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs index cc21c3e19e..38bffe0c3c 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorCompassProcessor.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Defines a sampler that detects edges within an image using a eight two dimensional matrices. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorProcessor.cs index 1400b6317a..b8e5106b7f 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/EdgeDetectorProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Defines a sampler that detects edges within an image using a single two dimensional matrix. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs index c7c126794d..1561072c82 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/IEdgeDetectorProcessor.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - - using ImageSharp.PixelFormats; +using System; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides properties and methods allowing the detection of edges within an image. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/KayyaliProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/KayyaliProcessor.cs index b1361b514f..8e4cdd6b5a 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/KayyaliProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/KayyaliProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Kayyali operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/KirschProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/KirschProcessor.cs index af4700bb97..c0a3b35954 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/KirschProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/KirschProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Kirsch operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/Laplacian3X3Processor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/Laplacian3X3Processor.cs index 5f58d56f8c..1b5c563187 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/Laplacian3X3Processor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/Laplacian3X3Processor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Laplacian 3 x 3 operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/Laplacian5X5Processor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/Laplacian5X5Processor.cs index 2e365374cf..11438fe8db 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/Laplacian5X5Processor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/Laplacian5X5Processor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Laplacian 5 x 5 operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs index de2594653d..424c01137e 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/LaplacianOfGaussianProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Laplacian of Gaussian operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/PrewittProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/PrewittProcessor.cs index 1b2d5f50ed..0d2e9b2066 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/PrewittProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/PrewittProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Prewitt operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/RobertsCrossProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/RobertsCrossProcessor.cs index d1b9614b62..09aa8ecb6c 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/RobertsCrossProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/RobertsCrossProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Roberts Cross operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/RobinsonProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/RobinsonProcessor.cs index bc687f6743..18f8cbf18c 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/RobinsonProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/RobinsonProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Kirsch operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/ScharrProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/ScharrProcessor.cs index 339b9741fc..e299d3f807 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/ScharrProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/ScharrProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Scharr operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/SobelProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/SobelProcessor.cs index b9060ecbca..e975e4ff6c 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/SobelProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/EdgeDetection/SobelProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +using System; +using System.Diagnostics.CodeAnalysis; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// The Sobel operator filter. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs index dcafd0d91e..583d38bf7f 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/GaussianBlurProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Applies a Gaussian blur sampler to the image. /// diff --git a/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs b/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs index 84a7f9b09c..e22904ae1c 100644 --- a/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Convolution/GaussianSharpenProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Applies a Gaussian sharpening sampler to the image. /// diff --git a/src/ImageSharp/Processing/Processors/DelegateProcessor.cs b/src/ImageSharp/Processing/Processors/DelegateProcessor.cs index d594bf23ee..e1bd8c5265 100644 --- a/src/ImageSharp/Processing/Processors/DelegateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/DelegateProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing -{ - using System; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing +{ /// /// Allows the application of processors to images. /// diff --git a/src/ImageSharp/Processing/Processors/Effects/AlphaProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/AlphaProcessor.cs index 0efca43b26..ce0998a3c1 100644 --- a/src/ImageSharp/Processing/Processors/Effects/AlphaProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/AlphaProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to change the alpha component of an . /// diff --git a/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs index 96a2b704f7..21cc22bc9c 100644 --- a/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/BackgroundColorProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Sets the background color of the image. /// diff --git a/src/ImageSharp/Processing/Processors/Effects/BrightnessProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/BrightnessProcessor.cs index 3fbe1742ed..096f6b7abd 100644 --- a/src/ImageSharp/Processing/Processors/Effects/BrightnessProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/BrightnessProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to change the brightness of an . /// diff --git a/src/ImageSharp/Processing/Processors/Effects/ContrastProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/ContrastProcessor.cs index e40f8d5de5..ba4c8b4dcb 100644 --- a/src/ImageSharp/Processing/Processors/Effects/ContrastProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/ContrastProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to change the contrast of an . /// diff --git a/src/ImageSharp/Processing/Processors/Effects/InvertProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/InvertProcessor.cs index 07a57db54a..683433e28e 100644 --- a/src/ImageSharp/Processing/Processors/Effects/InvertProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/InvertProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to invert the colors of an . /// diff --git a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs index 383917c45f..dc4ef1007b 100644 --- a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to apply an oil painting effect to an . /// diff --git a/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs b/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs index a44e85ef31..7050e5eeb7 100644 --- a/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Effects/PixelateProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Collections.Generic; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An to pixelate the colors of an . /// diff --git a/src/ImageSharp/Processing/Processors/ImageProcessor.cs b/src/ImageSharp/Processing/Processors/ImageProcessor.cs index a4ed4eb988..84ad7f8993 100644 --- a/src/ImageSharp/Processing/Processors/ImageProcessor.cs +++ b/src/ImageSharp/Processing/Processors/ImageProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing -{ - using System; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing +{ /// /// Allows the application of processors to images. /// diff --git a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs index 2b9c88f2d6..99300eb964 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/GlowProcessor.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An that applies a radial glow effect an . /// diff --git a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs index de50dd84bf..58e579509a 100644 --- a/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Overlays/VignetteProcessor.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// An that applies a radial vignette effect to an . /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs index 3a4eb31aee..e568bdea83 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/AutoRotateProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Adjusts an image so that its orientation is suitable for viewing. Adjustments are based on EXIF metadata embedded in the image. /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs index 37f8867755..d68c289db1 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/CropProcessor.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Threading.Tasks; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides methods to allow the cropping of an image. /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs index 648e86d3c9..89e22a7e6b 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/EntropyCropProcessor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides methods to allow the cropping of an image to preserve areas of highest /// entropy. diff --git a/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs index cba60f928e..f0173a6666 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/FlipProcessor.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides methods that allow the flipping of an image around its center point. /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/Matrix3x2Processor.cs b/src/ImageSharp/Processing/Processors/Transforms/Matrix3x2Processor.cs index d1a35659b3..54724ee782 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/Matrix3x2Processor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/Matrix3x2Processor.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System.Numerics; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides methods to transform an image using a . /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.Weights.cs b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.Weights.cs index 8aef87ec85..1169d2eadc 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.Weights.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.Weights.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - - using ImageSharp.Memory; +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Conains the definition of and . /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs index 59c0c37a27..8d5eeded15 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResamplingWeightedProcessor.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Runtime.CompilerServices; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides methods that allow the resizing of images using various algorithms. /// Adapted from diff --git a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs index 2853867460..592e8d2e34 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/ResizeProcessor.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides methods that allow the resizing of images using various algorithms. /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs index 1959bb9cb5..b8341d4027 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/RotateProcessor.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides methods that allow the rotating of images. /// diff --git a/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs index 757f3fa0be..c6d7921e26 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing.Processors -{ - using System; - using System.Numerics; - using System.Threading.Tasks; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing.Processors +{ /// /// Provides methods that allow the skewing of images. /// diff --git a/src/ImageSharp/Processing/Transforms/AutoOrient.cs b/src/ImageSharp/Processing/Transforms/AutoOrient.cs index f01fbef3dc..186c3b2236 100644 --- a/src/ImageSharp/Processing/Transforms/AutoOrient.cs +++ b/src/ImageSharp/Processing/Transforms/AutoOrient.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Transforms/Crop.cs b/src/ImageSharp/Processing/Transforms/Crop.cs index 6a8b02d023..3fa59c2483 100644 --- a/src/ImageSharp/Processing/Transforms/Crop.cs +++ b/src/ImageSharp/Processing/Transforms/Crop.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs b/src/ImageSharp/Processing/Transforms/EntropyCrop.cs index 8c5f32dd04..cbd2b46599 100644 --- a/src/ImageSharp/Processing/Transforms/EntropyCrop.cs +++ b/src/ImageSharp/Processing/Transforms/EntropyCrop.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Transforms/Flip.cs b/src/ImageSharp/Processing/Transforms/Flip.cs index 071662ae66..e153e89f28 100644 --- a/src/ImageSharp/Processing/Transforms/Flip.cs +++ b/src/ImageSharp/Processing/Transforms/Flip.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Transforms/Options/AnchorPosition.cs b/src/ImageSharp/Processing/Transforms/Options/AnchorPosition.cs index 67010a777f..263af14ccd 100644 --- a/src/ImageSharp/Processing/Transforms/Options/AnchorPosition.cs +++ b/src/ImageSharp/Processing/Transforms/Options/AnchorPosition.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Enumerated anchor positions to apply to resized images. diff --git a/src/ImageSharp/Processing/Transforms/Options/FlipType.cs b/src/ImageSharp/Processing/Transforms/Options/FlipType.cs index 3c66da697f..0129891f66 100644 --- a/src/ImageSharp/Processing/Transforms/Options/FlipType.cs +++ b/src/ImageSharp/Processing/Transforms/Options/FlipType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Provides enumeration over how a image should be flipped. diff --git a/src/ImageSharp/Processing/Transforms/Options/Orientation.cs b/src/ImageSharp/Processing/Transforms/Options/Orientation.cs index b8147348f7..9c8d96a71c 100644 --- a/src/ImageSharp/Processing/Transforms/Options/Orientation.cs +++ b/src/ImageSharp/Processing/Transforms/Options/Orientation.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Enumerates the available orientation values supplied by EXIF metadata. diff --git a/src/ImageSharp/Processing/Transforms/Options/ResizeHelper.cs b/src/ImageSharp/Processing/Transforms/Options/ResizeHelper.cs index 7eae89eac0..90f50ec3dc 100644 --- a/src/ImageSharp/Processing/Transforms/Options/ResizeHelper.cs +++ b/src/ImageSharp/Processing/Transforms/Options/ResizeHelper.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing -{ - using System.Linq; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; +using System.Linq; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing +{ /// /// Provides methods to help calculate the target rectangle when resizing using the /// enumeration. diff --git a/src/ImageSharp/Processing/Transforms/Options/ResizeMode.cs b/src/ImageSharp/Processing/Transforms/Options/ResizeMode.cs index dc6092de84..c88808f758 100644 --- a/src/ImageSharp/Processing/Transforms/Options/ResizeMode.cs +++ b/src/ImageSharp/Processing/Transforms/Options/ResizeMode.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Enumerated resize modes to apply to resized images. diff --git a/src/ImageSharp/Processing/Transforms/Options/ResizeOptions.cs b/src/ImageSharp/Processing/Transforms/Options/ResizeOptions.cs index 2ca2b1c39d..8f2d3db0a9 100644 --- a/src/ImageSharp/Processing/Transforms/Options/ResizeOptions.cs +++ b/src/ImageSharp/Processing/Transforms/Options/ResizeOptions.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing -{ - using System.Collections.Generic; - using System.Linq; - using SixLabors.Primitives; +using System.Collections.Generic; +using System.Linq; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Processing +{ /// /// The resize options for resizing images against certain modes. /// diff --git a/src/ImageSharp/Processing/Transforms/Options/RotateType.cs b/src/ImageSharp/Processing/Transforms/Options/RotateType.cs index 9f09cec280..9f6d45f2bf 100644 --- a/src/ImageSharp/Processing/Transforms/Options/RotateType.cs +++ b/src/ImageSharp/Processing/Transforms/Options/RotateType.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Provides enumeration over how the image should be rotated. diff --git a/src/ImageSharp/Processing/Transforms/Pad.cs b/src/ImageSharp/Processing/Transforms/Pad.cs index 40fd6da6e4..eb0f2e9c27 100644 --- a/src/ImageSharp/Processing/Transforms/Pad.cs +++ b/src/ImageSharp/Processing/Transforms/Pad.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs index e40bf59f92..be9de9edaa 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/BicubicResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the bicubic kernel algorithm W(x) as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs index f174ef48bd..5aab0d07fa 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/BoxResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the box algorithm. Similar to nearest neighbor when upscaling. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs index 0725ecb537..1c84676188 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/CatmullRomResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The Catmull-Rom filter is a well known standard Cubic Filter often used as a interpolation function. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs index 66cc36a21f..33435059f1 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/HermiteResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The Hermite filter is type of smoothed triangular interpolation Filter, diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs index 6339d9d8ea..9a128a05be 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/IResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// Encapsulates an interpolation algorithm for resampling images. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs index a46f38df42..deaa0ccb95 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos2Resampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the Lanczos kernel algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs index 3ad01b2b7b..2673c34914 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos3Resampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the Lanczos kernel algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs index 9bb8bdd16f..c52670e2d0 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos5Resampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the Lanczos kernel algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs index af8c2c111c..552d3065b4 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/Lanczos8Resampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the Lanczos kernel algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs index 38ca614c4a..df351d9505 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/MitchellNetravaliResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the mitchell algorithm as described on diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs index f1e5ab8fdb..7a7785be36 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/NearestNeighborResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the nearest neighbor algorithm. This uses an unscaled filter diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs index 1b060e6e3f..bd28d8da46 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the Robidoux algorithm. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs index 86c7b0517c..a345da3f42 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/RobidouxSharpResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the Robidoux Sharp algorithm. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs index abd5b835c6..ac5e2dedba 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/SplineResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the spline algorithm. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs index bf88b65df8..842da87e06 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/TriangleResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the triangle (bilinear) algorithm. diff --git a/src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs b/src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs index 33a2cc825e..e154d5483b 100644 --- a/src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs +++ b/src/ImageSharp/Processing/Transforms/Resamplers/WelchResampler.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Processing +namespace SixLabors.ImageSharp.Processing { /// /// The function implements the welch algorithm. diff --git a/src/ImageSharp/Processing/Transforms/Resize.cs b/src/ImageSharp/Processing/Transforms/Resize.cs index 38662317bf..c723f367f0 100644 --- a/src/ImageSharp/Processing/Transforms/Resize.cs +++ b/src/ImageSharp/Processing/Transforms/Resize.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; - using SixLabors.Primitives; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Transforms/Rotate.cs b/src/ImageSharp/Processing/Transforms/Rotate.cs index 435efa30fa..7b35a879bc 100644 --- a/src/ImageSharp/Processing/Transforms/Rotate.cs +++ b/src/ImageSharp/Processing/Transforms/Rotate.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Processing.Processors; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Transforms/RotateFlip.cs b/src/ImageSharp/Processing/Transforms/RotateFlip.cs index 83edba0f92..2ddcb151b2 100644 --- a/src/ImageSharp/Processing/Transforms/RotateFlip.cs +++ b/src/ImageSharp/Processing/Transforms/RotateFlip.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Processing/Transforms/Skew.cs b/src/ImageSharp/Processing/Transforms/Skew.cs index 5f7853f05c..00411946d9 100644 --- a/src/ImageSharp/Processing/Transforms/Skew.cs +++ b/src/ImageSharp/Processing/Transforms/Skew.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - - using ImageSharp.PixelFormats; - - using Processing.Processors; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Properties/AssemblyInfo.cs b/src/ImageSharp/Properties/AssemblyInfo.cs index e791dff5a5..7b8f933b0c 100644 --- a/src/ImageSharp/Properties/AssemblyInfo.cs +++ b/src/ImageSharp/Properties/AssemblyInfo.cs @@ -1,8 +1,6 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// using System.Runtime.CompilerServices; // Ensure the other projects can see the internal helpers -[assembly: InternalsVisibleTo("ImageSharp.Drawing")] \ No newline at end of file +[assembly: InternalsVisibleTo("SixLabors.ImageSharp.Drawing")] \ No newline at end of file diff --git a/src/ImageSharp/Quantizers/Box.cs b/src/ImageSharp/Quantizers/Box.cs index 7f2a320873..4a1e17753f 100644 --- a/src/ImageSharp/Quantizers/Box.cs +++ b/src/ImageSharp/Quantizers/Box.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Quantizers +namespace SixLabors.ImageSharp.Quantizers { /// /// Represents a box color cube. diff --git a/src/ImageSharp/Quantizers/IQuantizer{TPixel}.cs b/src/ImageSharp/Quantizers/IQuantizer{TPixel}.cs index b7cf2d469a..1e992c894d 100644 --- a/src/ImageSharp/Quantizers/IQuantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/IQuantizer{TPixel}.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Quantizers -{ - using ImageSharp.Dithering; - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Dithering; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Quantizers +{ /// /// Provides methods for for allowing quantization of images pixels with configurable dithering. /// diff --git a/src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs b/src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs index 8ebea85334..f41bcd04de 100644 --- a/src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Quantizers -{ - using System; - using System.Collections.Generic; - using System.Runtime.CompilerServices; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Quantizers +{ /// /// Encapsulates methods to calculate the color palette if an image using an Octree pattern. /// diff --git a/src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs b/src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs index d121dc6ae7..56ecf7c900 100644 --- a/src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Quantizers -{ - using System; - using System.Collections.Generic; - using System.Runtime.CompilerServices; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Quantizers +{ /// /// Encapsulates methods to create a quantized image based upon the given palette. /// diff --git a/src/ImageSharp/Quantizers/Quantization.cs b/src/ImageSharp/Quantizers/Quantization.cs index 039404384d..df55d3e87a 100644 --- a/src/ImageSharp/Quantizers/Quantization.cs +++ b/src/ImageSharp/Quantizers/Quantization.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp +namespace SixLabors.ImageSharp { /// /// Provides enumeration over how an image should be quantized. diff --git a/src/ImageSharp/Quantizers/Quantize.cs b/src/ImageSharp/Quantizers/Quantize.cs index 612816eef2..ad166f6065 100644 --- a/src/ImageSharp/Quantizers/Quantize.cs +++ b/src/ImageSharp/Quantizers/Quantize.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp -{ - using System; - using System.Threading.Tasks; - - using ImageSharp.PixelFormats; - using ImageSharp.Quantizers; +using System; +using System.Threading.Tasks; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Quantizers; +namespace SixLabors.ImageSharp +{ /// /// Extension methods for the type. /// diff --git a/src/ImageSharp/Quantizers/QuantizedImage{TPixel}.cs b/src/ImageSharp/Quantizers/QuantizedImage{TPixel}.cs index c8b2c7df60..52cf1a8d9a 100644 --- a/src/ImageSharp/Quantizers/QuantizedImage{TPixel}.cs +++ b/src/ImageSharp/Quantizers/QuantizedImage{TPixel}.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Quantizers -{ - using System; - using ImageSharp.PixelFormats; +using System; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Quantizers +{ /// /// Represents a quantized image where the pixels indexed by a color palette. /// diff --git a/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs b/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs index d8a2de148e..c658917755 100644 --- a/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/Quantizer{TPixel}.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Quantizers -{ - using System; - using System.Collections.Generic; - using System.Numerics; - using System.Runtime.CompilerServices; - using ImageSharp.Dithering; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Dithering; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Quantizers +{ /// /// Encapsulates methods to calculate the color palette of an image. /// diff --git a/src/ImageSharp/Quantizers/WuArrayPool.cs b/src/ImageSharp/Quantizers/WuArrayPool.cs index bd8ee9d6b9..04a70637b6 100644 --- a/src/ImageSharp/Quantizers/WuArrayPool.cs +++ b/src/ImageSharp/Quantizers/WuArrayPool.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Quantizers -{ - using System.Buffers; +using System.Buffers; +namespace SixLabors.ImageSharp.Quantizers +{ /// /// Provides array pooling for the . /// This is a separate class so that the pools can be shared accross multiple generic quantizer instaces. diff --git a/src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs b/src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs index aecca771c1..4bb9028176 100644 --- a/src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs +++ b/src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Quantizers -{ - using System; - using System.Buffers; - using System.Collections.Generic; - using System.Numerics; - using System.Runtime.CompilerServices; - using ImageSharp.PixelFormats; +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Quantizers +{ /// /// An implementation of Wu's color quantizer with alpha channel. /// diff --git a/src/Shared/AssemblyInfo.Common.cs b/src/Shared/AssemblyInfo.Common.cs index c2aa13de25..08d7768a05 100644 --- a/src/Shared/AssemblyInfo.Common.cs +++ b/src/Shared/AssemblyInfo.Common.cs @@ -1,7 +1,5 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// using System.Reflection; using System.Resources; @@ -12,9 +10,9 @@ // associated with an assembly. [assembly: AssemblyDescription("A cross-platform library for processing of image files; written in C#")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("James Jackson-South")] -[assembly: AssemblyProduct("ImageSharp")] -[assembly: AssemblyCopyright("Copyright (c) James Jackson-South and contributors.")] +[assembly: AssemblyCompany("Six Labors")] +[assembly: AssemblyProduct("SixLabors.ImageSharp")] +[assembly: AssemblyCopyright("Copyright (c) Six Labors and contributors.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] @@ -34,9 +32,9 @@ [assembly: AssemblyInformationalVersion("1.0.0.0")] // Ensure the internals can be built and tested. -[assembly: InternalsVisibleTo("ImageSharp.Drawing")] -[assembly: InternalsVisibleTo("ImageSharp.Benchmarks")] -[assembly: InternalsVisibleTo("ImageSharp.Tests")] -[assembly: InternalsVisibleTo("ImageSharp.Sandbox46")] +[assembly: InternalsVisibleTo("SixLabors.ImageSharp.Drawing")] +[assembly: InternalsVisibleTo("SixLabors.ImageSharp.Benchmarks")] +[assembly: InternalsVisibleTo("SixLabors.ImageSharp.Tests")] +[assembly: InternalsVisibleTo("SixLabors.ImageSharp.Sandbox46")] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] \ No newline at end of file diff --git a/src/Shared/stylecop.json b/src/Shared/stylecop.json deleted file mode 100644 index df8f120a5b..0000000000 --- a/src/Shared/stylecop.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", - "settings": { - "documentationRules": { - "companyName": "James Jackson-South", - "copyrightText": "Copyright (c) James Jackson-South and contributors.\nLicensed under the Apache License, Version 2.0." - } - } -} \ No newline at end of file diff --git a/tests/ImageSharp.Benchmarks/BenchmarkBase.cs b/tests/ImageSharp.Benchmarks/BenchmarkBase.cs index 41574d109f..6db03a4486 100644 --- a/tests/ImageSharp.Benchmarks/BenchmarkBase.cs +++ b/tests/ImageSharp.Benchmarks/BenchmarkBase.cs @@ -1,6 +1,6 @@ -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { - using ImageSharp.Formats; + using SixLabors.ImageSharp.Formats; /// /// The image benchmark base class. diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4ReferenceVsPointer.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4ReferenceVsPointer.cs index 78bdfd1599..b4f6ea9c06 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4ReferenceVsPointer.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromVector4ReferenceVsPointer.cs @@ -1,12 +1,12 @@ -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Numerics; using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; - using ImageSharp; - using ImageSharp.Memory; + using SixLabors.ImageSharp; + using SixLabors.ImageSharp.Memory; /// /// Compares two implementation candidates for general BulkPixelOperations.ToVector4(): diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromXyzw.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromXyzw.cs index 7b151989ea..5c3648c2d8 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromXyzw.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/PackFromXyzw.cs @@ -1,10 +1,10 @@ // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.Color.Bulk +namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk { using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.Memory; + using SixLabors.ImageSharp.PixelFormats; public abstract class PackFromXyzw where TPixel : struct, IPixel diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4.cs index 9976faa8c3..2bf4e0da67 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/ToVector4.cs @@ -1,12 +1,12 @@ // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.Color.Bulk +namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk { using System.Numerics; using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.Memory; + using SixLabors.ImageSharp.PixelFormats; public abstract class ToVector4 where TPixel : struct, IPixel diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs index 061a5bd37b..e1f5e6106d 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyz.cs @@ -1,10 +1,10 @@ // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.Color.Bulk +namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk { using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.Memory; + using SixLabors.ImageSharp.PixelFormats; public abstract class ToXyz where TPixel : struct, IPixel diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyzw.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyzw.cs index f4bcce1152..6032897634 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyzw.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/ToXyzw.cs @@ -4,12 +4,12 @@ using System.Threading.Tasks; // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.Color.Bulk +namespace SixLabors.ImageSharp.Benchmarks.Color.Bulk { using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.Memory; + using SixLabors.ImageSharp.PixelFormats; public abstract class ToXyzw where TPixel : struct, IPixel diff --git a/tests/ImageSharp.Benchmarks/Color/ColorEquality.cs b/tests/ImageSharp.Benchmarks/Color/ColorEquality.cs index a641baafe5..02017cbb7d 100644 --- a/tests/ImageSharp.Benchmarks/Color/ColorEquality.cs +++ b/tests/ImageSharp.Benchmarks/Color/ColorEquality.cs @@ -3,11 +3,11 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; using SystemColor = System.Drawing.Color; diff --git a/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToCieLabConvert.cs b/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToCieLabConvert.cs index b29fdc25b6..c5792f5476 100644 --- a/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToCieLabConvert.cs +++ b/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToCieLabConvert.cs @@ -1,12 +1,12 @@ -namespace ImageSharp.Benchmarks.Color +namespace SixLabors.ImageSharp.Benchmarks.Color { using BenchmarkDotNet.Attributes; using Colourful; using Colourful.Conversion; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; + using SixLabors.ImageSharp.ColorSpaces; + using SixLabors.ImageSharp.ColorSpaces.Conversion; public class ColorspaceCieXyzToCieLabConvert { diff --git a/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToHunterLabConvert.cs b/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToHunterLabConvert.cs index 3e7d609727..7528f75f80 100644 --- a/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToHunterLabConvert.cs +++ b/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToHunterLabConvert.cs @@ -1,12 +1,12 @@ -namespace ImageSharp.Benchmarks.Color +namespace SixLabors.ImageSharp.Benchmarks.Color { using BenchmarkDotNet.Attributes; using Colourful; using Colourful.Conversion; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; + using SixLabors.ImageSharp.ColorSpaces; + using SixLabors.ImageSharp.ColorSpaces.Conversion; public class ColorspaceCieXyzToHunterLabConvert { diff --git a/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToLmsConvert.cs b/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToLmsConvert.cs index f472dd2923..a4da780908 100644 --- a/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToLmsConvert.cs +++ b/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToLmsConvert.cs @@ -1,12 +1,12 @@ -namespace ImageSharp.Benchmarks.Color +namespace SixLabors.ImageSharp.Benchmarks.Color { using BenchmarkDotNet.Attributes; using Colourful; using Colourful.Conversion; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; + using SixLabors.ImageSharp.ColorSpaces; + using SixLabors.ImageSharp.ColorSpaces.Conversion; public class ColorspaceCieXyzToLmsConvert { diff --git a/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToRgbConvert.cs b/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToRgbConvert.cs index eeea86c6eb..dab0e7a515 100644 --- a/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToRgbConvert.cs +++ b/tests/ImageSharp.Benchmarks/Color/ColorspaceCieXyzToRgbConvert.cs @@ -1,12 +1,12 @@ -namespace ImageSharp.Benchmarks.Color +namespace SixLabors.ImageSharp.Benchmarks.Color { using BenchmarkDotNet.Attributes; using Colourful; using Colourful.Conversion; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; + using SixLabors.ImageSharp.ColorSpaces; + using SixLabors.ImageSharp.ColorSpaces.Conversion; public class ColorspaceCieXyzToRgbConvert { diff --git a/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.LookupTables.cs b/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.LookupTables.cs index 18c8cb3728..335ecf4789 100644 --- a/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.LookupTables.cs +++ b/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.LookupTables.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { public partial class RgbToYCbCr { diff --git a/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs b/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs index 2efd9bc429..51be951c1b 100644 --- a/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs +++ b/tests/ImageSharp.Benchmarks/Color/RgbToYCbCr.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System; using System.Buffers; @@ -7,7 +7,7 @@ using BenchmarkDotNet.Attributes; - using ImageSharp.Formats.Jpg; + using SixLabors.ImageSharp.Formats.Jpg; public partial class RgbToYCbCr { diff --git a/tests/ImageSharp.Benchmarks/Color/RgbWorkingSpaceAdapt.cs b/tests/ImageSharp.Benchmarks/Color/RgbWorkingSpaceAdapt.cs index 21d040e5c1..f4e0fd65f6 100644 --- a/tests/ImageSharp.Benchmarks/Color/RgbWorkingSpaceAdapt.cs +++ b/tests/ImageSharp.Benchmarks/Color/RgbWorkingSpaceAdapt.cs @@ -1,12 +1,12 @@ -namespace ImageSharp.Benchmarks.Color +namespace SixLabors.ImageSharp.Benchmarks.Color { using BenchmarkDotNet.Attributes; using Colourful; using Colourful.Conversion; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; + using SixLabors.ImageSharp.ColorSpaces; + using SixLabors.ImageSharp.ColorSpaces.Conversion; public class RgbWorkingSpaceAdapt { diff --git a/tests/ImageSharp.Benchmarks/Color/YcbCrToRgb.cs b/tests/ImageSharp.Benchmarks/Color/YcbCrToRgb.cs index dad32626d3..2e3307d298 100644 --- a/tests/ImageSharp.Benchmarks/Color/YcbCrToRgb.cs +++ b/tests/ImageSharp.Benchmarks/Color/YcbCrToRgb.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Numerics; diff --git a/tests/ImageSharp.Benchmarks/Config.cs b/tests/ImageSharp.Benchmarks/Config.cs index 8e278330bd..694f01f70a 100644 --- a/tests/ImageSharp.Benchmarks/Config.cs +++ b/tests/ImageSharp.Benchmarks/Config.cs @@ -5,7 +5,7 @@ using BenchmarkDotNet.Configs; -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using BenchmarkDotNet.Jobs; diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs index 0a5750fe93..ce1a88599a 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawBeziers.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; using System.Drawing.Drawing2D; @@ -12,7 +12,7 @@ namespace ImageSharp.Benchmarks using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; public class DrawBeziers : BenchmarkBase { diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs index 3a3b5f30db..4f40c001d9 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawLines.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; using System.Drawing.Drawing2D; @@ -12,7 +12,7 @@ namespace ImageSharp.Benchmarks using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; public class DrawLines : BenchmarkBase { diff --git a/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs b/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs index b9a9605898..fd8e4ad285 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/DrawPolygon.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; using System.Drawing.Drawing2D; @@ -13,7 +13,7 @@ namespace ImageSharp.Benchmarks using System.IO; using System.Numerics; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; public class DrawPolygon : BenchmarkBase { diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs b/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs index b0981b94d5..f948c4921f 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillPolygon.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; using System.Drawing.Drawing2D; @@ -13,7 +13,7 @@ namespace ImageSharp.Benchmarks using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; public class FillPolygon : BenchmarkBase { diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs b/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs index 6219a97f68..b3890c101e 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillRectangle.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; using System.Drawing.Drawing2D; @@ -14,7 +14,7 @@ namespace ImageSharp.Benchmarks using System.Numerics; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; public class FillRectangle : BenchmarkBase { diff --git a/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs b/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs index fec6332d25..46d02e4197 100644 --- a/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs +++ b/tests/ImageSharp.Benchmarks/Drawing/FillWithPattern.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; using System.Drawing.Drawing2D; @@ -11,9 +11,9 @@ namespace ImageSharp.Benchmarks using BenchmarkDotNet.Attributes; - using ImageSharp.Drawing.Brushes; + using SixLabors.ImageSharp.Drawing.Brushes; using CoreBrushes = ImageSharp.Drawing.Brushes.Brushes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; public class FillWithPattern { diff --git a/tests/ImageSharp.Benchmarks/General/Abs.cs b/tests/ImageSharp.Benchmarks/General/Abs.cs index b5b4494670..a67f3f1078 100644 --- a/tests/ImageSharp.Benchmarks/General/Abs.cs +++ b/tests/ImageSharp.Benchmarks/General/Abs.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System; diff --git a/tests/ImageSharp.Benchmarks/General/Array2D.cs b/tests/ImageSharp.Benchmarks/General/Array2D.cs index b7ac2cd867..02df1a19e2 100644 --- a/tests/ImageSharp.Benchmarks/General/Array2D.cs +++ b/tests/ImageSharp.Benchmarks/General/Array2D.cs @@ -3,13 +3,13 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System; using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; public class Array2D { diff --git a/tests/ImageSharp.Benchmarks/General/ArrayCopy.cs b/tests/ImageSharp.Benchmarks/General/ArrayCopy.cs index dd0ebd413e..ddfa0f08b1 100644 --- a/tests/ImageSharp.Benchmarks/General/ArrayCopy.cs +++ b/tests/ImageSharp.Benchmarks/General/ArrayCopy.cs @@ -2,7 +2,7 @@ // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System; using System.Runtime.CompilerServices; diff --git a/tests/ImageSharp.Benchmarks/General/ArrayReverse.cs b/tests/ImageSharp.Benchmarks/General/ArrayReverse.cs index 27341b146f..45a8519a9c 100644 --- a/tests/ImageSharp.Benchmarks/General/ArrayReverse.cs +++ b/tests/ImageSharp.Benchmarks/General/ArrayReverse.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System; diff --git a/tests/ImageSharp.Benchmarks/General/Clamp.cs b/tests/ImageSharp.Benchmarks/General/Clamp.cs index ae53de9d3a..ef6bc3c402 100644 --- a/tests/ImageSharp.Benchmarks/General/Clamp.cs +++ b/tests/ImageSharp.Benchmarks/General/Clamp.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System; using System.Runtime.CompilerServices; diff --git a/tests/ImageSharp.Benchmarks/General/ClearBuffer.cs b/tests/ImageSharp.Benchmarks/General/ClearBuffer.cs index c3a309bb8a..0ac1413be0 100644 --- a/tests/ImageSharp.Benchmarks/General/ClearBuffer.cs +++ b/tests/ImageSharp.Benchmarks/General/ClearBuffer.cs @@ -1,12 +1,12 @@ // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System; using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; public unsafe class ClearBuffer { diff --git a/tests/ImageSharp.Benchmarks/General/IterateArray.cs b/tests/ImageSharp.Benchmarks/General/IterateArray.cs index cc8d99b418..48ee266fe0 100644 --- a/tests/ImageSharp.Benchmarks/General/IterateArray.cs +++ b/tests/ImageSharp.Benchmarks/General/IterateArray.cs @@ -1,11 +1,11 @@ -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System.Numerics; using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; public class IterateArray { diff --git a/tests/ImageSharp.Benchmarks/General/Modulus.cs b/tests/ImageSharp.Benchmarks/General/Modulus.cs index aa3e461e1c..e6d5ccce62 100644 --- a/tests/ImageSharp.Benchmarks/General/Modulus.cs +++ b/tests/ImageSharp.Benchmarks/General/Modulus.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using BenchmarkDotNet.Attributes; diff --git a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromRgba32.cs b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromRgba32.cs index 0f025c9a40..a1db525a69 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromRgba32.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromRgba32.cs @@ -1,5 +1,5 @@ // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromVector4.cs b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromVector4.cs index 357ac307e4..5b059e2e65 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromVector4.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertFromVector4.cs @@ -1,5 +1,5 @@ // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System.Numerics; using System.Runtime.CompilerServices; diff --git a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertToRgba32.cs b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertToRgba32.cs index 88f607789f..782c792393 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertToRgba32.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelConversion_ConvertToRgba32.cs @@ -1,5 +1,5 @@ // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/tests/ImageSharp.Benchmarks/General/PixelIndexing.cs b/tests/ImageSharp.Benchmarks/General/PixelIndexing.cs index bd2bf599c4..0e21caffbc 100644 --- a/tests/ImageSharp.Benchmarks/General/PixelIndexing.cs +++ b/tests/ImageSharp.Benchmarks/General/PixelIndexing.cs @@ -1,11 +1,11 @@ -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System.Numerics; using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; // Pixel indexing benchmarks compare different methods for getting/setting all pixel values in a subsegment of a single pixel row. public abstract unsafe class PixelIndexing diff --git a/tests/ImageSharp.Benchmarks/General/RoundSinglePrecisionBlocks.cs b/tests/ImageSharp.Benchmarks/General/RoundSinglePrecisionBlocks.cs index f998290340..a4e5f358c5 100644 --- a/tests/ImageSharp.Benchmarks/General/RoundSinglePrecisionBlocks.cs +++ b/tests/ImageSharp.Benchmarks/General/RoundSinglePrecisionBlocks.cs @@ -1,11 +1,11 @@ -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System.Numerics; using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; - using ImageSharp.Formats.Jpg; + using SixLabors.ImageSharp.Formats.Jpg; /// /// The goal of this benchmark is to measure the following Jpeg-related scenario: diff --git a/tests/ImageSharp.Benchmarks/General/Vector4Constants.cs b/tests/ImageSharp.Benchmarks/General/Vector4Constants.cs index 820789ee7c..ae11806f32 100644 --- a/tests/ImageSharp.Benchmarks/General/Vector4Constants.cs +++ b/tests/ImageSharp.Benchmarks/General/Vector4Constants.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General +namespace SixLabors.ImageSharp.Benchmarks.General { using System; using System.Numerics; diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs index b882403c85..d189411b5d 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/BitwiseOrUint32.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General.Vectorization +namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization { using System.Numerics; diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/DivFloat.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/DivFloat.cs index caadaaa347..6378467478 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/DivFloat.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/DivFloat.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General.Vectorization +namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization { using System.Numerics; diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/DivUInt32.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/DivUInt32.cs index 6b3edb192b..49ada2f368 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/DivUInt32.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/DivUInt32.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General.Vectorization +namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization { using System.Numerics; diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs index e5ae49b2a6..8c5f568181 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/MulFloat.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General.Vectorization +namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization { using System.Numerics; diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs index 532acc02d5..913d4ce3c7 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/MulUInt32.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General.Vectorization +namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization { using System.Numerics; diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs index 30443fad9d..f3853a8b1f 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/ReinterpretUInt32AsFloat.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.General.Vectorization +namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization { using System.Numerics; using System.Runtime.InteropServices; diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs index 73fc886487..147f66f8f7 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs @@ -1,11 +1,11 @@ -namespace ImageSharp.Benchmarks.General.Vectorization +namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization { using System; using System.Numerics; using System.Runtime.CompilerServices; using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; /// /// This benchmark compares different methods for fetching memory data into diff --git a/tests/ImageSharp.Benchmarks/Image/CopyPixels.cs b/tests/ImageSharp.Benchmarks/Image/CopyPixels.cs index 1d4ed11936..7569d56f23 100644 --- a/tests/ImageSharp.Benchmarks/Image/CopyPixels.cs +++ b/tests/ImageSharp.Benchmarks/Image/CopyPixels.cs @@ -3,14 +3,14 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System; using System.Threading.Tasks; using BenchmarkDotNet.Attributes; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; public class CopyPixels : BenchmarkBase { diff --git a/tests/ImageSharp.Benchmarks/Image/DecodeBmp.cs b/tests/ImageSharp.Benchmarks/Image/DecodeBmp.cs index 6f3a38b7fd..142675fa7a 100644 --- a/tests/ImageSharp.Benchmarks/Image/DecodeBmp.cs +++ b/tests/ImageSharp.Benchmarks/Image/DecodeBmp.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using System.IO; diff --git a/tests/ImageSharp.Benchmarks/Image/DecodeFilteredPng.cs b/tests/ImageSharp.Benchmarks/Image/DecodeFilteredPng.cs index ae1add172d..e295aee732 100644 --- a/tests/ImageSharp.Benchmarks/Image/DecodeFilteredPng.cs +++ b/tests/ImageSharp.Benchmarks/Image/DecodeFilteredPng.cs @@ -3,13 +3,13 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.IO; using BenchmarkDotNet.Attributes; - using ImageSharp; + using SixLabors.ImageSharp; using SixLabors.Primitives; using CoreImage = ImageSharp.Image; diff --git a/tests/ImageSharp.Benchmarks/Image/DecodeGif.cs b/tests/ImageSharp.Benchmarks/Image/DecodeGif.cs index 3f908d3622..a65c9f9298 100644 --- a/tests/ImageSharp.Benchmarks/Image/DecodeGif.cs +++ b/tests/ImageSharp.Benchmarks/Image/DecodeGif.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using System.IO; diff --git a/tests/ImageSharp.Benchmarks/Image/DecodeJpeg.cs b/tests/ImageSharp.Benchmarks/Image/DecodeJpeg.cs index ece93f912e..db2b226314 100644 --- a/tests/ImageSharp.Benchmarks/Image/DecodeJpeg.cs +++ b/tests/ImageSharp.Benchmarks/Image/DecodeJpeg.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using System.IO; diff --git a/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs b/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs index 44c90d253d..a2d74a1c9a 100644 --- a/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Image/DecodeJpegMultiple.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Collections.Generic; using BenchmarkDotNet.Attributes; diff --git a/tests/ImageSharp.Benchmarks/Image/DecodePng.cs b/tests/ImageSharp.Benchmarks/Image/DecodePng.cs index be1633c044..b9a9d5cfa2 100644 --- a/tests/ImageSharp.Benchmarks/Image/DecodePng.cs +++ b/tests/ImageSharp.Benchmarks/Image/DecodePng.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using System.IO; diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeBmp.cs b/tests/ImageSharp.Benchmarks/Image/EncodeBmp.cs index 4941e17cba..86994f2d35 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeBmp.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeBmp.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using System.Drawing.Imaging; diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeBmpMultiple.cs b/tests/ImageSharp.Benchmarks/Image/EncodeBmpMultiple.cs index 852e175725..791e812ffc 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeBmpMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeBmpMultiple.cs @@ -3,14 +3,14 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Collections.Generic; using System.Drawing.Imaging; using BenchmarkDotNet.Attributes; - using ImageSharp.Formats; + using SixLabors.ImageSharp.Formats; [Config(typeof(Config.Short))] public class EncodeBmpMultiple : MultiImageBenchmarkBase.WithImagesPreloaded diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeGif.cs b/tests/ImageSharp.Benchmarks/Image/EncodeGif.cs index e6600594f0..7a6ddd79d7 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeGif.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeGif.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using System.Drawing.Imaging; diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeGifMultiple.cs b/tests/ImageSharp.Benchmarks/Image/EncodeGifMultiple.cs index 8d1d147466..244ff58828 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeGifMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeGifMultiple.cs @@ -1,4 +1,4 @@ -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Collections.Generic; using System.Drawing.Imaging; @@ -6,7 +6,7 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; - using ImageSharp.Formats; + using SixLabors.ImageSharp.Formats; [Config(typeof(SingleRunConfig))] public class EncodeGifMultiple : MultiImageBenchmarkBase.WithImagesPreloaded diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs b/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs index 02e3211a76..7c48dbae28 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeIndexedPng.cs @@ -3,15 +3,15 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.IO; using BenchmarkDotNet.Attributes; - using ImageSharp; - using ImageSharp.Formats; - using ImageSharp.Quantizers; + using SixLabors.ImageSharp; + using SixLabors.ImageSharp.Formats; + using SixLabors.ImageSharp.Quantizers; using CoreImage = ImageSharp.Image; diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeJpeg.cs b/tests/ImageSharp.Benchmarks/Image/EncodeJpeg.cs index 07c2560fd8..48fd6e9e7f 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeJpeg.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeJpeg.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using System.Drawing.Imaging; diff --git a/tests/ImageSharp.Benchmarks/Image/EncodeJpegMultiple.cs b/tests/ImageSharp.Benchmarks/Image/EncodeJpegMultiple.cs index bbf838a9e1..38b97f0043 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodeJpegMultiple.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodeJpegMultiple.cs @@ -3,14 +3,14 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Collections.Generic; using System.Drawing.Imaging; using BenchmarkDotNet.Attributes; - using ImageSharp.Formats; + using SixLabors.ImageSharp.Formats; [Config(typeof(Config.Short))] // It's long enough to iterate through multiple files diff --git a/tests/ImageSharp.Benchmarks/Image/EncodePng.cs b/tests/ImageSharp.Benchmarks/Image/EncodePng.cs index 81bb235eea..0401132fca 100644 --- a/tests/ImageSharp.Benchmarks/Image/EncodePng.cs +++ b/tests/ImageSharp.Benchmarks/Image/EncodePng.cs @@ -3,7 +3,7 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using System.Drawing.Imaging; @@ -11,8 +11,8 @@ namespace ImageSharp.Benchmarks.Image using BenchmarkDotNet.Attributes; - using ImageSharp.Formats; - using ImageSharp.Quantizers; + using SixLabors.ImageSharp.Formats; + using SixLabors.ImageSharp.Quantizers; using CoreImage = ImageSharp.Image; diff --git a/tests/ImageSharp.Benchmarks/Image/GetSetPixel.cs b/tests/ImageSharp.Benchmarks/Image/GetSetPixel.cs index 28616213b2..f9469e5fea 100644 --- a/tests/ImageSharp.Benchmarks/Image/GetSetPixel.cs +++ b/tests/ImageSharp.Benchmarks/Image/GetSetPixel.cs @@ -3,13 +3,13 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System.Drawing; using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; using SystemColor = System.Drawing.Color; diff --git a/tests/ImageSharp.Benchmarks/Image/ImageBenchmarkTests.cs b/tests/ImageSharp.Benchmarks/Image/ImageBenchmarkTests.cs index f68f4a418f..8b25ba6fed 100644 --- a/tests/ImageSharp.Benchmarks/Image/ImageBenchmarkTests.cs +++ b/tests/ImageSharp.Benchmarks/Image/ImageBenchmarkTests.cs @@ -12,7 +12,7 @@ #if TEST // ReSharper disable InconsistentNaming -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System; using System.Collections.Generic; diff --git a/tests/ImageSharp.Benchmarks/Image/MultiImageBenchmarkBase.cs b/tests/ImageSharp.Benchmarks/Image/MultiImageBenchmarkBase.cs index e01a5951ef..e0f9f8eed1 100644 --- a/tests/ImageSharp.Benchmarks/Image/MultiImageBenchmarkBase.cs +++ b/tests/ImageSharp.Benchmarks/Image/MultiImageBenchmarkBase.cs @@ -4,7 +4,7 @@ // -namespace ImageSharp.Benchmarks.Image +namespace SixLabors.ImageSharp.Benchmarks.Image { using System; using System.Collections.Generic; diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index 72593a0da4..eb1983e21e 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -1,8 +1,10 @@  - netcoreapp1.1;net461 + netcoreapp1.1 Exe True + SixLabors.ImageSharp.Benchmarks + SixLabors.ImageSharp.Benchmarks win7-x64 @@ -10,13 +12,13 @@ - + - + diff --git a/tests/ImageSharp.Benchmarks/PixelBlenders/PorterDuffBulkVsPixel.cs b/tests/ImageSharp.Benchmarks/PixelBlenders/PorterDuffBulkVsPixel.cs index 19904a5ad2..5a3131f796 100644 --- a/tests/ImageSharp.Benchmarks/PixelBlenders/PorterDuffBulkVsPixel.cs +++ b/tests/ImageSharp.Benchmarks/PixelBlenders/PorterDuffBulkVsPixel.cs @@ -3,17 +3,17 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System; using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; using CoreSize = SixLabors.Primitives.Size; using System.Numerics; - using ImageSharp.Memory; - using ImageSharp.PixelFormats.PixelBlenders; + using SixLabors.ImageSharp.Memory; + using SixLabors.ImageSharp.PixelFormats.PixelBlenders; public class PorterDuffBulkVsPixel : BenchmarkBase { diff --git a/tests/ImageSharp.Benchmarks/Program.cs b/tests/ImageSharp.Benchmarks/Program.cs index 789068426b..4dd63067ac 100644 --- a/tests/ImageSharp.Benchmarks/Program.cs +++ b/tests/ImageSharp.Benchmarks/Program.cs @@ -3,11 +3,11 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using BenchmarkDotNet.Running; - using ImageSharp.Formats; + using SixLabors.ImageSharp.Formats; using System.Reflection; public class Program diff --git a/tests/ImageSharp.Benchmarks/Samplers/Crop.cs b/tests/ImageSharp.Benchmarks/Samplers/Crop.cs index ee8fdcf250..3681ff6f20 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Crop.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Crop.cs @@ -3,14 +3,14 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; using System.Drawing.Drawing2D; using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; using CoreSize = SixLabors.Primitives.Size; diff --git a/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs b/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs index 380a0abb03..f65957128c 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/DetectEdges.cs @@ -3,13 +3,13 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.IO; using BenchmarkDotNet.Attributes; - using ImageSharp.Processing; + using SixLabors.ImageSharp.Processing; using CoreImage = ImageSharp.Image; diff --git a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs index 88851bd0ca..b6dd7f4e76 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Glow.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Glow.cs @@ -3,19 +3,19 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; + using SixLabors.ImageSharp.PixelFormats; + using SixLabors.ImageSharp.Processing.Processors; using CoreSize = SixLabors.Primitives.Size; - using ImageSharp.Processing; + using SixLabors.ImageSharp.Processing; using System.Numerics; using System; using System.Threading.Tasks; - using ImageSharp.Memory; + using SixLabors.ImageSharp.Memory; using SixLabors.Primitives; public class Glow : BenchmarkBase diff --git a/tests/ImageSharp.Benchmarks/Samplers/Resize.cs b/tests/ImageSharp.Benchmarks/Samplers/Resize.cs index db22167704..6e7e2c8c48 100644 --- a/tests/ImageSharp.Benchmarks/Samplers/Resize.cs +++ b/tests/ImageSharp.Benchmarks/Samplers/Resize.cs @@ -3,14 +3,14 @@ // Licensed under the Apache License, Version 2.0. // -namespace ImageSharp.Benchmarks +namespace SixLabors.ImageSharp.Benchmarks { using System.Drawing; using System.Drawing.Drawing2D; using BenchmarkDotNet.Attributes; - using ImageSharp.PixelFormats; + using SixLabors.ImageSharp.PixelFormats; using CoreSize = SixLabors.Primitives.Size; diff --git a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs index f2afe2f4f8..37696987cc 100644 --- a/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs +++ b/tests/ImageSharp.Tests/BaseImageOperationsExtensionTest.cs @@ -1,11 +1,14 @@ -using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; using System.Collections.Generic; using System.Text; -using ImageSharp.Processing; +using SixLabors.ImageSharp.Processing; using SixLabors.Primitives; using Xunit; -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { public abstract class BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs b/tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs index f2d8c92d28..92ec9f36f5 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs @@ -1,11 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs b/tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs index d263bbe18e..7c841aa2e2 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs @@ -1,11 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieLabConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieLabConversionTest.cs index 9bd8b17c79..76d76f236c 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieLabConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieLabConversionTest.cs @@ -1,11 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieLuvConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieLuvConversionTest.cs index 5589e9753e..b18bd56dcb 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieLuvConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieLuvConversionTest.cs @@ -1,11 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieXyyConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieXyyConversionTest.cs index 9b441f4526..1652c53923 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieXyyConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndCieXyyConversionTest.cs @@ -1,12 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndHunterLabConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndHunterLabConversionTest.cs index 5ad224eaf0..1c48d00ff2 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndHunterLabConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndHunterLabConversionTest.cs @@ -1,11 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndLmsConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndLmsConversionTest.cs index 868d429757..f63c542122 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieXyzAndLmsConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieXyzAndLmsConversionTest.cs @@ -1,11 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/ColorConverterAdaptTest.cs b/tests/ImageSharp.Tests/Colorspaces/ColorConverterAdaptTest.cs index 02095b31f2..87dc59907b 100644 --- a/tests/ImageSharp.Tests/Colorspaces/ColorConverterAdaptTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/ColorConverterAdaptTest.cs @@ -1,13 +1,14 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; - using ImageSharp.ColorSpaces.Conversion.Implementation.Lms; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.LmsColorSapce; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests methods. /// Test data generated using: diff --git a/tests/ImageSharp.Tests/Colorspaces/ColorSpaceEqualityTests.cs b/tests/ImageSharp.Tests/Colorspaces/ColorSpaceEqualityTests.cs index da58ddcda8..7fdebcac49 100644 --- a/tests/ImageSharp.Tests/Colorspaces/ColorSpaceEqualityTests.cs +++ b/tests/ImageSharp.Tests/Colorspaces/ColorSpaceEqualityTests.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System; +using System.Numerics; +using SixLabors.ImageSharp.ColorSpaces; +using Xunit; // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests.Colorspaces +namespace SixLabors.ImageSharp.Tests.Colorspaces { - using System; - using System.Numerics; - using Xunit; - - using ImageSharp.ColorSpaces; - /// /// Test implementations of IEquatable and IAlmostEquatable in our colorspaces /// diff --git a/tests/ImageSharp.Tests/Colorspaces/RgbAndCieXyzConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/RgbAndCieXyzConversionTest.cs index 7a4520a57e..ee71eefc17 100644 --- a/tests/ImageSharp.Tests/Colorspaces/RgbAndCieXyzConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/RgbAndCieXyzConversionTest.cs @@ -1,11 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/RgbAndCmykConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/RgbAndCmykConversionTest.cs index 8fe64e915b..6c3d579b4e 100644 --- a/tests/ImageSharp.Tests/Colorspaces/RgbAndCmykConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/RgbAndCmykConversionTest.cs @@ -1,12 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/RgbAndHslConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/RgbAndHslConversionTest.cs index fa02f887f2..a7071e883d 100644 --- a/tests/ImageSharp.Tests/Colorspaces/RgbAndHslConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/RgbAndHslConversionTest.cs @@ -1,12 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/RgbAndHsvConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/RgbAndHsvConversionTest.cs index f8d8c773a5..0dc58a0a3e 100644 --- a/tests/ImageSharp.Tests/Colorspaces/RgbAndHsvConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/RgbAndHsvConversionTest.cs @@ -1,12 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Colorspaces/RgbAndYCbCrConversionTest.cs b/tests/ImageSharp.Tests/Colorspaces/RgbAndYCbCrConversionTest.cs index 3f741ea3d9..0eb1f620bf 100644 --- a/tests/ImageSharp.Tests/Colorspaces/RgbAndYCbCrConversionTest.cs +++ b/tests/ImageSharp.Tests/Colorspaces/RgbAndYCbCrConversionTest.cs @@ -1,12 +1,13 @@ -namespace ImageSharp.Tests.Colorspaces -{ - using System.Collections.Generic; - - using ImageSharp.ColorSpaces; - using ImageSharp.ColorSpaces.Conversion; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.ColorSpaces; +using SixLabors.ImageSharp.ColorSpaces.Conversion; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colorspaces +{ /// /// Tests - conversions. /// diff --git a/tests/ImageSharp.Tests/Common/Buffer2DTests.cs b/tests/ImageSharp.Tests/Common/Buffer2DTests.cs index 5f44a132d7..2f275b7547 100644 --- a/tests/ImageSharp.Tests/Common/Buffer2DTests.cs +++ b/tests/ImageSharp.Tests/Common/Buffer2DTests.cs @@ -1,15 +1,14 @@ -// ReSharper disable InconsistentNaming -namespace ImageSharp.Tests.Common -{ - using System; - using System.Runtime.CompilerServices; - - using ImageSharp.Memory; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; - - using static TestStructs; +using System; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +using Xunit; +using static SixLabors.ImageSharp.Tests.Common.TestStructs; +namespace SixLabors.ImageSharp.Tests.Common +{ public unsafe class Buffer2DTests { // ReSharper disable once ClassNeverInstantiated.Local diff --git a/tests/ImageSharp.Tests/Common/BufferSpanTests.cs b/tests/ImageSharp.Tests/Common/BufferSpanTests.cs index af33a981ba..fb51880f3e 100644 --- a/tests/ImageSharp.Tests/Common/BufferSpanTests.cs +++ b/tests/ImageSharp.Tests/Common/BufferSpanTests.cs @@ -1,19 +1,16 @@ -// ReSharper disable ObjectCreationAsStatement -// ReSharper disable InconsistentNaming - -namespace ImageSharp.Tests.Common +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +using static SixLabors.ImageSharp.Tests.Common.TestStructs; + +namespace SixLabors.ImageSharp.Tests.Common { - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - - using Xunit; - - using static TestStructs; - public unsafe class SpanTests { // ReSharper disable once ClassNeverInstantiated.Local diff --git a/tests/ImageSharp.Tests/Common/BufferTests.cs b/tests/ImageSharp.Tests/Common/BufferTests.cs index 25ef173d4c..e1883ec7fd 100644 --- a/tests/ImageSharp.Tests/Common/BufferTests.cs +++ b/tests/ImageSharp.Tests/Common/BufferTests.cs @@ -1,17 +1,16 @@ -// ReSharper disable InconsistentNaming -namespace ImageSharp.Tests.Common +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Memory; +using Xunit; +using static SixLabors.ImageSharp.Tests.Common.TestStructs; + +namespace SixLabors.ImageSharp.Tests.Common { - using System; - using System.Runtime.CompilerServices; - using System.Runtime.InteropServices; - using System.Threading.Tasks; - - using ImageSharp.Memory; - - using Xunit; - - using static TestStructs; - public unsafe class BufferTests { // ReSharper disable once ClassNeverInstantiated.Local diff --git a/tests/ImageSharp.Tests/Common/ConstantsTests.cs b/tests/ImageSharp.Tests/Common/ConstantsTests.cs index be4addf913..48ecbbbc91 100644 --- a/tests/ImageSharp.Tests/Common/ConstantsTests.cs +++ b/tests/ImageSharp.Tests/Common/ConstantsTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Common -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Common +{ public class ConstantsTests { [Fact] diff --git a/tests/ImageSharp.Tests/Common/Fast2DArrayTests.cs b/tests/ImageSharp.Tests/Common/Fast2DArrayTests.cs index efdcaa8484..88d8a73e8a 100644 --- a/tests/ImageSharp.Tests/Common/Fast2DArrayTests.cs +++ b/tests/ImageSharp.Tests/Common/Fast2DArrayTests.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Common -{ - using System; - - using ImageSharp.Memory; - - using Xunit; +using System; +using SixLabors.ImageSharp.Memory; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Common +{ public class Fast2DArrayTests { private static readonly float[,] FloydSteinbergMatrix = diff --git a/tests/ImageSharp.Tests/Common/PixelDataPoolTests.cs b/tests/ImageSharp.Tests/Common/PixelDataPoolTests.cs index 21e86d434c..7b3d337ba1 100644 --- a/tests/ImageSharp.Tests/Common/PixelDataPoolTests.cs +++ b/tests/ImageSharp.Tests/Common/PixelDataPoolTests.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System.Linq; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System.Linq; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - - using Xunit; - /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/Common/TestStructs.cs b/tests/ImageSharp.Tests/Common/TestStructs.cs index f7f09bea20..87cf9a6325 100644 --- a/tests/ImageSharp.Tests/Common/TestStructs.cs +++ b/tests/ImageSharp.Tests/Common/TestStructs.cs @@ -1,7 +1,10 @@ -namespace ImageSharp.Tests.Common -{ - using Xunit; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using Xunit; +namespace SixLabors.ImageSharp.Tests.Common +{ public static class TestStructs { public struct Foo diff --git a/tests/ImageSharp.Tests/ConfigurationTests.cs b/tests/ImageSharp.Tests/ConfigurationTests.cs index 417588180a..ad631863f4 100644 --- a/tests/ImageSharp.Tests/ConfigurationTests.cs +++ b/tests/ImageSharp.Tests/ConfigurationTests.cs @@ -1,21 +1,18 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.PixelFormats; +using Moq; +using Xunit; + +namespace SixLabors.ImageSharp.Tests { - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - - using ImageSharp.Formats; - using ImageSharp.IO; - using ImageSharp.PixelFormats; - using Moq; - using Xunit; - /// /// Tests the configuration class. /// diff --git a/tests/ImageSharp.Tests/Drawing/BeziersTests.cs b/tests/ImageSharp.Tests/Drawing/BeziersTests.cs index 1b3aeacb15..0b0a474834 100644 --- a/tests/ImageSharp.Tests/Drawing/BeziersTests.cs +++ b/tests/ImageSharp.Tests/Drawing/BeziersTests.cs @@ -1,21 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using Drawing; - using ImageSharp.Drawing; - using System; - using System.Diagnostics.CodeAnalysis; - using System.IO; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; +using System; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests.Drawing; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class Beziers : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/BlendedShapes.cs b/tests/ImageSharp.Tests/Drawing/BlendedShapes.cs index e1ff00ca23..df029d2d72 100644 --- a/tests/ImageSharp.Tests/Drawing/BlendedShapes.cs +++ b/tests/ImageSharp.Tests/Drawing/BlendedShapes.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using System; - using System.Linq; - using System.Collections.Generic; - using System.Text; - using ImageSharp.PixelFormats; - using Xunit; - using SixLabors.Primitives; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class BlendedShapes { public static IEnumerable modes = ((PixelBlenderMode[])Enum.GetValues(typeof(PixelBlenderMode))) diff --git a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs index 29e3d94fb3..94dd903b43 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawImageTest.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.IO; - using System.Linq; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using System.IO; +using System.Linq; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class DrawImageTest : FileTestBase { private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32; diff --git a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs index c609aa9918..10d31a0d18 100644 --- a/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs +++ b/tests/ImageSharp.Tests/Drawing/DrawPathTests.cs @@ -1,20 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using ShapePath = SixLabors.Shapes.Path; - using SixLabors.Shapes; - using System.IO; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; - using ImageSharp.Drawing.Pens; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +using Xunit; +using ShapePath = SixLabors.Shapes.Path; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class DrawPathTests : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs b/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs index 5dd7c55211..10988e9d13 100644 --- a/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillPatternTests.cs @@ -1,19 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using System; - using System.IO; - - using ImageSharp.Drawing; - using ImageSharp.Drawing.Brushes; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using Xunit; +using System; +using System.IO; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class FillPatternBrushTests : FileTestBase { private void Test(string name, Rgba32 background, IBrush brush, Rgba32[,] expectedPattern) diff --git a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs index d0e93e7343..fbdd04e64e 100644 --- a/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillRegionProcessorTests.cs @@ -1,17 +1,18 @@ - -namespace ImageSharp.Tests.Drawing -{ - using ImageSharp; - using Xunit; - using ImageSharp.Drawing; - using ImageSharp.Drawing.Processors; - using Moq; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using ImageSharp.PixelFormats; - using System; - using ImageSharp.Drawing.Pens; - using System.Numerics; +using System; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using Moq; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class FillRegionProcessorTests { [Theory] diff --git a/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs b/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs index f2f6ad06a4..9d64d63191 100644 --- a/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs +++ b/tests/ImageSharp.Tests/Drawing/FillSolidBrushTests.cs @@ -1,21 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using Drawing; - using ImageSharp.Drawing; - using System; - using System.Diagnostics.CodeAnalysis; - using System.IO; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; +using System; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests.Drawing; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class FillSolidBrushTests : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs index fea7ee8183..3fe67a5aa1 100644 --- a/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/LineComplexPolygonTests.cs @@ -1,20 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using System.IO; - using Xunit; - using Drawing; - using ImageSharp.Drawing; - using System.Numerics; - using ImageSharp.Drawing.Pens; - using ImageSharp.PixelFormats; - - using SixLabors.Shapes; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests.Drawing; +using SixLabors.Shapes; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class LineComplexPolygonTests : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/LineTests.cs b/tests/ImageSharp.Tests/Drawing/LineTests.cs index 693bbc28fb..c2d60d4adb 100644 --- a/tests/ImageSharp.Tests/Drawing/LineTests.cs +++ b/tests/ImageSharp.Tests/Drawing/LineTests.cs @@ -1,20 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using ImageSharp.Drawing; - using ImageSharp.Drawing.Pens; - - using System.IO; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class LineTests : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs index c1e22e49c6..a88a5b09cd 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPath.cs @@ -1,16 +1,18 @@ - -namespace ImageSharp.Tests.Drawing.Paths +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +using Xunit; + +namespace SixLabors.ImageSharp.Tests.Drawing.Paths { - using System; - using ImageSharp; - using ImageSharp.Drawing.Brushes; - using Xunit; - using ImageSharp.Drawing; - using System.Numerics; - using SixLabors.Shapes; - using ImageSharp.Drawing.Processors; - using ImageSharp.PixelFormats; - public class FillPath : BaseImageOperationsExtensionTest { GraphicsOptions noneDefault = new GraphicsOptions(); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs index 11ead13c18..e8fad9d125 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPathCollection.cs @@ -1,16 +1,18 @@ - -namespace ImageSharp.Tests.Drawing.Paths +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +using Xunit; + +namespace SixLabors.ImageSharp.Tests.Drawing.Paths { - using System; - using ImageSharp; - using ImageSharp.Drawing.Brushes; - using Xunit; - using ImageSharp.Drawing; - using System.Numerics; - using SixLabors.Shapes; - using ImageSharp.Drawing.Processors; - using ImageSharp.PixelFormats; - public class FillPathCollection : BaseImageOperationsExtensionTest { GraphicsOptions noneDefault = new GraphicsOptions(); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs index d833bf47be..b390c31069 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillPolygon.cs @@ -1,16 +1,18 @@ - -namespace ImageSharp.Tests.Drawing.Paths +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +using Xunit; + +namespace SixLabors.ImageSharp.Tests.Drawing.Paths { - using System; - using ImageSharp; - using ImageSharp.Drawing.Brushes; - using Xunit; - using ImageSharp.Drawing; - using System.Numerics; - using SixLabors.Shapes; - using ImageSharp.Drawing.Processors; - using ImageSharp.PixelFormats; - public class FillPolygon : BaseImageOperationsExtensionTest { GraphicsOptions noneDefault = new GraphicsOptions(); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs b/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs index 687c63068d..05e6bb29b3 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/FillRectangle.cs @@ -1,15 +1,15 @@ - -namespace ImageSharp.Tests.Drawing.Paths -{ - using System; - - using ImageSharp.Drawing.Brushes; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; - using ImageSharp.Drawing; - using ImageSharp.Drawing.Processors; - using ImageSharp.PixelFormats; +using System; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing.Paths +{ public class FillRectangle : BaseImageOperationsExtensionTest { GraphicsOptions noneDefault = new GraphicsOptions(); diff --git a/tests/ImageSharp.Tests/Drawing/Paths/ShapePathTests.cs b/tests/ImageSharp.Tests/Drawing/Paths/ShapePathTests.cs index e791a2bfb7..5d2e93e877 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/ShapePathTests.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/ShapePathTests.cs @@ -1,21 +1,23 @@ - -namespace ImageSharp.Tests.Drawing.Paths -{ - using System; - using System.IO; - using ImageSharp; - using ImageSharp.Drawing.Brushes; - using ImageSharp.Processing; - using System.Collections.Generic; - using Xunit; - using ImageSharp.Drawing; - using System.Numerics; - using SixLabors.Shapes; - using ImageSharp.Drawing.Processors; - using ImageSharp.Drawing.Pens; - using Moq; - using System.Collections.Immutable; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.Processing; +using Moq; +using SixLabors.Shapes; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing.Paths +{ public class ShapePathTests { // TODO readd these back in diff --git a/tests/ImageSharp.Tests/Drawing/Paths/ShapeRegionTests.cs b/tests/ImageSharp.Tests/Drawing/Paths/ShapeRegionTests.cs index df183a8aff..41fb5643f0 100644 --- a/tests/ImageSharp.Tests/Drawing/Paths/ShapeRegionTests.cs +++ b/tests/ImageSharp.Tests/Drawing/Paths/ShapeRegionTests.cs @@ -1,22 +1,24 @@ - -namespace ImageSharp.Tests.Drawing.Paths +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.Processing; +using Moq; +using SixLabors.Primitives; +using SixLabors.Shapes; +using Xunit; + +namespace SixLabors.ImageSharp.Tests.Drawing.Paths { - using System; - using System.IO; - using ImageSharp; - using ImageSharp.Drawing.Brushes; - using ImageSharp.Processing; - using System.Collections.Generic; - using Xunit; - using ImageSharp.Drawing; - using System.Numerics; - using SixLabors.Shapes; - using ImageSharp.Drawing.Processors; - using ImageSharp.Drawing.Pens; - using Moq; - using System.Collections.Immutable; - using SixLabors.Primitives; - public class ShapeRegionTests { private readonly Mock pathMock; diff --git a/tests/ImageSharp.Tests/Drawing/PolygonTests.cs b/tests/ImageSharp.Tests/Drawing/PolygonTests.cs index 827cde5a85..996387d14c 100644 --- a/tests/ImageSharp.Tests/Drawing/PolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/PolygonTests.cs @@ -1,21 +1,18 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing +using System; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests.Drawing; +using SixLabors.Primitives; +using Xunit; + +namespace SixLabors.ImageSharp.Tests.Drawing { - using System; - using System.Diagnostics.CodeAnalysis; - using System.IO; - using Xunit; - using Drawing; - using ImageSharp.Drawing; - using System.Numerics; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - public class PolygonTests : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs b/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs index 53b7d950f4..d2bbdbb052 100644 --- a/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs +++ b/tests/ImageSharp.Tests/Drawing/RecolorImageTest.cs @@ -1,19 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using ImageSharp.Drawing.Brushes; - using System.IO; - using System.Linq; - - using ImageSharp.PixelFormats; - - using Xunit; - using SixLabors.Primitives; +using System.IO; +using System.Linq; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class RecolorImageTest : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs b/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs index aa9ffb1877..0ddd99712e 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidBezierTests.cs @@ -1,19 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using System.IO; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using SixLabors.Shapes; - - using Xunit; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Shapes; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class SolidBezierTests : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs index 70369a6a8c..8bad1a6b06 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidComplexPolygonTests.cs @@ -1,20 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing -{ - using System.IO; - using Xunit; - using Drawing; - using ImageSharp.Drawing; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using SixLabors.Shapes; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests.Drawing; +using SixLabors.Shapes; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing +{ public class SolidComplexPolygonTests : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs index 469669acf2..10625dedbf 100644 --- a/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs +++ b/tests/ImageSharp.Tests/Drawing/SolidPolygonTests.cs @@ -1,22 +1,19 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing +using System; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests.Drawing; +using SixLabors.Shapes; +using Xunit; + +namespace SixLabors.ImageSharp.Tests.Drawing { - using Drawing; - using ImageSharp.Drawing; - using System; - using System.Diagnostics.CodeAnalysis; - using System.IO; - using System.Numerics; - using Xunit; - using ImageSharp.Drawing.Brushes; - using ImageSharp.PixelFormats; - - using SixLabors.Shapes; - public class SolidPolygonTests : FileTestBase { [Fact] diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs index 705c99d08e..3f138248eb 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawText.Path.cs @@ -1,25 +1,20 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing.Text +using System; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests.Drawing.Paths; +using SixLabors.Fonts; +using SixLabors.Shapes; +using Xunit; + +namespace SixLabors.ImageSharp.Tests.Drawing.Text { - using System; - using System.Numerics; - - using ImageSharp.Drawing; - using ImageSharp.Drawing.Brushes; - using ImageSharp.Drawing.Pens; - using ImageSharp.Drawing.Processors; - using ImageSharp.PixelFormats; - using ImageSharp.Tests.Drawing.Paths; - - using SixLabors.Fonts; - using SixLabors.Shapes; - - using Xunit; - public class DrawText_Path : BaseImageOperationsExtensionTest { Rgba32 color = Rgba32.HotPink; diff --git a/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs b/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs index 0adf0141c5..d9fe1a76db 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/DrawText.cs @@ -1,25 +1,20 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Drawing.Text +using System; +using System.Numerics; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Tests.Drawing.Paths; +using SixLabors.Fonts; +using SixLabors.Shapes; +using Xunit; + +namespace SixLabors.ImageSharp.Tests.Drawing.Text { - using System; - using System.Numerics; - - using ImageSharp.Drawing; - using ImageSharp.Drawing.Brushes; - using ImageSharp.Drawing.Pens; - using ImageSharp.Drawing.Processors; - using ImageSharp.PixelFormats; - using ImageSharp.Tests.Drawing.Paths; - - using SixLabors.Fonts; - using SixLabors.Shapes; - - using Xunit; - public class DrawText : BaseImageOperationsExtensionTest { Rgba32 color = Rgba32.HotPink; diff --git a/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs b/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs index af401264dc..07041956d6 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/OutputText.cs @@ -1,22 +1,23 @@ - -namespace ImageSharp.Tests.Drawing.Text -{ - using System; - using System.IO; - using ImageSharp; - using ImageSharp.Drawing.Brushes; - using ImageSharp.Processing; - using System.Collections.Generic; - using Xunit; - using ImageSharp.Drawing; - using System.Numerics; - using SixLabors.Shapes; - using ImageSharp.Drawing.Processors; - using ImageSharp.Drawing.Pens; - using ImageSharp.PixelFormats; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using SixLabors.Fonts; +using System; +using System.Collections.Generic; +using System.IO; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Drawing; +using SixLabors.ImageSharp.Drawing.Brushes; +using SixLabors.ImageSharp.Drawing.Pens; +using SixLabors.ImageSharp.Drawing.Processors; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Fonts; +using SixLabors.Shapes; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing.Text +{ public class OutputText : FileTestBase { private readonly FontCollection FontCollection; diff --git a/tests/ImageSharp.Tests/Drawing/Text/TextGraphicsOptionsTests.cs b/tests/ImageSharp.Tests/Drawing/Text/TextGraphicsOptionsTests.cs index 1a26bcfedc..975622e43d 100644 --- a/tests/ImageSharp.Tests/Drawing/Text/TextGraphicsOptionsTests.cs +++ b/tests/ImageSharp.Tests/Drawing/Text/TextGraphicsOptionsTests.cs @@ -1,15 +1,17 @@ - -namespace ImageSharp.Tests.Drawing.Text -{ - using ImageSharp.Drawing; - using SixLabors.Fonts; - using System; - using System.Collections.Generic; - using System.Linq; - using System.Numerics; - using System.Threading.Tasks; - using Xunit; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Drawing; +using SixLabors.Fonts; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Drawing.Text +{ public class TextGraphicsOptionsTests { [Fact] diff --git a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs index 1c6fec0a43..f750bfcfad 100644 --- a/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs +++ b/tests/ImageSharp.Tests/FakeImageOperationsProvider.cs @@ -1,13 +1,16 @@ -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Text; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +namespace SixLabors.ImageSharp.Tests +{ internal class FakeImageOperationsProvider : IImageProcessingContextFactory { private List ImageOperators = new List(); diff --git a/tests/ImageSharp.Tests/FileTestBase.cs b/tests/ImageSharp.Tests/FileTestBase.cs index 08ed69f3e2..37377a2fbc 100644 --- a/tests/ImageSharp.Tests/FileTestBase.cs +++ b/tests/ImageSharp.Tests/FileTestBase.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.Collections.Generic; +using System.Collections.Generic; +namespace SixLabors.ImageSharp.Tests +{ /// /// The test base class for reading and writing to files. /// diff --git a/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs index e5af28d8b4..c3ab62b0da 100644 --- a/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -using ImageSharp.Formats; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using ImageSharp.PixelFormats; - - using Xunit; - public class BmpEncoderTests : FileTestBase { public static readonly TheoryData BitsPerPixel diff --git a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs index be6ce13433..bee0aedc18 100644 --- a/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs +++ b/tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.IO; - using ImageSharp.Formats; - using ImageSharp.PixelFormats; - - using Xunit; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class GeneralFormatTests : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs index f74c7a5a71..9cc2ebec49 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System.Text; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System.Text; - using Xunit; - - using ImageSharp.Formats; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - public class GifDecoderTests { private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32 | Tests.PixelTypes.RgbaVector | Tests.PixelTypes.Argb32; diff --git a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs index c365396863..fb806e244d 100644 --- a/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.IO; - using Xunit; - - using ImageSharp.Formats; - using ImageSharp.PixelFormats; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class GifEncoderTests { private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32 | Tests.PixelTypes.RgbaVector | Tests.PixelTypes.Argb32; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs index dc6985dd34..44e399b460 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/BadEofJpegTests.cs @@ -1,25 +1,22 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// using System; using System.Collections.Generic; using System.IO; using System.Linq; -using ImageSharp.Formats; +using System.Numerics; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Jpg; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; using Xunit; using Xunit.Abstractions; + // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System.Numerics; - - using ImageSharp.Formats.Jpg; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - public class BadEOFJpegTests : MeasureFixture { public BadEOFJpegTests(ITestOutputHelper output) diff --git a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs index 01501a33d4..c4981cc01d 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs @@ -1,24 +1,20 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System.Diagnostics; +using System.Numerics; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Jpg; +using Xunit; +using Xunit.Abstractions; // Uncomment this to turn unit tests into benchmarks: //#define BENCHMARKING // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System.Diagnostics; - using System.Numerics; - - using ImageSharp.Formats; - using ImageSharp.Formats.Jpg; - - using Xunit; - using Xunit.Abstractions; - public class Block8x8FTests : JpegUtilityTestFixture { #if BENCHMARKING diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs index 9401d098de..55c1cc53ae 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs @@ -1,19 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System; - using System.IO; - - using ImageSharp.Formats; - using ImageSharp.PixelFormats; - - using Xunit; - public class JpegDecoderTests : TestBase { public static string[] BaselineTestJpegs = diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs index 49802a8d23..b79c4555ce 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs @@ -1,24 +1,22 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// using System; using System.Collections.Generic; using System.IO; using System.Linq; -using ImageSharp.Formats; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Jpg; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; using Xunit; using Xunit.Abstractions; + // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using ImageSharp.Formats.Jpg; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; - public class JpegEncoderTests : MeasureFixture { public static IEnumerable AllBmpFiles => TestImages.Bmp.All; diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs index daf8da6a38..e7a9d3d3eb 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs @@ -1,21 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.IO; - using System.Linq; - using System.Numerics; - - using ImageSharp.Formats; - using ImageSharp.PixelFormats; - - using Xunit; - using Xunit.Abstractions; +using System; +using System.IO; +using System.Linq; +using System.Numerics; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ public class JpegProfilingBenchmarks : MeasureFixture { public JpegProfilingBenchmarks(ITestOutputHelper output) diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegUtilityTestFixture.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegUtilityTestFixture.cs index 252b01138b..351e12ddf2 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegUtilityTestFixture.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegUtilityTestFixture.cs @@ -1,20 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -using System.Text; +using System; +using System.Diagnostics; +using System.Text; +using SixLabors.ImageSharp.Formats.Jpg; using Xunit.Abstractions; + // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System; - using System.Diagnostics; - - using ImageSharp.Formats.Jpg; - public class JpegUtilityTestFixture : MeasureFixture { public JpegUtilityTestFixture(ITestOutputHelper output) : base(output) diff --git a/tests/ImageSharp.Tests/Formats/Jpg/JpegUtilsTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/JpegUtilsTests.cs index f681e1d8f9..6aad77b30f 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/JpegUtilsTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/JpegUtilsTests.cs @@ -1,19 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System; +using System.Numerics; +using SixLabors.ImageSharp.Formats.Jpg; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System; - using System.Numerics; - - using ImageSharp.Formats.Jpg; - using ImageSharp.PixelFormats; - - using Xunit; - public class JpegUtilsTests : TestBase { public static Image CreateTestImage(GenericFactory factory) diff --git a/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementations.cs b/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementations.cs index e76a11cec9..86f5e99a0a 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementations.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementations.cs @@ -1,19 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.Formats.Jpg; // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System; - using System.Numerics; - using System.Runtime.CompilerServices; - - using ImageSharp.Formats; - using ImageSharp.Formats.Jpg; - /// /// This class contains simplified (unefficient) reference implementations to produce verification data for unit tests /// Floating point DCT code Ported from https://github.com/norishigefukushima/dct_simd diff --git a/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs index 50b94bc24c..a1a98296d3 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using SixLabors.ImageSharp.Formats.Jpg; +using Xunit; +using Xunit.Abstractions; // ReSharper disable InconsistentNaming -namespace ImageSharp.Tests.Formats.Jpg +namespace SixLabors.ImageSharp.Tests.Formats.Jpg { - using ImageSharp.Formats.Jpg; - - using Xunit; - using Xunit.Abstractions; - public class ReferenceImplementationsTests : JpegUtilityTestFixture { public ReferenceImplementationsTests(ITestOutputHelper output) diff --git a/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs b/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs index b911e11846..1b1f05aa47 100644 --- a/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs +++ b/tests/ImageSharp.Tests/Formats/Jpg/YCbCrImageTests.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using ImageSharp.Formats.Jpg; - using SixLabors.Primitives; - using Xunit; - using Xunit.Abstractions; +using SixLabors.ImageSharp.Formats.Jpg; +using SixLabors.Primitives; +using Xunit; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ public class YCbCrImageTests { public YCbCrImageTests(ITestOutputHelper output) diff --git a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs index 3c335441ab..73cfa85b2d 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// using System.IO; using System.IO.Compression; using System.Text; -using ImageSharp.Formats; -using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; using Xunit; -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { public class PngDecoderTests { diff --git a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs index 24907cfdb7..c17a1c3b02 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs @@ -1,21 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -using ImageSharp.Formats; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Threading.Tasks; - using ImageSharp.IO; - using ImageSharp.PixelFormats; - - using Xunit; - public class PngEncoderTests : FileTestBase { private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32 | Tests.PixelTypes.RgbaVector | Tests.PixelTypes.Argb32; diff --git a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs index e065385ac8..c32fd91795 100644 --- a/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs +++ b/tests/ImageSharp.Tests/Formats/Png/PngSmokeTests.cs @@ -1,22 +1,19 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Formats.Png -{ - using System; - using System.Collections.Generic; - using System.Text; - using System.IO; - using Xunit; - using ImageSharp.Formats; - using System.Linq; - using ImageSharp.IO; - using System.Numerics; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Numerics; +using System.Text; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Formats.Png +{ public class PngSmokeTests { [Theory] diff --git a/tests/ImageSharp.Tests/GlobalSuppressions.cs b/tests/ImageSharp.Tests/GlobalSuppressions.cs new file mode 100644 index 0000000000..a00c6d05f1 --- /dev/null +++ b/tests/ImageSharp.Tests/GlobalSuppressions.cs @@ -0,0 +1,8 @@ + +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1004:Test methods should not be skipped", Justification = "", Scope = "member", Target = "~M:ImageSharp.Tests.Processing.Transforms.PadTest.Pad_width_height_ResizeProcessorWithCorrectOPtionsSet")] + diff --git a/tests/ImageSharp.Tests/Helpers/GuardTests.cs b/tests/ImageSharp.Tests/Helpers/GuardTests.cs index ba6d5687ce..83075dc83e 100644 --- a/tests/ImageSharp.Tests/Helpers/GuardTests.cs +++ b/tests/ImageSharp.Tests/Helpers/GuardTests.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Helpers -{ - using System; - using System.Diagnostics.CodeAnalysis; - - using Xunit; +using System; +using System.Diagnostics.CodeAnalysis; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Helpers +{ /// /// Tests the helper. /// diff --git a/tests/ImageSharp.Tests/Helpers/MathFTests.cs b/tests/ImageSharp.Tests/Helpers/MathFTests.cs index 62a971f9f5..f865353c4d 100644 --- a/tests/ImageSharp.Tests/Helpers/MathFTests.cs +++ b/tests/ImageSharp.Tests/Helpers/MathFTests.cs @@ -1,9 +1,11 @@ -namespace ImageSharp.Tests.Helpers -{ - using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Helpers +{ public class MathFTests { [Fact] diff --git a/tests/ImageSharp.Tests/IO/BigEndianBitConverter.CopyBytesTests.cs b/tests/ImageSharp.Tests/IO/BigEndianBitConverter.CopyBytesTests.cs index 4cdf9122a9..254cfa2dc4 100644 --- a/tests/ImageSharp.Tests/IO/BigEndianBitConverter.CopyBytesTests.cs +++ b/tests/ImageSharp.Tests/IO/BigEndianBitConverter.CopyBytesTests.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.IO -{ - using System; - using ImageSharp.IO; - using Xunit; +using System; +using SixLabors.ImageSharp.IO; +using Xunit; +namespace SixLabors.ImageSharp.Tests.IO +{ /// /// The tests. /// diff --git a/tests/ImageSharp.Tests/IO/BigEndianBitConverter.GetBytesTests.cs b/tests/ImageSharp.Tests/IO/BigEndianBitConverter.GetBytesTests.cs index 06962e0106..d8408523ba 100644 --- a/tests/ImageSharp.Tests/IO/BigEndianBitConverter.GetBytesTests.cs +++ b/tests/ImageSharp.Tests/IO/BigEndianBitConverter.GetBytesTests.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.IO -{ - using ImageSharp.IO; - using Xunit; +using SixLabors.ImageSharp.IO; +using Xunit; +namespace SixLabors.ImageSharp.Tests.IO +{ /// /// The tests. /// diff --git a/tests/ImageSharp.Tests/IO/BigEndianBitConverter.ToTypeTests.cs b/tests/ImageSharp.Tests/IO/BigEndianBitConverter.ToTypeTests.cs index a69727d457..65963918cb 100644 --- a/tests/ImageSharp.Tests/IO/BigEndianBitConverter.ToTypeTests.cs +++ b/tests/ImageSharp.Tests/IO/BigEndianBitConverter.ToTypeTests.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.IO -{ - using System; - using ImageSharp.IO; - using Xunit; +using System; +using SixLabors.ImageSharp.IO; +using Xunit; +namespace SixLabors.ImageSharp.Tests.IO +{ /// /// The tests. /// diff --git a/tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs b/tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs index ffd9cdedcc..9a4d7cf6f6 100644 --- a/tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs +++ b/tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.IO -{ - using System; - using System.IO; - using System.Text; - - using ImageSharp.IO; - - using Xunit; +using System; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.IO; +using Xunit; +namespace SixLabors.ImageSharp.Tests.IO +{ /// /// The endian binary reader tests. /// diff --git a/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.CopyBytesTests.cs b/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.CopyBytesTests.cs index 5ff47409b0..97d9275ad1 100644 --- a/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.CopyBytesTests.cs +++ b/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.CopyBytesTests.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.IO -{ - using System; - using ImageSharp.IO; - using Xunit; +using System; +using SixLabors.ImageSharp.IO; +using Xunit; +namespace SixLabors.ImageSharp.Tests.IO +{ /// /// The tests. /// diff --git a/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.GetBytesTests.cs b/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.GetBytesTests.cs index 7fd7a97d43..eae8ca2919 100644 --- a/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.GetBytesTests.cs +++ b/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.GetBytesTests.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.IO -{ - using ImageSharp.IO; - using Xunit; +using SixLabors.ImageSharp.IO; +using Xunit; +namespace SixLabors.ImageSharp.Tests.IO +{ /// /// The tests. /// diff --git a/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.ToTypeTests.cs b/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.ToTypeTests.cs index c46c011a14..f358362576 100644 --- a/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.ToTypeTests.cs +++ b/tests/ImageSharp.Tests/IO/LittleEndianBitConverter.ToTypeTests.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.IO -{ - using System; - using ImageSharp.IO; - using Xunit; +using System; +using SixLabors.ImageSharp.IO; +using Xunit; +namespace SixLabors.ImageSharp.Tests.IO +{ /// /// The tests. /// diff --git a/tests/ImageSharp.Tests/IO/LocalFileSystem.cs b/tests/ImageSharp.Tests/IO/LocalFileSystem.cs index 472d643cd3..3fa94d6711 100644 --- a/tests/ImageSharp.Tests/IO/LocalFileSystem.cs +++ b/tests/ImageSharp.Tests/IO/LocalFileSystem.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.IO -{ - using System; - using System.IO; - using ImageSharp.IO; - - using Xunit; +using System; +using System.IO; +using SixLabors.ImageSharp.IO; +using Xunit; +namespace SixLabors.ImageSharp.Tests.IO +{ public class LocalFileSystemTests { [Fact] diff --git a/tests/ImageSharp.Tests/Image/ImageDiscoverMimeType.cs b/tests/ImageSharp.Tests/Image/ImageDiscoverMimeType.cs index d34fa22e25..3b66579935 100644 --- a/tests/ImageSharp.Tests/Image/ImageDiscoverMimeType.cs +++ b/tests/ImageSharp.Tests/Image/ImageDiscoverMimeType.cs @@ -1,19 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.IO; - - using ImageSharp.Formats; - using ImageSharp.IO; - using ImageSharp.PixelFormats; - using Moq; - using Xunit; +using System; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.PixelFormats; +using Moq; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/Image/ImageEqualTests.cs b/tests/ImageSharp.Tests/Image/ImageEqualTests.cs index 3990060127..ac6ea888f5 100644 --- a/tests/ImageSharp.Tests/Image/ImageEqualTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageEqualTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class ImageEqualTests { [Fact] diff --git a/tests/ImageSharp.Tests/Image/ImageLoadTests.cs b/tests/ImageSharp.Tests/Image/ImageLoadTests.cs index 4573d0d9de..1f58b0a3b4 100644 --- a/tests/ImageSharp.Tests/Image/ImageLoadTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageLoadTests.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.IO; - - using ImageSharp.Formats; - using ImageSharp.IO; - using Moq; - using Xunit; +using System; +using System.IO; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.IO; +using Moq; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/Image/ImageRotationTests.cs b/tests/ImageSharp.Tests/Image/ImageRotationTests.cs index d9106399e0..bc9c28898f 100644 --- a/tests/ImageSharp.Tests/Image/ImageRotationTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageRotationTests.cs @@ -1,7 +1,10 @@ -using SixLabors.Primitives; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using SixLabors.Primitives; using Xunit; -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { public class ImageRotationTests { diff --git a/tests/ImageSharp.Tests/Image/ImageSaveTests.cs b/tests/ImageSharp.Tests/Image/ImageSaveTests.cs index ad8a5cc7d5..dd7a0eae59 100644 --- a/tests/ImageSharp.Tests/Image/ImageSaveTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageSaveTests.cs @@ -1,20 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.IO; - using System.Linq; - using ImageSharp.Formats; - using ImageSharp.IO; - using ImageSharp.PixelFormats; - - using Moq; - using Xunit; +using System; +using System.IO; +using System.Linq; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.PixelFormats; +using Moq; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/Image/ImageTests.cs b/tests/ImageSharp.Tests/Image/ImageTests.cs index 217bf37fe8..7c70ed761d 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - - using ImageSharp.Formats; - using ImageSharp.PixelFormats; - - using Xunit; +using System; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/Image/NoneSeekableStream.cs b/tests/ImageSharp.Tests/Image/NoneSeekableStream.cs index bc36b60eb2..10a531eafe 100644 --- a/tests/ImageSharp.Tests/Image/NoneSeekableStream.cs +++ b/tests/ImageSharp.Tests/Image/NoneSeekableStream.cs @@ -1,7 +1,10 @@ -using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; using System.IO; -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { internal class NoneSeekableStream : Stream { diff --git a/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs b/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs index 98f316f439..c41b8fce20 100644 --- a/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs +++ b/tests/ImageSharp.Tests/Image/PixelAccessorTests.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/ImageComparer.cs b/tests/ImageSharp.Tests/ImageComparer.cs index ea6d2e8052..86b48e6e92 100644 --- a/tests/ImageSharp.Tests/ImageComparer.cs +++ b/tests/ImageSharp.Tests/ImageComparer.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using ImageSharp; - using ImageSharp.Memory; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using System; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Class to perform simple image comparisons. /// diff --git a/tests/ImageSharp.Tests/ImageOperationTests.cs b/tests/ImageSharp.Tests/ImageOperationTests.cs index f7352a8eae..59722a84d2 100644 --- a/tests/ImageSharp.Tests/ImageOperationTests.cs +++ b/tests/ImageSharp.Tests/ImageOperationTests.cs @@ -1,23 +1,20 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.IO; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using Moq; +using SixLabors.Primitives; +using Xunit; + +namespace SixLabors.ImageSharp.Tests { - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - - using ImageSharp.Formats; - using ImageSharp.IO; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using Moq; - using SixLabors.Primitives; - using Xunit; - /// /// Tests the configuration class. /// diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index b0429d9ede..d459eedd3a 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -5,17 +5,27 @@ full portable True + SixLabors.ImageSharp.Tests + SixLabors.ImageSharp.Tests + + + true + - - + + + + diff --git a/tests/ImageSharp.Tests/MetaData/ImageFrameMetaDataTests.cs b/tests/ImageSharp.Tests/MetaData/ImageFrameMetaDataTests.cs index da2bb41561..8b42d4f515 100644 --- a/tests/ImageSharp.Tests/MetaData/ImageFrameMetaDataTests.cs +++ b/tests/ImageSharp.Tests/MetaData/ImageFrameMetaDataTests.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using ImageSharp.Formats; - using Xunit; +using SixLabors.ImageSharp.Formats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs b/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs index c60c8978ce..09a05a2544 100644 --- a/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs +++ b/tests/ImageSharp.Tests/MetaData/ImageMetaDataTests.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using ImageSharp.Formats; - using ImageSharp.PixelFormats; - - using Xunit; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/MetaData/ImagePropertyTests.cs b/tests/ImageSharp.Tests/MetaData/ImagePropertyTests.cs index 3b224014da..63a51e8638 100644 --- a/tests/ImageSharp.Tests/MetaData/ImagePropertyTests.cs +++ b/tests/ImageSharp.Tests/MetaData/ImagePropertyTests.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using Xunit; +using System; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the class. /// diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs index db22300fa5..845fbd8fa4 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifProfileTests.cs @@ -1,20 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections; - using System.IO; - using System.Linq; - using System.Text; - - using ImageSharp.PixelFormats; - - using Xunit; +using System; +using System.Collections; +using System.IO; +using System.Linq; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class ExifProfileTests { [Fact] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifReaderTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifReaderTests.cs index dc62f1cbf3..802f856e42 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifReaderTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifReaderTests.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.Collections.ObjectModel; - using Xunit; +using System.Collections.ObjectModel; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class ExifReaderTests { [Fact] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs index 1d36de5ef3..a2b2c6e70c 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifTagDescriptionAttributeTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class ExifDescriptionAttributeTests { [Fact] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifValueTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifValueTests.cs index 473af77121..3fbd1d9f0b 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifValueTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/Exif/ExifValueTests.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.Linq; - - using ImageSharp.PixelFormats; - - using Xunit; +using System.Linq; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class ExifValueTests { private static ExifValue GetExifValue() diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.CurvesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.CurvesTests.cs index 2bde125435..6a08c98e54 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.CurvesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.CurvesTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataReaderCurvesTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.LutTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.LutTests.cs index 52c67ba539..1271fc2680 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.LutTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.LutTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataReaderLutTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MatrixTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MatrixTests.cs index 9d148ec94a..8395f70158 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MatrixTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MatrixTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataReaderMatrixTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElementTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElementTests.cs index c02ef40e37..610efaf6a7 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElementTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.MultiProcessElementTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataReaderMultiProcessElementTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitivesTests.cs index e3593bfa9e..0c33ad9fe1 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.NonPrimitivesTests.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using System; - using System.Numerics; - using Xunit; +using System; +using System.Numerics; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataReaderNonPrimitivesTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.PrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.PrimitivesTests.cs index b9b0c6655c..7975da04c3 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.PrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.PrimitivesTests.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using System; - using Xunit; +using System; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataReaderPrimitivesTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntryTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntryTests.cs index 76bb1cda19..c75f6b96f4 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntryTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReader.TagDataEntryTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataReaderTagDataEntryTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReaderTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReaderTests.cs index 635ce6168d..3c66d9a4ad 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReaderTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataReader/IccDataReaderTests.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using System; - using Xunit; +using System; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataReaderTests { [Fact] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.CurvesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.CurvesTests.cs index c04401f6d0..85d091ec76 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.CurvesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.CurvesTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataWriterCurvesTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.LutTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.LutTests.cs index 4fcc55d016..6bbdb80386 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.LutTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.LutTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataWriterLutTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MatrixTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MatrixTests.cs index 61b5d57ffd..20c7c3bead 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MatrixTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MatrixTests.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using System.Numerics; - - using ImageSharp.Memory; - - using Xunit; +using System.Numerics; +using SixLabors.ImageSharp.Memory; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataWriterMatrixTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElementTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElementTests.cs index e3bc375744..bf80b53701 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElementTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.MultiProcessElementTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataWriterMultiProcessElementTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitivesTests.cs index ae83458051..d97e32de89 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.NonPrimitivesTests.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using System; - using System.Numerics; - using Xunit; +using System; +using System.Numerics; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataWriterNonPrimitivesTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs index 8d0cd32ab4..76ada231e2 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.PrimitivesTests.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using System; - using Xunit; +using System; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataWriterPrimitivesTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntryTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntryTests.cs index ea85bd16df..a026cb8a0c 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntryTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriter.TagDataEntryTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataWriterTagDataEntryTests { [Theory] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriterTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriterTests.cs index 5239d7cd51..2d0aa920b0 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriterTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/DataWriter/IccDataWriterTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccDataWriterTests { [Fact] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccReaderTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccReaderTests.cs index 34aa24fa66..6c11182e09 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccReaderTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccReaderTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccReaderTests { [Fact] diff --git a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs index 7e3f8c0c94..e845535304 100644 --- a/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs +++ b/tests/ImageSharp.Tests/MetaData/Profiles/ICC/IccWriterTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Icc -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Icc +{ public class IccWriterTests { [Fact] diff --git a/tests/ImageSharp.Tests/Numerics/RationalTests.cs b/tests/ImageSharp.Tests/Numerics/RationalTests.cs index 3d80b88fe7..c6c59915d6 100644 --- a/tests/ImageSharp.Tests/Numerics/RationalTests.cs +++ b/tests/ImageSharp.Tests/Numerics/RationalTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the struct. /// diff --git a/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs b/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs index cb7e21db0b..d4b3421518 100644 --- a/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs +++ b/tests/ImageSharp.Tests/Numerics/SignedRationalTests.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using Xunit; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the struct. /// diff --git a/tests/ImageSharp.Tests/PixelFormats/Bgr24Tests.cs b/tests/ImageSharp.Tests/PixelFormats/Bgr24Tests.cs index 76001ed3a0..ca59cea725 100644 --- a/tests/ImageSharp.Tests/PixelFormats/Bgr24Tests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/Bgr24Tests.cs @@ -1,12 +1,12 @@ -// ReSharper disable InconsistentNaming -namespace ImageSharp.Tests -{ - using System.Numerics; - - using ImageSharp.PixelFormats; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class Bgr24Tests { public static readonly TheoryData ColorData = diff --git a/tests/ImageSharp.Tests/PixelFormats/Bgra32Tests.cs b/tests/ImageSharp.Tests/PixelFormats/Bgra32Tests.cs index 1928d51f69..e3cf868257 100644 --- a/tests/ImageSharp.Tests/PixelFormats/Bgra32Tests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/Bgra32Tests.cs @@ -1,12 +1,12 @@ -// ReSharper disable InconsistentNaming -namespace ImageSharp.Tests -{ - using System.Numerics; - - using ImageSharp.PixelFormats; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class Bgra32Tests { public static readonly TheoryData ColorData = diff --git a/tests/ImageSharp.Tests/PixelFormats/ColorConstructorTests.cs b/tests/ImageSharp.Tests/PixelFormats/ColorConstructorTests.cs index eac0644d9a..b0d5929f49 100644 --- a/tests/ImageSharp.Tests/PixelFormats/ColorConstructorTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/ColorConstructorTests.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Colors -{ - using System.Collections.Generic; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; +using System.Collections.Generic; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colors +{ public class ColorConstructorTests { public static IEnumerable Vector4Data diff --git a/tests/ImageSharp.Tests/PixelFormats/ColorDefinitionTests.cs b/tests/ImageSharp.Tests/PixelFormats/ColorDefinitionTests.cs index db5b4a4c91..af4181cde2 100644 --- a/tests/ImageSharp.Tests/PixelFormats/ColorDefinitionTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/ColorDefinitionTests.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - - using ImageSharp.PixelFormats; - - using Xunit; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class ColorDefinitionTests { public static TheoryData ColorNames diff --git a/tests/ImageSharp.Tests/PixelFormats/ColorEqualityTests.cs b/tests/ImageSharp.Tests/PixelFormats/ColorEqualityTests.cs index 2967e7c864..d3815f2eb6 100644 --- a/tests/ImageSharp.Tests/PixelFormats/ColorEqualityTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/ColorEqualityTests.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Colors -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colors +{ /// /// Test implementations of IEquatable /// diff --git a/tests/ImageSharp.Tests/PixelFormats/ColorPackingTests.cs b/tests/ImageSharp.Tests/PixelFormats/ColorPackingTests.cs index 563b6be3c4..ad8297fbb5 100644 --- a/tests/ImageSharp.Tests/PixelFormats/ColorPackingTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/ColorPackingTests.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Colors -{ - using System.Collections.Generic; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; +using System.Collections.Generic; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colors +{ public class ColorPackingTests { public static IEnumerable Vector4PackData diff --git a/tests/ImageSharp.Tests/PixelFormats/PackedPixelTests.cs b/tests/ImageSharp.Tests/PixelFormats/PackedPixelTests.cs index 773bfa513d..303905baf0 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PackedPixelTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PackedPixelTests.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Colors -{ - using System; - using System.Diagnostics; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; +using System; +using System.Diagnostics; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colors +{ /// /// The packed pixel tests. /// diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests.cs index 97d5505923..9aa2e01a67 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.PixelFormats.PixelBlenders -{ - using System; - using System.Collections.Generic; - using System.Numerics; - using System.Text; - using ImageSharp.PixelFormats.PixelBlenders; - using ImageSharp.Tests.TestUtilities; - using Xunit; +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Text; +using SixLabors.ImageSharp.PixelFormats.PixelBlenders; +using SixLabors.ImageSharp.Tests.TestUtilities; +using Xunit; +namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelBlenders +{ public class PorterDuffFunctionsTests { public static TheoryData NormalBlendFunctionData = new TheoryData() { diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs index b2a663d074..b95f8fdf61 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs @@ -1,19 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.PixelFormats.PixelBlenders -{ - using System; - using System.Collections.Generic; - using System.Numerics; - using System.Text; - using ImageSharp.PixelFormats; - using ImageSharp.PixelFormats.PixelBlenders; - using ImageSharp.Tests.TestUtilities; - using Xunit; +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats.PixelBlenders; +using SixLabors.ImageSharp.Tests.TestUtilities; +using Xunit; +namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelBlenders +{ public class PorterDuffFunctionsTests_TPixel { private static Span AsSpan(T value) diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.Blender.cs b/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.Blender.cs index 6bcada0ff5..681aa6f0d1 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.Blender.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.Blender.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.PixelFormats -{ - using System; - using System.Collections.Generic; - using System.Text; - using ImageSharp.PixelFormats; - using ImageSharp.PixelFormats.PixelBlenders; - using ImageSharp.Tests.TestUtilities; - using Xunit; +using System; +using System.Collections.Generic; +using System.Text; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats.PixelBlenders; +using SixLabors.ImageSharp.Tests.TestUtilities; +using Xunit; +namespace SixLabors.ImageSharp.Tests.PixelFormats +{ public partial class PixelOperationsTests { diff --git a/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.cs b/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.cs index 0a121cfce9..6a108503bf 100644 --- a/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/PixelOperationsTests.cs @@ -1,16 +1,15 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable AccessToDisposedClosure -namespace ImageSharp.Tests.PixelFormats -{ - using System; - using System.Numerics; - - using ImageSharp.Memory; - using ImageSharp.PixelFormats; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; - using Xunit.Abstractions; +using System; +using System.Numerics; +using SixLabors.ImageSharp.Memory; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests.PixelFormats +{ public partial class PixelOperationsTests { diff --git a/tests/ImageSharp.Tests/PixelFormats/Rgb24Tests.cs b/tests/ImageSharp.Tests/PixelFormats/Rgb24Tests.cs index 1d0d024fbb..4e85fe7e32 100644 --- a/tests/ImageSharp.Tests/PixelFormats/Rgb24Tests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/Rgb24Tests.cs @@ -1,13 +1,13 @@ -// ReSharper disable InconsistentNaming -namespace ImageSharp.Tests -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class Rgb24Tests { public static readonly TheoryData ColorData = diff --git a/tests/ImageSharp.Tests/PixelFormats/Rgba32Tests.cs b/tests/ImageSharp.Tests/PixelFormats/Rgba32Tests.cs index 5509cbddcf..a8d38b9381 100644 --- a/tests/ImageSharp.Tests/PixelFormats/Rgba32Tests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/Rgba32Tests.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit; +using System; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the struct. /// diff --git a/tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs b/tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs index 1f5df6d880..1dd280bee4 100644 --- a/tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/RgbaVectorTests.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.Numerics; - using System.Runtime.CompilerServices; - - using ImageSharp.PixelFormats; - - using Xunit; +using System.Numerics; +using System.Runtime.CompilerServices; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// Tests the struct. /// diff --git a/tests/ImageSharp.Tests/PixelFormats/UnPackedPixelTests.cs b/tests/ImageSharp.Tests/PixelFormats/UnPackedPixelTests.cs index 25a61453b2..b5d46ba769 100644 --- a/tests/ImageSharp.Tests/PixelFormats/UnPackedPixelTests.cs +++ b/tests/ImageSharp.Tests/PixelFormats/UnPackedPixelTests.cs @@ -1,11 +1,12 @@ -namespace ImageSharp.Tests.Colors -{ - using System.Numerics; - - using ImageSharp.PixelFormats; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. - using Xunit; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Colors +{ public class UnPackedPixelTests { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs index b61df20354..221b4a9bff 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/BinaryThresholdTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Binarization -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Binarization +{ public class BinaryThresholdTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs index bf67826b67..8aef37d4d1 100644 --- a/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs +++ b/tests/ImageSharp.Tests/Processing/Binarization/DitherTest.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Binarization -{ - using ImageSharp.Dithering; - using ImageSharp.Dithering.Ordered; - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using Moq; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.Dithering; +using SixLabors.ImageSharp.Dithering.Ordered; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using Moq; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Binarization +{ public class DitherTest : BaseImageOperationsExtensionTest { private readonly IOrderedDither orderedDither; diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs index 0608ee511d..f6efdc9a99 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/BlackWhiteTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.ColorMatrix -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.ColorMatrix +{ public class BlackWhiteTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs index 5f0fe06e45..cc80e32d58 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/ColorBlindnessTest.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.ColorMatrix -{ - using System.Collections.Generic; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using ImageSharp.Processing.Processors; - using ImageSharp.Tests.TestUtilities; - using SixLabors.Primitives; - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Tests.TestUtilities; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.ColorMatrix +{ public class ColorBlindnessTest : BaseImageOperationsExtensionTest { public static IEnumerable TheoryData = new[] { diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs index a4722261e6..14697c6234 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/GrayscaleTest.cs @@ -1,19 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.ColorMatrix -{ - using System.Collections; - using System.Collections.Generic; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using ImageSharp.Processing.Processors; - using ImageSharp.Tests.TestUtilities; - using SixLabors.Primitives; - using Xunit; +using System.Collections; +using System.Collections.Generic; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Tests.TestUtilities; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.ColorMatrix +{ public class GrayscaleTest : BaseImageOperationsExtensionTest { public static IEnumerable ModeTheoryData = new[] { diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs index 4132990855..0ec03dfdd5 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/HueTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.ColorMatrix -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.ColorMatrix +{ public class HueTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs index dcffd4b4f6..61a4124c9e 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/KodachromeTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.ColorMatrix -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.ColorMatrix +{ public class KodachromeTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs index 5b468bfdea..32107cb716 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/LomographTest.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.IO; - - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ public class LomographTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs index 245bc47c5f..10433aa9b1 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/PolaroidTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.ColorMatrix -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.ColorMatrix +{ public class PolaroidTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs index 58df89db6f..5a44023293 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/SaturationTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.ColorMatrix -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.ColorMatrix +{ public class SaturationTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs index 3fa1f081aa..b2117b94a2 100644 --- a/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs +++ b/tests/ImageSharp.Tests/Processing/ColorMatrix/SepiaTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.ColorMatrix -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.ColorMatrix +{ public class SepiaTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs index e4c185114d..cd0e8e5ab0 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/BoxBlurTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Convolution -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Convolution +{ public class BoxBlurTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs index 0377953a65..5a711bd04e 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/DetectEdgesTest.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Convolution -{ - using System.Collections.Generic; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using ImageSharp.Processing.Processors; - using ImageSharp.Tests.TestUtilities; - using SixLabors.Primitives; - using Xunit; +using System.Collections.Generic; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Tests.TestUtilities; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Convolution +{ public class DetectEdgesTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs index 8b2e4c6340..d0773a0bfe 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianBlurTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Convolution -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Convolution +{ public class GaussianBlurTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs index e381ad7e92..c7c78a21a6 100644 --- a/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs +++ b/tests/ImageSharp.Tests/Processing/Convolution/GaussianSharpenTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Convolution -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Convolution +{ public class GaussianSharpenTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/DelegateTest.cs b/tests/ImageSharp.Tests/Processing/DelegateTest.cs index d5846b1589..518a28bea0 100644 --- a/tests/ImageSharp.Tests/Processing/DelegateTest.cs +++ b/tests/ImageSharp.Tests/Processing/DelegateTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing +{ public class DelegateTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs b/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs index 960ab4509c..9840d71c7a 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/AlphaTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Effects -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Effects +{ public class AlphaTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs index 8de7b675ab..a24b8a4d47 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/BackgroundColorTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Effects -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Effects +{ public class BackgroundColorTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs index e9a9a49b6a..d057f9233a 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/BrightnessTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Effects -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Effects +{ public class BrightnessTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs index 392c407f3a..374937ea38 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/ContrastTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Effects -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Effects +{ public class ContrastTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs index 794cb65b8e..ad74b3c909 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/InvertTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Effects -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Effects +{ public class InvertTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs index b96887c76b..36de67188f 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/OilPaintTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Effects -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Effects +{ public class OilPaintTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs index bcd35af163..8b50e14861 100644 --- a/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Effects/PixelateTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Effects -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Effects +{ public class PixelateTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs index 223129877f..9e7a046507 100644 --- a/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs +++ b/tests/ImageSharp.Tests/Processing/Overlays/GlowTest.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Overlays -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Overlays +{ public class GlowTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs index f93ca186f1..e082e42cd7 100644 --- a/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Overlays/VignetteTest.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Overlays -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using ImageSharp.Tests.TestUtilities; - using SixLabors.Primitives; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.ImageSharp.Tests.TestUtilities; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Overlays +{ public class VignetteTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs index 209d506615..21b3727c01 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/BinaryThresholdTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Binarization -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Binarization +{ public class BinaryThresholdTest : FileTestBase { public static readonly TheoryData BinaryThresholdValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs index edaede58da..17ab2545ca 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Binarization/DitherTest.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Binarization -{ - using ImageSharp.Dithering; - using ImageSharp.Dithering.Ordered; - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.Dithering; +using SixLabors.ImageSharp.Dithering.Ordered; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Binarization +{ public class DitherTest : FileTestBase { public static readonly TheoryData Ditherers = new TheoryData diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs index dcc61a629a..101a0c2cda 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/BlackWhiteTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class BlackWhiteTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs index 59f389cfd8..097557e041 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/ColorBlindnessTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class ColorBlindnessTest : FileTestBase { public static readonly TheoryData ColorBlindnessFilters diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs index 7fdc070050..a93997deec 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/GrayscaleTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class GrayscaleTest : FileTestBase { public static readonly TheoryData GrayscaleModeTypes diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs index 30beb61d07..d5ea145766 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/HueTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class HueTest : FileTestBase { public static readonly TheoryData HueValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs index be2464d1d9..07be75d78d 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/KodachromeTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class KodachromeTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs index 1709995943..1d1c6f783e 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/LomographTest.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using System.IO; - - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using System.IO; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class LomographTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs index 367ce04c78..ad22f92eda 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/PolaroidTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class PolaroidTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs index ba0cc344ee..58cfaa2e9d 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SaturationTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class SaturationTest : FileTestBase { public static readonly TheoryData SaturationValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs index 5879a8bb76..fa098e7448 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/ColorMatrix/SepiaTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.ColorMatrix -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.ColorMatrix +{ public class SepiaTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs index 3daa8c9334..d1f24b925a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/BoxBlurTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Convolution -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution +{ public class BoxBlurTest : FileTestBase { public static readonly TheoryData BoxBlurValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs index 72a3e90231..fd107314f1 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/DetectEdgesTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Convolution -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution +{ public class DetectEdgesTest : FileTestBase { public static readonly TheoryData DetectEdgesFilters diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs index 9ccc4e4536..4b4879f9b8 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianBlurTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Convolution -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution +{ public class GaussianBlurTest : FileTestBase { public static readonly TheoryData GaussianBlurValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs index dab576c2b8..86b601c3c2 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Convolution/GaussianSharpenTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Convolution -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution +{ public class GaussianSharpenTest : FileTestBase { public static readonly TheoryData GaussianSharpenValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs index a7626f386b..1d77370f8f 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/AlphaTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Effects -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects +{ public class AlphaTest : FileTestBase { public static readonly TheoryData AlphaValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs index 70c2844de4..cd0639900d 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BackgroundColorTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Effects -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects +{ public class BackgroundColorTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs index 57b7cd8d9f..fbf0b78fa5 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/BrightnessTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Effects -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects +{ public class BrightnessTest : FileTestBase { public static readonly TheoryData BrightnessValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs index a5423ba937..91f112ae99 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/ContrastTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Effects -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects +{ public class ContrastTest : FileTestBase { public static readonly TheoryData ContrastValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs index 2816cb9258..f182fbb25d 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/InvertTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Effects -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects +{ public class InvertTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs index 0a26cee69b..c1227c3d9a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/OilPaintTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Effects -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects +{ public class OilPaintTest : FileTestBase { public static readonly TheoryData OilPaintValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs index 92703ca076..9b5bf7dedd 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Effects/PixelateTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Effects -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Effects +{ public class PixelateTest : FileTestBase { public static readonly TheoryData PixelateValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs index 3f69ba148c..fdaed975a7 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Overlays -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays +{ public class GlowTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs index c65b254c00..fdbd47a7b8 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Overlays -{ - using ImageSharp.PixelFormats; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays +{ public class VignetteTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs index 7ab49bc417..7573672674 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/AutoOrientTests.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.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 951fdee5ec..1eaf1802ed 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/CropTest.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using ImageSharp.PixelFormats; - - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms +{ public class CropTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs index 910925e8f3..c71f380a01 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/EntropyCropTest.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using ImageSharp.PixelFormats; - - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms +{ public class EntropyCropTest : FileTestBase { public static readonly TheoryData EntropyCropValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs index 1ffccb80a4..d4de4c3d2e 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/FlipTests.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.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 9a09645385..f2da8e267d 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/PadTest.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using ImageSharp.PixelFormats; - - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms +{ public class PadTest : FileTestBase { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs index 4e6fd024e7..963b849d2a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeProfilingBenchmarks.cs @@ -1,20 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using System; - using System.IO; - using System.Text; - - using ImageSharp.Processing; - using ImageSharp.Processing.Processors; - - using Xunit; - using Xunit.Abstractions; +using System; +using System.IO; +using System.Text; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using Xunit; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms +{ 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 813767edcb..cdf5e77df9 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms +{ public class ResizeTests : FileTestBase { public static readonly string[] ResizeFiles = { TestImages.Jpeg.Baseline.Calliphora }; diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs index b0cafd114e..e4ac76e7a7 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateFlipTests.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.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 74afd02404..4262e6e2eb 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms +{ public class RotateTests : FileTestBase { public static readonly TheoryData RotateFloatValues diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs index 64f4d4905e..4afe4f2f1d 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/SkewTest.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Processors.Transforms -{ - using ImageSharp.PixelFormats; - - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms +{ public class SkewTest : FileTestBase { public static readonly TheoryData SkewValues diff --git a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs index c26c957a0a..dbb2d8415e 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/AutoOrientTests.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using ImageSharp.Processing.Processors; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class AutoOrientTests : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs index 33f3ffb935..a001efc417 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/CropTest.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using SixLabors.Primitives; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class CropTest : BaseImageOperationsExtensionTest { [Theory] diff --git a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs index 11a7dc2505..c1cde48794 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/EntropyCropTest.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class EntropyCropTest : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs index 5234baed72..4b3e97d106 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using ImageSharp.Processing.Processors; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class FlipTests : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs index 8b8d51f9fa..58fc7fa802 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/PadTest.cs @@ -1,18 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using System; - using ImageSharp.PixelFormats; - - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class PadTest : BaseImageOperationsExtensionTest { +#pragma warning disable xUnit1004 // Test methods should not be skipped [Fact(Skip = "Skip this is a helper around resize, skip until resize can be refactord")] +#pragma warning restore xUnit1004 // Test methods should not be skipped public void Pad_width_height_ResizeProcessorWithCorrectOPtionsSet() { throw new NotImplementedException("Write test here"); diff --git a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs index ae35740a94..d2f5cb2c3d 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/ResizeTests.cs @@ -1,19 +1,19 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using SixLabors.Primitives; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.Primitives; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class ResizeTests : BaseImageOperationsExtensionTest { +#pragma warning disable xUnit1004 // Test methods should not be skipped [Fact(Skip = "Skip resize tests as they need refactoring to be simpler and just pass data into the resize processor.")] +#pragma warning restore xUnit1004 // Test methods should not be skipped public void TestMissing() { // diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs index 91505afa04..67602131b0 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateFlipTests.cs @@ -1,16 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using System; - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using ImageSharp.Processing.Processors; - using Xunit; +using System; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class RotateFlipTests : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs index da2a34d0e2..80eccd00cd 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/RotateTests.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing; - using ImageSharp.Processing.Processors; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class RotateTests : BaseImageOperationsExtensionTest { diff --git a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs index 6e7b2d8e8a..28a0e0d8f8 100644 --- a/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs +++ b/tests/ImageSharp.Tests/Processing/Transforms/SkewTest.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests.Processing.Transforms -{ - using ImageSharp.PixelFormats; - using ImageSharp.Processing.Processors; - using Xunit; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing.Processors; +using Xunit; +namespace SixLabors.ImageSharp.Tests.Processing.Transforms +{ public class SkewTest : BaseImageOperationsExtensionTest { [Fact] diff --git a/tests/ImageSharp.Tests/TestBase.cs b/tests/ImageSharp.Tests/TestBase.cs index c7514d5aee..d11292ed00 100644 --- a/tests/ImageSharp.Tests/TestBase.cs +++ b/tests/ImageSharp.Tests/TestBase.cs @@ -1,15 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.IO; - using System.Reflection; - - using ImageSharp.Formats; +using System.IO; +using System.Reflection; +using SixLabors.ImageSharp.Formats; +namespace SixLabors.ImageSharp.Tests +{ /// /// The test base class. Inherit from this class for any image manipulation tests. /// diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataArray.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataArray.cs index a14433f1e1..4fd798f345 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataArray.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataArray.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { internal static class IccTestDataArray { diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs index c8d517aac6..2b13e5bad2 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.Numerics; +using System.Numerics; +namespace SixLabors.ImageSharp.Tests +{ internal static class IccTestDataCurves { #region Response diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs index cc2dfc6e97..b4a512bd1e 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { internal static class IccTestDataLut { diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMatrix.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMatrix.cs index 78e493829c..8e4b7d3d5b 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMatrix.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMatrix.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// using System.Numerics; +using SixLabors.ImageSharp.Memory; -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using ImageSharp.Memory; - internal static class IccTestDataMatrix { #region 2D diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs index 49e9550df5..d29906d426 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { internal static class IccTestDataMultiProcessElement { diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs index fdbcb31271..370b881682 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs @@ -1,9 +1,12 @@ -namespace ImageSharp.Tests -{ - using System; - using System.Globalization; - using System.Numerics; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Globalization; +using System.Numerics; +namespace SixLabors.ImageSharp.Tests +{ internal static class IccTestDataNonPrimitives { #region DateTime diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataPrimitives.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataPrimitives.cs index fcfa2d0d79..b24e3f24a4 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataPrimitives.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataPrimitives.cs @@ -1,9 +1,7 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { internal static class IccTestDataPrimitives { diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs index 32a4a8e57b..ee32aa934f 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// using System; using System.Numerics; -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { internal static class IccTestDataProfiles { diff --git a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs index 05942ab618..240bd4fa53 100644 --- a/tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs +++ b/tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.Globalization; - using System.Numerics; +using System.Globalization; +using System.Numerics; +namespace SixLabors.ImageSharp.Tests +{ internal static class IccTestDataTagDataEntry { #region TagDataEntry Header diff --git a/tests/ImageSharp.Tests/TestFile.cs b/tests/ImageSharp.Tests/TestFile.cs index 4f286f4da0..daf07679a6 100644 --- a/tests/ImageSharp.Tests/TestFile.cs +++ b/tests/ImageSharp.Tests/TestFile.cs @@ -1,19 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Reflection; - using ImageSharp.Formats; - using ImageSharp.PixelFormats; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Tests +{ /// /// A test image file. /// diff --git a/tests/ImageSharp.Tests/TestFileSystem.cs b/tests/ImageSharp.Tests/TestFileSystem.cs index d43b989f10..304e8dcb86 100644 --- a/tests/ImageSharp.Tests/TestFileSystem.cs +++ b/tests/ImageSharp.Tests/TestFileSystem.cs @@ -1,19 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Reflection; - using ImageSharp.Formats; - using Xunit; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using SixLabors.ImageSharp.Formats; +using Xunit; +namespace SixLabors.ImageSharp.Tests +{ /// /// A test image file. /// diff --git a/tests/ImageSharp.Tests/TestFont.cs b/tests/ImageSharp.Tests/TestFont.cs index 7e5b6c370d..6f805e3676 100644 --- a/tests/ImageSharp.Tests/TestFont.cs +++ b/tests/ImageSharp.Tests/TestFont.cs @@ -1,17 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Reflection; +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +namespace SixLabors.ImageSharp.Tests +{ /// /// A test image file. /// diff --git a/tests/ImageSharp.Tests/TestFormat.cs b/tests/ImageSharp.Tests/TestFormat.cs index 5a3cd102e7..2683d47524 100644 --- a/tests/ImageSharp.Tests/TestFormat.cs +++ b/tests/ImageSharp.Tests/TestFormat.cs @@ -1,21 +1,18 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; + +namespace SixLabors.ImageSharp.Tests { - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Reflection; - using ImageSharp.Formats; - using ImageSharp.PixelFormats; - - using Xunit; - /// /// A test image file. /// diff --git a/tests/ImageSharp.Tests/TestImages.cs b/tests/ImageSharp.Tests/TestImages.cs index 46887d721d..a6177b7c9f 100644 --- a/tests/ImageSharp.Tests/TestImages.cs +++ b/tests/ImageSharp.Tests/TestImages.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System.Linq; // ReSharper disable MemberHidesStaticFromOuterClass -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System.Linq; - /// /// Class that contains all the relative test image paths in the TestImages/Formats directory. /// Use with , or . diff --git a/tests/ImageSharp.Tests/TestUtilities/ApproximateFloatComparer.cs b/tests/ImageSharp.Tests/TestUtilities/ApproximateFloatComparer.cs index 333b645dea..6b3f6ccd21 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ApproximateFloatComparer.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ApproximateFloatComparer.cs @@ -1,9 +1,12 @@ -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Numerics; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Collections.Generic; +using System.Numerics; +namespace SixLabors.ImageSharp.Tests +{ internal struct ApproximateFloatComparer : IEqualityComparer, IEqualityComparer { private readonly float Eps; diff --git a/tests/ImageSharp.Tests/TestUtilities/ArrayHelper.cs b/tests/ImageSharp.Tests/TestUtilities/ArrayHelper.cs index d3b4da9b92..e342f7029f 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ArrayHelper.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ArrayHelper.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System.Linq; +using System.Linq; +namespace SixLabors.ImageSharp.Tests +{ public static class ArrayHelper { /// diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs index 05e8c61360..c94215bffa 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - - using Xunit.Sdk; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Xunit.Sdk; +namespace SixLabors.ImageSharp.Tests +{ /// /// Base class for Theory Data attributes which pass an instance of to the test case. /// diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithBlankImageAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithBlankImageAttribute.cs index 72be5abc29..796cba8554 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithBlankImageAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithBlankImageAttribute.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Reflection; +using System; +using System.Reflection; +namespace SixLabors.ImageSharp.Tests +{ /// /// Triggers passing instances which produce a blank image of size width * height. /// One instance will be passed for each the pixel format defined by the pixelTypes parameter diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileAttribute.cs index ec8421853e..e896c18546 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileAttribute.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Reflection; +using System; +using System.Reflection; +namespace SixLabors.ImageSharp.Tests +{ /// /// Triggers passing instances which read an image from the given file /// One instance will be passed for each the pixel format defined by the pixelTypes parameter diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileCollectionAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileCollectionAttribute.cs index 1b37c45a92..65f2bfc1ba 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileCollectionAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithFileCollectionAttribute.cs @@ -1,15 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +namespace SixLabors.ImageSharp.Tests +{ /// /// Triggers passing instances which read an image for each file being enumerated by the (static) test class field/property defined by enumeratorMemberName /// instances will be passed for each the pixel format defined by the pixelTypes parameter diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithMemberFactoryAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithMemberFactoryAttribute.cs index 6c6198c38d..e9673062f6 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithMemberFactoryAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithMemberFactoryAttribute.cs @@ -1,14 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Linq; - using System.Reflection; +using System; +using System.Linq; +using System.Reflection; +namespace SixLabors.ImageSharp.Tests +{ /// /// Triggers passing instances which return the image produced by the given test class member method /// instances will be passed for each the pixel format defined by the pixelTypes parameter diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs index 9a8538e78b..f787a35916 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Reflection; +using System; +using System.Reflection; +namespace SixLabors.ImageSharp.Tests +{ /// /// Triggers passing instances which produce an image of size width * height filled with the requested color. /// One instance will be passed for each the pixel format defined by the pixelTypes parameter diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithTestPatternImageAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithTestPatternImageAttribute.cs index f6ab65f714..585bb8f066 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithTestPatternImageAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithTestPatternImageAttribute.cs @@ -1,13 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Reflection; +using System; +using System.Reflection; +namespace SixLabors.ImageSharp.Tests +{ /// /// Triggers passing instances which produce a blank image of size width * height. /// One instance will be passed for each the pixel format defined by the pixelTypes parameter diff --git a/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs b/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs index bfa70a2a50..d7e4773ec2 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Factories/GenericFactory.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - - using ImageSharp.PixelFormats; +using System; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Tests +{ /// /// Utility class to create specialized subclasses of generic classes (eg. ) /// Used as parameter for -based factory methods diff --git a/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs b/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs index 052a4c774f..b3c423bc57 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Factories/ImageFactory.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Tests +{ public class ImageFactory : GenericFactory { public override Image CreateImage(byte[] bytes) => Image.Load(bytes); diff --git a/tests/ImageSharp.Tests/TestUtilities/FloatRoundingComparer.cs b/tests/ImageSharp.Tests/TestUtilities/FloatRoundingComparer.cs index dd3ef3a4f9..f7732fce53 100644 --- a/tests/ImageSharp.Tests/TestUtilities/FloatRoundingComparer.cs +++ b/tests/ImageSharp.Tests/TestUtilities/FloatRoundingComparer.cs @@ -1,9 +1,12 @@ -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Numerics; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; +using System.Collections.Generic; +using System.Numerics; +namespace SixLabors.ImageSharp.Tests +{ /// /// Allows the comparison of single-precision floating point values by precision. /// diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs index 4252a60b5e..be1c59994a 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - - using ImageSharp.PixelFormats; - - using Xunit.Abstractions; +using System; +using SixLabors.ImageSharp.PixelFormats; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ public abstract partial class TestImageProvider where TPixel : struct, IPixel { diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs index 16eecd2fc7..b1da04fcd8 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Concurrent; - - using ImageSharp.PixelFormats; - - using Xunit.Abstractions; +using System; +using System.Collections.Concurrent; +using SixLabors.ImageSharp.PixelFormats; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ public abstract partial class TestImageProvider where TPixel : struct, IPixel { diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/LambdaProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/LambdaProvider.cs index 30e7a63b50..755807f1f9 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/LambdaProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/LambdaProvider.cs @@ -1,14 +1,11 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - - using ImageSharp.PixelFormats; +using System; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Tests +{ /// /// Provides instances for parametric unit tests. /// diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs index 08e3e1054d..e746531d78 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs @@ -1,16 +1,12 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - - using ImageSharp.PixelFormats; - - using Xunit.Abstractions; +using System; +using SixLabors.ImageSharp.PixelFormats; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ /// /// Provides instances for parametric unit tests. /// diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs index 8681bb334a..8c0cfec144 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Reflection; - - using ImageSharp.PixelFormats; +using System; +using System.Reflection; +using SixLabors.ImageSharp.PixelFormats; +using Xunit.Abstractions; - using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ public interface ITestImageProvider { PixelTypes PixelType { get; } diff --git a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs index f25beb7269..e75be4a68e 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs @@ -1,18 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Numerics; - - using ImageSharp.PixelFormats; - - using Xunit.Abstractions; +using System; +using System.Collections.Generic; +using System.Numerics; +using SixLabors.ImageSharp.PixelFormats; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ public abstract partial class TestImageProvider where TPixel : struct, IPixel { diff --git a/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs b/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs index 47085cf5f4..0bb2895de2 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.IO; - using System.Linq; - using System.Reflection; - - using ImageSharp.Formats; - using ImageSharp.PixelFormats; +using System; +using System.IO; +using System.Linq; +using System.Reflection; +using SixLabors.ImageSharp.Formats; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Tests +{ /// /// Utility class to provide information about the test image & the test case for the test code, /// and help managing IO. diff --git a/tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs b/tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs index 1a6bf5d8b8..50974cef86 100644 --- a/tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs +++ b/tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs @@ -1,16 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Diagnostics; - using System.Runtime.CompilerServices; - - using Xunit.Abstractions; +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ /// /// Utility class to measure the execution of an operation. It can be used either by inheritance or by composition. /// diff --git a/tests/ImageSharp.Tests/TestUtilities/PixelTypes.cs b/tests/ImageSharp.Tests/TestUtilities/PixelTypes.cs index 645a4dc596..b6f6b7a171 100644 --- a/tests/ImageSharp.Tests/TestUtilities/PixelTypes.cs +++ b/tests/ImageSharp.Tests/TestUtilities/PixelTypes.cs @@ -1,12 +1,10 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; +using System; +namespace SixLabors.ImageSharp.Tests +{ /// /// Flags that are mapped to PackedPixel types. /// They trigger the desired parametrization for . diff --git a/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs b/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs index bb97daaa47..2ba1580152 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestImageExtensions.cs @@ -1,17 +1,14 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Tests +{ public static class TestImageExtensions { /// diff --git a/tests/ImageSharp.Tests/TestUtilities/TestPixel.cs b/tests/ImageSharp.Tests/TestUtilities/TestPixel.cs index 852bc587d0..1eb0aafff0 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestPixel.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestPixel.cs @@ -1,10 +1,13 @@ -using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; using System.Collections.Generic; using System.Text; -using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; using Xunit.Abstractions; -namespace ImageSharp.Tests.TestUtilities +namespace SixLabors.ImageSharp.Tests.TestUtilities { public class TestPixel : IXunitSerializable where TPixel : struct, IPixel diff --git a/tests/ImageSharp.Tests/TestUtilities/TestType.cs b/tests/ImageSharp.Tests/TestUtilities/TestType.cs index adba1f971f..788a0543ab 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestType.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestType.cs @@ -1,10 +1,13 @@ -using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; using System.Collections.Generic; using System.Text; -using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; using Xunit.Abstractions; -namespace ImageSharp.Tests.TestUtilities +namespace SixLabors.ImageSharp.Tests.TestUtilities { public class TestType : IXunitSerializable { diff --git a/tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensions.cs b/tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensions.cs index e42cbe1934..dd853aa52f 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensions.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensions.cs @@ -1,18 +1,15 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Reflection; - - using ImageSharp.PixelFormats; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Reflection; +using SixLabors.ImageSharp.PixelFormats; +namespace SixLabors.ImageSharp.Tests +{ /// /// Extension methods for TestUtilities /// diff --git a/tests/ImageSharp.Tests/TestUtilities/TestVector4.cs b/tests/ImageSharp.Tests/TestUtilities/TestVector4.cs index beb3fcd970..3916f189cc 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestVector4.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestVector4.cs @@ -1,11 +1,14 @@ -using System; +// Copyright (c) Six Labors and contributors. +// Licensed under the Apache License, Version 2.0. + +using System; using System.Collections.Generic; using System.Numerics; using System.Text; -using ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; using Xunit.Abstractions; -namespace ImageSharp.Tests.TestUtilities +namespace SixLabors.ImageSharp.Tests.TestUtilities { public class TestVector4 : IXunitSerializable { diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs index c01babb632..4eedd1dac8 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs @@ -1,17 +1,13 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - - using ImageSharp.PixelFormats; - - using Xunit; - using Xunit.Abstractions; +using System; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ public class TestImageProviderTests { public TestImageProviderTests(ITestOutputHelper output) diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs index 88ab987ed8..bac94c029d 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs @@ -1,21 +1,17 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// -namespace ImageSharp.Tests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Numerics; - using System.Reflection; - - using ImageSharp.PixelFormats; - - using Xunit; - using Xunit.Abstractions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Reflection; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; +using Xunit.Abstractions; +namespace SixLabors.ImageSharp.Tests +{ public class TestUtilityExtensionsTests { public TestUtilityExtensionsTests(ITestOutputHelper output) diff --git a/tests/ImageSharp.Tests/VectorAssert.cs b/tests/ImageSharp.Tests/VectorAssert.cs index ad26963d43..402d066555 100644 --- a/tests/ImageSharp.Tests/VectorAssert.cs +++ b/tests/ImageSharp.Tests/VectorAssert.cs @@ -1,18 +1,16 @@ -// -// Copyright (c) James Jackson-South and contributors. +// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. -// + +using System; +using System.Collections.Generic; +using System.Numerics; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.PixelFormats; +using Xunit; // ReSharper disable MemberHidesStaticFromOuterClass -namespace ImageSharp.Tests +namespace SixLabors.ImageSharp.Tests { - using System; - using System.Collections.Generic; - using System.Numerics; - using ImageSharp; - using ImageSharp.PixelFormats; - using Xunit; - /// /// Class to perform simple image comparisons. /// From 3653f1f3c5fc6d9d56f5f340009ce1bce1569138 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Wed, 16 Aug 2017 22:38:17 +0100 Subject: [PATCH 26/33] fix some tests and updated packages --- ImageSharp.ruleset | 4 +-- ImageSharp.sln | 15 ++++++++++ README.md | 22 +++++++------- appveyor.yml | 30 ++++++++++--------- global.json | 5 ---- .../ImageSharp.Drawing.csproj | 1 + src/ImageSharp/ImageSharp.csproj | 2 +- .../ImageSharp.Benchmarks.csproj | 2 +- .../ImageSharp.Sandbox46.csproj | 7 +++-- tests/ImageSharp.Sandbox46/Program.cs | 10 +++---- .../CieLabAndCieLchConversionTests.cs | 2 -- .../CieLuvAndCieLchuvConversionTests.cs | 2 -- tests/ImageSharp.Tests/GlobalSuppressions.cs | 3 +- .../IO/EndianBinaryReaderTests.cs | 3 +- .../ImageSharp.Tests/ImageSharp.Tests.csproj | 4 +-- .../Tests/TestImageProviderTests.cs | 2 +- .../Tests/TestUtilityExtensionsTests.cs | 11 ------- 17 files changed, 63 insertions(+), 62 deletions(-) delete mode 100644 global.json diff --git a/ImageSharp.ruleset b/ImageSharp.ruleset index c1de1bc434..2149364b1b 100644 --- a/ImageSharp.ruleset +++ b/ImageSharp.ruleset @@ -5,7 +5,7 @@ + --> + \ No newline at end of file diff --git a/ImageSharp.sln b/ImageSharp.sln index c3bd150683..5e4eed874b 100644 --- a/ImageSharp.sln +++ b/ImageSharp.sln @@ -46,6 +46,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvatarWithRoundedCorner", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChangeDefaultEncoderOptions", "samples\ChangeDefaultEncoderOptions\ChangeDefaultEncoderOptions.csproj", "{07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ImageSharp.Sandbox46", "tests\ImageSharp.Sandbox46\ImageSharp.Sandbox46.csproj", "{561B880A-D9EE-44EF-90F5-817C54A9D9AB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -128,6 +130,18 @@ Global {07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x64.Build.0 = Release|Any CPU {07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x86.ActiveCfg = Release|Any CPU {07EE511D-4BAB-4323-BAFC-3AF2BF9366F0}.Release|x86.Build.0 = Release|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x64.ActiveCfg = Debug|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x64.Build.0 = Debug|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x86.ActiveCfg = Debug|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Debug|x86.Build.0 = Debug|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|Any CPU.Build.0 = Release|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x64.ActiveCfg = Release|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x64.Build.0 = Release|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x86.ActiveCfg = Release|Any CPU + {561B880A-D9EE-44EF-90F5-817C54A9D9AB}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -140,6 +154,7 @@ Global {2BF743D8-2A06-412D-96D7-F448F00C5EA5} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} {844FC582-4E78-4371-847D-EFD4D1103578} = {7CC6D57E-B916-43B8-B315-A0BB92F260A2} {07EE511D-4BAB-4323-BAFC-3AF2BF9366F0} = {7CC6D57E-B916-43B8-B315-A0BB92F260A2} + {561B880A-D9EE-44EF-90F5-817C54A9D9AB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {5F8B9D1F-CD8B-4CC5-8216-D531E25BD795} diff --git a/README.md b/README.md index 7113d6ba1a..a5e8d33e6d 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Built against .Net Standard 1.1 ImageSharp can be used in device, cloud, and emb > **ImageSharp** has made excellent progress and contains many great features but is still considered by us to be still in early stages (alpha). As such, we cannot support its use on production environments until the library reaches release candidate status. > -> Pre-release downloads are available from the [MyGet package repository](https://www.myget.org/gallery/imagesharp). +> Pre-release downloads are available from the [MyGet package repository](https://www.myget.org/gallery/sixlabors). [![GitHub license](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://raw.githubusercontent.com/SixLabors/ImageSharp/master/APACHE-2.0-LICENSE.txt) [![GitHub issues](https://img.shields.io/github/issues/SixLabors/ImageSharp.svg)](https://github.com/SixLabors/ImageSharp/issues) @@ -31,20 +31,20 @@ At present the code is pre-release but when ready it will be available on [Nuget **Pre-release downloads** -We already have a [MyGet package repository](https://www.myget.org/gallery/imagesharp) - for bleeding-edge / development NuGet releases. +We already have a [MyGet package repository](https://www.myget.org/gallery/sixlabors) - for bleeding-edge / development NuGet releases. ### Packages The **ImageSharp** library is made up of multiple packages. Packages include: -- **ImageSharp** +- **SixLabors.ImageSharp** - Contains the generic `Image` class, PixelFormats, Primitives, Configuration, and other core functionality. - The `IImageFormat` interface, Jpeg, Png, Bmp, and Gif formats. - Transform methods like Resize, Crop, Skew, Rotate - Anything that alters the dimensions of the image. - Non-transform methods like Gaussian Blur, Pixelate, Edge Detection - Anything that maintains the original image dimensions. -- **ImageSharp.Drawing** +- **SixLabors.ImageSharp.Drawing** - Brushes and various drawing algorithms, including drawing images. - Various vector drawing methods for drawing paths, polygons etc. - Text drawing. @@ -88,9 +88,10 @@ On platforms supporting netstandard 1.3+ // Image.Load(string path) is a shortcut for our default type. Other pixel formats use Image.Load(string path)) using (Image image = Image.Load("foo.jpg")) { - image.Resize(image.Width / 2, image.Height / 2) - .Grayscale() - .Save("bar.jpg"); // automatic encoder selected based on extension. + image.Mutate(x=>x + .Resize(image.Width / 2, image.Height / 2) + .Grayscale()); + image.Save("bar.jpg"); // automatic encoder selected based on extension. } ``` on netstandard 1.1 - 1.2 @@ -100,9 +101,10 @@ using (FileStream stream = File.OpenRead("foo.jpg")) using (FileStream output = File.OpenWrite("bar.jpg")) using (Image image = Image.Load(stream)) { - image.Resize(image.Width / 2, image.Height / 2) - .Grayscale() - .Save(output); + image.Mutate(x=>x + .Resize(image.Width / 2, image.Height / 2) + .Grayscale()); + image.Save(output); } ``` diff --git a/appveyor.yml b/appveyor.yml index fdbe46b015..f2ba80e725 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,11 +1,13 @@ version: 1.0.0.{build} image: Visual Studio 2017 -# prevent the double build when a branch has an active PR -skip_branch_with_pr: true -init: - - ps: iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/PureKrome/0f79e25693d574807939/raw/8cf3160c9516ef1f4effc825c0a44acc918a0b5a/appveyor-build-info.ps')) +install: + - choco install gitversion.portable -pre -y + +before_build: + - cmd: dotnet --version + - ps: gitversion /l console /output buildserver build_script: - cmd: build.cmd @@ -13,16 +15,16 @@ build_script: test_script: - tests\CodeCoverage\CodeCoverage.cmd -artifacts: -- path: artifacts\bin\ImageSharp\**\*.nupkg +after_build: + - cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.%GitVersion_NuGetVersion%.nupkg" deploy: # MyGet Deployment for builds & releases - - provider: NuGet - server: https://www.myget.org/F/imagesharp/api/v2/package - symbol_server: https://www.myget.org/F/imagesharp/symbols/api/v2/package - api_key: - secure: P2Fz82nty+itjL+kNRCsMQcqzngmVtkU0R4CZqgST7zgUaE6/1q9ekh5MKKlZLkD - artifact: /.*\.nupkg/ - on: - branch: master + - provider: NuGet + server: https://www.myget.org/F/sixlabors/api/v2/package + symbol_server: https://www.myget.org/F/sixlabors/symbols/api/v2/package + api_key: + secure: V/lEHP0UeMWIpWd0fiNlY2IgbCnJKQlGdRksECdJbOBdaE20Fl0RNL7WyqHe02o4 + artifact: /.*\.nupkg/ + on: + branch: master diff --git a/global.json b/global.json deleted file mode 100644 index cccd8b4545..0000000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "1.1.0" - } -} \ No newline at end of file diff --git a/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj b/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj index 702c354cdd..f25b6eaf70 100644 --- a/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj +++ b/src/ImageSharp.Drawing/ImageSharp.Drawing.csproj @@ -37,6 +37,7 @@ + All diff --git a/src/ImageSharp/ImageSharp.csproj b/src/ImageSharp/ImageSharp.csproj index c16045d61d..c3bb1f9a1c 100644 --- a/src/ImageSharp/ImageSharp.csproj +++ b/src/ImageSharp/ImageSharp.csproj @@ -39,7 +39,7 @@ All - + diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index eb1983e21e..0db2fe569f 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -1,6 +1,6 @@  - netcoreapp1.1 + netcoreapp1.1;net461 Exe True SixLabors.ImageSharp.Benchmarks diff --git a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj index b9124afc6a..3618c99247 100644 --- a/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj +++ b/tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj @@ -5,11 +5,12 @@ win7-x64 True false - ImageSharp.Sandbox46 + SixLabors.ImageSharp.Sandbox46 A cross-platform library for processing of image files written in C# Copyright © James Jackson-South and contributors. James Jackson-South and contributors James Jackson-South + SixLabors.ImageSharp.Sandbox46 @@ -17,8 +18,8 @@ - - + + diff --git a/tests/ImageSharp.Sandbox46/Program.cs b/tests/ImageSharp.Sandbox46/Program.cs index b536af71fa..eb8d1369b9 100644 --- a/tests/ImageSharp.Sandbox46/Program.cs +++ b/tests/ImageSharp.Sandbox46/Program.cs @@ -8,11 +8,11 @@ namespace ImageSharp.Sandbox46 using System; using System.Runtime.DesignerServices; - using ImageSharp.Tests; - using ImageSharp.Tests.Colors; - using ImageSharp.Tests.PixelFormats; - using ImageSharp.Tests.Processing.Processors.Transforms; - using ImageSharp.Tests.Processing.Transforms; + using SixLabors.ImageSharp.Tests; + using SixLabors.ImageSharp.Tests.Colors; + using SixLabors.ImageSharp.Tests.PixelFormats; + using SixLabors.ImageSharp.Tests.Processing.Processors.Transforms; + using SixLabors.ImageSharp.Tests.Processing.Transforms; using Xunit.Abstractions; diff --git a/tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs b/tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs index 92ec9f36f5..4269459893 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieLabAndCieLchConversionTests.cs @@ -30,7 +30,6 @@ public class CieLabAndCieLchConversionTests [InlineData(100, 0, 0, 100, 0, 0)] [InlineData(100, 50, 180, 100, -50, 0)] [InlineData(10, 36.0555, 56.3099, 10, 20, 30)] - [InlineData(10, 36.0555, 56.3099, 10, 20, 30)] [InlineData(10, 36.0555, 123.6901, 10, -20, 30)] [InlineData(10, 36.0555, 303.6901, 10, 20, -30)] [InlineData(10, 36.0555, 236.3099, 10, -20, -30)] @@ -57,7 +56,6 @@ public void Convert_Lch_to_Lab(float l, float c, float h, float l2, float a, flo [InlineData(100, 0, 0, 100, 0, 0)] [InlineData(100, -50, 0, 100, 50, 180)] [InlineData(10, 20, 30, 10, 36.0555, 56.3099)] - [InlineData(10, 20, 30, 10, 36.0555, 56.3099)] [InlineData(10, -20, 30, 10, 36.0555, 123.6901)] [InlineData(10, 20, -30, 10, 36.0555, 303.6901)] [InlineData(10, -20, -30, 10, 36.0555, 236.3099)] diff --git a/tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs b/tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs index 7c841aa2e2..17fd1db50f 100644 --- a/tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs +++ b/tests/ImageSharp.Tests/Colorspaces/CieLuvAndCieLchuvConversionTests.cs @@ -30,7 +30,6 @@ public class CieLuvAndCieLchuvuvConversionTests [InlineData(100, 0, 0, 100, 0, 0)] [InlineData(100, 50, 180, 100, -50, 0)] [InlineData(10, 36.0555, 56.3099, 10, 20, 30)] - [InlineData(10, 36.0555, 56.3099, 10, 20, 30)] [InlineData(10, 36.0555, 123.6901, 10, -20, 30)] [InlineData(10, 36.0555, 303.6901, 10, 20, -30)] [InlineData(10, 36.0555, 236.3099, 10, -20, -30)] @@ -57,7 +56,6 @@ public void Convert_Lchuv_to_Luv(float l, float c, float h, float l2, float u, f [InlineData(100, 0, 0, 100, 0, 0)] [InlineData(100, -50, 0, 100, 50, 180)] [InlineData(10, 20, 30, 10, 36.0555, 56.3099)] - [InlineData(10, 20, 30, 10, 36.0555, 56.3099)] [InlineData(10, -20, 30, 10, 36.0555, 123.6901)] [InlineData(10, 20, -30, 10, 36.0555, 303.6901)] [InlineData(10, -20, -30, 10, 36.0555, 236.3099)] diff --git a/tests/ImageSharp.Tests/GlobalSuppressions.cs b/tests/ImageSharp.Tests/GlobalSuppressions.cs index a00c6d05f1..106d34d0bc 100644 --- a/tests/ImageSharp.Tests/GlobalSuppressions.cs +++ b/tests/ImageSharp.Tests/GlobalSuppressions.cs @@ -4,5 +4,6 @@ // Project-level suppressions either have no target or are given // a specific target and scoped to a namespace, type, member, etc. -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1004:Test methods should not be skipped", Justification = "", Scope = "member", Target = "~M:ImageSharp.Tests.Processing.Transforms.PadTest.Pad_width_height_ResizeProcessorWithCorrectOPtionsSet")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Assertions", "xUnit2013:Do not use equality check to check for collection size.")] diff --git a/tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs b/tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs index 9a4d7cf6f6..87adead338 100644 --- a/tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs +++ b/tests/ImageSharp.Tests/IO/EndianBinaryReaderTests.cs @@ -45,8 +45,7 @@ public void ReadCharsBeyondInternalBufferSize() [Fact] public void ReadCharsBeyondProvidedBufferSize() { - Assert.Throws( - typeof(ArgumentException), + Assert.Throws( () => { MemoryStream stream = new MemoryStream(TestBytes); diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index d459eedd3a..bd6a3f695d 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs index 4eedd1dac8..66263203fe 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs @@ -46,7 +46,7 @@ public void Use_WithBlankImagesAttribute_WithAllPixelTypes( [Theory] [WithBlankImages(1, 1, PixelTypes.Rgba32, PixelTypes.Rgba32)] [WithBlankImages(1, 1, PixelTypes.Alpha8, PixelTypes.Alpha8)] - [WithBlankImages(1, 1, PixelTypes.Rgba32, PixelTypes.Rgba32)] + [WithBlankImages(1, 1, PixelTypes.Rgba32, PixelTypes.Argb32)] public void PixelType_PropertyValueIsCorrect(TestImageProvider provider, PixelTypes expected) where TPixel : struct, IPixel { diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs index bac94c029d..0e2dea846b 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs @@ -46,16 +46,6 @@ public static Image CreateTestImage(GenericFactory facto return image; } - [Fact] - public void Baz() - { - Type type = typeof(Rgba32).GetTypeInfo().Assembly.GetType("ImageSharp.Rgba32"); - this.Output.WriteLine(type.ToString()); - - Type fake = typeof(Rgba32).GetTypeInfo().Assembly.GetType("ImageSharp.dsaada_DASqewrr"); - Assert.Null(fake); - } - [Theory] [WithFile(TestImages.Bmp.Car, PixelTypes.Rgba32, true)] [WithFile(TestImages.Bmp.Car, PixelTypes.Rgba32, false)] @@ -84,7 +74,6 @@ public void IsEquivalentTo_WhenTrue(TestImageProvider provider, [InlineData(PixelTypes.Rgba32, typeof(Rgba32))] [InlineData(PixelTypes.Argb32, typeof(Argb32))] [InlineData(PixelTypes.HalfVector4, typeof(HalfVector4))] - [InlineData(PixelTypes.Rgba32, typeof(Rgba32))] public void ToType(PixelTypes pt, Type expectedType) { Assert.Equal(pt.ToType(), expectedType); From fbe9d250714ae2ee7b23676080f5e456f4349040 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Wed, 16 Aug 2017 22:44:29 +0100 Subject: [PATCH 27/33] add missing stylecop.json --- .gitignore | 1 - stylecop.json | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 stylecop.json diff --git a/.gitignore b/.gitignore index 8034c8c89c..9157c43ae3 100644 --- a/.gitignore +++ b/.gitignore @@ -158,7 +158,6 @@ AppPackages/ # Others *.[Cc]ache ClientBin/ -[Ss]tyle[Cc]op.* ~$* *~ *.dbmdl diff --git a/stylecop.json b/stylecop.json new file mode 100644 index 0000000000..485ab604a5 --- /dev/null +++ b/stylecop.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json", + "settings": { + "orderingRules": { + "usingDirectivesPlacement": "outsideNamespace", + "elementOrder": [ + "kind" + ] + }, + "documentationRules": { + "xmlHeader": false, + "documentInternalElements": false, + "copyrightText": "Copyright (c) Six Labors and contributors.\nLicensed under the Apache License, Version 2.0." + } + } +} \ No newline at end of file From 8f53b5b7729978bd7c5a33e909438643d5f41385 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Wed, 16 Aug 2017 23:15:14 +0100 Subject: [PATCH 28/33] tweek codecov cmd file --- tests/CodeCoverage/CodeCoverage.cmd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/CodeCoverage/CodeCoverage.cmd b/tests/CodeCoverage/CodeCoverage.cmd index 1e16d5c14a..571138f69d 100644 --- a/tests/CodeCoverage/CodeCoverage.cmd +++ b/tests/CodeCoverage/CodeCoverage.cmd @@ -9,9 +9,8 @@ cd .. cd .. dotnet restore ImageSharp.sln -dotnet build ImageSharp.sln --no-incremental -c release /p:codecov=true rem The -threshold options prevents this taking ages... -tests\CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj --no-build -c release /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[ImageSharp*]*" +tests\CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj -c release /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[SixLabors.ImageSharp*]*" if %errorlevel% neq 0 exit /b %errorlevel% From 9be5ba09fdcb3d63f3356843c3dfdc3496b641b6 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 17 Aug 2017 07:48:54 +0100 Subject: [PATCH 29/33] skip tests in build on CI server as they are ran from CodeCoverage.cmd --- .gitignore | 1 + build.cmd | 6 ++++-- tests/CodeCoverage/CodeCoverage.cmd | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9157c43ae3..c2a0cfa79c 100644 --- a/.gitignore +++ b/.gitignore @@ -217,3 +217,4 @@ artifacts/ **/CodeCoverage/* docs/ /samples/AvatarWithRoundedCorner/output +/ImageSharp.Coverage.xml diff --git a/build.cmd b/build.cmd index fd2639da0e..54be940890 100644 --- a/build.cmd +++ b/build.cmd @@ -12,8 +12,10 @@ ECHO Building nuget packages dotnet build -c Release %versionCommand% if not "%errorlevel%"=="0" goto failure -dotnet test ./tests/ImageSharp.Tests/ImageSharp.Tests.csproj --no-build -if not "%errorlevel%"=="0" goto failure +if not %CI% == "True" ( + dotnet test ./tests/ImageSharp.Tests/ImageSharp.Tests.csproj --no-build + if not "%errorlevel%"=="0" goto failure +) dotnet pack ./src/ImageSharp/ -c Release --output ../../artifacts --no-build %versionCommand% if not "%errorlevel%"=="0" goto failure diff --git a/tests/CodeCoverage/CodeCoverage.cmd b/tests/CodeCoverage/CodeCoverage.cmd index 571138f69d..2c13cfc144 100644 --- a/tests/CodeCoverage/CodeCoverage.cmd +++ b/tests/CodeCoverage/CodeCoverage.cmd @@ -10,7 +10,7 @@ cd .. dotnet restore ImageSharp.sln rem The -threshold options prevents this taking ages... -tests\CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj -c release /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[SixLabors.ImageSharp*]*" +tests\CodeCoverage\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test tests\ImageSharp.Tests\ImageSharp.Tests.csproj -c Release /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\ImageSharp.Coverage.xml -hideskipped:All -returntargetcode -filter:"+[SixLabors.ImageSharp*]*" if %errorlevel% neq 0 exit /b %errorlevel% From 9a4d048a81d78eaf4ee2c2984fe48b6f587e2394 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 17 Aug 2017 07:53:27 +0100 Subject: [PATCH 30/33] publish both packages --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index f2ba80e725..a44fe37c47 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,6 +17,7 @@ test_script: after_build: - cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.%GitVersion_NuGetVersion%.nupkg" + - cmd: appveyor PushArtifact "artifacts\SixLabors.ImageSharp.Drawing.%GitVersion_NuGetVersion%.nupkg" deploy: # MyGet Deployment for builds & releases From c9db035a4d5c9ba85ef4f65735e0649d0626dc22 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 17 Aug 2017 07:53:53 +0100 Subject: [PATCH 31/33] ensure local running of build scripts runs tests from correct build --- build.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cmd b/build.cmd index 54be940890..662be648a2 100644 --- a/build.cmd +++ b/build.cmd @@ -13,7 +13,7 @@ dotnet build -c Release %versionCommand% if not "%errorlevel%"=="0" goto failure if not %CI% == "True" ( - dotnet test ./tests/ImageSharp.Tests/ImageSharp.Tests.csproj --no-build + dotnet test ./tests/ImageSharp.Tests/ImageSharp.Tests.csproj --no-build -c Release if not "%errorlevel%"=="0" goto failure ) From 4c8ba5905ce10bf22520726ebb6ce625dcb59c99 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 17 Aug 2017 07:57:14 +0100 Subject: [PATCH 32/33] fix broken test --- .../TestUtilities/Tests/TestImageProviderTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs index 66263203fe..5dfe1eabb8 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs @@ -46,7 +46,7 @@ public void Use_WithBlankImagesAttribute_WithAllPixelTypes( [Theory] [WithBlankImages(1, 1, PixelTypes.Rgba32, PixelTypes.Rgba32)] [WithBlankImages(1, 1, PixelTypes.Alpha8, PixelTypes.Alpha8)] - [WithBlankImages(1, 1, PixelTypes.Rgba32, PixelTypes.Argb32)] + [WithBlankImages(1, 1, PixelTypes.Argb32, PixelTypes.Argb32)] public void PixelType_PropertyValueIsCorrect(TestImageProvider provider, PixelTypes expected) where TPixel : struct, IPixel { From 4f38761d54b684ab4f779b11f38545634d49cc30 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 18 Aug 2017 23:39:27 +1000 Subject: [PATCH 33/33] Fix skew --- .../Processing/Processors/Transforms/SkewProcessor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs index c6d7921e26..bd84e483f5 100644 --- a/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs +++ b/src/ImageSharp/Processing/Processors/Transforms/SkewProcessor.cs @@ -73,7 +73,7 @@ protected override void OnApply(ImageBase source, Rectangle sourceRectan /// protected override void BeforeApply(ImageBase source, Rectangle sourceRectangle) { - this.processMatrix = Matrix3x2Extensions.CreateSkew(-this.AngleX, -this.AngleY, new Point(0, 0)); + this.processMatrix = Matrix3x2Extensions.CreateSkewDegrees(-this.AngleX, -this.AngleY, new Point(0, 0)); if (this.Expand) { this.CreateNewCanvas(sourceRectangle, this.processMatrix);